goocanvas-1.0.0/0000755000076400007640000000000011512612761010503 500000000000000goocanvas-1.0.0/configure.in0000644000076400007640000000422211512612534012732 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(goocanvas, 1.0.0) AC_PREREQ(2.50) AC_CONFIG_SRCDIR(src/goocanvas.c) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE # Libtool versioning - only update before a public release. # If the code has changed at all: REVISION++. # If any interfaces have changed at all: CURRENT++, REVISION=0. # If interfaces changed but it is backwards compatible: AGE++, else AGE=0. # i.e. the library supports interfaces CURRENT - AGE up to CURRENT. # if two libraries have identical CURRENT and AGE, then newest REVISION used. CURRENT=8 AGE=5 REVISION=0 LT_VERSION_INFO="$CURRENT:$REVISION:$AGE" AC_SUBST(LT_VERSION_INFO) AM_MAINTAINER_MODE AC_ISC_POSIX AC_PROG_CC AC_HEADER_STDC AM_PROG_LIBTOOL pkg_modules="gtk+-2.0 >= 2.12.0 glib-2.0 >= 2.10.0 cairo >= 1.4.0" PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) GETTEXT_PACKAGE=goocanvas AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) dnl i18n ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" AM_GLIB_GNU_GETTEXT GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` AC_SUBST(GLIB_MKENUMS) AC_ARG_ENABLE(rebuilds, [AC_HELP_STRING([--disable-rebuilds], [disable all source autogeneration rules])],, [enable_rebuilds=yes]) # define a MAINT-like variable REBUILD which is set if Perl # and awk are found, so autogenerated sources can be rebuilt AC_PATH_PROGS(PERL, perl5 perl) REBUILD=\# if test "x$enable_rebuilds" = "xyes" && \ test -n "$PERL" && \ $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then REBUILD= fi AC_SUBST(REBUILD) AC_MSG_CHECKING([for some Win32 platform]) case "$host" in *-*-mingw*|*-*-cygwin*) platform_win32=yes ;; *) platform_win32=no ;; esac AC_MSG_RESULT([$platform_win32]) AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes") GTK_DOC_CHECK(1.8) AC_OUTPUT([ Makefile src/Makefile demo/Makefile docs/Makefile po/Makefile.in goocanvas.pc ]) goocanvas-1.0.0/autogen.sh0000755000076400007640000001066011412723611012423 00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. DIE=0 if [ -n "$GNOME2_DIR" ]; then ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" PATH="$GNOME2_DIR/bin:$PATH" export PATH export LD_LIBRARY_PATH fi (test -f $srcdir/configure.in) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level package directory" exit 1 } gtkdocize || exit 1 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && { (intltoolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`intltool' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/" DIE=1 } } (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && { (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`xml-i18n-toolize' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/" DIE=1 } } (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 } } (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && { (grep "sed.*POTFILES" $srcdir/configure.in) > /dev/null || \ (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`glib' installed." echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" DIE=1 } } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 NO_AUTOMAKE=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.in -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running glib-gettextize... Ignore non-fatal messages." echo "no" | glib-gettextize --force --copy echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then echo "Running intltoolize..." intltoolize --copy --force --automake fi if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then echo "Running xml-i18n-toolize..." xml-i18n-toolize --copy --force --automake fi if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then if test -z "$NO_LIBTOOLIZE" ; then echo "Running libtoolize..." libtoolize --force --copy fi fi echo "Running aclocal $aclocalinclude ..." aclocal $aclocalinclude if grep "^A[CM]_CONFIG_HEADER" configure.in >/dev/null; then echo "Running autoheader..." autoheader fi echo "Running automake --gnu $am_opt ..." automake --add-missing --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done conf_flags="--enable-maintainer-mode" if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile. || exit 1 else echo Skipping configure process. fi goocanvas-1.0.0/depcomp0000755000076400007640000004426711310245766012020 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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 outputing 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 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. ## 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" ;; 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" ;; #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" cat < "$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: goocanvas-1.0.0/goocanvas.pc.in0000644000076400007640000000040311412723611013325 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: GooCanvas Description: A GTK+ canvas widget using cairo Version: @VERSION@ Requires: gtk+-2.0 cairo Libs: -L${libdir} -lgoocanvas Cflags: -I${includedir}/goocanvas-1.0 goocanvas-1.0.0/AUTHORS0000644000076400007640000000004011412723611011461 00000000000000Damon Chaplin goocanvas-1.0.0/ltmain.sh0000755000076400007640000073306011512612651012255 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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 # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long 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. # 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.2.6b # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION=2.2.6b TIMESTAMP="" package_revision=1.3017 # 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 # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). 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 $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${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_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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # 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" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # 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=: 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' # 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${mode+: }$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_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$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 "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e '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 "X$my_tmpdir" | $Xsed } # 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 "X$1" | $Xsed -e "$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 "X$1" | $Xsed \ -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_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$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 () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { 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 --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </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 } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # 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 # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 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 mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done 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_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # 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 } ## ----------- ## ## Main. ## ## ----------- ## $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 test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$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=$mode' for more information." } # 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_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # 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_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_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done 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 "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # 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_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # 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 <?"'"'"' &()|`$[]' \ && 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 "X$srcfile" | $Xsed -e 's%^.*/%%' -e '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 removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi 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 command="$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 command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$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 "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $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 building PIC objects only -prefer-non-pic try to building 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 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 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 -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 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 \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # 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 $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # 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 dir="$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 -*) ;; *) # 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_quote_for_eval "$file" args="$args $func_quote_for_eval_result" 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 "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. 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" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $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 "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$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. $ECHO "X$nonopt" | $GREP shtool >/dev/null; 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" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_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 -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. staticlibs="$staticlibs $file" ;; *.la) # 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 "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -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 "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "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_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" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else 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 "X$lib" | $Xsed -e '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 "X$relink_command" | $Xsed -e '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 "X$file$stripped_ext" | $Xsed -e "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_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $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 "$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 /* 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 "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $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" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } 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; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ 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) ;; *) symtab_cflags="$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 "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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. 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 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $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_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' 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 | $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 | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $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. Xsed='${SED} -e 1s/^X//' 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 ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_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 \"X\$thisdir\" | \$Xsed -e '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" # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # 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=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # 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. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # 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_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # 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 # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #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 #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #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 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #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) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; 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_fatal (const char *message, ...); 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_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 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; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); 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; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); 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 ("getcwd failed"); 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 ("getcwd failed"); 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) { LTWRAPPER_DEBUGPRINTF (("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 { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("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; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? 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; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? 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) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? 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 } # end: func_emit_cwrapperexe_src # 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 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 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 dlfiles="$dlfiles $arg" else dlprefiles="$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 "*) ;; *) deplibs="$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 # moreargs="$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 dlfiles="$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. dlprefiles="$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 "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$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 ;; -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" dir=$func_stripname_result if test -z "$dir"; 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 # 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 "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$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*) # 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 deplibs="$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 deplibs="$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) compiler_flags="$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) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$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_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$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" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$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" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$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" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$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 dlfiles="$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. dlprefiles="$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. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" 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 \"X\${$shlibpath_var}\" \| \$Xsed -e \'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" # 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_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$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 "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$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% $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= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$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) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$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 "*) ;; * ) new_inherited_linker_flags="$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" newlib_search_path="$newlib_search_path $func_stripname_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" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$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 \"X$deplib\"" 2>/dev/null | $Xsed -e 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. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$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 "X$inherited_linker_flags" | $Xsed -e '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 "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e '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" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$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. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then 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. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$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 "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$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 notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$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 # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$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" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi 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 newlib_search_path="$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" newlib_search_path="$newlib_search_path $func_stripname_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_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$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:"*) ;; *) temp_rpath="$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 "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac 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 notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$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 "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac 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 "$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$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$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:"*) ;; *) compile_shlibpath="$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:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$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:"*) ;; *) finalize_shlibpath="$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 [\\/]*) add_dir="$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 "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$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" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) 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 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$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 "X $new_inherited_linker_flags" | $Xsed -e '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 "*) ;; *) lib_search_path="$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 "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$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 tmp_libs="$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" objs="$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!" libobjs="$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 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|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 ;; 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) 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. verstring="$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" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$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 removelist="$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 oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "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 temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$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 "*) ;; *) dlfiles="$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 "*) ;; *) dlprefiles="$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*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$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 deplibs="$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` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$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. newdeplibs="$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 "*) newdeplibs="$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 \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$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. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e '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 "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e '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 "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e '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 "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$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 if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$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 if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$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 "$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 linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$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" delfiles="$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 cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' 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 "X$include_expsyms" | $Xsed | $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 delfiles="$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 "*) ;; *) tmp_deplibs="$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" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$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\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$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 output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # 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 $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" 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 $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" 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. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$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~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$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 "$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 "X$include_expsyms" | $Xsed | $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 delfiles="$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" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$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 "$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 "$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 "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$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 "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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 "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$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 "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$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"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi 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 *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) 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 "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # 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 rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$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 "X$link_command" | $Xsed -e '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 $?' 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 "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if 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 oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$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" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$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" generated="$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" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi 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 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 "X$relink_command" | $Xsed -e "$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" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$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" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$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" newdlprefiles="$newdlprefiles $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 newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 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 "$mode" = link || test "$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) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; 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 rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${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 rmfiles="$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 rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$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 rmfiles="$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 rmfiles="$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 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # 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 "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$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 goocanvas-1.0.0/ChangeLog0000644000076400007640000022315111512447642012205 000000000000002011-01-10 Damon Chaplin * src/goocanvasimage.c: added "alpha" property. Patch from xapantu plus a few changes. * demo/mv-demo.c: * demo/demo.c: added test for the above for the flowers. * demo/*: don't set page size for spin button adjustments since that seems to be deprecated and outputs warnings. 2010-07-27 Damon Chaplin * src/goocanvas.c (goo_canvas_adjustment_value_changed): fixed call to redraw_static_items_at_position() - was using hadjustment twice. 2010-06-30 Damon Chaplin * docs: added empty internal subset "[]" to the DOCTYPEs to keep gtk-doc happy. * src/goocanvas.c (goo_canvas_expose_event): do a cairo_save()/restore() around painting the main items, so the static items don't get clipped. 2010-06-29 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_property): handle setting "clip-path" to NULL to reset it. * src/goocanvastable.c: try to handle RTL direction better. * src/goocanvasgroup.c (goo_canvas_group_paint): use the scale argument rather than the canvas scale. * src/goocanvas.c: added "before-initial-expose" flag which we use to ignore any redraw requests before the initial expose (since we know the entire canvas needs redrawing anyway). This speeds up the creation of lots of items, e.g. scalability-demo. * demo/Makefile.am (mv_demo_LDADD, demo_LDADD): added -lm to compile. * demo/mv-scalability-demo.c: * demo/scalability-demo.c: updated to compare with the new-api code. 2010-05-10 Damon Chaplin * src/goocanvastext.c: improve docs for "width" and "height" properties. #595164. 2010-05-10 Damon Chaplin * src/goocanvaspolyline.c: don't use the reconfigure_arrows flag any more - always reconfigure the arrows during an update. This avoids a bug where the line width changes but the arrows don't get reconfigured, since the line width is an inherited property and reconfigure_arrows wasn't being set when it changed. 2010-05-07 Damon Chaplin * src/goocanvasstyle.c (goo_canvas_style_set_stroke_options): handle a NULL dash setting. #617960. 2010-04-28 Luis Medinas * applied small patch to compile with GTK+ 3.0. #615435. 2009-08-20 Murray Cumming * docs/architecture.xml: Fixed documenation typo. Bug #591983. (Martin Olsson) 2009-06-29 Damon Chaplin * Released GooCanvas 0.15 2009-06-29 Damon Chaplin * src/goocanvasimage.c: added "scale-to-fit" property, which scales the image to fit the "width" and "height" settings. * demo/units-demo.c: * demo/mv-demo.c (plant_flower): * demo/demo.c (plant_flower): test "scale-to-fit" property. 2009-05-07 Damon Chaplin * src/goocanvasatk.c: fixed GooCanvasWidgetAccessible's G_DEFINE_TYPE call, using GOO_TYPE_CANVAS_ITEM_ACCESSIBLE as parent class. This avoids a hang when using GooCanvasWidget with accessibility support turned on. #581596. 2009-03-16 Damon Chaplin * src/goocanvasitem.c: changed docs referring to "root_x" and "root_y" fields of event structs to "x_root" and "y_root". 2009-03-15 Damon Chaplin * Released GooCanvas 0.14 2009-03-15 Damon Chaplin * src/goocanvas.c (goo_canvas_query_tooltip): new function to propagate the "query-tooltip" signal up through the canvas items. * src/goocanvasitem.[hc]: added "query-tooltip" signal and "tooltip" property. * src/goocanvasitemmodel.c: added "tooltip" property. * src/goocanvasitemsimple.c: added "tooltip" property and query_tooltip signal handler. * configure.in: added dependancy on GTK+ 2.12 for tooltips. * demo/mv-demo.c: * demo/demo.c: added tests for tooltips. 2009-03-15 Damon Chaplin * src/goocanvasgrid.c: improved section docs. * src/goocanvas.c: improved a few function docs. 2009-03-15 Damon Chaplin * docs/coordinates.xml: * docs/architecture.xml: * docs/creating-items.xml: * src/goocanvasitemsimple.c: use the terms "canvas coordinate space" or "canvas space" rather than "device space" which is a bit misleading. * src/goocanvasitem.c: clarify the docs for the mouse position fields of the event structs of the signals. #573458 2009-03-15 Gian Mario Tagliaretti (Committed by Damon with a few changes.) * src/goocanvasitem.h (struct _GooCanvasItemIface): added scroll_event() signals on items. * src/goocanvasitem.c: implemented "scroll_event" signals on items. * src/goocanvas.c: implemented "scroll_event" signals on items. * demo/demo.c: added test for above. #566110 2009-02-17 Damon Chaplin * src/goocanvas.c (goo_canvas_convert_from_item_space): changed the order of the arguments to cairo_matrix_multiply(). This was broken for everything except translations. #572180 2009-01-12 Armin Burgmeier * src/goocanvasellipse.c: * src/goocanvaspolyline.c: * src/goocanvasgroup.c: * src/goocanvaspath.c: * src/goocanvaswidget.c: * src/goocanvastext.c: * src/goocanvastable.c: Added "x", "y", "width" and "height" properties where they do not exist already. GooCanvasGroup clips its children if they are out of the specified area, and GooCanvasText clips the text. It is possible to turn off the clipping by using -1 for width or height, respectively, which is the default. * demo/generic-position-demo.c: * demo/mv-generic-position-demo.c: * demo/Makefile.am: Added a demo showing how this can be used to generically resize items using drag and drop. (Patch from bug #555097 committed with quite a few changes by Damon) 2008-12-29 Damon Chaplin * src/goocanvasgrid.c (calculate_start_position) (paint_vertical_lines, paint_horizontal_lines): handle step <= 0.0. It should now draw a single line at the start position. (based on patch from Murray Cumming) #563487. 2008-12-29 Jonathon Jongsma * demo/Makefile.am: Fix building demos when builddir != srcdir. goocanvasenumtypes.h is generated in the build dir and not the src dir so we must also add the build dir to the INCLUDES. #561401. 2008-11-30 Damon Chaplin * Released GooCanvas 0.13 2008-11-19 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_stop_animation): * src/goocanvasitem.c (goo_canvas_item_animate_cb) (goo_canvas_item_stop_animation): remove the current animation data before emitting "animation-finished", so signal handlers can start a new animation. 2008-11-17 Damon Chaplin * src/goocanvasgrid.c: added "show-horz-grid-lines" and "show-vert-grid-lines" properties, to turn off horz/vert grid lines. 2008-11-17 Damon Chaplin * src/goocanvas.c (redraw_static_items_at_position): redraw each group of static items separately, to stop GTK+ merging the redraw rect into one massive one. * demo/mv-demo.c (create_static_model): * demo/demo.c (setup_static_items): use a group for all the static items. 2008-11-17 Damon Chaplin * src/goocanvas.c: added "redraw-when-scrolled" boolean property, which makes the canvas redraw the entire window when scrolled. This is useful for static items to reduce flicker, but is slower. (goo_canvas_adjustment_value_changed): map/unmap the temporary window to implement "redraw-when-scrolled". 2008-11-04 Damon Chaplin * src/goocanvasutils.h: added typedefs for wrappers of cairo types (but ifdef'd out so not usable), so we can add docs for them. And added the docs, pointing to the cairo docs. * src/goocanvasutils.c (goo_canvas_line_dash_get_type): changed the registered type name from GooCairoLineDash to GooCanvasLineDash so the docs work. The struct was already called GooCanvasLineDash. 2008-11-03 Damon Chaplin * src/goocanvas.c (emit_pointer_event): handle NULL target_item. * src/goocanvaswidget.c: note that widgets can't be static. * README: * docs/overview.xml: mention static items and the grid item. 2008-11-03 Damon Chaplin * src/goocanvas.c (goo_canvas_scroll_to_item): just return if the item is static, as we can't scroll to a static item. (emit_pointer_event): convert the pointer position to static item space for static items. * src/goocanvasatk.c (goo_canvas_item_accessible_get_item_extents): handle static items - don't need to convert to pixels within the window as they are already like that. 2008-11-03 Damon Chaplin * src/goocanvasgrid.[hc]: new grid item. * demo/mv-demo.c (setup_grids): * demo/demo.c (setup_grids): added a grid. * src/Makefile.am: added grid. * src/goocanvas.[hc] (goo_canvas_convert_bounds_to_item_space): new function to convert a bounding box in device space to a bounding box in item space. Useful in paint() methods to optimize painting. * src/goocanvasutils.c (goo_canvas_convert_colors_to_rgba) (goo_canvas_get_rgba_value_from_pattern) (goo_canvas_set_style_property_from_pattern) (goo_canvas_create_pattern_from_color_value) (goo_canvas_create_pattern_from_rgba_value) (goo_canvas_create_pattern_from_pixbuf_value): new private utility functions taken out of goocanvasitemsimple.c code. * src/goocanvasitemsimple.c: use above utility functions. 2008-10-31 Damon Chaplin * src/goocanvasitemmodel.h (struct _GooCanvasItemModelIface): * src/goocanvasitem.h (struct _GooCanvasItemIface): added animation_finished() signals. * src/goocanvasitemmodel.c: * src/goocanvasitem.c: implemented "animation-finished" signals. * demo/mv-demo-animation.c: * demo/demo-animation.c: added test for above. 2008-10-31 Damon Chaplin * demo/mv-demo-arrowhead.c (on_button_press): * demo/demo-arrowhead.c (on_button_press): * demo/mv-demo.c (on_button_press): * demo/demo.c (on_button_press): use GDK_POINTER_MOTION_HINT_MASK for the pointer grab, so we don't get too many events. 2008-10-31 Damon Chaplin * src/goocanvas.h: (goo_canvas_get_static_root_item): new function to get static root item. (goo_canvas_set_static_root_item): new function to set static root item. (goo_canvas_get_static_root_item_model): new function to get static root item model. (goo_canvas_set_static_root_item_model): new function to set static root item model. (goo_canvas_request_item_redraw): new function to request a redraw of an item either in device space or in the static item space. * src/goocanvasitem.h (struct _GooCanvasItemIface): added get_is_static() and set_is_static() interface methods. * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): removed one bit from cache_setting and used it for is_static. Hopefully that won't break binary compatibility. * src/goocanvas.c (struct _GooCanvasPrivate): added new private struct with static root item & model and current window position. (goo_canvas_init): init private struct and create static root item. (goo_canvas_dispose): free static root item & model. (goo_canvas_update_internal): update static items. (goo_canvas_get_item_at): check static items as well. (goo_canvas_get_items_at): check static items as well. (goo_canvas_realize): store original window position in private struct. (request_static_redraw): new function to request a redraw in static coordinate space. (request_all_static_redraws): new function to request a redraw of all static items. (paint_static_items): new function to paint the static items. (goo_canvas_expose_event): call paint_static_items(). (goo_canvas_convert_to_static_item_space): new function to convert coords to static space. (goo_canvas_adjustment_value_changed): redraw the static items before the window is scrolled, but in their new position. We do this so we don't see them being dragged along when scrolling. Redraw them again after the window has been moved. Hopefully we can optimize this a bit in future to avoid the flickering. * src/goocanvasitem.c (goo_canvas_item_get_is_static) (goo_canvas_item_set_is_static): new functions to call the interface methods if they are implemented. The default behavior allows old code to work without crashing (but old items can't be static). * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_is_static) (goo_canvas_item_simple_set_is_static): implemented new interface functions - just get/set the bit-flag. * src/goocanvasgroup.c (goo_canvas_group_add_child): call set_is_static() on new child. * src/goocanvasgroup.c (goo_canvas_group_set_is_static): implement new interface method, calling set_is_static() for all children if changed. * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: * src/goocanvastable.c: use new goo_canvas_request_item_redraw() function so static items are redrawn correctly. * demo/mv-demo.c (create_static_model): * demo/demo.c (setup_static_items): added some static items to test. Note that dragging around when scale != 1.0 is weird as the coord spaces are different, but is expected. 2008-10-15 Damon Chaplin * src/goocanvaspolyline.c (goo_canvas_polyline_is_item_at): only check the fill if the polyline path is closed. Otherwise if we call cairo_in_fill() it will automatically close the path which is not what we want. * src/goocanvaspath.c (goo_canvas_path_is_item_at): only check the fill if a fill color/pattern has been set, for similar reasons. 2008-10-12 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_create_layout): fixed calculation of text bounds. 2008-10-12 Armin Burgmeier * src/goocanvastable.c (goo_canvas_table_get_requested_area) (goo_canvas_table_allocate_area): Request redraw of the table's bounds, as GooCanvasItemSimple does, to fix incorrect drawing when changing the table's width or height. (goo_canvas_table_paint): Keep clipping to the allocated size when drawing the children, so they are not rendered outside the allocated area when the table is shrunk. #555093 2008-10-11 Damon Chaplin * docs/coordinates.xml: added section on Cairo limits. * README: updated home page URL. 2008-10-05 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_create_layout): don't turn off font hinting. I don't think it has any effect on text layout so we can safely leave it on. Small text should be easier to read, as well as non-antialiased text. Though it does seem to sometimes produce slightly odd results for rotated text (see the 8-bit text in the demo). 2008-09-21 Damon Chaplin * Released GooCanvas 0.12 2008-09-21 Damon Chaplin * configure.in: renamed LT_CURRENT, LT_AGE & LT_REVISION to CURRENT, AGE & REVISION to avoid problems with libtool 2.2. #552725. 2008-09-14 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_requested_area) (goo_canvas_item_simple_allocate_area): request redraws of the old and new item bounds. 2008-09-09 Damon Chaplin * Released GooCanvas 0.11 2008-09-02 Damon Chaplin * src/goocanvastable.c (goo_canvas_table_paint): use the item's fill and stroke colors for the table background and grid. * demo/table-demo.c: test the above. 2008-08-17 Damon Chaplin * src/goocanvasgroup.c (goo_canvas_group_add_child) (goo_canvas_group_remove_child): emit the "children_changed" ATK signal, if ATK is enabled. This needs testing. 2008-08-17 Damon Chaplin * src/Makefile.am (INCLUDES): * demo/Makefile.am (INCLUDES): get rid of the XXX_DISABLE_DEPRECATED flags so we don't break compilation when GTK+ deprecates stuff. #548086 2008-06-24 Damon Chaplin * src/goocanvasgroup.c (goo_canvas_group_get_child) (goo_canvas_group_model_get_child): return NULL if child_num is out of range. #535150 * src/goocanvasitemmodel.c (goo_canvas_item_model_get_child): * src/goocanvasitem.c (goo_canvas_item_get_child): updated docs. 2008-06-24 Damon Chaplin * src/goocanvasutils.h: removed comma at end of GooCanvasItemVisibility enum. Patch from Hubert Figuiere. #539844 2008-06-22 Kjartan Maraas * demo/demo-animation.c: (create_animation_page): * demo/demo-arrowhead.c: (create_drag_box): * demo/demo-clipping.c: (setup_canvas): * demo/demo-events.c: (setup_item_signals): * demo/demo-features.c: (create_canvas_features): * demo/demo-fifteen.c: (setup_item_signals), (create_canvas_fifteen): * demo/demo-focus.c: (create_focus_box): * demo/demo-grabs.c: (create_fixed), (setup_item_signals): * demo/demo-large-items.c: (create_large_items_page): * demo/demo-paths.c: (create_paths_page): * demo/demo-table.c: (create_demo_item), (create_demo_table), (create_width_for_height_table): * demo/demo.c: (setup_item_signals), (create_canvas_primitives), (setup_canvas), (create_window): * demo/mv-demo-animation.c: (create_animation_page): * demo/mv-demo-arrowhead.c: (on_item_created), (create_canvas_arrowhead): * demo/mv-demo-clipping.c: (setup_canvas): * demo/mv-demo-events.c: (on_item_created), (create_events_page): * demo/mv-demo-features.c: (on_item_created), (create_canvas_features): * demo/mv-demo-fifteen.c: (on_item_created), (create_canvas_fifteen): * demo/mv-demo-focus.c: (on_item_created), (create_focus_page): * demo/mv-demo-grabs.c: (create_fixed), (on_item_created), (create_canvas): * demo/mv-demo-paths.c: (create_paths_page): * demo/mv-demo-table.c: (create_demo_item), (create_demo_table), (create_width_for_height_table): * demo/mv-demo.c: (on_item_created), (create_canvas_primitives), (create_window): * demo/mv-scalability-demo.c: (setup_canvas), (create_canvas), (main): * demo/mv-simple-demo.c: (main): * demo/mv-table-demo.c: (main): * demo/scalability-demo.c: (setup_canvas), (create_canvas), (main): * demo/simple-demo.c: (main): * demo/table-demo.c: (main): * demo/units-demo.c: (setup_canvas), (create_canvas), (main): * demo/widgets-demo.c: (create_focus_box), (main): Use G_CALLBACK instead of the deprecated GtkSignal stuff. 2008-05-18 Damon Chaplin * src/goocanvasatk.c (goo_canvas_widget_accessible_new): made static. 2008-05-18 Damon Chaplin * src/goocanvas.c (goo_canvas_expose_event): when clipping, clip to the intersection of the canvas bounds and the expose bounds, to avoid problems with cairo's coordinate limits. (This was apparent in the scalability demo - it wasn't redrawing properly at the bottom of the canvas.) 2008-05-09 Damon Chaplin * src/goocanvasitemmodel.h: * src/goocanvasitem.h: removed _CLASS macros since they are interfaces. (From Masatake YAMATO). 2008-05-09 Damon Chaplin * demo/widgets-demo.c (remove_widget_clicked): use g_list_delete_link to update the GList, to avoid a crash. 2008-04-27 Damon Chaplin * Released GooCanvas 0.10 2008-04-06 Armin Burgmeier * src/goocanvastable.c: Implemented grid lines between table items by adding "horz-grid-line-width", "vert-grid-line-width", "x-border-spacing" and "y-border-spacing" properties. (Patch applied by Damon with a few changes.) * demo/mv-table-demo.c: * demo/table-demo.c: added tests for the gridlines. 2008-04-04 Damon Chaplin * docs/coordinates.xml: * docs/architecture.xml: new sections. * docs/creating-items.xml: rewritten. * src/goocanvasitemmodel.c (goo_canvas_item_model_set_parent): * src/goocanvasitem.c (goo_canvas_item_set_parent): note in the docs that the "parent" property can be used to set the parent, but that these functions are only for implementing new items (a bit confusing). * src/goocanvasitem.c (goo_canvas_item_is_visible): fixed a bug where if the item doesn't support the method it would just return TRUE, but it should also check the ancestors are visible. * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_property) (goo_canvas_item_model_simple_set_property): use the _remove() functions instead of the find_child()/remove_child() code. 2008-03-27 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_get_simple_transform): * src/goocanvasitemmodel.c (goo_canvas_item_model_get_simple_transform): new functions to do opposite of set_simple_transform(). * demo/mv-demo.c (test_simple_transforms): * demo/demo.c (test_simple_transforms): added some test code for above. 2008-03-27 Damon Chaplin * docs/wysiwyg.xml: new section to document WYSIWYG stuff. 2008-03-23 Damon Chaplin * src/goocanvasitemsimple.c: made "stroke-color-rgba" and "fill-color-rgba" properties read/write. * configure.in (pkg_modules): depend on cairo >= 1.4.0 for cairo_pattern_get_rgba(). * demo/demo.c (test_color_properties): added some test code. 2008-02-25 Damon Chaplin * src/goocanvasitemsimple.c: added default implementations for the simple_update/paint/get_item_at() virtual functions that call simple_create_path(). These make it easier for language bindings. Based on patch from Jonathon Jongsma. 2008-02-25 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_get_natural_extents): added function to get the natural extents of the text. 2007-11-23 Damon Chaplin * src/goocanvastable.c (goo_canvas_table_size_allocate_pass1): when shrinking, make sure the extra value is always decreasing, so we don't get into an infinite loop. 2007-11-18 Damon Chaplin * src/goocanvas.c: added support for "clear-background" property, patch from Grahame Bowland. 2007-11-18 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_get_child_property) (goo_canvas_item_set_child_property): * src/goocanvasitemmodel.c (goo_canvas_item_model_get_child_property) (goo_canvas_item_model_set_child_property): new functions to get/set individual child properties (to help language bindings). * demo/demo-table.c (create_demo_item): * demo/mv-demo-table.c (create_demo_item): test the above. * src/goocanvasitem.c: * src/goocanvasitemmodel.c: fixed some docs that wrongly say functions are for implementing new items only. 2007-11-13 Murray Cumming * src/goocanvasitem.c: goo_canvas_item_add_child(): * src/goocanvasitemmodel.c: goo_canvas_item_model_add_child(): Add a debugging check to make sure the child is not the same as the parent, preventing an endless loop. 2007-11-13 Murray Cumming * src/goocanvasimage.c: goo_canvas_image_set_common_property(): Support setting the pixbuf property to NULL. 2007-11-13 Murray Cumming * src/goocanvas.c: goo_canvas_render(): Call goo_canvas_update() if necessary, as suggested by Damon, to fix a crash when rendering a GooCanvasTable that has never been shown on screen. 2007-08-13 Damon Chaplin * Released GooCanvas 0.9 2007-08-13 Damon Chaplin * src/goocanvastext.c: added "wrap" property (patch from James Dietrich). * src/goocanvastable.c: use static goo_canvas_table_parent_iface and goo_canvas_table_model_parent_iface variables which are set in the class_init functions. That makes it much easier to call the GooCanvasGroup methods when needed. * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_parent): call goo_canvas_item_set_canvas() so items can do whatever is needed (e.g. groups can pass the canvas on to children). * src/goocanvasitem.c (goo_canvas_item_request_update): don't use return here as it is a void function. * src/goocanvastable.c (goo_canvas_table_remove_child): * src/goocanvasgroup.c (goo_canvas_group_remove_child): check the child_num arg is valid. 2007-06-20 Damon Chaplin * src/goocanvas.c: added "automatic-bounds", "bounds-from-origin" and "bounds-padding" properties, used to calculate the canvas bounds automatically. * demo/demo.c (change_bounds_clicked): * demo/mv-demo.c (change_bounds_clicked): test the above. 2007-06-19 Damon Chaplin * src/goocanvas.c: added "integer-layout" boolean property, to specify that all layout in the canvas (i.e. in GooCanvasTable) is done to the nearest integer. * src/goocanvastable.c: implement integer layout. * demo/table-demo.c: * demo/mv-table-demo.c: tests for integer layout. 2007-05-15 Damon Chaplin * src/goocanvas.c: added "scale-x" and "scale-y" properties to set the horizontal and vertical scale independently. Note that if items use the visibility threshold setting it will compare it to the minimum of scale_x and scale_y. * demo/demo.c: added "Scale X" and "Scale Y" spinbuttons. 2007-05-15 Damon Chaplin * src/goocanvas.c (goo_canvas_style_set, goo_canvas_realize): reset the window backgrounds to nothing, to avoid flicker when scrolling. (This happened due to the delay between X clearing the window and GooCanvas repainting it.) (goo_canvas_expose_event): clear the background ourselves here. 2007-05-14 Damon Chaplin * src/goocanvas.c (goo_canvas_set_property) (goo_canvas_set_bounds): queue a redraw of the widget. (goo_canvas_expose_event): clip to the canvas bounds if necessary. * demo/mv-demo.c (change_bounds_clicked): * demo/demo.c (change_bounds_clicked): test changing the bounds dynamically. 2007-05-13 Damon Chaplin * src/goocanvaspath.c: use a common GooCanvasPathData like the other standard items. This fixes a crash where the model's path_commands GArray was updated but the view still pointed to the old GArray which had been freed. * demo/mv-demo-paths.c: * demo/demo-paths.c: added a button to test changing the path data dynamically. 2007-05-11 Damon Chaplin * demo/demo-large-rect.c: * demo/demo-large-line.c: * demo/demo-large-items.c: new demo and items to show how to create a very large canvas and very large items. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_line_width): added utility function to get an item's line width. Also changed default line width property value to 2.0, and returned canvas line width setting if item's line width isn't set. * src/goocanvasrect.c (goo_canvas_rect_update): * src/goocanvaspolyline.c (goo_canvas_polyline_reconfigure_arrows): use the above function to get the line width. 2007-04-30 Damon Chaplin * src/goocanvas.c (goo_canvas_create_cairo_context): if the GooCanvas isn't realized, use a temporary image surface to create the cairo_t. Hopefully that will result in exactly the same bounds of items. (goo_canvas_get_item): initialize item to NULL. 2007-04-27 Damon Chaplin * src/goocanvasitem.h: * src/goocanvasutils.c (goo_canvas_bounds_get_type): added type stuff for language bindings (patch from Murray Cumming). 2007-04-25 Damon Chaplin * src/goocanvasitemmodel.c (_goo_canvas_item_model_emit_child_added) (_goo_canvas_item_model_emit_changed): new simple functions to emit signals faster (avoids signal name lookups). * src/goocanvasitemsimple.c (goo_canvas_item_model_simple_set_property) (goo_canvas_item_model_simple_set_transform) (goo_canvas_item_model_simple_set_style): * src/goocanvasgroup.c (goo_canvas_group_model_add_child): use the above functions for a little speedup. 2007-04-25 Damon Chaplin * demo/mv-scalability-demo.c: * demo/scalability-demo.c: instead of connecting signals to all items we just use a handler on the root item. Also added a switch to turn off the text items, to see the difference in performance (a lot). Without text items we can startup with 100,000 items in 1 second for a simple canvas, or 4 seconds for model-view (compared to 4 seconds and 7 seconds with text items). * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_model): only setup the accessibility stuff if accessibility is enabled (as it is quite slow if you have lots of items). 2007-04-25 Damon Chaplin * src/goocanvasrect.c (goo_canvas_rect_update): added optimized function to calculate the bounds without using cairo. 2007-04-16 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_animate_cb): check keep_source before updating the item so we don't use the freed animation data. 2007-04-16 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_path_bounds): handle empty bounds for an item's fill or stroke. cairo 1.4.x returns 0.0 for x1/y1/x2/y2 in that case, though older versions of cairo returned odd values. So I've added a workaround for that as well. 2007-04-05 Damon Chaplin * src/goocanvas.c (goo_canvas_key_press, goo_canvas_key_release): only emit "key-press" and "key-release" signals on items if the canvas has the focus. (We were incorrectly emitting signals if an embedded widget had the focus, as the events were propagating up to the canvas.) 2007-04-03 Damon Chaplin * Released GooCanvas 0.8 2007-04-03 Damon Chaplin * demo/mv-demo.c (create_canvas_primitives): * demo/demo.c (create_canvas_primitives): set the maximum scale to 50, since if we go above that we hit the cairo 16-bit limit and the large rectangle isn't painted correctly. * src/goocanvasitemsimple.c (goo_canvas_item_simple_install_common_properties): improved docs for fill/stroke properties. * src/goocanvaswidget.c (goo_canvas_widget_new) (goo_canvas_widget_set_widget): keep our own reference to the widget, rather than just relying on the canvas widget's reference. Otherwise once the widget is removed from the canvas we have an invalid pointer. 2007-03-30 Damon Chaplin * src/goocanvasutils.c (goo_canvas_boolean_handled_accumulator): new function, copied from _gtk_boolean_handled_accumulator(). * src/goocanvasitem.c (goo_canvas_item_base_init): use the above accumulator for the event signals, so returning TRUE from a handler stops the signal. * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): * src/goocanvasitem.h (struct _GooCanvasItemIface): added a few bits that will be needed to support tooltips with GTK+ 2.12. I have a patch to support tooltips but I don't want to depend on GTK+ 2.12 yet. 2007-03-28 Damon Chaplin * src/goocanvasstyle.c (goo_canvas_style_set_fill_options): check if the fill pattern is set to NULL, which is used to reset any fill pattern or color. If it is, don't set the cairo source and return FALSE. * demo/demo.c (move_ellipse_clicked): set the fill pattern to NULL occasionally to test the above. 2007-03-27 Damon Chaplin * src/goocanvas.c: added "background-color" and "background-color-rgb" properties to set the background color of the canvas, based on a patch from Gian Mario Tagliaretti. * demo/demo.c (create_canvas_primitives): * demo/mv-demo.c (create_canvas_primitives): use above properties. 2007-03-16 Murray Cumming * src/goocanvasitemsimple.h: Change the struct field name from private to priv, to avoid problems when using this from C++. 2007-03-08 Damon Chaplin * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): use guints for the bitflags rather than the enum types, since that is what GTK+ does. Maybe enums cause a problem because of being signed ints. Also added cache_setting which we may use in future. (struct _GooCanvasItemSimple): added private pointer to allow a bit of expansion in future (e.g. maybe a cache). 2007-03-08 Damon Chaplin * src/goocanvaswidget.c (goo_canvas_widget_set_canvas): unparent the widget if the canvas is set to NULL (i.e. when the item is removed from the canvas). 2007-03-08 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_remove): * src/goocanvasitem.c (goo_canvas_item_remove): new convenience functions to easily remove items & models from the canvas. * demo/mv-demo-features.c (on_button_press): * demo/demo-features.c (on_button_press): * demo/demo.c (on_button_press): * demo/mv-demo.c (on_button_press): * demo/widgets-demo.c (remove_widget_clicked): use new remove() functions to test them. * docs/goocanvas-sections.txt: rearranged GooCanvasItem/Model to put commonly-used functions first, and added remove() functions. 2007-03-08 Damon Chaplin * src/goocanvastext.[hc]: added ellipsize property, and used bit flags to cut down on memory use a bit. * demo/demo.c (setup_texts): added test for ellipsized text. * demo/mv-demo.c: * demo/mv-demo-table.c: * demo/mv-demo-clipping.c: updated model-view demos, adding new stuff from simple demo. 2007-03-07 Damon Chaplin * src/*.c: added notes to all functions that are only meant to be used when implementing new canvas items. * docs/goocanvas-sections.txt: placed all the functions only used when implementing new canvas items together at the bottom. 2007-03-06 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_get_items_at): if the item doesn't support this method just return found_items. * src/goocanvas.c (goo_canvas_create_cairo_context): made this public. 2007-03-06 Damon Chaplin * */*: added 'const' to a number of arguments taking a cairo_matrix_t* or a GooCanvasBounds*. 2007-03-06 Damon Chaplin * src/goocanvasitem.[hc]: added get_requested_height() method. * src/goocanvastable.c: Reworked a lot of code to support width-for-height layout. This gets the requested area of all children, calculates the column widths, then checks if any children want to change their requested height given their allocated width. Text items change their requested height based on their width, so this results in a better layout. * src/goocanvastext.h (struct _GooCanvasText): added layout_width to store the width used for the PangoLayout. This initially comes from the text's width property, but can be modified when the text item is layed out in a container like GooCanvasTable. * src/goocanvastext.c (goo_canvas_text_get_requested_height): calculates the requested height for the given width, or just returns -1 if the text item is rotated or has a clip path, in which case the original height is used. (goo_canvas_text_init, goo_canvas_text_create_layout) (goo_canvas_text_update): use layout_width. * demo/demo-table.c (create_width_for_height_table): added tests for width-for-height layout. * demo/demo-clipping.c (setup_canvas): added text item to check clipping works OK with them. 2007-02-27 Damon Chaplin * Released GooCanvas 0.7 2007-02-27 Damon Chaplin * src/goocanvas.c (goo_canvas_get_items_in_area): new function to get items inside or outside a given area. * demo/demo.c: added little test for goo_canvas_get_items_at() and goo_canvas_get_items_in_area(). 2007-02-27 Damon Chaplin * src/goocanvasitemmodel.[hc]: * src/goocanvasitem.[hc]: used name "transform" for all arguments to get/set_transform functions. 2007-02-27 Damon Chaplin * src/goocanvasitemmodel.[hc]: * src/goocanvasitem.[hc]: changed get_transform() method to take a cairo_matrix_t* to fill in, and return a boolean if a transform is set. This is better for bindings. * src/goocanvasitemsimple.c: updated get_transform() methods. 2007-02-27 Damon Chaplin * src/goocanvasitem.[hc]: changed get_item_at method to get_items_at which returns a list of found items rather than a single found item. * src/goocanvasitemsimple.[hc]: changed get_item_at() method to is_item_at() which just returns a boolean, and updated to new API. * src/goocanvas.c (goo_canvas_get_item_at): updated to use new API. (goo_canvas_get_items_at): new function to return list of found items. * src/goocanvastable.c (goo_canvas_table_get_items_at): * src/goocanvasgroup.c (goo_canvas_group_get_items_at): * src/goocanvasimage.c (goo_canvas_image_is_item_at): * src/goocanvaspolyline.c (goo_canvas_polyline_is_item_at): * src/goocanvastext.c (goo_canvas_text_is_item_at): * src/goocanvaswidget.c (goo_canvas_widget_is_item_at): * docs/creating-items.xml: * demo/demo-item.c (goo_demo_item_is_item_at): updated for new API. 2007-02-25 Damon Chaplin * src/goocanvasitemsimple.c: added "hint-metrics" property so people can use hinted metrics for prettier text if they aren't scaling the canvas at all. * src/goocanvasstyle.c: added goo_canvas_style_hint_metrics_id quark. * src/goocanvasutils.c (goo_cairo_hint_metrics_get_type): added enum stuff for cairo_hint_metrics_t. * src/goocanvastext.c (goo_canvas_text_create_layout): use hint metrics property. 2007-02-25 Damon Chaplin * src/goocanvas.c (goo_canvas_create_cairo): use CAIRO_ANTIALIAS_GRAY as the default antialiasing mode, as that is what is recommended when using unhinted text. (subpixel antialiasing looks really bad.) 2007-02-25 Damon Chaplin * src/*.c: checked over all finalize methods and moved code to dispose methods where appropriate. (Dispose methods should be used to unref any other objects.) This was done to help the Ruby bindings. It was a bit fiddly so it might cause a few bugs. * src/goocanvasutils.c (goo_cairo_matrix_copy) (goo_cairo_matrix_free): allocate and free with g_slice_new/free() as that is what was being used in GooCanvasItemSimple. * demo/scalability-demo.c: added a test for a very wide canvas, almost up to the 31-bit GDK window size limit. (It is slow to start though.) 2007-02-24 Damon Chaplin * demo/widgets-demo.c (on_delete_event): * demo/units-demo.c (on_delete_event): * demo/mv-scalability-demo.c (on_delete_event): * demo/scalability-demo.c (on_delete_event): * demo/mv-demo.c (on_delete_event): * demo/demo.c (on_delete_event): use gtk_main_quit() rather than exit() here, so GTK+ destroys the window and the finalization code gets tested. * src/goocanvas.c (goo_canvas_remove): implement this so embedded widgets are removed properly. 2007-02-20 Damon Chaplin * demo/demo-table.c: * demo/mv-demo-table.c: moved table-demo.c into main demo app, and made a model-view version. 2007-02-20 Damon Chaplin * src/goocanvastable.c (goo_canvas_table_get_item_at) (goo_canvas_table_paint): if the table was shrunk below its requested size, clip the children if appropriate. * src/goocanvastable.c (goo_canvas_table_get_item_at) (goo_canvas_table_paint): * src/goocanvasgroup.c (goo_canvas_group_get_item_at) (goo_canvas_group_paint): check the bounds and handle the clip path. * demo/table-demo.c (create_demo_table): added parameters and created a second table of shapes, this time with the items shrunk and clipped. 2007-02-20 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_create_layout): (goo_canvas_text_get_item_at): use the ink rect as well as the logical rect when calculating the bounds or doing hit-testing. * src/goocanvastable.c (goo_canvas_table_size_allocate_pass1): shrink homogeneous tables if appropriate. * src/goocanvaswidget.c (goo_canvas_widget_get_item_at): return the widget item if the point is within its bounds. * src/goocanvas.c (goo_canvas_render): if bounds are passed in set the clip path to the bounds. * demo/demo.c (write_pdf_clicked): added code to test clipped painting. 2007-02-19 Damon Chaplin * demo/scalability-demo.c (setup_canvas): set the font on the root group so we don't need to set it on all the text items. Also output the time to the first expose. * demo/mv-scalability-demo.c: new demo based on scalability-demo.c. 2007-02-19 Damon Chaplin * demo/demo.c: * demo/mv-demo.c: * demo/demo-animation.c: * demo/mv-demo-animation.c: made the file-global variables static so they don't clash, and updated the demos a bit. 2007-02-19 Damon Chaplin * configure.in: * src/Makefile.am: rewrote the stuff that handles the autogeneration of goocanvasmarshal.[hc] and goocanvasenumtypes.[hc], copying what GTK+ does. It now has a --disable-rebuilds option to disable the autogeneration and it doesn't try autogeneration if Perl isn't available. 2007-02-17 Damon Chaplin * Released GooCanvas 0.6 2007-02-17 Damon Chaplin * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleClass): renamed create_path, update, paint and get_item_at class methods to simple_create_path, simple_update, simple_paint and simple_get_item_at. This avoids confusion with the GooCanvasItem interface methods with the same name (and may avoid problems with language bindings etc.) * src/goocanvasellipse.c (goo_canvas_ellipse_class_init): * src/goocanvasimage.c (goo_canvas_image_class_init): * src/goocanvaspath.c (goo_canvas_path_class_init): * src/goocanvaspolyline.c (goo_canvas_polyline_class_init): * src/goocanvasrect.c (goo_canvas_rect_class_init): * src/goocanvastext.c (goo_canvas_text_class_init): * src/goocanvaswidget.c (goo_canvas_widget_class_init): * demo/demo-item.c (goo_demo_item_class_init): * src/goocanvasitemsimple.c: updated use of above class methods. * src/goocanvasgroup.c (goo_canvas_group_update): handle children with empty bounds (i.e. ignore their bounds when computing the group's bounds). * src/goocanvastable.c (goo_canvas_table_paint) (goo_canvas_table_get_item_at): * src/goocanvasgroup.c (goo_canvas_group_get_item_at) (goo_canvas_group_paint): don't check the child bounds here. Leave it up to the children to do that. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_item_at) (goo_canvas_item_simple_paint): check the item's bounds here. 2007-02-15 Damon Chaplin * src/goocanvasutils.c: * src/goocanvaspath.c: moved data structures and code for parsing and creating SVG paths from goocanvaspath.[hc] to goocanvasutils.[hc]. Added goo_canvas_parse_path_data() and goo_canvas_create_path() public functions. * src/goocanvasitemsimple.c: added "clip-path" and "clip-fill-rule" properties to specify the clip path and fill rule, and used these to calculate bounds, paint, and do hit testing. * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): added clip_path_commands and clip_fill_rule. * src/goocanvastext.c (goo_canvas_text_set_model): * src/goocanvasrect.c (goo_canvas_rect_set_model): * src/goocanvaspolyline.c (goo_canvas_polyline_set_model): * src/goocanvaspath.c (goo_canvas_path_set_model): * src/goocanvasimage.c (goo_canvas_image_set_model): * src/goocanvasgroup.c (goo_canvas_group_set_model): * src/goocanvasellipse.c (goo_canvas_ellipse_set_model): use goo_canvas_item_simple_set_model() rather than getting parent iface. (For GooCanvasTable this actually caused a crash as when it called the GooCanvasGroup function that got the parent iface which pointed to itself so it got into an infinite loop.) * demo/mv-demo-clipping.c: * demo/demo-clipping.c: new files for clipping demo pages. * demo/Makefile.am: * demo/mv-demo.c: * demo/demo.c: added clipping pages. 2007-02-13 Damon Chaplin * src/goocanvas.c (goo_canvas_size_allocate): only allocate the child widgets if we are realized, otherwise it crashes. 2007-02-13 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_animate): * src/goocanvasitem.c (goo_canvas_item_animate): added "absolute" parameter, and rewrote the animation code, using the same code for GooCanvasItem and GooCanvasItemModel. * demo/demo-animation.c: * demo/mv-demo-animation.c: new files for animation demo pages. * demo/mv-demo.c: * demo/demo.c: added new animation pages and updated animation calls. 2007-02-12 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_set_simple_transform): * src/goocanvasitem.c (goo_canvas_item_set_simple_transform): convert rotation to radians. 2007-02-09 Damon Chaplin * demo/demo-item.c (goo_demo_item_update): don't convert bounds to device space. * src/*.h: added padding to all *Class structs, to allow a bit of expansion without breaking backwards compatibility. * docs/*.xml: added example code to the introductory sections. Needs more explanation at some point. * configure.in: * src/Makefile.am: added libtool version numbers. 2007-02-08 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_set_simple_transform): * src/goocanvasitem.c (goo_canvas_item_set_simple_transform): new convenience functions to set the position, scale and rotation easily. * demo/demo.c (move_ellipse_clicked): added tests for goo_canvas_item_set_simple_transform(). * */*: more documentation updates. I've started adding a few introductory sections, tidied up a few bits, and tried to update all the docs that referred to the old model/view terminology. 2007-02-08 Damon Chaplin * */*: more documentation updates. It is 100% complete now, though it still needs docs on the optional model/view split and creating new items. 2007-02-07 Damon Chaplin * src/goocanvasutils.c (goo_canvas_query_child_properties): check if type is classed before calling g_type_interface_peek(). 2007-02-06 Damon Chaplin * src/goocanvas.[hc]: updated docs. 2007-02-04 Damon Chaplin * src/goocanvasstyle.[hc]: extern the GQuarks in the header and define them in the .c file. 2007-02-04 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_base_init): fix type of "parent" property, from Gian Mario Tagliaretti. 2007-02-04 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_check_style): fixed bug where if item was using its parent's style it wouldn't get updated. * */*: documented most of the other symbols. I just need to document the 2 main interfaces - GooCanvasItemIface and GooCanvasItemModelIface, check it all over for out-of-date docs, and document the optional model/view split a bit more. (And maybe a section on writing new items) 2007-02-02 Damon Chaplin * */*: updated docs for all canvas items & models. 2007-02-01 Damon Chaplin * src/goocanvastable.c: finished table item. I think the only API breakage this introduces is that GooCanvasItemSimple subclasses that override the update() class method must now return the bounds in user space rather than device space. (This is needed to do the table layout.) * demo/table-demo.c: added more test tables with various transforms and settings. * src/goocanvasitem.c (goo_canvas_item_get_requested_area) (goo_canvas_item_allocate_area) (goo_canvas_item_get_transform_for_child) : new functions and interface methods to support GooCanvasTable and other layout containers. * src/goocanvasitemsimple.c: added support for GOO_CANVAS_ITEM_HIDDEN, initialized the model's visibility setting to GOO_CANVAS_ITEM_VISIBLE. (goo_canvas_item_simple_update): split part of it out into goo_canvas_item_simple_update_internal and updated slightly. (goo_canvas_item_simple_get_requested_area) (goo_canvas_item_simple_allocate_area): new functions to support GooCanvasTable and other layout containers. (goo_canvas_item_simple_get_path_bounds): don't convert to device space as some code needs the bounds in user space. * src/goocanvas.c (goo_canvas_convert_to_item_space) (goo_canvas_convert_from_item_space): used the new goo_canvas_item_get_transform_for_child() function to get the transform for each item. * src/goocanvasutils.h: added GOO_CANVAS_ITEM_HIDDEN visibility setting which is used for items which are invisible and not allocated any space in containter items like GooCanvasTable. * src/goocanvasgroup.c (goo_canvas_group_get_item_at) (goo_canvas_group_paint): support GOO_CANVAS_ITEM_HIDDEN. * src/goocanvaspolyline.c (goo_canvas_polyline_compute_bounds): * src/goocanvasimage.c (goo_canvas_image_update): leave bounds in user space. * src/goocanvaswidget.c: updated to override the GooCanvasItemSimple update, paint & get_item_at methods instead of the interface methods, added support for GOO_CANVAS_ITEM_HIDDEN, and added goo_canvas_widget_allocate_area() implementation. * src/goocanvastext.c (goo_canvas_text_get_item_at): fixed bug that meant it didn't work for text items with no fill color/pattern set. 2006-12-09 Damon Chaplin * docs/goocanvas-sections.txt: * docs/goocanvas-docs.sgml: use separate sections for model objects, as gtk-doc doesn't support multiple objects per section. * docs/Makefile.am (SCANGOBJ_OPTIONS): added --query-child-properties argument to document child properties (needs cvs gtk-doc). * src/goocanvasutils.c (goo_canvas_query_child_properties): new function to allow documentation of child properties with gtk-doc. * src/goocanvasitemmodel.c: * src/goocanvasitem.c: added support for child properties of item models. * src/goocanvastable.c: beginnings of a new table item to layout child items. Doesn't do much yet. * demo/table-demo.c: beginnings of demo for GooCanvasTable. * src/goocanvasitem.c (goo_canvas_item_animate): clarified docs. * src/goocanvasgroup.c: use goo_canvas_item_add/move/remove_child() rather than goo_canvas_group_add/move_remove_child() so subclasses can reuse group's code. Also fix some docs & variable names. 2006-11-30 Damon Chaplin * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleClass): added new update/paint/get_item_at methods that subclasses can override. If items use these methods GooCanvasItemSimple will perform all the standard stuff before passing control to them. This makes it much easier to create simple canvas items. * demo/demo-item.c: * src/goocanvaspolyline.c: * src/goocanvastext.c: * src/goocanvasimage.c: use the above methods, so we can get rid of all the boilerplate code. 2006-11-29 Damon Chaplin * demo/demo-item.[hc]: new demo item to show how to create new items. There's more boilerplate code than I'd like, but I don't know the best way to deal with it. 2006-11-29 Damon Chaplin * */*: major rewrite to make the model optional, so people can choose to have either a simple canvas or a model/view canvas. (Many people found the model/view split awkward.) The standard items can be used in either scenario. Also added support for cascading styles, with arbitrary properties, and embedded widget items. I'm in the middle of adding support for layout items as well (e.g. something like a GtkTable for items). 2006-10-12 Damon Chaplin * src/goocanvastextview.c (goo_canvas_text_view_create_layout) (goo_canvas_text_view_get_item_view_at) (goo_canvas_text_view_paint): patch from Martin Soto to fix a text positioning bug. The position was wrong when the text width was set and the alignment wasn't PANGO_ALIGN_LEFT. (Pango uses the set width to calculate the text origin, but we were using the logical width.) 2006-10-12 Damon Chaplin * src/goocanvasutils.h: * src/goocanvasprivate.h: make get_type() declarations public as they are useful for bindings. 2006-10-12 Damon Chaplin Applied patch from Paul Davis to use glib_mkenums, slightly modified: * configure.in: use pkg-config to get the glib_genmarshal and glib_mkenums binaries. * src/Makefile.am: use glib_mkenums to generate goocanvasenums.[hc]. * src/goocanvasutils.c: removed goo_canvas_pointer_events_get_type() and goo_canvas_item_visibility_get_type() as they're generated now. * src/goocanvasutils.h: removed get_type() declarations that are now in goocanvasenums.h, and modifed GooCanvasPointerEvents so glib_mkenums could parse it. * src/goocanvas.h: * src/goocanvasitem.c: include goocanvasenums.h. 2006-10-12 Damon Chaplin * src/goocanvaspolyline.h (struct _GooCanvasPoints): use a separate typedef declaration for the struct, to help C++ bindings. From Paul Davis. * src/goocanvaspath.c (goo_canvas_path_new): use 'const' for the path_data argument. From Paul Davis. * src/goocanvaspathview.c (goo_canvas_path_view_create_path): init last_control_point_x/y to avoid compiler warning. 2006-09-11 Damon Chaplin * src/goocanvaspolylineview.c: be more careful about using points and arrow data. * demo/demo.c (setup_lines): add checks for polylines with 0 and 1 points. * configure.in: require GTK+ 2.10.0, for GtkUnit (Gian Mario Tagliaretti). 2006-08-31 Damon Chaplin * src/goocanvasview.c: added "units", "resolution-x" & "resolution-y" properties so we can support points, inches and millimeters being used for item units as well as just pixels. Thus you can create a complete WYSIWYG printable document. But note that you must use absolute units for font sizes, i.e. use "px" after the size in any font description strings, e.g. "Sans 10px". That stops us scaling fonts twice. (goo_canvas_view_set_default_line_width): set a reasonable default line width according to the current units. * demo/units-demo.c: new demo showing different units in use. 2006-08-30 Damon Chaplin * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_update) * src/goocanvaspolylineview.c (goo_canvas_polyline_view_update): added a workaround for cairo limits. Cairo uses fixed point integer maths and is currently limited to 16-bits for the integer component. So we remove any current translation before calculating the bounds of the item, then add it back to the results. This means the 16-bit limit only applies to items' user space rather than the entire canvas. * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_get_item_view_at): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_get_item_view_at): as above, remove any current translation before checking if the point is in the item. * demo/scalability-demo.c: updated to create ~100,000 items, either rectangles or images. For images it now reuses a single cairo pattern rather than passing the pixbuf to the GooCanvasImage (which created a new pattern for each one and ran out of memory). It takes about 10 seconds to setup the canvas which is slower than I'd like, but once created it seems to work fast enough. 2006-08-27 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_class_init): * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_class_init) * src/goocanvasgroupview.c (goo_canvas_group_view_class_init): only register the accessible factories if accessibility is enabled (i.e. GtkWidget has registered a factory). * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_setup_accessibility): * src/goocanvasgroupview.c (goo_canvas_group_view_set_group): only set the accessible title & description and connect the signal handlers if accessibility is enabled. (It would be better to not call atk_gobject_accessible_for_object() at all, as it isn't useful.) * demo/scalability-demo.c: start of new demo/test for scalability. We are currently hitting the cairo 16-bit limit (transformed coords can't be larger than 16-bit ints). A workaround would be nice. I also want to profile it and see if there are any major bottlenecks. (Creating canvases with thousands of items is very slow, though scrolling etc. is OK as long as the canvas is split into groups.) 2006-08-24 Damon Chaplin * Released GooCanvas 0.4 2006-08-24 Damon Chaplin * src/*.c: updated docs to point to goo_canvas_view_get_item_view() as a simple alternative for setting up signal handlers. * src/goocanvasview.c (goo_canvas_view_pointer_ungrab): only call gdk_display_pointer_ungrab() if we have an active pointer grab. So maybe we can now use goo_canvas_view_pointer_ungrab() to ungrab passive grabs on canvas item views (need to test this though). 2006-08-23 Damon Chaplin * src/goocanvasview.c: keep an item_to_view hash table so apps can get the view for particular items (e.g. as an easy alternative for setting up signal handlers). (goo_canvas_view_get_item_view): new function to get the item view for a given item. (goo_canvas_view_unregister_item_view): new function that implementors of GooCanvasItemView should call in their finalize method to unregister the view (so the GooCanvasView removes it from the hash table.) (goo_canvas_view_create_item_view): add the new item view to the item_to_view hash table. * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_finalize): * src/goocanvasgroupview.c (goo_canvas_group_view_finalize): unregister the item view. (goo_canvas_group_view_set_parent_view): don't change the canvas view here any more, since we don't support that. * demo/simple-demo.c: updated to use simple signal handler setup. 2006-08-22 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_class_init): 2 minor fixes for the docs (from Gian Mario Tagliaretti). 2006-08-15 Damon Chaplin * src/goocanvasutils.h: moved GOO_TYPE_CAIRO_PATTERN stuff here, so bindings can use it. Also renamed goo_cairo_line_dash stuff to goo_canvas_line_dash for consistency. * src/goocanvasutils.c (goo_canvas_line_dash_newv): new non-varargs variant of function of goo_canvas_line_dash_new() for bindings. (from Gustavo J. A. M. Carneiro.) 2006-08-14 Damon Chaplin * Makefile.am: require automake 1.7, since it is needed for glib-genmarshal (from Gian Mario Tagliaretti). 2006-08-08 Damon Chaplin * src/goocanvastextview.c (goo_canvas_text_view_update): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_update): * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_update): * src/goocanvasimageview.c (goo_canvas_image_view_update): * src/goocanvasgroupview.c (goo_canvas_group_view_update): rewrote the update methods to make sure the bounds is always set and returned correctly. 2006-07-26 Damon Chaplin * src/goocanvasgroup.[hc]: added goo_canvas_group_set_model() function, to set the model of the root group. * src/goocanvasmodelsimple.c (goo_canvas_model_simple_init): use the above function. * src/goocanvas*view.c: support an optional transformation matrix for each view, which is combined with the underlying item's transform. (I'm not sure if this will overcomplicate things.) * src/goocanvasgroupview.c: support generic GooCanvasItems as the underlying group rather than just GooCanvasGroups. This allows us to use subclasses of GooCanvasGroupView easily. (goo_canvas_group_view_set_group): new function to set the underlying group item, creating child views and setting up signal handlers etc. 2006-07-21 Damon Chaplin * src/goocanvas*view.c: renamed get_item_at() methods to get_item_view_at(). * src/goocanvasview.c (goo_canvas_view_get_root_view): new function to return the root view. (goo_canvas_view_get_item_view_at): new function to return the item view at a given point. 2006-07-19 Damon Chaplin * src/goocanvasatk.c: * src/goocanvasgroupview.c: * src/goocanvasimageview.c: * src/goocanvasitemview.c: * src/goocanvasitemview.h: * src/goocanvasitemviewsimple.c: * src/goocanvaspolylineview.c: * src/goocanvastextview.c: * src/goocanvasview.c: changed item view update() and get_bounds() methods to take a GooCanvasBounds* to fill in, rather than returning a pointer to a static GooCanvasBounds. This makes it easier for language bindings. 2006-07-19 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_scroll): handle scroll events ourselves, in case we aren't placed directly in a scrolled window. * src/goocanvasitem.c (goo_canvas_item_get_transform): if the item doesn't support this method just return NULL. * demo/demo-fifteen.c: use generic goo_canvas_item_view_get_item() method to get the item rather than private struct members. * configure.in: depend on glib 2.10.0 (from Gian Mario Tagliaretti). * src/goocanvasutils.c (goo_canvas_pointer_events_get_type): use a flags type rather than an enum type (from Gustavo J. A. M. Carneiro). * src/goocanvasitem.c (goo_canvas_item_base_init): * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: updated to use the flags type for "pointer-events" instead of enum. * src/goocanvasprivate.h: * src/goocanvasutils.h: The type GOO_TYPE_CAIRO_MATRIX is used in a public interface (a property in the GooCanvasItem interface), therefore it has to be public (from Gustavo J. A. M. Carneiro). 2006-06-08 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_property): only create the item's style when needed. (goo_canvas_style_get_type): register boxed type (from Gustavo J. A. M. Carneiro). 2006-06-01 Damon Chaplin * demo/demo.c: only add the "Output PDF" option if cairo has PDF support compiled in. 2006-05-27 Damon Chaplin * src/*.c: removed ';' after all G_DEFINE_TYPE* macros. 2006-05-27 Damon Chaplin * autogen.sh: check for AC_CONFIG_HEADER as well as old AM_*. 2006-05-16 Damon Chaplin * goocanvas.pc.in: * Makefile.am: * configure.in: added .pc file (patch from Gian Mario Tagliaretti). 2006-05-12 Damon Chaplin * src/goocanvastextview.c (goo_canvas_text_view_create_layout): if there is no text return an empty layout rather than NULL. (goo_canvas_text_view_get_item_at): check if there is no text first. * src/goocanvasitemsimple.[hc]: rename operator to op since operator is a C++ keyword (reported by Yevgen Muntyan). 2006-04-24 Damon Chaplin * Released GooCanvas 0.3 2006-04-24 Damon Chaplin * src/goocanvasview.c: added "model", "scale", "anchor", "x1", "y1", "x2", "y2" properties, and goo_canvas_view_get_bounds() and goo_canvas_view_get_scale() accessors. Removed goo_canvas_view_set_anchor() as the property should be enough. (I think we should only have accessor functions for major properties.) * src/goocanvasitemview.c (goo_canvas_item_view_is_visible) (goo_canvas_item_view_get_item_at): removed scale argument. We get it from the canvas view now, to make the API a little simpler. * src/goocanvasitemviewsimple.h (struct _GooCanvasItemViewSimple): added pointer to the canvas view. * src/*view.[hc]: added canvas view argument to all view creation functions. 2006-04-23 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_focus): scroll to show the new focused item if necessary. (goo_canvas_view_set_model): set need_update to TRUE. (goo_canvas_view_focus_check_is_best): try to avoid wild jumps when moving around with the cursor keys. 2006-04-22 Damon Chaplin * src/goocanvasview.c: added support for keyboard focus navigation. (I still need to make it scroll to show the focused item if needed.) * demo/demo-focus.c: new demo page to test keyboard focus navigation. * src/goocanvasitemview.c: added "focus-in-event" & "focus-out-event" signals. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_path_bounds): make sure we do min/max over all points of bounds. * src/goocanvasview.c (goo_canvas_view_focus_out): emit "focus_out_event", not "focus_in_event". 2006-04-19 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_base_init): added "title" and "description" properties for accessibility. Note that we only support per-item settings for the standard canvas items, though more complex items may want to support per-view settings. * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: implemented "title" and "description" properties. * src/goocanvas*view.c: set the accessible name & description based on the item's settings, and update them if changed. * src/goocanvasatk.c (goo_canvas_item_view_accessible_ref_child): return the accessible rather than the item view. 2006-04-18 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_get_model): new function. (goo_canvas_view_adjustment_value_changed): emit "visible_data_changed" on accessible object. (goo_canvas_view_init): initialize default bounds, and create default adjustments. * src/goocanvasitemview.[hc]: added new is_visible() method, and "can-focus" property, and convenience find_child() function. * src/goocanvasitemviewsimple.c: implemented "can-focus" property and "is_visible" method. * src/goocanvasgroupview.c: implemented "can-focus" property and "is_visible" method, and used same flags field as GooCanvasItemViewSimple. * src/goocanvasatk.[c]: new files to support accessibility. Most of the code has been copied from foocanvas & libgnomecanvas, with slight changes to handle our model/view split. * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_finalize): chain up to parent's finalize method. 2006-04-16 Damon Chaplin * src/goocanvasview.c (propagate_event, emit_pointer_event): ref views and check they are still valid. * src/*view.[hc]: made views hold reference on items, to ensure we never use invalid pointers. 2006-04-16 Damon Chaplin * demo/simple-demo.c: new very simple demo, also used in docs. * src/goocanvasitemviewsimple.[hc]: new base class for item views, so we can share a lot of the common code. * src/*view.[hc]: updated item views to be a subclass of above. * src/*.c: removed lots of unused debugging code. * src/goocanvasitem.c: * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: moved "pointer-events" and "transform" properties, and the "changed" signal to the GooCanvasItem interface. * src/*.[hc]: updated use of above. 2006-04-14 Damon Chaplin * src/goocanvasview.c: documented GooCanvasView, though it needs an overview and demo code. * src/*.[hc]: documented most of the core objects. * src/goocanvasutils.h: renamed goo_cairo_dash* to goo_canvas_dash* for consistency. * src/goocanvasprivate.h: new header to contain private declarations that we don't install. * src/*.[hc]: documented enums & structs on the types page. 2006-04-13 Damon Chaplin * src/*.[hc]: documented views for standard items. * src/*.[hc]: documented standard items. 2006-04-12 Damon Chaplin * configure.in: updated to use newer forms of macros. * COPYING: added LGPL license. * src/Makefile.am (libgoocanvasincludedir): install headers into $(includedir)/goocanvas-1.0 rather than $(includedir)/libgoocanvas-1.0. * demo/*: moved all the demo code here. * src/goocanvas.h: new main header to include all the public headers. * autogen.sh: * configure.in: * Makefile.am: setup to use gtk-doc. * src/Makefile.am: build libgoocanvas as a library now, so we can document it with gtk-doc. The demo will be moved to a separate directory. * src/goocanvastext.h: * src/goocanvasitem.h: rename a few parameters to match the sources, since gtk-doc complains if they are different. 2006-04-11 Damon Chaplin * src/demo-paths.c (create_paths): added more arc tests. * src/goocanvaspathview.c: finished the elliptical arc and split up the create_path() function a bit. 2006-04-10 Damon Chaplin * src/goocanvaspathview.[hc]: * src/goocanvaspath.[hc]: new path item and view, that uses the same path spec strings as SVG. I think everything works, except the elliptical arc, which I haven't finished yet. * src/demo-paths.c: new demo page to test paths. 2006-04-08 Damon Chaplin * src/goocanvasitemsimple.[hc]: * src/goocanvasgroup.[hc]: added "pointer-events" property, like SVG. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_path_bounds): changed to include both the stroke and fill extents, even if they will not be painted. This is needed to handle the "pointer-events" property. * src/goocanvasitemsimple.c (goo_canvas_item_simple_check_in_path): added "pointer_events" argument, to specify which parts of the path to check. * src/goocanvasitemview.[hc]: change get_item_at() to take "is_pointer_event", "parent_visible", and "scale" properties, so we can handle the "pointer-events" property. * src/goocanvasgroupview.c (goo_canvas_group_view_get_item_at): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_get_item_at): * src/goocanvasimageview.c (goo_canvas_image_view_get_item_at): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_get_item_at): * src/goocanvasrectview.c (goo_canvas_rect_view_get_item_at): * src/goocanvastextview.c (goo_canvas_text_view_get_item_at): updated to support "pointer-events". * src/goocanvasutils.[hc]: added GooCanvasPointerEvents enum, and goo_cairo_line_dash_new(). * src/demo-events.c: new demo page to test "pointer-events" property. * src/goocanvastextview.c (goo_canvas_text_view_paint): if the fill pattern has been explicitly set to NULL, don't paint the text. 2006-04-03 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_style_set) (goo_canvas_view_realize): use the base color for the background. * src/demo.c (create_canvas_primitives): use gtk_widget_modify_base() to test setting the background color. 2006-03-24 Damon Chaplin * src/goocanvasitemview.c (goo_canvas_item_view_ensure_updated): new convenience function to do an immediate update. * src/goocanvasview.c (goo_canvas_view_update): turned this into a public function for use by the above. * src/goocanvastextview.c (goo_canvas_text_view_get_bounds) (goo_canvas_text_view_get_item_at): * src/goocanvasrectview.c (goo_canvas_rect_view_get_bounds) (goo_canvas_rect_view_get_item_at): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_get_bounds) (goo_canvas_polyline_view_get_item_at): * src/goocanvasgroupview.c (goo_canvas_group_view_get_bounds) (goo_canvas_group_view_get_item_at): * src/goocanvasimageview.c (goo_canvas_image_view_get_bounds) (goo_canvas_image_view_get_item_at): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_get_bounds) (goo_canvas_ellipse_view_get_item_at): make sure the canvas is updated first, if needed. 2006-03-24 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_render): new function to render all or part of the canvas to a given cairo context. * src/demo.c: added "Write PDF" test, that creates a pdf file containing the main canvas. * src/goocanvasview.[hc]: used a GooCanvasBounds rather than left, right, top, bottom for the bounds. Also renamed "pixels_per_unit" to "scale". * src/goocanvasitemview.[hc]: * src/goocanvastextview.c (goo_canvas_text_view_paint): * src/goocanvasgroupview.c (goo_canvas_group_view_paint): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_paint): * src/goocanvasimageview.c (goo_canvas_image_view_paint): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_paint): we now just pass the effective scale to the paint function rather than the GooCanvasView*, since when rendering to an arbitrary cairo_t we may not want to use a different effective scale (to determine which items are shown). (Also fixed some of the visibility checks.) 2006-03-23 Damon Chaplin * src/goocanvasitem.c: added new "visibility" and "visibility-threshold" properties to specify when an item should be visible (always, never, or above a certain scale threshold). * src/goocanvasutils.[hc]: added GooCanvasItemVisibility enum stuff. * src/goocanvasitemsimple.[hc]: * src/goocanvasgroup.[hc]: implemented new properties. * src/goocanvasgroupview.c (goo_canvas_group_view_paint): * src/goocanvastextview.c (goo_canvas_text_view_paint): * src/goocanvasrectview.c (goo_canvas_rect_view_paint): * src/goocanvasimageview.c (goo_canvas_image_view_paint): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_paint): check the visibility settings to see if the items should be painted. * src/demo.c (setup_invisible_texts): added test for visibility settings. * src/goocanvasitem.[hc] (goo_canvas_item_create_view): removed this as it is mainly an internal function and the interface can be used directly instead where needed. 2006-03-23 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_scroll_to): freeze the canvas while setting the adjustments so we don't redraw twice. 2006-03-22 Damon Chaplin * src/goocanvasview.[hc]: convert to a subclass of GtkContainer rather than GtkLayout, since the layout code didn't help much and just added to the confusion. (Getting scrolling/zooming to work smoothly is pretty difficult.) Added a goo_canvas_view_scroll_to() function to scroll to a desired position. Added an anchor setting to specify where to place the contents of the canvas if it is smaller than the allocated widget area. (Like the "center_scroll_region" setting in GnomeCanvas but a bit more general.) Mapped a temporary window above the canvas when zooming in/out to stop X from scrolling the canvas contents before it is redrawn. (Idea pinched from FooCanvas.) Though this could possibly cause problems with keyboard input in future, in which case I think we should drop the fancy window scrolling stuff and just scroll ourselves. Added an internal freeze_count like GtkLayout used to have. This is used while reconfiguring the scrollbars etc. so we don't scroll more than once (e.g. horizontally then vertically). Added coordinate conversion functions to convert between device units and canvas item units or pixels. * src/goocanvastextview.[hc]: create a cairo_font_options_t object in the class init function and use it for all created PangoLayouts. This ensures that text is layed out the same at any scale, which also avoids the problems with items not being redrawn properly (since the bounds were slightly wrong). Note that I was using cairo_set_font_options(cr) before, but that isn't picked up by Pango so didn't work. (Font options seem to be associated with surfaces and also with the graphics state which is confusing.) goocanvas-1.0.0/demo/0000755000076400007640000000000011512612761011427 500000000000000goocanvas-1.0.0/demo/mv-demo-clipping.c0000644000076400007640000001341211412723611014657 00000000000000#include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gchar *id) { g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id, event->x, event->y, event->x_root, event->y_root); return TRUE; } static void setup_canvas (GooCanvas *canvas) { GooCanvasItemModel *root, *model, *table; GooCanvasItem *item; root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (canvas, root); g_object_unref (root); /* Plain items without clip path. */ model = goo_canvas_ellipse_model_new (root, 0, 0, 50, 30, "fill-color", "blue", NULL); goo_canvas_item_model_translate (model, 100, 100); goo_canvas_item_model_rotate (model, 30, 0, 0); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse (unclipped)"); model = goo_canvas_rect_model_new (root, 200, 50, 100, 100, "fill-color", "red", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle (unclipped)"); model = goo_canvas_rect_model_new (root, 380, 50, 100, 100, "fill-color", "yellow", NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle (unclipped)"); model = goo_canvas_text_model_new (root, "Sample Text", 520, 100, -1, GTK_ANCHOR_NW, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); /* Clipped items. */ model = goo_canvas_ellipse_model_new (root, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_model_translate (model, 100, 300); goo_canvas_item_model_rotate (model, 30, 0, 0); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); model = goo_canvas_rect_model_new (root, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); model = goo_canvas_rect_model_new (root, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); model = goo_canvas_text_model_new (root, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); /* Table with clipped items. */ table = goo_canvas_table_model_new (root, NULL); goo_canvas_item_model_translate (table, 200, 400); goo_canvas_item_model_rotate (table, 30, 0, 0); model = goo_canvas_ellipse_model_new (table, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_model_translate (model, 100, 300); goo_canvas_item_model_rotate (model, 30, 0, 0); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); model = goo_canvas_rect_model_new (table, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); goo_canvas_item_model_set_child_properties (table, model, "column", 1, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); model = goo_canvas_rect_model_new (table, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); goo_canvas_item_model_set_child_properties (table, model, "column", 2, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); model = goo_canvas_text_model_new (table, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); goo_canvas_item_model_set_child_properties (table, model, "column", 3, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); } GtkWidget * create_clipping_page (void) { GtkWidget *vbox, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (GOO_CANVAS (canvas)); return vbox; } goocanvas-1.0.0/demo/demo-scalability.c0000644000076400007640000000427511412723611014741 00000000000000#include #include #include #include #define N_COLS 5 #define N_ROWS 20 #define PADDING 10 #if 1 #define USE_PIXMAP #endif GtkWidget * create_canvas_scalability (void) { GtkWidget *vbox; GtkWidget *frame; GtkWidget *scrolled_win, *canvas; GtkWidget *table; GdkPixbuf *pixbuf; GooCanvasItem *root, *item; int i, j, width, height; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); table = gtk_table_new (2, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); gtk_widget_show (table); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); gtk_widget_show (frame); /* Create the canvas and board */ pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); #ifdef USE_PIXMAP width = gdk_pixbuf_get_width (pixbuf) + 3; height = gdk_pixbuf_get_height (pixbuf) +1; #else width = 37; height = 19; #endif canvas = goo_canvas_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, N_COLS * (width + PADDING), N_ROWS * (height + PADDING)); gtk_widget_show (canvas); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (frame), scrolled_win); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { #ifdef USE_PIXMAP item = goo_canvas_image_new (root, pixbuf, i * (width + PADDING), j * (height + PADDING), NULL); #else item = goo_canvas_rect_new (root, i * (width + PADDING), j * (height + PADDING), width, height); g_object_set (item, "fill_color", (j%2)?"mediumseagreen":"steelblue", NULL); #endif } } return vbox; } goocanvas-1.0.0/demo/demo-animation.c0000644000076400007640000001054411423522047014416 00000000000000#include #include #include #include static GooCanvasItem *ellipse1, *ellipse2, *rect1, *rect2, *rect3, *rect4; static void start_animation_clicked (GtkWidget *button, gpointer data) { /* Absolute. */ goo_canvas_item_set_simple_transform (ellipse1, 100, 100, 1, 0); goo_canvas_item_animate (ellipse1, 500, 100, 2, 720, TRUE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_set_simple_transform (rect1, 100, 200, 1, 0); goo_canvas_item_animate (rect1, 100, 200, 1, 350, TRUE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_set_simple_transform (rect3, 200, 200, 1, 0); goo_canvas_item_animate (rect3, 200, 200, 3, 0, TRUE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); /* Relative. */ goo_canvas_item_set_simple_transform (ellipse2, 100, 400, 1, 0); goo_canvas_item_animate (ellipse2, 400, 0, 2, 720, FALSE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_set_simple_transform (rect2, 100, 500, 1, 0); goo_canvas_item_animate (rect2, 0, 0, 1, 350, FALSE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_set_simple_transform (rect4, 200, 500, 1, 0); goo_canvas_item_animate (rect4, 0, 0, 3, 0, FALSE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); } static void stop_animation_clicked (GtkWidget *button, gpointer data) { goo_canvas_item_stop_animation (ellipse1); goo_canvas_item_stop_animation (ellipse2); goo_canvas_item_stop_animation (rect1); goo_canvas_item_stop_animation (rect2); goo_canvas_item_stop_animation (rect3); goo_canvas_item_stop_animation (rect4); } static void on_animation_finished (GooCanvasItem *item, gboolean stopped, gpointer data) { g_print ("Animation finished stopped: %i\n", stopped); #if 0 /* Test starting another animation. */ goo_canvas_item_animate (ellipse1, 500, 200, 2, 720, TRUE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Absolute. */ ellipse1 = goo_canvas_ellipse_new (root, 0, 0, 25, 15, "fill-color", "blue", NULL); goo_canvas_item_translate (ellipse1, 100, 100); g_signal_connect (ellipse1, "animation_finished", G_CALLBACK (on_animation_finished), NULL); rect1 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_translate (rect1, 100, 200); rect3 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_translate (rect3, 200, 200); /* Relative. */ ellipse2 = goo_canvas_ellipse_new (root, 0, 0, 25, 15, "fill-color", "red", NULL); goo_canvas_item_translate (ellipse2, 100, 400); rect2 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_translate (rect2, 100, 500); rect4 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_translate (rect4, 200, 500); } GtkWidget * create_animation_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label("Start Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (start_animation_clicked), NULL); w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); return vbox; } goocanvas-1.0.0/demo/demo-grabs.c0000644000076400007640000002620711412723611013536 00000000000000#include #include #include #include static gboolean on_widget_expose (GtkWidget *widget, GdkEventExpose *event, char *item_id) { g_print ("%s received 'expose' signal\n", item_id); gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_IN, &event->area, widget, NULL, 0, 0, widget->allocation.width, widget->allocation.height); return FALSE; } static gboolean on_widget_enter_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'enter-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'leave-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_motion_notify (GtkWidget *widget, GdkEventMotion *event, char *item_id) { g_print ("%s received 'motion-notify' signal (window: %p)\n", item_id, event->window); if (event->is_hint) gdk_window_get_pointer (event->window, NULL, NULL, NULL); return TRUE; } static gboolean on_widget_button_press (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; status = gdk_pointer_grab (widget->window, FALSE, mask, FALSE, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return TRUE; } static gboolean on_widget_button_release (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkDisplay *display; display = gtk_widget_get_display (widget); gdk_display_pointer_ungrab (display, event->time); g_print ("released pointer grab\n"); } return TRUE; } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'enter-notify' signal\n", item_id); return FALSE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'leave-notify' signal\n", item_id); return FALSE; } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'motion-notify' signal\n", item_id); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; canvas = goo_canvas_item_get_canvas (item); status = goo_canvas_pointer_grab (canvas, item, mask, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return FALSE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); g_print ("released pointer grab\n"); } return FALSE; } static void create_fixed (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *fixed, *drawing_area; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); fixed = gtk_fixed_new (); gtk_fixed_set_has_window (GTK_FIXED (fixed), TRUE); gtk_widget_set_events (fixed, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (fixed, 200, 100); gtk_table_attach (GTK_TABLE (table), fixed, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (fixed); view_id = g_strdup_printf ("%s-background", id); g_signal_connect (fixed, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (fixed, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (fixed, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (fixed, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (fixed, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (fixed, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 20, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-left", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 120, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-right", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } static void create_canvas (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *canvas; GooCanvasItem *root, *rect; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 200, 100); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 200, 100); gtk_table_attach (table, canvas, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); rect = goo_canvas_rect_new (root, 0, 0, 200, 100, "stroke-pattern", NULL, "fill-color", "yellow", NULL); view_id = g_strdup_printf ("%s-yellow", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); rect = goo_canvas_rect_new (root, 20, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "blue", NULL); view_id = g_strdup_printf ("%s-blue", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); rect = goo_canvas_rect_new (root, 120, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "red", NULL); view_id = g_strdup_printf ("%s-red", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); } GtkWidget * create_grabs_page (void) { GtkWidget *table, *label; table = gtk_table_new (5, 2, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 12); gtk_table_set_row_spacings (GTK_TABLE (table), 12); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_widget_show (table); label = gtk_label_new ("Move the mouse over the widgets and canvas items on the right to see what events they receive.\nClick buttons to start explicit or implicit pointer grabs and see what events they receive now.\n(They should all receive the same events.)"); gtk_table_attach (GTK_TABLE (table), label, 0, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (label); /* Drawing area with explicit grabs. */ create_fixed (GTK_TABLE (table), 1, "Widget with Explicit Grabs:", "widget-explicit"); /* Drawing area with implicit grabs. */ create_fixed (GTK_TABLE (table), 2, "Widget with Implicit Grabs:", "widget-implicit"); /* Canvas with explicit grabs. */ create_canvas (GTK_TABLE (table), 3, "Canvas with Explicit Grabs:", "canvas-explicit"); /* Canvas with implicit grabs. */ create_canvas (GTK_TABLE (table), 4, "Canvas with Implicit Grabs:", "canvas-implicit"); return table; } goocanvas-1.0.0/demo/mv-demo-features.c0000644000076400007640000000770611412723611014701 00000000000000#include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); GooCanvasItemModel *parent1, *parent2, *parent; if (event->button != 1 || event->type != GDK_BUTTON_PRESS) return FALSE; parent1 = g_object_get_data (G_OBJECT (model), "parent1"); parent2 = g_object_get_data (G_OBJECT (model), "parent2"); parent = goo_canvas_item_model_get_parent (model); g_object_ref (model); goo_canvas_item_model_remove (model); if (parent == parent1) goo_canvas_item_model_add_child (parent2, model, -1); else goo_canvas_item_model_add_child (parent1, model, -1); g_object_unref (model); return TRUE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (g_object_get_data (G_OBJECT (model), "parent1")) { g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } } GtkWidget * create_canvas_features (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GooCanvasItemModel *root, *item; GooCanvasItemModel *parent1; GooCanvasItemModel *parent2; GooCanvasItemModel *group; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ w = gtk_label_new ("Reparent test: click on the items to switch them between parents"); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); gtk_widget_set_size_request (canvas, 400, 200); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 400, 200); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); /* First parent and box */ parent1 = goo_canvas_group_model_new (root, NULL); goo_canvas_rect_model_new (parent1, 0, 0, 200, 200, "fill_color", "tan", NULL); /* Second parent and box */ parent2 = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (parent2, 200, 0); goo_canvas_rect_model_new (parent2, 0, 0, 200, 200, "fill_color", "#204060", NULL); /* Big circle to be reparented */ item = goo_canvas_ellipse_model_new (parent1, 100, 100, 90, 90, "stroke_color", "black", "fill_color", "mediumseagreen", "line-width", 3.0, NULL); g_object_set_data (G_OBJECT (item), "parent1", parent1); g_object_set_data (G_OBJECT (item), "parent2", parent2); #if 0 g_signal_connect (G_OBJECT (item), "event", G_CALLBACK (item_event), NULL); #endif /* A group to be reparented */ group = goo_canvas_group_model_new (parent2, NULL); goo_canvas_item_model_translate (group, 100, 100); goo_canvas_ellipse_model_new (group, 0, 0, 50, 50, "stroke_color", "black", "fill_color", "wheat", "line_width", 3.0, NULL); goo_canvas_ellipse_model_new (group, 0, 0, 25, 25, "fill_color", "steelblue", NULL); g_object_set_data (G_OBJECT (group), "parent1", parent1); g_object_set_data (G_OBJECT (group), "parent2", parent2); #if 0 g_signal_connect (G_OBJECT (group), "event", G_CALLBACK (item_event), NULL); #endif goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); /* Done */ return vbox; } goocanvas-1.0.0/demo/demo-events.c0000644000076400007640000001235211412723611013740 00000000000000#include #include #include #include static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { char *item_id = NULL; if (target) item_id = g_object_get_data (G_OBJECT (target), "id"); if (item_id) g_print ("%s item received 'motion-notify' signal\n", item_id); return FALSE; } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); } static void create_events_area (GtkWidget *canvas, gint area_num, GooCanvasPointerEvents pointer_events, gchar *label) { gint row = area_num / 3, col = area_num % 3; gdouble x = col * 200, y = row * 150; GooCanvasItem *root, *rect; char *view_id; GooCanvasLineDash *dash; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); dash = goo_canvas_line_dash_new (2, 5.0, 5.0); /* Create invisible item. */ rect = goo_canvas_rect_new (root, x + 45, y + 35, 30, 30, "fill-color", "red", "visibility", GOO_CANVAS_ITEM_INVISIBLE, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s invisible", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_new (root, x + 42.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create unpainted item. */ rect = goo_canvas_rect_new (root, x + 85, y + 35, 30, 30, "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s unpainted", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_new (root, x + 82.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create stroked item. */ rect = goo_canvas_rect_new (root, x + 125, y + 35, 30, 30, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Create filled item. */ rect = goo_canvas_rect_new (root, x + 60, y + 75, 30, 30, "fill-color", "red", "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Create stroked & filled item. */ rect = goo_canvas_rect_new (root, x + 100, y + 75, 30, 30, "fill-color", "red", "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked & filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); goo_canvas_text_new (root, label, x + 100, y + 130, -1, GTK_ANCHOR_CENTER, "font", "Sans 12", "fill-color", "blue", NULL); goo_canvas_line_dash_unref (dash); } GtkWidget * create_events_page (void) { GtkWidget *vbox, *alignment, *frame, *label, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ label = gtk_label_new ("Move the mouse over the items to check they receive the right motion events.\nThe first 2 items in each group are 1) invisible and 2) visible but unpainted."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 600, 450); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); create_events_area (canvas, 0, GOO_CANVAS_EVENTS_NONE, "none"); create_events_area (canvas, 1, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, "visible-painted"); create_events_area (canvas, 2, GOO_CANVAS_EVENTS_VISIBLE_FILL, "visible-fill"); create_events_area (canvas, 3, GOO_CANVAS_EVENTS_VISIBLE_STROKE, "visible-stroke"); create_events_area (canvas, 4, GOO_CANVAS_EVENTS_VISIBLE, "visible"); create_events_area (canvas, 5, GOO_CANVAS_EVENTS_PAINTED, "painted"); create_events_area (canvas, 6, GOO_CANVAS_EVENTS_FILL, "fill"); create_events_area (canvas, 7, GOO_CANVAS_EVENTS_STROKE, "stroke"); create_events_area (canvas, 8, GOO_CANVAS_EVENTS_ALL, "all"); return vbox; } goocanvas-1.0.0/demo/demo.c0000644000076400007640000012205511512447174012450 00000000000000/* * GooCanvas Demo. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * main.c - demo app. */ #include #include #include #include #include #include #include #if CAIRO_HAS_PDF_SURFACE #include #endif #include #include "demo-item.h" static GooCanvasItem *ellipse2, *textitem; static gboolean dragging = FALSE; static double drag_x, drag_y; static void setup_canvas (GooCanvas *canvas); GtkWidget *create_canvas_fifteen (void); GtkWidget *create_canvas_features (void); GtkWidget *create_canvas_arrowhead (void); GtkWidget *create_canvas_scalability (void); GtkWidget *create_grabs_page (void); GtkWidget *create_events_page (void); GtkWidget *create_paths_page (void); GtkWidget *create_focus_page (void); GtkWidget *create_animation_page (void); GtkWidget *create_clipping_page (void); GtkWidget *create_table_page (void); GtkWidget *create_large_items_page (void); #if CAIRO_HAS_PDF_SURFACE static void write_pdf_clicked (GtkWidget *button, GooCanvas *canvas) { cairo_surface_t *surface; GooCanvasBounds bounds; cairo_t *cr; g_print ("In write_pdf_clicked\n"); surface = cairo_pdf_surface_create ("demo.pdf", 9 * 72, 10 * 72); cr = cairo_create (surface); /* Place it in the middle of our 9x10 page. */ cairo_translate (cr, 20, 130); bounds.x1 = 100; bounds.y1 = 100; bounds.x2 = 300; bounds.y2 = 300; #if 1 goo_canvas_render (canvas, cr, NULL, 1.0); #else goo_canvas_render (canvas, cr, &bounds, 1.0); #endif cairo_show_page (cr); cairo_surface_destroy (surface); cairo_destroy (cr); } #endif static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } static void zoom_x_changed (GtkAdjustment *adj, GooCanvas *canvas) { g_object_set (G_OBJECT (canvas), "scale-x", adj->value, NULL); } static void zoom_y_changed (GtkAdjustment *adj, GooCanvas *canvas) { g_object_set (G_OBJECT (canvas), "scale-y", adj->value, NULL); } static void center_toggled (GtkToggleButton *button, gpointer data) { /*foo_canvas_set_center_scroll_region (data, gtk_toggle_button_get_active (button));*/ } static void anchor_toggled (GtkWidget *button, GooCanvas *canvas) { GtkAnchorType anchor; anchor = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "anchor")); if (GTK_TOGGLE_BUTTON (button)->active) g_object_set (canvas, "anchor", anchor, NULL); } static void scroll_to_50_50_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 50, 50); } static void scroll_to_500_500_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 500, 500); } static void scroll_to_250_250_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 250, 250); } static void animate_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { #if 1 goo_canvas_item_animate (ellipse2, 100, 100, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif #if 0 goo_canvas_item_animate (textitem, -300, -200, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif } static void stop_animation_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_item_stop_animation (ellipse2); } static void change_bounds_clicked (GtkWidget *button, GooCanvas *canvas) { static gdouble bounds[4][4] = { { -100, -100, 200, 200 }, { 100, 100, 200, 200 }, { 0, 0, 300, 300 }, { 0, 0, 604, 454 } }; static gint bounds_num = 0; gboolean automatic_bounds = TRUE; gboolean bounds_from_origin = FALSE; gdouble bounds_padding = 50.0; if (bounds_num < 4) { automatic_bounds = FALSE; goo_canvas_set_bounds (canvas, bounds[bounds_num][0], bounds[bounds_num][1], bounds[bounds_num][2], bounds[bounds_num][3]); } else if (bounds_num == 4) { bounds_from_origin = TRUE; bounds_padding = 50.0; } g_object_set (G_OBJECT (canvas), "automatic-bounds", automatic_bounds, "bounds-from-origin", bounds_from_origin, "bounds-padding", bounds_padding, NULL); bounds_num = (bounds_num + 1) % 6; } static void move_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { static int last_state = 0; #if 0 g_print ("Moving ellipse\n"); #endif goo_canvas_item_set_transform (ellipse2, NULL); if (last_state == 0) { g_object_set (ellipse2, "center-x", 300.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "red", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A red ellipse", NULL); last_state = 1; } else if (last_state == 1) { g_object_set (ellipse2, "center-x", 390.0, "center-y", 150.0, "radius-x", 45.0, "radius-y", 40.0, "fill-pattern", NULL, "stroke-color", "midnightblue", "line-width", 4.0, "title", "A brown ellipse", NULL); last_state = 2; } else if (last_state == 2) { g_object_set (ellipse2, "center-x", 0.0, "center-y", 0.0, "radius-y", 30.0, NULL); goo_canvas_item_set_simple_transform (ellipse2, 100, 100, 1, 0); last_state = 3; } else if (last_state == 3) { goo_canvas_item_set_simple_transform (ellipse2, 200, 100, 2, 0); last_state = 4; } else if (last_state == 4) { goo_canvas_item_set_simple_transform (ellipse2, 200, 200, 1, 45); last_state = 5; } else if (last_state == 5) { goo_canvas_item_set_simple_transform (ellipse2, 50, 50, 0.2, 225); last_state = 6; } else { g_object_set (ellipse2, "center-x", 335.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "purple", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A purple ellipse", NULL); last_state = 0; } } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { #if 0 g_print ("received 'motion-notify' signal at %g, %g\n", event->x, event->y); #endif if (dragging && (event->state & GDK_BUTTON1_MASK)) { double new_x = event->x; double new_y = event->y; goo_canvas_item_translate (item, new_x - drag_x, new_y - drag_y); } return TRUE; } static void output_items_in_area (GooCanvas *canvas, gdouble x, gdouble y) { static gdouble last_x = 0.0, last_y = 0.0; GooCanvasBounds area; GList *items, *elem; /* Print out the items from the last point to this one. */ area.x1 = MIN (x, last_x); area.x2 = MAX (x, last_x); area.y1 = MIN (y, last_y); area.y2 = MAX (y, last_y); items = goo_canvas_get_items_in_area (canvas, &area, TRUE, FALSE, FALSE); for (elem = items; elem; elem = elem->next) { g_print (" found items in area (%g, %g - %g, %g): %p\n", area.x1, area.y1, area.x2, area.y2, elem->data); } g_list_free (items); last_x = x; last_y = y; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GdkCursor *fleur; GList *items, *elem; g_print ("%p received 'button-press' signal at %g, %g (root: %g, %g)\n", item, event->x, event->y, event->x_root, event->y_root); canvas = goo_canvas_item_get_canvas (item); items = goo_canvas_get_items_at (canvas, event->x_root, event->y_root, TRUE); for (elem = items; elem; elem = elem->next) g_print (" found items: %p\n", elem->data); g_list_free (items); output_items_in_area (canvas, event->x_root, event->y_root); switch (event->button) { case 1: if (event->state & GDK_SHIFT_MASK) { goo_canvas_item_remove (item); } else { drag_x = event->x; drag_y = event->y; fleur = gdk_cursor_new (GDK_FLEUR); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); dragging = TRUE; } break; case 2: goo_canvas_item_lower (item, NULL); break; case 3: goo_canvas_item_raise (item, NULL); break; default: break; } return TRUE; } static gboolean on_scroll (GooCanvasItem *item, GooCanvasItem *target, GdkEventScroll *event, gpointer data) { #if 0 g_print ("received 'scroll-event' signal\n"); #endif if (event->direction == GDK_SCROLL_UP) goo_canvas_item_scale (item, 1.1, 1.1); else if (event->direction == GDK_SCROLL_DOWN) goo_canvas_item_scale (item, 0.909, 0.909); else return FALSE; return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; #if 0 g_print ("received 'button-release' signal\n"); #endif canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); dragging = FALSE; return TRUE; } static gboolean on_background_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GList *items, *elem; #if 1 g_print ("background received 'button-press' signal\n"); #endif canvas = goo_canvas_item_get_canvas (item); output_items_in_area (canvas, event->x_root, event->y_root); items = goo_canvas_get_items_at (canvas, event->x_root, event->y_root, FALSE); for (elem = items; elem; elem = elem->next) g_print (" clicked items: %p\n", elem->data); g_list_free (items); return TRUE; } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } GtkWidget * create_canvas_primitives () { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *w; GtkWidget *scrolled_win, *canvas; GtkAdjustment *adj; GSList *group = NULL; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("Drag an item with button 1. Click button 2 on an item to lower it, or button 3 to raise it."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Create the canvas */ canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "automatic-bounds", TRUE, "bounds-from-origin", FALSE, "bounds-padding", 4.0, "background-color-rgb", 0xC3C3FF, "has-tooltip", TRUE, #if 0 "redraw-when-scrolled", TRUE, #endif NULL); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 604, 454); /* Scale */ w = gtk_label_new ("Scale:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.0)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_label_new ("Scale X:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.0)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_x_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_label_new ("Scale Y:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.0)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_y_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Center: */ w = gtk_check_button_new_with_label("Center scroll region"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); /*gtk_widget_show (w);*/ g_signal_connect (w, "toggled", G_CALLBACK (center_toggled), canvas); /* Move Ellipse */ w = gtk_button_new_with_label("Move Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_ellipse_clicked), canvas); /* Animate Ellipse */ w = gtk_button_new_with_label("Animate Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (animate_ellipse_clicked), canvas); /* Stop Animation */ w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), canvas); #if CAIRO_HAS_PDF_SURFACE /* Create PDF */ w = gtk_button_new_with_label("Write PDF"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (write_pdf_clicked), canvas); #endif w = gtk_button_new_with_label("Change Bounds"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_bounds_clicked), canvas); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Scroll to */ w = gtk_label_new ("Scroll To:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_button_new_with_label("50,50"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_50_50_clicked), canvas); w = gtk_button_new_with_label("250,250"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_250_250_clicked), canvas); w = gtk_button_new_with_label("500,500"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_500_500_clicked), canvas); /* Scroll anchor */ w = gtk_label_new ("Anchor:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_radio_button_new_with_label (group, "NW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NW)); w = gtk_radio_button_new_with_label (group, "N"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_N)); w = gtk_radio_button_new_with_label (group, "NE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NE)); w = gtk_radio_button_new_with_label (group, "W"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_W)); w = gtk_radio_button_new_with_label (group, "C"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_CENTER)); w = gtk_radio_button_new_with_label (group, "E"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_E)); w = gtk_radio_button_new_with_label (group, "SW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SW)); w = gtk_radio_button_new_with_label (group, "S"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_S)); w = gtk_radio_button_new_with_label (group, "SE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SE)); /* Layout the stuff */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); /* Add all the canvas items. */ setup_canvas (GOO_CANVAS (canvas)); #if 0 g_signal_connect_after (canvas, "key_press_event", G_CALLBACK (key_press), NULL); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_grab_focus (canvas); #endif return vbox; } static void setup_heading (GooCanvasItem *root, char *text, int pos) { double x = (pos % 3) * 200 + 100; double y = (pos / 3) * 150 + 5; GooCanvasItem *item; PangoRectangle ink_rect, logical_rect; item = goo_canvas_text_new (root, text, x, y, -1, GTK_ANCHOR_N, "font", "Sans 12", NULL); goo_canvas_item_skew_y (item, 30, x, y); /*goo_canvas_item_rotate (item, 30, x, y);*/ goo_canvas_text_get_natural_extents (GOO_CANVAS_TEXT (item), &ink_rect, &logical_rect); g_print ("Ink Extents: %i,%i %ix%i Logical: %i,%i %ix%i\n", ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height, logical_rect.x, logical_rect.y, logical_rect.width, logical_rect.height); } static void setup_divisions (GooCanvasItem *root) { GooCanvasItem *group, *item; group = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (group, 2, 2); item = goo_canvas_rect_new (group, 0, 0, 600, 450, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 0, 150, 600, 150, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 0, 300, 600, 300, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 200, 0, 200, 450, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 400, 0, 400, 450, "line-width", 4.0, NULL); #if 1 setup_heading (group, "Rectangles", 0); setup_heading (group, "Ellipses", 1); setup_heading (group, "Texts", 2); setup_heading (group, "Images", 3); setup_heading (group, "Lines", 4); /*setup_heading (group, "No Curves", 5);*/ /*setup_heading (group, "Arcs", 6);*/ setup_heading (group, "Polygons", 7); /*setup_heading (group, "Widgets", 8);*/ #endif } /* FIXME: I think we may need to check byte order. */ static cairo_pattern_t* create_stipple (const char *color_name, guchar stipple_data[16]) { cairo_surface_t *surface; cairo_pattern_t *pattern; GdkColor color; gdk_color_parse (color_name, &color); stipple_data[2] = stipple_data[14] = color.red >> 8; stipple_data[1] = stipple_data[13] = color.green >> 8; stipple_data[0] = stipple_data[12] = color.blue >> 8; surface = cairo_image_surface_create_for_data (stipple_data, CAIRO_FORMAT_ARGB32, 2, 2, 8); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); return pattern; } static void setup_rectangles (GooCanvasItem *root) { GooCanvasItem *item; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; item = goo_canvas_rect_new (root, 20, 30, 50, 30, "stroke-color", "red", "line-width", 8.0, "tooltip", "Red stroked rectangle", NULL); setup_item_signals (item); pattern = create_stipple ("mediumseagreen", stipple_data); item = goo_canvas_rect_new (root, 90, 40, 90, 60, "fill-pattern", pattern, "stroke-color", "black", "line-width", 4.0, "tooltip", "Medium Sea Green stippled rectangle", NULL); cairo_pattern_destroy (pattern); setup_item_signals (item); item = goo_canvas_rect_new (root, 10, 80, 70, 60, "fill-color", "steelblue", /*"fill-pattern", NULL,*/ "tooltip", "Steel Blue rectangle", NULL); setup_item_signals (item); item = goo_canvas_rect_new (root, 20, 90, 70, 60, "fill-color-rgba", 0x3cb37180, "stroke-color", "blue", "line-width", 2.0, "tooltip", "Partially transparent rectangle", NULL); setup_item_signals (item); item = goo_canvas_rect_new (root, 110, 80, 50, 30, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color-rgba", 0x3cb3f180, "tooltip", "Rectangle with rounded corners", NULL); setup_item_signals (item); item = goo_demo_item_new (root, 30, 20, 50, 30, "fill-color", "yellow", "tooltip", "Yellow demo item", NULL); setup_item_signals (item); } static void setup_ellipses (GooCanvasItem *root) { GooCanvasItem *ellipse1, *ellipse3; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; #if 1 ellipse1 = goo_canvas_ellipse_new (root, 245, 45, 25, 15, "stroke-color", "goldenrod", "line-width", 8.0, NULL); setup_item_signals (ellipse1); #endif ellipse2 = goo_canvas_ellipse_new (root, 335, 70, 45, 30, "fill-color", "wheat", "stroke-color", "midnightblue", "line-width", 4.0, "title", "An ellipse", NULL); #if 0 goo_canvas_item_rotate (ellipse2, 30, 0, 0); #endif setup_item_signals (ellipse2); #if 1 pattern = create_stipple ("cadetblue", stipple_data); ellipse3 = goo_canvas_ellipse_new (root, 245, 110, 35, 30, "fill-pattern", pattern, "stroke-color", "black", "line-width", 1.0, NULL); cairo_pattern_destroy (pattern); setup_item_signals (ellipse3); #endif } #define VERTICES 10 #define RADIUS 60.0 static void polish_diamond (GooCanvasItem *root) { GooCanvasItem *group, *item; int i, j; double a, x1, y1, x2, y2; group = goo_canvas_group_new (root, "line-width", 1.0, "line-cap", CAIRO_LINE_CAP_ROUND, NULL); goo_canvas_item_translate (group, 270, 230); setup_item_signals (group); for (i = 0; i < VERTICES; i++) { a = 2.0 * M_PI * i / VERTICES; x1 = RADIUS * cos (a); y1 = RADIUS * sin (a); for (j = i + 1; j < VERTICES; j++) { a = 2.0 * M_PI * j / VERTICES; x2 = RADIUS * cos (a); y2 = RADIUS * sin (a); item = goo_canvas_polyline_new_line (group, x1, y1, x2, y2, NULL); } } } #define SCALE 7.0 static void make_hilbert (GooCanvasItem *root) { char hilbert[] = "urdrrulurulldluuruluurdrurddldrrruluurdrurddldrddlulldrdldrrurd"; char *c; double *pp, *p; GooCanvasItem *item; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (strlen (hilbert) + 1); points->coords[0] = 340.0; points->coords[1] = 290.0; pp = points->coords; for (c = hilbert, p = points->coords + 2; *c; c++, p += 2, pp += 2) switch (*c) { case 'u': p[0] = pp[0]; p[1] = pp[1] - SCALE; break; case 'd': p[0] = pp[0]; p[1] = pp[1] + SCALE; break; case 'l': p[0] = pp[0] - SCALE; p[1] = pp[1]; break; case 'r': p[0] = pp[0] + SCALE; p[1] = pp[1]; break; } pattern = create_stipple ("red", stipple_data); item = goo_canvas_polyline_new (root, FALSE, 0, "points", points, "line-width", 4.0, "stroke-pattern", pattern, "line-cap", CAIRO_LINE_CAP_SQUARE, "line-join", CAIRO_LINE_JOIN_MITER, NULL); cairo_pattern_destroy (pattern); setup_item_signals (item); goo_canvas_points_unref (points); } static void setup_lines (GooCanvasItem *root) { GooCanvasItem *polyline1, *polyline2, *polyline3, *polyline4, *polyline5; polish_diamond (root); make_hilbert (root); /* Arrow tests */ polyline1 = goo_canvas_polyline_new (root, FALSE, 4, 340.0, 170.0, 340.0, 230.0, 390.0, 230.0, 390.0, 170.0, "stroke-color", "midnightblue", "line-width", 3.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); setup_item_signals (polyline1); polyline2 = goo_canvas_polyline_new (root, FALSE, 2, 356.0, 180.0, 374.0, 220.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); setup_item_signals (polyline2); polyline3 = goo_canvas_polyline_new (root, FALSE, 2, 356.0, 220.0, 374.0, 180.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); setup_item_signals (polyline3); /* Test polyline without any coords. */ polyline4 = goo_canvas_polyline_new (root, FALSE, 0, NULL); setup_item_signals (polyline4); /* Test polyline with 1 coord and arrows. */ polyline5 = goo_canvas_polyline_new (root, FALSE, 1, 356.0, 220.0, "start-arrow", TRUE, "end-arrow", TRUE, NULL); setup_item_signals (polyline5); } static void setup_polygons (GooCanvasItem *root) { GooCanvasItem *polyline1, *polyline2; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (3); points->coords[0] = 210.0; points->coords[1] = 320.0; points->coords[2] = 210.0; points->coords[3] = 380.0; points->coords[4] = 260.0; points->coords[5] = 350.0; pattern = create_stipple ("blue", stipple_data); polyline1 = goo_canvas_polyline_new (root, TRUE, 0, "line-width", 1.0, "points", points, "fill_pattern", pattern, "stroke_color", "black", NULL); cairo_pattern_destroy (pattern); goo_canvas_points_unref (points); setup_item_signals (polyline1); points = goo_canvas_points_new (14); points->coords[0] = 270.0; points->coords[1] = 330.0; points->coords[2] = 270.0; points->coords[3] = 430.0; points->coords[4] = 390.0; points->coords[5] = 430.0; points->coords[6] = 390.0; points->coords[7] = 330.0; points->coords[8] = 310.0; points->coords[9] = 330.0; points->coords[10] = 310.0; points->coords[11] = 390.0; points->coords[12] = 350.0; points->coords[13] = 390.0; points->coords[14] = 350.0; points->coords[15] = 370.0; points->coords[16] = 330.0; points->coords[17] = 370.0; points->coords[18] = 330.0; points->coords[19] = 350.0; points->coords[20] = 370.0; points->coords[21] = 350.0; points->coords[22] = 370.0; points->coords[23] = 410.0; points->coords[24] = 290.0; points->coords[25] = 410.0; points->coords[26] = 290.0; points->coords[27] = 330.0; polyline2 = goo_canvas_polyline_new (root, TRUE, 0, "points", points, "fill_color", "tan", "stroke_color", "black", "line-width", 3.0, NULL); goo_canvas_points_unref (points); setup_item_signals (polyline2); } static GooCanvasItem * make_anchor (GooCanvasItem *root, double x, double y) { GooCanvasItem *group, *item; cairo_matrix_t transform = { 0.8, 0.2, -0.3, 0.5, x, y }; group = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (group, x, y); #if 1 g_object_set (group, "transform", &transform, NULL); #endif item = goo_canvas_rect_new (group, -2.5, -2.5, 4, 4, "line-width", 1.0, NULL); setup_item_signals (item); g_signal_connect (group, "scroll_event", G_CALLBACK (on_scroll), NULL); return group; } static void setup_texts (GooCanvasItem *root) { GooCanvasItem *item; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; #if 1 pattern = create_stipple ("blue", stipple_data); item = goo_canvas_text_new (make_anchor (root, 420, 20), "Anchor NW", 0, 0, -1, GTK_ANCHOR_NW, "font", "Sans Bold 24", "fill_pattern", pattern, NULL); cairo_pattern_destroy (pattern); setup_item_signals (item); item = goo_canvas_text_new (make_anchor (root, 470, 75), "Anchor center\nJustify center\nMultiline text\nb8bit text ÅÄÖåäö", 0, 0, -1, GTK_ANCHOR_CENTER, "font", "monospace bold 14", "alignment", PANGO_ALIGN_CENTER, "fill_color", "firebrick", NULL); setup_item_signals (item); #endif #if 0 item = goo_canvas_text_new (make_anchor (root, 590, 140), "Clipped text\nClipped text\nClipped text\nClipped text\nClipped text\nClipped text", 0, 0, -1, GTK_ANCHOR_SE, "font", "Sans 12", /*"clip", TRUE,*/ /*"clip_width", 50.0,*/ /*"clip_height", 55.0,*/ /*"x_offset", 10.0,*/ "fill_color", "darkgreen", NULL); setup_item_signals (item); #endif #if 1 textitem = goo_canvas_text_new (make_anchor (root, 420, 240), "This is a very long paragraph that will need to be wrapped over several lines so we can see what happens to line-breaking as the view is zoomed in and out.", 0, 0, 180, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "goldenrod", NULL); setup_item_signals (textitem); #endif #if 1 textitem = goo_canvas_text_new (root, "Ellipsized text.", 20, 420, 115, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "blue", "ellipsize", PANGO_ELLIPSIZE_END, NULL); setup_item_signals (textitem); #endif } static void setup_invisible_texts (GooCanvasItem *root) { goo_canvas_text_new (root, "Visible above 0.8x", 500, 330, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_rect_new (root, 410.5, 322.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_text_new (root, "Visible above 1.5x", 500, 350, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_rect_new (root, 410.5, 342.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_text_new (root, "Visible above 3.0x", 500, 370, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); goo_canvas_rect_new (root, 410.5, 362.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); /* This should never be seen. */ goo_canvas_text_new (root, "Always Invisible", 500, 390, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); goo_canvas_rect_new (root, 410.5, 350.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); } static void plant_flower (GooCanvasItem *root, double x, double y, GtkAnchorType anchor, gdouble opacity) { cairo_pattern_t *pattern; cairo_surface_t *surface; GooCanvasItem *image; double w, h; surface = cairo_image_surface_create_from_png ("flower.png"); w = cairo_image_surface_get_width (surface); h = cairo_image_surface_get_height (surface); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); image = goo_canvas_image_new (root, NULL, x, y, "pattern", pattern, "width", w * 1.5, "height", h * 2, "scale-to-fit", TRUE, "alpha", opacity, NULL); cairo_pattern_destroy (pattern); setup_item_signals (image); } static void setup_images (GooCanvasItem *root) { GdkPixbuf *im; GooCanvasItem *image; im = gdk_pixbuf_new_from_file ("toroid.png", NULL); if (im) { double w = gdk_pixbuf_get_width (im); double h = gdk_pixbuf_get_height (im); image = goo_canvas_image_new (root, im, 100.0 - w / 2, 225.0 - h / 2, "width", w, "height", h, /* "anchor", GTK_ANCHOR_CENTER, */ NULL); g_object_unref(im); setup_item_signals (image); } else g_warning ("Could not find the toroid.png sample file"); plant_flower (root, 20.0, 170.0, GTK_ANCHOR_NW, 0.3); plant_flower (root, 180.0, 170.0, GTK_ANCHOR_NE, 0.5); plant_flower (root, 20.0, 280.0, GTK_ANCHOR_SW, 0.7); plant_flower (root, 180.0, 280.0, GTK_ANCHOR_SE, 1.0); } static void setup_static_items (GooCanvas *canvas) { GooCanvasItem *static_root, *group, *item; static_root = goo_canvas_get_static_root_item (canvas); /* All static items in one place in the canvas should be placed in the same group. */ group = goo_canvas_group_new (static_root, NULL); item = goo_canvas_polyline_new_line (group, 40.0, 410.0, 40.0, 330.0, "stroke-color", "midnightblue", "line-width", 3.0, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); setup_item_signals (item); item = goo_canvas_polyline_new_line (group, 32.0, 370.0, 48.0, 370.0, "stroke-color", "midnightblue", "line-width", 3.0, NULL); setup_item_signals (item); item = goo_canvas_text_new (group, "N", 40, 320, -1, GTK_ANCHOR_S, "font", "Sans 12", NULL); setup_item_signals (item); } /* This checks that the rgba color properties work properly, i.e. the value written to them is the same when read back out. */ static void test_color_properties (GooCanvasItem *root) { #if 0 GooCanvasItem *item; guint red, green, blue, alpha, rgba_in, rgba_out; item = goo_canvas_rect_new (root, 20, 30, 50, 30, NULL); for (red = 0; red < 256; red += 15) { for (green = 0; green < 256; green += 15) { for (blue = 0; blue < 256; blue ++) { for (alpha = 0; alpha < 256; alpha += 15) { rgba_in = (red << 24) + (green << 16) + (blue << 8) + alpha; g_object_set (item, "fill_color_rgba", rgba_in, NULL); rgba_out = 0; g_object_get (item, "fill_color_rgba", &rgba_out, NULL); if (rgba_in != rgba_out) g_print ("ERROR: rgba in: %.8X out: %.8X\n", rgba_in, rgba_out); } } } } #endif } static void test_simple_transforms (GooCanvasItem *root) { #if 0 GooCanvasItem *item; int rotation, x, y; double scale, x_out, y_out, scale_out, rotation_out, max_error = 0.0000001; item = goo_canvas_rect_new (root, 20, 30, 50, 30, NULL); for (rotation = 0; rotation < 360; rotation += 20) { scale = 0.1; while (scale < 10) { g_print ("Rotation: %i Scale: %g\n", rotation, scale); for (x = -100; x < 100; x += 10) { for (y = -100; y < 100; y += 10) { goo_canvas_item_set_simple_transform (item, x, y, scale, rotation); goo_canvas_item_get_simple_transform (item, &x_out, &y_out, &scale_out, &rotation_out); if (fabs (x_out - x) > max_error || fabs (y_out - y) > max_error || fabs (scale_out - scale) > max_error || fabs (rotation_out - rotation) > max_error) { g_print ("IN X:%i Y:%i Scale:%g Rotation:%i -> %g, %g, %g, %g\n", x, y, scale, rotation, x_out, y_out, scale_out, rotation_out); } } } scale += 0.1; } } #endif } static void setup_grids (GooCanvasItem *root) { GooCanvasItem *item; item = goo_canvas_grid_new (root, 80, 310, 90, 90, 10, 10, 5, 5, "stroke-color", "yellow", "fill-color", "pink", "border-width", 2.0, "border-color", "red", "vert-grid-line-color", "lightblue", "horz-grid-line-width", 1.0, "vert-grid-line-width", 1.0, "vert-grid-lines-on-top", TRUE, NULL); } static void setup_canvas (GooCanvas *canvas) { GooCanvasItem *root; root = goo_canvas_get_root_item (canvas); g_signal_connect (root, "button_press_event", G_CALLBACK (on_background_button_press), NULL); /* Setup canvas items */ #if 1 setup_divisions (root); setup_rectangles (root); setup_ellipses (root); setup_lines (root); setup_polygons (root); setup_texts (root); setup_images (root); setup_invisible_texts (root); setup_static_items (canvas); setup_grids (root); #endif test_color_properties (root); test_simple_transforms (root); } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } static GtkWidget* create_window () { GtkWidget *window, *notebook; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); notebook = gtk_notebook_new (); gtk_widget_show (notebook); gtk_container_add (GTK_CONTAINER (window), notebook); #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_primitives (), gtk_label_new ("Primitives")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_arrowhead (), gtk_label_new ("Arrowhead")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_fifteen (), gtk_label_new ("Fifteen")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_features (), gtk_label_new ("Reparent")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_scalability (), gtk_label_new ("Scalability")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_grabs_page (), gtk_label_new ("Grabs")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_events_page (), gtk_label_new ("Events")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_paths_page (), gtk_label_new ("Paths")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_focus_page (), gtk_label_new ("Focus")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_animation_page (), gtk_label_new ("Animation")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_clipping_page (), gtk_label_new ("Clipping")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_table_page (), gtk_label_new ("Table")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_large_items_page (), gtk_label_new ("Large Items")); #endif return window; } int main (int argc, char *argv[]) { GtkWidget *window; gtk_set_locale (); gtk_init (&argc, &argv); window = create_window (); gtk_main (); return 0; } goocanvas-1.0.0/demo/demo-large-line.c0000644000076400007640000001570611412723611014461 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-line.c - a demo item that exceeds the cairo 16-bit size limit. * Note that it doesn't support miters. */ #include #include "goocanvas.h" #include "demo-large-line.h" /* Use the GLib convenience macro to define the type. GooDemoLargeLine is the class struct, goo_demo_large_line is the function prefix, and our class is a subclass of GOO_TYPE_CANVAS_ITEM_SIMPLE. */ G_DEFINE_TYPE (GooDemoLargeLine, goo_demo_large_line, GOO_TYPE_CANVAS_ITEM_SIMPLE) /* The standard object initialization function. */ static void goo_demo_large_line_init (GooDemoLargeLine *demo_large_line) { demo_large_line->x1 = 0.0; demo_large_line->y1 = 0.0; demo_large_line->x2 = 0.0; demo_large_line->y2 = 0.0; } /* The convenience function to create new items. This should start with a parent argument and end with a variable list of object properties to fit in with the standard canvas items. */ GooCanvasItem* goo_demo_large_line_new (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...) { GooCanvasItem *item; GooDemoLargeLine *demo_large_line; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_DEMO_LARGE_LINE, NULL); demo_large_line = (GooDemoLargeLine*) item; demo_large_line->x1 = x1; demo_large_line->y1 = y1; demo_large_line->x2 = x2; demo_large_line->y2 = y2; va_start (var_args, y2); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* The update method. This is called when the canvas is initially shown and also whenever the object is updated and needs to change its size and/or shape. It should calculate its new bounds in its own coordinate space, storing them in simple->bounds. */ static void goo_demo_large_line_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoLargeLine *item = (GooDemoLargeLine*) simple; gdouble half_line_width; half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; /* Compute the new bounds. */ simple->bounds.x1 = MIN (item->x1, item->x2) - half_line_width; simple->bounds.y1 = MIN (item->y1, item->y2) - half_line_width; simple->bounds.x2 = MAX (item->x1, item->x2) + half_line_width; simple->bounds.y2 = MAX (item->y1, item->y2) + half_line_width; } static void clamp_x (gdouble point1[2], gdouble point2[2], gdouble clamp) { gdouble fraction = (clamp - point1[0]) / (point2[0] - point1[0]); point1[0] = clamp; point1[1] += fraction * (point2[1] - point1[1]); } static void clamp_y (gdouble point1[2], gdouble point2[2], gdouble clamp) { gdouble fraction = (clamp - point1[1]) / (point2[1] - point1[1]); point1[1] = clamp; point1[0] += fraction * (point2[0] - point1[0]); } static void paint_large_line (GooDemoLargeLine *line, cairo_t *cr, const GooCanvasBounds *bounds, gdouble line_width, gdouble x1, gdouble y1, gdouble x2, gdouble y2) { GooCanvasItem *item = (GooCanvasItem*) line; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) line; GooCanvas *canvas = simple->canvas; GooCanvasBounds tmp_bounds = *bounds; gdouble point1[2], point2[2], *p1, *p2; point1[0] = x1; point1[1] = y1; point2[0] = x2; point2[1] = y2; /* Transform the coordinates to the canvas device space, so we can clamp the line to the bounds to be painted. */ goo_canvas_convert_from_item_space (canvas, item, &point1[0], &point1[1]); goo_canvas_convert_from_item_space (canvas, item, &point2[0], &point2[1]); /* Extend the bounds a bit to account for the line width. */ tmp_bounds.x1 -= line_width; tmp_bounds.y1 -= line_width; tmp_bounds.x2 += line_width; tmp_bounds.y2 += line_width; /* Make p1 the left-most point. */ if (point1[0] < point2[0]) { p1 = point1; p2 = point2; } else { p1 = point2; p2 = point1; } /* Just return if the line is completely outside the bounds horizontally. */ if (p2[0] < tmp_bounds.x1 || p1[0] > tmp_bounds.x2) return; /* Clamp each x coordinate to the bounds. */ if (p1[0] < tmp_bounds.x1) clamp_x (p1, p2, tmp_bounds.x1); if (p2[0] > tmp_bounds.x2) clamp_x (p2, p1, tmp_bounds.x2); /* Now make p1 the top-most point. */ if (point1[1] < point2[1]) { p1 = point1; p2 = point2; } else { p1 = point2; p2 = point1; } /* Just return if the line is completely outside the bounds vertically. */ if (p2[1] < tmp_bounds.y1 || p1[1] > tmp_bounds.y2) return; /* Clamp each y coordinate to the bounds. */ if (p1[1] < tmp_bounds.y1) clamp_y (p1, p2, tmp_bounds.y1); if (p2[1] > tmp_bounds.y2) clamp_y (p2, p1, tmp_bounds.y2); /* Convert back to item space. */ goo_canvas_convert_to_item_space (canvas, item, &point1[0], &point1[1]); goo_canvas_convert_to_item_space (canvas, item, &point2[0], &point2[1]); /* Draw the line. */ cairo_move_to (cr, point1[0], point1[1]); cairo_line_to (cr, point2[0], point2[1]); cairo_stroke (cr); } /* The paint method. This should draw the item on the given cairo_t, using the item's own coordinate space. */ static void goo_demo_large_line_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoLargeLine *item = (GooDemoLargeLine*) simple; gdouble line_width; goo_canvas_style_set_stroke_options (simple->simple_data->style, cr); line_width = goo_canvas_item_simple_get_line_width (simple); paint_large_line (item, cr, bounds, line_width, item->x1, item->y1, item->x2, item->y2); } /* Hit detection. This should check if the given coordinate (in the item's coordinate space) is within the item. If it is it should return TRUE, otherwise it should return FALSE. */ static gboolean goo_demo_large_line_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { /*GooDemoLargeLine *item = (GooDemoLargeLine*) simple;*/ /* FIXME: Implement this. */ return FALSE; } /* The class initialization function. Here we set the class' update(), paint() and is_item_at() methods. */ static void goo_demo_large_line_class_init (GooDemoLargeLineClass *klass) { GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; simple_class->simple_update = goo_demo_large_line_update; simple_class->simple_paint = goo_demo_large_line_paint; simple_class->simple_is_item_at = goo_demo_large_line_is_item_at; } goocanvas-1.0.0/demo/demo-clipping.c0000644000076400007640000001163511412723611014244 00000000000000#include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gchar *id) { g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id, event->x, event->y, event->x_root, event->y_root); return TRUE; } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root, *item, *table; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Plain items without clip path. */ item = goo_canvas_ellipse_new (root, 0, 0, 50, 30, "fill-color", "blue", NULL); goo_canvas_item_translate (item, 100, 100); goo_canvas_item_rotate (item, 30, 0, 0); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse (unclipped)"); item = goo_canvas_rect_new (root, 200, 50, 100, 100, "fill-color", "red", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle (unclipped)"); item = goo_canvas_rect_new (root, 380, 50, 100, 100, "fill-color", "yellow", NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle (unclipped)"); item = goo_canvas_text_new (root, "Sample Text", 520, 100, -1, GTK_ANCHOR_NW, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); /* Clipped items. */ item = goo_canvas_ellipse_new (root, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_translate (item, 100, 300); goo_canvas_item_rotate (item, 30, 0, 0); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); item = goo_canvas_rect_new (root, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); item = goo_canvas_rect_new (root, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); item = goo_canvas_text_new (root, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text"); /* Table with clipped items. */ table = goo_canvas_table_new (root, NULL); goo_canvas_item_translate (table, 200, 400); goo_canvas_item_rotate (table, 30, 0, 0); item = goo_canvas_ellipse_new (table, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_translate (item, 100, 300); goo_canvas_item_rotate (item, 30, 0, 0); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); item = goo_canvas_rect_new (table, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); goo_canvas_item_set_child_properties (table, item, "column", 1, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); item = goo_canvas_rect_new (table, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); goo_canvas_item_set_child_properties (table, item, "column", 2, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); item = goo_canvas_text_new (table, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); goo_canvas_item_set_child_properties (table, item, "column", 3, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text"); } GtkWidget * create_clipping_page (void) { GtkWidget *vbox, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); return vbox; } goocanvas-1.0.0/demo/mv-simple-demo.c0000644000076400007640000000536211412723611014350 00000000000000#include #include static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItemModel *root, *rect_model, *text_model; GooCanvasItem *rect_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_group_model_new (NULL, NULL); /* Add a few simple items. */ rect_model = goo_canvas_rect_model_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_model = goo_canvas_text_model_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_model_rotate (text_model, 45, 300, 300); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); /* Connect a signal handler for the rectangle item. */ rect_item = goo_canvas_get_item (GOO_CANVAS (canvas), rect_model); g_signal_connect (rect_item, "button_press_event", G_CALLBACK (on_rect_button_press), NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-1.0.0/demo/mv-demo-events.c0000644000076400007640000001273311412723611014363 00000000000000#include #include #include #include static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItemModel *model = NULL; char *item_id = NULL; if (target) model = goo_canvas_item_get_model (target); if (model) item_id = g_object_get_data (G_OBJECT (model), "id"); if (item_id) g_print ("%s item received 'motion-notify' signal\n", item_id); return FALSE; } static void on_item_created (GooCanvas *view, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); } static void create_events_area (GooCanvasItemModel *root, gint area_num, GooCanvasPointerEvents pointer_events, gchar *label) { gint row = area_num / 3, col = area_num % 3; gdouble x = col * 200, y = row * 150; GooCanvasItemModel *rect; char *view_id; GooCanvasLineDash *dash; dash = goo_canvas_line_dash_new (2, 5.0, 5.0); /* Create invisible item. */ rect = goo_canvas_rect_model_new (root, x + 45, y + 35, 30, 30, "fill-color", "red", "visibility", GOO_CANVAS_ITEM_INVISIBLE, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s invisible", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_model_new (root, x + 42.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create unpainted item. */ rect = goo_canvas_rect_model_new (root, x + 85, y + 35, 30, 30, "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s unpainted", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_model_new (root, x + 82.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create stroked item. */ rect = goo_canvas_rect_model_new (root, x + 125, y + 35, 30, 30, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Create filled item. */ rect = goo_canvas_rect_model_new (root, x + 60, y + 75, 30, 30, "fill-color", "red", "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Create stroked & filled item. */ rect = goo_canvas_rect_model_new (root, x + 100, y + 75, 30, 30, "fill-color", "red", "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked & filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); goo_canvas_text_model_new (root, label, x + 100, y + 130, -1, GTK_ANCHOR_CENTER, "font", "Sans 12", "fill-color", "blue", NULL); goo_canvas_line_dash_unref (dash); } GtkWidget * create_events_page (void) { GtkWidget *vbox, *alignment, *frame, *label, *canvas; GooCanvasItemModel *root; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ label = gtk_label_new ("Move the mouse over the items to check they receive the right motion events.\nThe first 2 items in each group are 1) invisible and 2) visible but unpainted."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 600, 450); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); create_events_area (root, 0, GOO_CANVAS_EVENTS_NONE, "none"); create_events_area (root, 1, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, "visible-painted"); create_events_area (root, 2, GOO_CANVAS_EVENTS_VISIBLE_FILL, "visible-fill"); create_events_area (root, 3, GOO_CANVAS_EVENTS_VISIBLE_STROKE, "visible-stroke"); create_events_area (root, 4, GOO_CANVAS_EVENTS_VISIBLE, "visible"); create_events_area (root, 5, GOO_CANVAS_EVENTS_PAINTED, "painted"); create_events_area (root, 6, GOO_CANVAS_EVENTS_FILL, "fill"); create_events_area (root, 7, GOO_CANVAS_EVENTS_STROKE, "stroke"); create_events_area (root, 8, GOO_CANVAS_EVENTS_ALL, "all"); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); return vbox; } goocanvas-1.0.0/demo/simple-demo.c0000644000076400007640000000507511412723611013731 00000000000000#include #include static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItem *root, *rect_item, *text_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_rotate (text_item, 45, 300, 300); /* Connect a signal handler for the rectangle item. */ g_signal_connect (rect_item, "button_press_event", G_CALLBACK (on_rect_button_press), NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-1.0.0/demo/demo-large-line.h0000644000076400007640000000327611412723611014465 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-line.h - a demo item that exceeds the cairo 16-bit size limit. * Note that it doesn't support miters. */ #ifndef __GOO_DEMO_LARGE_LINE_H__ #define __GOO_DEMO_LARGE_LINE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_DEMO_LARGE_LINE (goo_demo_large_line_get_type ()) #define GOO_DEMO_LARGE_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_DEMO_LARGE_LINE, GooDemoLargeLine)) #define GOO_DEMO_LARGE_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_DEMO_LARGE_LINE, GooDemoLargeLineClass)) #define GOO_IS_DEMO_LARGE_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_DEMO_LARGE_LINE)) #define GOO_IS_DEMO_LARGE_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_DEMO_LARGE_LINE)) #define GOO_DEMO_LARGE_LINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_DEMO_LARGE_LINE, GooDemoLargeLineClass)) typedef struct _GooDemoLargeLine GooDemoLargeLine; typedef struct _GooDemoLargeLineClass GooDemoLargeLineClass; struct _GooDemoLargeLine { GooCanvasItemSimple parent_object; gdouble x1, y1, x2, y2; }; struct _GooDemoLargeLineClass { GooCanvasItemSimpleClass parent_class; }; GType goo_demo_large_line_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_demo_large_line_new (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); G_END_DECLS #endif /* __GOO_DEMO_LARGE_LINE_H__ */ goocanvas-1.0.0/demo/mv-demo-animation.c0000644000076400007640000001104311412723611015027 00000000000000#include #include #include #include static GooCanvasItemModel *root = NULL; static GooCanvasItemModel *ellipse1, *ellipse2, *rect1, *rect2, *rect3, *rect4; static void start_animation_clicked (GtkWidget *button, gpointer data) { /* Absolute. */ goo_canvas_item_model_set_simple_transform (ellipse1, 100, 100, 1, 0); goo_canvas_item_model_animate (ellipse1, 500, 100, 2, 720, TRUE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_model_set_simple_transform (rect1, 100, 200, 1, 0); goo_canvas_item_model_animate (rect1, 100, 200, 1, 350, TRUE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_model_set_simple_transform (rect3, 200, 200, 1, 0); goo_canvas_item_model_animate (rect3, 200, 200, 3, 0, TRUE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); /* Relative. */ goo_canvas_item_model_set_simple_transform (ellipse2, 100, 400, 1, 0); goo_canvas_item_model_animate (ellipse2, 400, 0, 2, 720, FALSE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_model_set_simple_transform (rect2, 100, 500, 1, 0); goo_canvas_item_model_animate (rect2, 0, 0, 1, 350, FALSE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_model_set_simple_transform (rect4, 200, 500, 1, 0); goo_canvas_item_model_animate (rect4, 0, 0, 3, 0, FALSE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); } static void stop_animation_clicked (GtkWidget *button, gpointer data) { goo_canvas_item_model_stop_animation (ellipse1); goo_canvas_item_model_stop_animation (ellipse2); goo_canvas_item_model_stop_animation (rect1); goo_canvas_item_model_stop_animation (rect2); goo_canvas_item_model_stop_animation (rect3); goo_canvas_item_model_stop_animation (rect4); } static void on_animation_finished (GooCanvasItemModel *model, gboolean stopped, gpointer data) { g_print ("Animation finished stopped: %i\n", stopped); } static GooCanvasItemModel* create_canvas_model (void) { if (root) return root; root = goo_canvas_group_model_new (NULL, NULL); /* Absolute. */ ellipse1 = goo_canvas_ellipse_model_new (root, 0, 0, 25, 15, "fill-color", "blue", NULL); goo_canvas_item_model_translate (ellipse1, 100, 100); g_signal_connect (ellipse1, "animation_finished", G_CALLBACK (on_animation_finished), NULL); rect1 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_model_translate (rect1, 100, 200); rect3 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_model_translate (rect3, 200, 200); /* Relative. */ ellipse2 = goo_canvas_ellipse_model_new (root, 0, 0, 25, 15, "fill-color", "red", NULL); goo_canvas_item_model_translate (ellipse2, 100, 400); rect2 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_model_translate (rect2, 100, 500); rect4 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_model_translate (rect4, 200, 500); return root; } GtkWidget * create_animation_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GooCanvasItemModel *root; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label("Start Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (start_animation_clicked), NULL); w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = create_canvas_model (); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); return vbox; } goocanvas-1.0.0/demo/flower.png0000644000076400007640000000146211412723611013352 00000000000000‰PNG  IHDRísO/gAMA† 1è–_éIDATxÚm“MhTwÅÿñ½ùR3/ãÌ›d"ãKÒÅ€‘D‘DcœJ‘Aƒ‹ nŠ´Ji]‰  Š+.DPA²(]tÓU»üè$ RFZDÖOìÄ’8yÉ8óòæ}L湈 ½ËË=ç\î=GÜ»4ÄgkÇy¯#ÕÅìoߊ¼¹›LøîgÇ$€‚/Ë:%æýßtM“üê;ëu–+t þ@(äÚ•‹ ÇŠûN†~…À²,ï»oŽ Ë~\× nÖÙýåW«j¥7%ýû”UóŽlÎ éØ‹±´HéM‰¶ö6ŒÒ Œé Œ¹'oÑí “Cµ,³Ó“„~â‰(0€¸záœg7€ZÝ&žP …Chûγ¼aÅçAJ3 ËJ7±CGé;0‚cV™¸“GŸ×Ñ´Õv¤´¶‰-ýC„Â!dÙÔ’¤Ñµ‡É‡L&KçÝD”‘V…ªÙ@ÓR$Ûâ´'T¾î. i8ùDÜ›Ùè_>Cö¯å‰1FGG©Tª´(*ý»v ‡¨›uŒj€Sƒ55ˆ½+Fš›™âô™3,.¾cjj5¡’ËQ­è$S]UƒÜX³nA–m©àËöÍQ7m*• ŠÒBgç&âñ8ÍFƒ›cw˜|ý3ëÂa4-µúÞ©·9Noa6ÓÞÒ; p r@FÆÉ„¤¯#™ n®hsº[@ñc˜ ¾,®×DÚ‚(«©»ï¨|YŽõŒ‹Ûåm Ç~€)ø²ô6Çx%%½ä¬nIEND®B`‚goocanvas-1.0.0/demo/demo-focus.c0000644000076400007640000001062211412723611013551 00000000000000#include #include #include #include static gboolean on_focus_in (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-in event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-color", "black", NULL); return FALSE; } static gboolean on_focus_out (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-out event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-pattern", NULL, NULL); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received button-press event\n", id ? id : "unknown"); canvas = goo_canvas_item_get_canvas (item); goo_canvas_grab_focus (canvas, item); return TRUE; } static gboolean on_key_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received key-press event\n", id ? id : "unknown"); return FALSE; } static void create_focus_box (GtkWidget *canvas, gdouble x, gdouble y, gdouble width, gdouble height, gchar *color) { GooCanvasItem *root, *item; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); item = goo_canvas_rect_new (root, x, y, width, height, "stroke-pattern", NULL, "fill-color", color, "line-width", 5.0, "can-focus", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", color); g_signal_connect (item, "focus_in_event", G_CALLBACK (on_focus_in), NULL); g_signal_connect (item, "focus_out_event", G_CALLBACK (on_focus_out), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "key_press_event", G_CALLBACK (on_key_press), NULL); } static void setup_canvas (GtkWidget *canvas) { create_focus_box (canvas, 110, 80, 50, 30, "red"); create_focus_box (canvas, 300, 160, 50, 30, "orange"); create_focus_box (canvas, 500, 50, 50, 30, "yellow"); create_focus_box (canvas, 70, 400, 50, 30, "blue"); create_focus_box (canvas, 130, 200, 50, 30, "magenta"); create_focus_box (canvas, 200, 160, 50, 30, "green"); create_focus_box (canvas, 450, 450, 50, 30, "cyan"); create_focus_box (canvas, 300, 350, 50, 30, "grey"); create_focus_box (canvas, 900, 900, 50, 30, "gold"); create_focus_box (canvas, 800, 150, 50, 30, "thistle"); create_focus_box (canvas, 600, 800, 50, 30, "azure"); create_focus_box (canvas, 700, 250, 50, 30, "moccasin"); create_focus_box (canvas, 500, 100, 50, 30, "cornsilk"); create_focus_box (canvas, 200, 750, 50, 30, "plum"); create_focus_box (canvas, 400, 800, 50, 30, "orchid"); } GtkWidget * create_focus_page (void) { GtkWidget *vbox, *label, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); label = gtk_label_new ("Use Tab, Shift+Tab or the arrow keys to move the keyboard focus between the canvas items."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); return vbox; } goocanvas-1.0.0/demo/demo-arrowhead.c0000644000076400007640000003277511412723611014423 00000000000000#include #include #include #include #define LEFT 50.0 #define RIGHT 350.0 #define MIDDLE 150.0 #define DEFAULT_WIDTH 2 #define DEFAULT_SHAPE_A 4 #define DEFAULT_SHAPE_B 5 #define DEFAULT_SHAPE_C 4 static void set_dimension (GooCanvas *canvas, char *arrow_name, char *text_name, double x1, double y1, double x2, double y2, double tx, double ty, int dim) { GooCanvasPoints *points; char buf[100]; points = goo_canvas_points_new (2); points->coords[0] = x1; points->coords[1] = y1; points->coords[2] = x2; points->coords[3] = y2; g_object_set (g_object_get_data (G_OBJECT (canvas), arrow_name), "points", points, NULL); sprintf (buf, "%d", dim); g_object_set (g_object_get_data (G_OBJECT (canvas), text_name), "text", buf, "x", tx, "y", ty, NULL); goo_canvas_points_unref (points); } static void move_drag_box (GooCanvasItem *item, double x, double y) { g_object_set (item, "x", x - 5.0, "y", y - 5.0, NULL); } static void set_arrow_shape (GooCanvas *canvas) { int width; int shape_a, shape_b, shape_c; GooCanvasPoints *points; char buf[100]; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_a")); shape_b = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_b")); shape_c = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_c")); /* Big arrow */ g_object_set (g_object_get_data (G_OBJECT (canvas), "big_arrow"), "line-width", 10.0 * width, "arrow-tip-length", (double) (shape_a), "arrow-length", (double) (shape_b), "arrow-width", (double) (shape_c), NULL); /* Outline */ points = goo_canvas_points_new (5); points->coords[0] = RIGHT - 10 * shape_a * width; points->coords[1] = MIDDLE - 10 * width / 2; points->coords[2] = RIGHT - 10 * shape_b * width; points->coords[3] = MIDDLE - 10 * (shape_c * width / 2.0); points->coords[4] = RIGHT; points->coords[5] = MIDDLE; points->coords[6] = points->coords[2]; points->coords[7] = MIDDLE + 10 * (shape_c * width / 2.0); points->coords[8] = points->coords[0]; points->coords[9] = MIDDLE + 10 * width / 2; g_object_set (g_object_get_data (G_OBJECT (canvas), "outline"), "points", points, NULL); goo_canvas_points_unref (points); /* Drag boxes */ move_drag_box (g_object_get_data (G_OBJECT (canvas), "width_drag_box"), LEFT, MIDDLE - 10 * width / 2.0); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box"), RIGHT - 10 * shape_a * width, MIDDLE); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box"), RIGHT - 10 * shape_b * width, MIDDLE - 10 * (shape_c * width / 2.0)); /* Dimensions */ set_dimension (canvas, "width_arrow", "width_text", LEFT - 10, MIDDLE - 10 * width / 2.0, LEFT - 10, MIDDLE + 10 * width / 2.0, LEFT - 15, MIDDLE, width); set_dimension (canvas, "shape_a_arrow", "shape_a_text", RIGHT - 10 * shape_a * width, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT - 10 * shape_a * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 15, shape_a); set_dimension (canvas, "shape_b_arrow", "shape_b_text", RIGHT - 10 * shape_b * width, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT - 10 * shape_b * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 40, shape_b); set_dimension (canvas, "shape_c_arrow", "shape_c_text", RIGHT + 10, MIDDLE - 10 * shape_c * width / 2.0, RIGHT + 10, MIDDLE + 10 * shape_c * width / 2.0, RIGHT + 15, MIDDLE, shape_c); /* Info */ sprintf (buf, "line-width: %d", width); g_object_set (g_object_get_data (G_OBJECT (canvas), "width_info"), "text", buf, NULL); sprintf (buf, "arrow-tip-length: %d (* line-width)", shape_a); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_a_info"), "text", buf, NULL); sprintf (buf, "arrow-length: %d (* line-width)", shape_b); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_b_info"), "text", buf, NULL); sprintf (buf, "arrow-width: %d (* line-width)", shape_c); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_c_info"), "text", buf, NULL); /* Sample arrows */ g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_1"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_2"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_3"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); } static void create_dimension (GtkWidget *canvas, GooCanvasItem *root, char *arrow_name, char *text_name, GtkAnchorType anchor) { GooCanvasItem *item; item = goo_canvas_polyline_new (root, FALSE, 0, "fill_color", "black", "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), arrow_name, item); item = goo_canvas_text_new (root, NULL, 0, 0, -1, anchor, "fill_color", "black", "font", "Sans 12", NULL); g_object_set_data (G_OBJECT (canvas), text_name, item); } static void create_info (GtkWidget *canvas, GooCanvasItem *root, char *info_name, double x, double y) { GooCanvasItem *item; item = goo_canvas_text_new (root, NULL, x, y, -1, GTK_ANCHOR_NW, "fill_color", "black", "font", "Sans 14", NULL); g_object_set_data (G_OBJECT (canvas), info_name, item); } static void create_sample_arrow (GtkWidget *canvas, GooCanvasItem *root, char *sample_name, double x1, double y1, double x2, double y2) { GooCanvasItem *item; item = goo_canvas_polyline_new_line (root, x1, y1, x2, y2, "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), sample_name, item); } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { g_object_set (item, "fill_color", "red", NULL); return TRUE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { g_object_set (item, "fill_color", "black", NULL); return TRUE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GdkCursor *fleur; fleur = gdk_cursor_new (GDK_FLEUR); canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); return TRUE; } static gboolean on_motion (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvas *canvas = goo_canvas_item_get_canvas (item); int x, y, width, shape_a, shape_b, shape_c; gboolean change = FALSE; if (!(event->state & GDK_BUTTON1_MASK)) return FALSE; if (item == g_object_get_data (G_OBJECT (canvas), "width_drag_box")) { y = event->y; width = (MIDDLE - y) / 5; if (width < 0) return FALSE; g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (width)); set_arrow_shape (canvas); } else if (item == g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box")) { x = event->x; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = (RIGHT - x) / 10 / width; if ((shape_a < 0) || (shape_a > 30)) return FALSE; g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (shape_a)); set_arrow_shape (canvas); } else if (item == g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box")) { width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); x = event->x; shape_b = (RIGHT - x) / 10 / width; if ((shape_b >= 0) && (shape_b <= 30)) { g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (shape_b)); change = TRUE; } y = event->y; shape_c = (MIDDLE - y) * 2 / 10 / width; if (shape_c >= 0) { g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (shape_c)); change = TRUE; } if (change) set_arrow_shape (canvas); } return TRUE; } static void create_drag_box (GtkWidget *canvas, GooCanvasItem *root, char *box_name) { GooCanvasItem *item; item = goo_canvas_rect_new (root, 0, 0, 10, 10, "fill_color", "black", "stroke_color", "black", "line_width", 1.0, NULL); g_object_set_data (G_OBJECT (canvas), box_name, item); g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion), NULL); } GtkWidget * create_canvas_arrowhead (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *frame; GtkWidget *canvas; GooCanvasItem *root, *item; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("This demo allows you to edit arrowhead shapes. Drag the little boxes\n" "to change the shape of the line and its arrowhead. You can see the\n" "arrows at their normal scale on the right hand side of the window."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), w, TRUE, TRUE, 0); gtk_widget_show (w); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (w), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, 500, 350); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 500, 350); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (DEFAULT_WIDTH)); g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (DEFAULT_SHAPE_A)); g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (DEFAULT_SHAPE_B)); g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (DEFAULT_SHAPE_C)); /* Big arrow */ item = goo_canvas_polyline_new_line (root, LEFT, MIDDLE, RIGHT, MIDDLE, "stroke_color", "mediumseagreen", "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), "big_arrow", item); /* Arrow outline */ item = goo_canvas_polyline_new (root, TRUE, 0, "stroke_color", "black", "line-width", 2.0, "line-cap", CAIRO_LINE_CAP_ROUND, "line-join", CAIRO_LINE_JOIN_ROUND, NULL); g_object_set_data (G_OBJECT (canvas), "outline", item); /* Drag boxes */ create_drag_box (canvas, root, "width_drag_box"); create_drag_box (canvas, root, "shape_a_drag_box"); create_drag_box (canvas, root, "shape_b_c_drag_box"); /* Dimensions */ create_dimension (canvas, root, "width_arrow", "width_text", GTK_ANCHOR_E); create_dimension (canvas, root, "shape_a_arrow", "shape_a_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_b_arrow", "shape_b_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_c_arrow", "shape_c_text", GTK_ANCHOR_W); /* Info */ create_info (canvas, root, "width_info", LEFT, 260); create_info (canvas, root, "shape_a_info", LEFT, 280); create_info (canvas, root, "shape_b_info", LEFT, 300); create_info (canvas, root, "shape_c_info", LEFT, 320); /* Division line */ goo_canvas_polyline_new_line (root, RIGHT + 50, 0, RIGHT + 50, 1000, "fill_color", "black", "line-width", 2.0, NULL); /* Sample arrows */ create_sample_arrow (canvas, root, "sample_1", RIGHT + 100, 30, RIGHT + 100, MIDDLE - 30); create_sample_arrow (canvas, root, "sample_2", RIGHT + 70, MIDDLE, RIGHT + 130, MIDDLE); create_sample_arrow (canvas, root, "sample_3", RIGHT + 70, MIDDLE + 30, RIGHT + 130, MIDDLE + 120); /* Done! */ set_arrow_shape (GOO_CANVAS (canvas)); return vbox; } goocanvas-1.0.0/demo/scalability-demo.c0000644000076400007640000002047611412723611014742 00000000000000#include #include #include #if 1 #define N_GROUP_COLS 25 #define N_GROUP_ROWS 200 #define N_COLS 10 #define N_ROWS 10 #define ITEM_WIDTH 400 #define PADDING 10 #if 1 #define ROTATE #endif #else /* This tests a very wide canvas, nearly up to the 31-bit GDK window size limit. */ #define N_GROUP_COLS 100000 #define N_GROUP_ROWS 1 #define N_COLS 10 #define N_ROWS 1 #define ITEM_WIDTH 1000 #define PADDING 100 #endif #define N_TOTAL_ID_ITEMS (N_GROUP_COLS * N_GROUP_ROWS) * (N_COLS * N_ROWS) /* The maximum length of a string identifying an item (i.e. its coords). */ #define MAX_ID_LEN 20 #if 1 #define SET_STYLE #endif #if 1 #define USE_TEXT #endif #if 1 #define SET_IDS #endif #if 0 #define USE_PIXMAP #endif #if 0 #define ONLY_ONE #endif double total_width, total_height; double left_offset, top_offset; char ids[N_TOTAL_ID_ITEMS][MAX_ID_LEN]; GdkPixbuf *pixbuf = NULL; cairo_pattern_t *pattern = NULL; double item_width, item_height; double cell_width, cell_height; double group_width, group_height; static clock_t start; static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItem *ancestor = target; gchar *id; while (ancestor) { id = g_object_get_data (G_OBJECT (ancestor), "id"); if (id) { g_print ("%s item received 'motion-notify' signal\n", id); return TRUE; } ancestor = goo_canvas_item_get_parent (ancestor); } return TRUE; } static void init_ids (void) { int group_i, group_j, i, j; int id_item_num = 0;; for (group_i = 0; group_i < N_GROUP_COLS; group_i++) { for (group_j = 0; group_j < N_GROUP_ROWS; group_j++) { double group_x = left_offset + (group_i * group_width); double group_y = top_offset + (group_j * group_height); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { double item_x = (i * cell_width) + PADDING; double item_y = (j * cell_height) + PADDING; sprintf (ids[id_item_num++], "%.10g, %.10g", group_x + item_x, group_y + item_y); } } } } } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root, *group, *item; int group_i, group_j, i, j; int total_items = 0, id_item_num = 0;; GdkColor color = { 0, 0, 0, 0, }; GooCanvasStyle *style, *style2; GValue tmpval = { 0 }; cairo_matrix_t item_matrix; GQuark id_quark = g_quark_from_static_string ("id"); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_signal_connect (root, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_object_set (G_OBJECT (root), "font", "Sans 8", NULL); style = goo_canvas_style_new (); gdk_color_parse ("mediumseagreen", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); style2 = goo_canvas_style_new (); gdk_color_parse ("steelblue", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style2, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); for (group_i = 0; group_i < N_GROUP_COLS; group_i++) { for (group_j = 0; group_j < N_GROUP_ROWS; group_j++) { double group_x = left_offset + (group_i * group_width); double group_y = top_offset + (group_j * group_height); group = goo_canvas_group_new (root, NULL); total_items++; goo_canvas_item_translate (group, group_x, group_y); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { double item_x = (i * cell_width) + PADDING; double item_y = (j * cell_height) + PADDING; #ifdef ROTATE double rotation = (i % 10 * 2) * M_PI / 180; double rotation_x = item_x + item_width / 2; double rotation_y = item_y + item_height / 2; #endif #ifdef USE_PIXMAP item = goo_canvas_image_new (group, NULL, item_x, item_y, "pattern", pattern, "width", item_width, "height", item_height, NULL); #else item = goo_canvas_rect_new (group, item_x, item_y, item_width, item_height, NULL); #ifdef SET_STYLE goo_canvas_item_set_style (item, (j % 2) ? style : style2); #endif #ifdef ROTATE cairo_matrix_init_identity (&item_matrix); cairo_matrix_translate (&item_matrix, rotation_x, rotation_y); cairo_matrix_rotate (&item_matrix, rotation); cairo_matrix_translate (&item_matrix, -rotation_x, -rotation_y); goo_canvas_item_set_transform (item, &item_matrix); #endif #endif #ifdef SET_IDS g_object_set_qdata (G_OBJECT (item), id_quark, ids[id_item_num]); #endif #if 0 g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); #endif #ifdef USE_TEXT item = goo_canvas_text_new (group, ids[id_item_num], item_x + item_width / 2, item_y + item_height / 2, item_width, GTK_ANCHOR_CENTER, "height", item_height, /*"alignment", PANGO_ALIGN_CENTER,*/ NULL); /* FIXME: This is slightly naughty, but much faster. */ GOO_CANVAS_TEXT (item)->text_data->alignment = PANGO_ALIGN_CENTER; #else item = goo_canvas_rect_new (group, item_x + 20, item_y + 4, item_width - 40, item_height - 8, NULL); #endif #ifdef ROTATE goo_canvas_item_set_transform (item, &item_matrix); #endif id_item_num++; total_items += 2; #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } if (pattern) cairo_pattern_destroy (pattern); g_print ("Total items: %i\n", total_items); } static gboolean on_expose_event (GtkWidget *canvas, GdkEvent *event, gpointer unused_data) { static gboolean first_time = TRUE; if (first_time) { printf ("Update Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); first_time = FALSE; } return FALSE; } GtkWidget * create_canvas (void) { GtkWidget *canvas; #ifdef USE_PIXMAP pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); item_width = gdk_pixbuf_get_width (pixbuf); item_height = gdk_pixbuf_get_height (pixbuf); pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); #else pixbuf = NULL; item_width = ITEM_WIDTH; item_height = 19; #endif cell_width = item_width + PADDING * 2; cell_height = item_height + PADDING * 2; group_width = N_COLS * cell_width; group_height = N_ROWS * cell_height; total_width = N_GROUP_COLS * group_width; total_height = N_GROUP_ROWS * group_height; /* We use -ve offsets to test if -ve coords are handled correctly. */ left_offset = -total_width / 2; top_offset = -total_height / 2; #ifdef SET_IDS init_ids (); #endif /* Create the canvas. */ canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); start = clock(); setup_canvas (canvas); printf ("Create Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); start = clock(); goo_canvas_set_bounds (GOO_CANVAS (canvas), left_offset, top_offset, left_offset + total_width, top_offset + total_height); gtk_widget_show (canvas); g_signal_connect (canvas, "expose_event", G_CALLBACK (on_expose_event), NULL); return canvas; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = create_canvas (); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); gtk_main (); return 0; } goocanvas-1.0.0/demo/mv-demo-focus.c0000644000076400007640000001221111412723611014165 00000000000000#include #include #include #include static gboolean on_focus_in (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received focus-in event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (model, "stroke-color", "black", NULL); return FALSE; } static gboolean on_focus_out (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received focus-out event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (model, "stroke-pattern", NULL, NULL); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); GooCanvas *canvas; g_print ("%s received button-press event\n", id ? id : "unknown"); canvas = goo_canvas_item_get_canvas (item); goo_canvas_grab_focus (canvas, item); return TRUE; } static gboolean on_key_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received key-press event\n", id ? id : "unknown"); return FALSE; } static void on_item_created (GooCanvas *view, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (GOO_IS_CANVAS_RECT_MODEL (model)) { g_object_set (model, "can-focus", TRUE, NULL); g_signal_connect (item, "focus_in_event", G_CALLBACK (on_focus_in), NULL); g_signal_connect (item, "focus_out_event", G_CALLBACK (on_focus_out), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "key_press_event", G_CALLBACK (on_key_press), NULL); } } static void create_focus_box (GtkWidget *canvas, gdouble x, gdouble y, gdouble width, gdouble height, gchar *color) { GooCanvasItemModel *root, *item; root = goo_canvas_get_root_item_model (GOO_CANVAS (canvas)); item = goo_canvas_rect_model_new (root, x, y, width, height, "stroke-pattern", NULL, "fill-color", color, "line-width", 5.0, "can-focus", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", color); } static void setup_canvas (GtkWidget *canvas) { GooCanvasItemModel *root; root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); create_focus_box (canvas, 110, 80, 50, 30, "red"); create_focus_box (canvas, 300, 160, 50, 30, "orange"); create_focus_box (canvas, 500, 50, 50, 30, "yellow"); create_focus_box (canvas, 70, 400, 50, 30, "blue"); create_focus_box (canvas, 130, 200, 50, 30, "magenta"); create_focus_box (canvas, 200, 160, 50, 30, "green"); create_focus_box (canvas, 450, 450, 50, 30, "cyan"); create_focus_box (canvas, 300, 350, 50, 30, "grey"); create_focus_box (canvas, 900, 900, 50, 30, "gold"); create_focus_box (canvas, 800, 150, 50, 30, "thistle"); create_focus_box (canvas, 600, 800, 50, 30, "azure"); create_focus_box (canvas, 700, 250, 50, 30, "moccasin"); create_focus_box (canvas, 500, 100, 50, 30, "cornsilk"); create_focus_box (canvas, 200, 750, 50, 30, "plum"); create_focus_box (canvas, 400, 800, 50, 30, "orchid"); } GtkWidget * create_focus_page (void) { GtkWidget *vbox, *label, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); label = gtk_label_new ("Use Tab, Shift+Tab or the arrow keys to move the keyboard focus between the canvas items."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); setup_canvas (canvas); return vbox; } goocanvas-1.0.0/demo/table-demo.c0000644000076400007640000001764311412723611013533 00000000000000#include #include static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } static GooCanvasItem* create_item (GooCanvasItem *table, gdouble width, gdouble height, gint row, gint column, gint rows, gint columns, gboolean x_expand, gboolean x_shrink, gboolean x_fill, gboolean y_expand, gboolean y_shrink, gboolean y_fill) { GooCanvasItem *item; item = goo_canvas_rect_new (table, 0, 0, width, height, "stroke-color", "black", "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, item, "row", row, "column", column, "rows", rows, "columns", columns, "x-expand", x_expand, "x-fill", x_fill, "x-shrink", x_shrink, "y-expand", y_expand, "y-fill", y_fill, "y-shrink", y_shrink, NULL); return item; } void create_table1 (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItem *table, *items[9]; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_new (parent, "width", width, "height", height, NULL); goo_canvas_item_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, "stroke-color", "blue", "fill-color", "lightblue", NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 1, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 1, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 2, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { goo_canvas_item_get_bounds (items[i], &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } /* Creates a table with items spanning multiple cells */ void create_table2 (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItem *table, *items[9]; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_new (parent, "width", width, "height", height, NULL); goo_canvas_item_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 2, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 3, 2, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 3, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 3, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 3, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 3, 2, 1, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { goo_canvas_item_get_bounds (items[i], &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_print ("\nTable at default size...\n"); create_table1 (root, 50, 50, -1, -1, FALSE); g_print ("\nTable at reduced size...\n"); create_table1 (root, 250, 50, 30, 30, FALSE); g_print ("\nTable at enlarged size...\n"); create_table1 (root, 450, 50, 100, 100, FALSE); g_print ("\nTable with grid lines at default size...\n"); create_table1 (root, 50, 250, -1, -1, TRUE); g_print ("\nTable with grid lines at reduced size...\n"); create_table1 (root, 250, 250, 30, 30, TRUE); g_print ("\nTable with grid lines at enlarged size...\n"); create_table1 (root, 450, 250, 150, 150, TRUE); g_print ("Multispanning table with grid lines at default size...\n"); create_table2 (root, 50, 450, -1, -1, TRUE); g_print ("Multispanning table with grid lines at reduced size...\n"); create_table2 (root, 250, 450, 30, 30, TRUE); g_print ("Multispanning table with grid lines at enlarged size...\n"); create_table2 (root, 450, 450, 150, 150, TRUE); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Normal Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nNormal Canvas...\n"); setup_canvas (canvas); label = gtk_label_new ("Integer Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create bottom canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); g_object_set (canvas, "integer-layout", TRUE, NULL); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nInteger Layout Canvas...\n"); setup_canvas (canvas); gtk_main (); return 0; } goocanvas-1.0.0/demo/demo-fifteen.c0000644000076400007640000001554111412723611014057 00000000000000#include #include #include #include #include #include #include #include #define PIECE_SIZE 50 static void free_stuff (GtkObject *obj, gpointer data) { g_free (data); } static void test_win (GooCanvasItem **board) { int i; #if 0 GtkWidget *dlg; #endif for (i = 0; i < 15; i++) if (!board[i] || (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (board[i]), "piece_num")) != i)) return; #if 0 dlg=gnome_ok_dialog ("You stud, you win!"); gtk_window_set_modal(GTK_WINDOW(dlg),TRUE); gnome_dialog_run (GNOME_DIALOG (dlg)); #endif } static char * get_piece_color (int piece) { static char buf[50]; int x, y; int r, g, b; y = piece / 4; x = piece % 4; r = ((4 - x) * 255) / 4; g = ((4 - y) * 255) / 4; b = 128; sprintf (buf, "#%02x%02x%02x", r, g, b); return buf; } static gboolean piece_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItem *text; #if 0 g_print ("In piece_enter_notify\n"); #endif text = g_object_get_data (G_OBJECT (item), "text"); g_object_set (text, "fill_color", "white", NULL); return FALSE; } static gboolean piece_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { GooCanvasItem *text; #if 0 g_print ("In piece_leave_notify\n"); #endif text = g_object_get_data (G_OBJECT (item), "text"); g_object_set (text, "fill_color", "black", NULL); return FALSE; } static gboolean piece_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GooCanvasItem **board; GooCanvasItem *text; int num, pos, newpos; int x, y; double dx = 0.0, dy = 0.0; int move; canvas = goo_canvas_item_get_canvas (item); board = g_object_get_data (G_OBJECT (canvas), "board"); num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "piece_num")); pos = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "piece_pos")); text = g_object_get_data (G_OBJECT (item), "text"); #if 0 g_print ("In piece_event pos: %i,%i num: %i\n", pos % 4, pos / 4, num + 1); #endif y = pos / 4; x = pos % 4; move = TRUE; if ((y > 0) && (board[(y - 1) * 4 + x] == NULL)) { dx = 0.0; dy = -1.0; y--; } else if ((y < 3) && (board[(y + 1) * 4 + x] == NULL)) { dx = 0.0; dy = 1.0; y++; } else if ((x > 0) && (board[y * 4 + x - 1] == NULL)) { dx = -1.0; dy = 0.0; x--; } else if ((x < 3) && (board[y * 4 + x + 1] == NULL)) { dx = 1.0; dy = 0.0; x++; } else move = FALSE; if (move) { newpos = y * 4 + x; board[pos] = NULL; board[newpos] = item; g_object_set_data (G_OBJECT (item), "piece_pos", GINT_TO_POINTER (newpos)); goo_canvas_item_translate (item, dx * PIECE_SIZE, dy * PIECE_SIZE); test_win (board); } return FALSE; } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (piece_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (piece_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (piece_button_press), NULL); } #define SCRAMBLE_MOVES 256 static void scramble (GtkObject *object, gpointer data) { GooCanvas *canvas; GooCanvasItem **board; int i; int pos, oldpos; int dir; int x, y; srand (time (NULL)); canvas = data; board = g_object_get_data (G_OBJECT (canvas), "board"); /* First, find the blank spot */ for (pos = 0; pos < 16; pos++) if (board[pos] == NULL) break; /* "Move the blank spot" around in order to scramble the pieces */ for (i = 0; i < SCRAMBLE_MOVES; i++) { retry_scramble: dir = rand () % 4; x = y = 0; if ((dir == 0) && (pos > 3)) /* up */ y = -1; else if ((dir == 1) && (pos < 12)) /* down */ y = 1; else if ((dir == 2) && ((pos % 4) != 0)) /* left */ x = -1; else if ((dir == 3) && ((pos % 4) != 3)) /* right */ x = 1; else goto retry_scramble; oldpos = pos + y * 4 + x; board[pos] = board[oldpos]; board[oldpos] = NULL; g_object_set_data (G_OBJECT (board[pos]), "piece_pos", GINT_TO_POINTER (pos)); goo_canvas_item_translate (board[pos], -x * PIECE_SIZE, -y * PIECE_SIZE); pos = oldpos; } } GtkWidget * create_canvas_fifteen (void) { GtkWidget *vbox; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GtkWidget *button; GooCanvasItem **board; GooCanvasItem *root, *rect, *text; int i, x, y; char buf[20]; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, TRUE, TRUE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); /* Create the canvas and board */ canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "automatic-bounds", TRUE, "bounds-from-origin", FALSE, NULL); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); #if 0 goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); #endif gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); board = g_new (GooCanvasItem *, 16); g_object_set_data (G_OBJECT (canvas), "board", board); g_signal_connect (canvas, "destroy", G_CALLBACK (free_stuff), board); for (i = 0; i < 15; i++) { y = i / 4; x = i % 4; board[i] = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (board[i], x * PIECE_SIZE, y * PIECE_SIZE); setup_item_signals (board[i]); rect = goo_canvas_rect_new (board[i], 0, 0, PIECE_SIZE, PIECE_SIZE, "fill_color", get_piece_color (i), "stroke_color", "black", "line-width", 1.0, NULL); sprintf (buf, "%d", i + 1); text = goo_canvas_text_new (board[i], buf, PIECE_SIZE / 2.0, PIECE_SIZE / 2.0, -1, GTK_ANCHOR_CENTER, "font", "Sans bold 24", "fill_color", "black", NULL); g_object_set_data (G_OBJECT (board[i]), "text", text); g_object_set_data (G_OBJECT (board[i]), "piece_num", GINT_TO_POINTER (i)); g_object_set_data (G_OBJECT (board[i]), "piece_pos", GINT_TO_POINTER (i)); } board[15] = NULL; /* Scramble button */ button = gtk_button_new_with_label ("Scramble"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); g_object_set_data (G_OBJECT (button), "board", board); g_signal_connect (button, "clicked", G_CALLBACK (scramble), canvas); gtk_widget_show (button); return vbox; } goocanvas-1.0.0/demo/mv-demo-scalability.c0000644000076400007640000000442611412723611015357 00000000000000#include #include #include #include #define N_COLS 5 #define N_ROWS 20 #define PADDING 10 #if 1 #define USE_PIXMAP #endif GtkWidget * create_canvas_scalability (void) { GtkWidget *vbox; GtkWidget *frame; GtkWidget *scrolled_win, *canvas; GtkWidget *table; GdkPixbuf *pixbuf; GooCanvasItemModel *root, *item; int i, j, width, height; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); table = gtk_table_new (2, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); gtk_widget_show (table); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); gtk_widget_show (frame); /* Create the canvas and board */ pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); #ifdef USE_PIXMAP width = gdk_pixbuf_get_width (pixbuf) + 3; height = gdk_pixbuf_get_height (pixbuf) +1; #else width = 37; height = 19; #endif canvas = goo_canvas_new (); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, N_COLS * (width + PADDING), N_ROWS * (height + PADDING)); gtk_widget_show (canvas); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (frame), scrolled_win); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { #ifdef USE_PIXMAP item = goo_canvas_image_model_new (root, pixbuf, i * (width + PADDING), j * (height + PADDING), NULL); #else item = goo_canvas_rect_model_new (root, i * (width + PADDING), j * (height + PADDING), width, height); g_object_set (item, "fill_color", (j%2)?"mediumseagreen":"steelblue", NULL); #endif } } return vbox; } goocanvas-1.0.0/demo/mv-demo-arrowhead.c0000644000076400007640000003421311412723611015030 00000000000000#include #include #include #include #define LEFT 50.0 #define RIGHT 350.0 #define MIDDLE 150.0 #define DEFAULT_WIDTH 2 #define DEFAULT_SHAPE_A 4 #define DEFAULT_SHAPE_B 5 #define DEFAULT_SHAPE_C 4 static void set_dimension (GooCanvas *canvas, char *arrow_name, char *text_name, double x1, double y1, double x2, double y2, double tx, double ty, int dim) { GooCanvasPoints *points; char buf[100]; points = goo_canvas_points_new (2); points->coords[0] = x1; points->coords[1] = y1; points->coords[2] = x2; points->coords[3] = y2; g_object_set (g_object_get_data (G_OBJECT (canvas), arrow_name), "points", points, NULL); sprintf (buf, "%d", dim); g_object_set (g_object_get_data (G_OBJECT (canvas), text_name), "text", buf, "x", tx, "y", ty, NULL); goo_canvas_points_unref (points); } static void move_drag_box (GooCanvasItem *item, double x, double y) { g_object_set (item, "x", x - 5.0, "y", y - 5.0, NULL); } static void set_arrow_shape (GooCanvas *canvas) { int width; int shape_a, shape_b, shape_c; GooCanvasPoints *points; char buf[100]; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_a")); shape_b = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_b")); shape_c = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_c")); /* Big arrow */ g_object_set (g_object_get_data (G_OBJECT (canvas), "big_arrow"), "line-width", 10.0 * width, "arrow-tip-length", (double) (shape_a), "arrow-length", (double) (shape_b), "arrow-width", (double) (shape_c), NULL); /* Outline */ points = goo_canvas_points_new (5); points->coords[0] = RIGHT - 10 * shape_a * width; points->coords[1] = MIDDLE - 10 * width / 2; points->coords[2] = RIGHT - 10 * shape_b * width; points->coords[3] = MIDDLE - 10 * (shape_c * width / 2.0); points->coords[4] = RIGHT; points->coords[5] = MIDDLE; points->coords[6] = points->coords[2]; points->coords[7] = MIDDLE + 10 * (shape_c * width / 2.0); points->coords[8] = points->coords[0]; points->coords[9] = MIDDLE + 10 * width / 2; g_object_set (g_object_get_data (G_OBJECT (canvas), "outline"), "points", points, NULL); goo_canvas_points_unref (points); /* Drag boxes */ move_drag_box (g_object_get_data (G_OBJECT (canvas), "width_drag_box"), LEFT, MIDDLE - 10 * width / 2.0); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box"), RIGHT - 10 * shape_a * width, MIDDLE); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box"), RIGHT - 10 * shape_b * width, MIDDLE - 10 * (shape_c * width / 2.0)); /* Dimensions */ set_dimension (canvas, "width_arrow", "width_text", LEFT - 10, MIDDLE - 10 * width / 2.0, LEFT - 10, MIDDLE + 10 * width / 2.0, LEFT - 15, MIDDLE, width); set_dimension (canvas, "shape_a_arrow", "shape_a_text", RIGHT - 10 * shape_a * width, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT - 10 * shape_a * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 15, shape_a); set_dimension (canvas, "shape_b_arrow", "shape_b_text", RIGHT - 10 * shape_b * width, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT - 10 * shape_b * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 40, shape_b); set_dimension (canvas, "shape_c_arrow", "shape_c_text", RIGHT + 10, MIDDLE - 10 * shape_c * width / 2.0, RIGHT + 10, MIDDLE + 10 * shape_c * width / 2.0, RIGHT + 15, MIDDLE, shape_c); /* Info */ sprintf (buf, "line-width: %d", width); g_object_set (g_object_get_data (G_OBJECT (canvas), "width_info"), "text", buf, NULL); sprintf (buf, "arrow-tip-length: %d (* line-width)", shape_a); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_a_info"), "text", buf, NULL); sprintf (buf, "arrow-length: %d (* line-width)", shape_b); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_b_info"), "text", buf, NULL); sprintf (buf, "arrow-width: %d (* line-width)", shape_c); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_c_info"), "text", buf, NULL); /* Sample arrows */ g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_1"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_2"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_3"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); } static void create_drag_box (GtkWidget *canvas, GooCanvasItemModel *root, char *box_name) { GooCanvasItemModel *box; box = goo_canvas_rect_model_new (root, 0, 0, 10, 10, "fill_color", "black", "stroke_color", "black", "line_width", 1.0, NULL); g_object_set_data (G_OBJECT (canvas), box_name, box); } static void create_dimension (GtkWidget *canvas, GooCanvasItemModel *root, char *arrow_name, char *text_name, GtkAnchorType anchor) { GooCanvasItemModel *item; item = goo_canvas_polyline_model_new (root, FALSE, 0, "fill_color", "black", "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), arrow_name, item); item = goo_canvas_text_model_new (root, NULL, 0, 0, -1, anchor, "fill_color", "black", "font", "Sans 12", NULL); g_object_set_data (G_OBJECT (canvas), text_name, item); } static void create_info (GtkWidget *canvas, GooCanvasItemModel *root, char *info_name, double x, double y) { GooCanvasItemModel *item; item = goo_canvas_text_model_new (root, NULL, x, y, -1, GTK_ANCHOR_NW, "fill_color", "black", "font", "Sans 14", NULL); g_object_set_data (G_OBJECT (canvas), info_name, item); } static void create_sample_arrow (GtkWidget *canvas, GooCanvasItemModel *root, char *sample_name, double x1, double y1, double x2, double y2) { GooCanvasItemModel *item; item = goo_canvas_polyline_model_new_line (root, x1, y1, x2, y2, "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), sample_name, item); } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); g_object_set (model, "fill_color", "red", NULL); return TRUE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); g_object_set (model, "fill_color", "black", NULL); return TRUE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GdkCursor *fleur; fleur = gdk_cursor_new (GDK_FLEUR); canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); return TRUE; } static gboolean on_motion (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvas *canvas = goo_canvas_item_get_canvas (item); GooCanvasItemModel *model = goo_canvas_item_get_model (target); int x, y, width, shape_a, shape_b, shape_c; gboolean change = FALSE; if (!(event->state & GDK_BUTTON1_MASK)) return FALSE; if (model == g_object_get_data (G_OBJECT (canvas), "width_drag_box")) { y = event->y; width = (MIDDLE - y) / 5; if (width < 0) return FALSE; g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (width)); set_arrow_shape (canvas); } else if (model == g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box")) { x = event->x; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = (RIGHT - x) / 10 / width; if ((shape_a < 0) || (shape_a > 30)) return FALSE; g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (shape_a)); set_arrow_shape (canvas); } else if (model == g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box")) { width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); x = event->x; shape_b = (RIGHT - x) / 10 / width; if ((shape_b >= 0) && (shape_b <= 30)) { g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (shape_b)); change = TRUE; } y = event->y; shape_c = (MIDDLE - y) * 2 / 10 / width; if (shape_c >= 0) { g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (shape_c)); change = TRUE; } if (change) set_arrow_shape (canvas); } return TRUE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (GOO_IS_CANVAS_RECT_MODEL (model)) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion), NULL); } } GtkWidget * create_canvas_arrowhead (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *frame; GtkWidget *canvas; GooCanvasItemModel *root, *item; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("This demo allows you to edit arrowhead shapes. Drag the little boxes\n" "to change the shape of the line and its arrowhead. You can see the\n" "arrows at their normal scale on the right hand side of the window."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), w, TRUE, TRUE, 0); gtk_widget_show (w); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (w), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); gtk_widget_set_size_request (canvas, 500, 350); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 500, 350); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (DEFAULT_WIDTH)); g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (DEFAULT_SHAPE_A)); g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (DEFAULT_SHAPE_B)); g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (DEFAULT_SHAPE_C)); /* Big arrow */ item = goo_canvas_polyline_model_new_line (root, LEFT, MIDDLE, RIGHT, MIDDLE, "stroke_color", "mediumseagreen", "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), "big_arrow", item); /* Arrow outline */ item = goo_canvas_polyline_model_new (root, TRUE, 0, "stroke_color", "black", "line-width", 2.0, "line-cap", CAIRO_LINE_CAP_ROUND, "line-join", CAIRO_LINE_JOIN_ROUND, NULL); g_object_set_data (G_OBJECT (canvas), "outline", item); /* Drag boxes */ create_drag_box (canvas, root, "width_drag_box"); create_drag_box (canvas, root, "shape_a_drag_box"); create_drag_box (canvas, root, "shape_b_c_drag_box"); /* Dimensions */ create_dimension (canvas, root, "width_arrow", "width_text", GTK_ANCHOR_E); create_dimension (canvas, root, "shape_a_arrow", "shape_a_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_b_arrow", "shape_b_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_c_arrow", "shape_c_text", GTK_ANCHOR_W); /* Info */ create_info (canvas, root, "width_info", LEFT, 260); create_info (canvas, root, "shape_a_info", LEFT, 280); create_info (canvas, root, "shape_b_info", LEFT, 300); create_info (canvas, root, "shape_c_info", LEFT, 320); /* Division line */ goo_canvas_polyline_model_new_line (root, RIGHT + 50, 0, RIGHT + 50, 1000, "fill_color", "black", "line-width", 2.0, NULL); /* Sample arrows */ create_sample_arrow (canvas, root, "sample_1", RIGHT + 100, 30, RIGHT + 100, MIDDLE - 30); create_sample_arrow (canvas, root, "sample_2", RIGHT + 70, MIDDLE, RIGHT + 130, MIDDLE); create_sample_arrow (canvas, root, "sample_3", RIGHT + 70, MIDDLE + 30, RIGHT + 130, MIDDLE + 120); /* Done! */ set_arrow_shape (GOO_CANVAS (canvas)); return vbox; } goocanvas-1.0.0/demo/demo-item.h0000644000076400007640000000272611412723611013403 00000000000000/* * GooCanvas Demo. Copyright (C) 2006 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-item.c - a simple demo item. */ #ifndef __GOO_DEMO_ITEM_H__ #define __GOO_DEMO_ITEM_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_DEMO_ITEM (goo_demo_item_get_type ()) #define GOO_DEMO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_DEMO_ITEM, GooDemoItem)) #define GOO_DEMO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_DEMO_ITEM, GooDemoItemClass)) #define GOO_IS_DEMO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_DEMO_ITEM)) #define GOO_IS_DEMO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_DEMO_ITEM)) #define GOO_DEMO_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_DEMO_ITEM, GooDemoItemClass)) typedef struct _GooDemoItem GooDemoItem; typedef struct _GooDemoItemClass GooDemoItemClass; struct _GooDemoItem { GooCanvasItemSimple parent_object; gdouble x, y, width, height; }; struct _GooDemoItemClass { GooCanvasItemSimpleClass parent_class; }; GType goo_demo_item_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_demo_item_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_DEMO_ITEM_H__ */ goocanvas-1.0.0/demo/demo-table.c0000644000076400007640000002270111412723611013522 00000000000000#include #include #include #define DEMO_RECT_ITEM 0 #define DEMO_TEXT_ITEM 1 #define DEMO_WIDGET_ITEM 2 static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { gchar *id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id ? id : "unknown", event->x, event->y, event->x_root, event->y_root); return TRUE; } static void create_demo_item (GooCanvasItem *table, gint demo_item_type, gint row, gint column, gint rows, gint columns, gchar *text) { GooCanvasItem *item = NULL; GtkWidget *widget; GValue value = { 0 }; guint new_row; switch (demo_item_type) { case DEMO_RECT_ITEM: item = goo_canvas_rect_new (table, 0, 0, 38, 19, "fill-color", "red", NULL); break; case DEMO_TEXT_ITEM: item = goo_canvas_text_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); break; case DEMO_WIDGET_ITEM: widget = gtk_button_new_with_label (text); item = goo_canvas_widget_new (table, widget, 0, 0, -1, -1, NULL); break; } g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, row); goo_canvas_item_set_child_property (table, item, "row", &value); g_value_set_uint (&value, column); goo_canvas_item_set_child_property (table, item, "column", &value); g_value_set_uint (&value, rows); goo_canvas_item_set_child_property (table, item, "rows", &value); g_value_set_uint (&value, columns); goo_canvas_item_set_child_property (table, item, "columns", &value); /* Test the get function. */ goo_canvas_item_get_child_property (table, item, "row", &value); new_row = g_value_get_uint (&value); if (new_row != row) g_warning ("Got bad row setting: %i should be: %i\n", new_row, row); #if 1 goo_canvas_item_set_child_properties (table, item, "x-expand", TRUE, "x-fill", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); #endif g_object_set_data (G_OBJECT (item), "id", text); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } static GooCanvasItem* create_table (GooCanvasItem *parent, gint row, gint column, gint embedding_level, gdouble x, gdouble y, gdouble rotation, gdouble scale, gint demo_item_type) { GooCanvasItem *table; /* Add a few simple items. */ table = goo_canvas_table_new (parent, "row-spacing", 4.0, "column-spacing", 4.0, NULL); goo_canvas_item_translate (table, x, y); #if 1 goo_canvas_item_rotate (table, rotation, 0, 0); #endif #if 1 goo_canvas_item_scale (table, scale, scale); #endif if (row != -1) goo_canvas_item_set_child_properties (parent, table, "row", row, "column", column, #if 1 "x-expand", TRUE, "x-fill", TRUE, #endif #if 0 "y-expand", TRUE, "y-fill", TRUE, #endif NULL); if (embedding_level) { gint level = embedding_level - 1; create_table (table, 0, 0, level, 50, 50, 0, 0.7, demo_item_type); create_table (table, 0, 1, level, 50, 50, 45, 1.0, demo_item_type); create_table (table, 0, 2, level, 50, 50, 90, 1.0, demo_item_type); create_table (table, 1, 0, level, 50, 50, 135, 1.0, demo_item_type); create_table (table, 1, 1, level, 50, 50, 180, 1.5, demo_item_type); create_table (table, 1, 2, level, 50, 50, 225, 1.0, demo_item_type); create_table (table, 2, 0, level, 50, 50, 270, 1.0, demo_item_type); create_table (table, 2, 1, level, 50, 50, 315, 1.0, demo_item_type); create_table (table, 2, 2, level, 50, 50, 360, 2.0, demo_item_type); } else { create_demo_item (table, demo_item_type, 0, 0, 1, 1, "(0,0)"); create_demo_item (table, demo_item_type, 0, 1, 1, 1, "(1,0)"); create_demo_item (table, demo_item_type, 0, 2, 1, 1, "(2,0)"); create_demo_item (table, demo_item_type, 1, 0, 1, 1, "(0,1)"); create_demo_item (table, demo_item_type, 1, 1, 1, 1, "(1,1)"); create_demo_item (table, demo_item_type, 1, 2, 1, 1, "(2,1)"); create_demo_item (table, demo_item_type, 2, 0, 1, 1, "(0,2)"); create_demo_item (table, demo_item_type, 2, 1, 1, 1, "(1,2)"); create_demo_item (table, demo_item_type, 2, 2, 1, 1, "(2,2)"); } return table; } static void create_demo_table (GooCanvasItem *root, gdouble x, gdouble y, gdouble width, gdouble height) { GooCanvasItem *table, *square, *circle, *triangle; table = goo_canvas_table_new (root, "row-spacing", 4.0, "column-spacing", 4.0, "width", width, "height", height, NULL); goo_canvas_item_translate (table, x, y); square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, square, "row", 0, "column", 0, "x-shrink", TRUE, NULL); g_object_set_data (G_OBJECT (square), "id", "Red square"); g_signal_connect (square, "button_press_event", G_CALLBACK (on_button_press), NULL); circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0, "fill-color", "blue", NULL); goo_canvas_item_set_child_properties (table, circle, "row", 0, "column", 1, "x-shrink", TRUE, NULL); g_object_set_data (G_OBJECT (circle), "id", "Blue circle"); g_signal_connect (circle, "button_press_event", G_CALLBACK (on_button_press), NULL); triangle = goo_canvas_polyline_new (table, TRUE, 3, 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, "fill-color", "yellow", NULL); goo_canvas_item_set_child_properties (table, triangle, "row", 0, "column", 2, "x-shrink", TRUE, NULL); g_object_set_data (G_OBJECT (triangle), "id", "Yellow triangle"); g_signal_connect (triangle, "button_press_event", G_CALLBACK (on_button_press), NULL); } static void create_width_for_height_table (GooCanvasItem *root, gdouble x, gdouble y, gdouble width, gdouble height, gdouble rotation) { GooCanvasItem *table, *item; gchar *text = "This is a long paragraph that will have to be split over a few lines so we can see if its allocated height changes when its allocated width is changed."; table = goo_canvas_table_new (root, #if 1 "width", width, "height", height, #endif NULL); goo_canvas_item_translate (table, x, y); goo_canvas_item_rotate (table, rotation, 0, 0); item = goo_canvas_rect_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, item, "row", 0, "column", 0, "x-shrink", TRUE, NULL); #if 1 item = goo_canvas_text_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); goo_canvas_item_set_child_properties (table, item, "row", 1, "column", 0, "x-expand", TRUE, "x-fill", TRUE, "x-shrink", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", "Text Item"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); #endif item = goo_canvas_rect_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, item, "row", 2, "column", 0, "x-shrink", TRUE, NULL); } GtkWidget * create_table_page (void) { GtkWidget *vbox, *scrolled_win, *canvas; GooCanvasItem *root, *table; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 2000); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); #if 1 create_demo_table (root, 400, 200, -1, -1); create_demo_table (root, 400, 260, 100, -1); #endif #if 1 create_table (root, -1, -1, 0, 10, 10, 0, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 180, 10, 30, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 350, 10, 60, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 500, 10, 90, 1.0, DEMO_TEXT_ITEM); #endif #if 1 table = create_table (root, -1, -1, 0, 30, 150, 0, 1.0, DEMO_TEXT_ITEM); g_object_set (table, "width", 300.0, "height", 100.0, NULL); #endif #if 1 create_table (root, -1, -1, 1, 200, 200, 30, 0.8, DEMO_TEXT_ITEM); #endif #if 1 table = create_table (root, -1, -1, 0, 10, 700, 0, 1.0, DEMO_WIDGET_ITEM); g_object_set (table, "width", 300.0, "height", 200.0, NULL); #endif create_width_for_height_table (root, 100, 1000, 200, -1, 0); #if 1 create_width_for_height_table (root, 100, 1200, 300, -1, 0); create_width_for_height_table (root, 500, 1000, 200, -1, 30); create_width_for_height_table (root, 500, 1200, 300, -1, 30); #endif gtk_widget_show (canvas); return vbox; } goocanvas-1.0.0/demo/mv-demo-grabs.c0000644000076400007640000002731211412723611014154 00000000000000#include #include #include #include static gboolean on_widget_expose (GtkWidget *widget, GdkEventExpose *event, char *item_id) { g_print ("%s received 'expose' signal\n", item_id); gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_IN, &event->area, widget, NULL, 0, 0, widget->allocation.width, widget->allocation.height); return FALSE; } static gboolean on_widget_enter_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'enter-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'leave-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_motion_notify (GtkWidget *widget, GdkEventMotion *event, char *item_id) { g_print ("%s received 'motion-notify' signal (window: %p)\n", item_id, event->window); if (event->is_hint) gdk_window_get_pointer (event->window, NULL, NULL, NULL); return TRUE; } static gboolean on_widget_button_press (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; status = gdk_pointer_grab (widget->window, FALSE, mask, FALSE, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return TRUE; } static gboolean on_widget_button_release (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkDisplay *display; display = gtk_widget_get_display (widget); gdk_display_pointer_ungrab (display, event->time); g_print ("released pointer grab\n"); } return TRUE; } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'enter-notify' signal\n", item_id); return FALSE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'leave-notify' signal\n", item_id); return FALSE; } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'motion-notify' signal\n", item_id); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; canvas = goo_canvas_item_get_canvas (item); status = goo_canvas_pointer_grab (canvas, item, mask, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return FALSE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); g_print ("released pointer grab\n"); } return FALSE; } static void create_fixed (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *fixed, *drawing_area; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); fixed = gtk_fixed_new (); gtk_fixed_set_has_window (GTK_FIXED (fixed), TRUE); gtk_widget_set_events (fixed, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (fixed, 200, 100); gtk_table_attach (GTK_TABLE (table), fixed, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (fixed); view_id = g_strdup_printf ("%s-background", id); g_signal_connect (fixed, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (fixed, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (fixed, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (fixed, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (fixed, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (fixed, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 20, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-left", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 120, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-right", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (GOO_IS_CANVAS_RECT (model)) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } } static void create_canvas (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *canvas; GooCanvasItemModel *root, *rect; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); gtk_widget_set_size_request (canvas, 200, 100); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 200, 100); gtk_table_attach (table, canvas, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (canvas); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); rect = goo_canvas_rect_model_new (root, 0, 0, 200, 100, "stroke-pattern", NULL, "fill-color", "yellow", NULL); view_id = g_strdup_printf ("%s-yellow", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); rect = goo_canvas_rect_model_new (root, 20, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "blue", NULL); view_id = g_strdup_printf ("%s-blue", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); rect = goo_canvas_rect_model_new (root, 120, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "red", NULL); view_id = g_strdup_printf ("%s-red", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); } GtkWidget * create_grabs_page (void) { GtkWidget *table, *label; table = gtk_table_new (5, 2, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 12); gtk_table_set_row_spacings (GTK_TABLE (table), 12); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_widget_show (table); label = gtk_label_new ("Move the mouse over the widgets and canvas items on the right to see what events they receive.\nClick buttons to start explicit or implicit pointer grabs and see what events they receive now.\n(They should all receive the same events.)"); gtk_table_attach (GTK_TABLE (table), label, 0, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (label); /* Drawing area with explicit grabs. */ create_fixed (GTK_TABLE (table), 1, "Widget with Explicit Grabs:", "widget-explicit"); /* Drawing area with implicit grabs. */ create_fixed (GTK_TABLE (table), 2, "Widget with Implicit Grabs:", "widget-implicit"); /* Canvas with explicit grabs. */ create_canvas (GTK_TABLE (table), 3, "Canvas with Explicit Grabs:", "canvas-explicit"); /* Canvas with implicit grabs. */ create_canvas (GTK_TABLE (table), 4, "Canvas with Implicit Grabs:", "canvas-implicit"); return table; } goocanvas-1.0.0/demo/mv-demo-fifteen.c0000644000076400007640000001637411412723611014504 00000000000000#include #include #include #include #include #include #include #include #define PIECE_SIZE 50 static void free_stuff (GtkObject *obj, gpointer data) { g_free (data); } static void test_win (GooCanvasItemModel **board) { int i; #if 0 GtkWidget *dlg; #endif for (i = 0; i < 15; i++) if (!board[i] || (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (board[i]), "piece_num")) != i)) return; #if 0 dlg=gnome_ok_dialog ("You stud, you win!"); gtk_window_set_modal(GTK_WINDOW(dlg),TRUE); gnome_dialog_run (GNOME_DIALOG (dlg)); #endif } static char * get_piece_color (int piece) { static char buf[50]; int x, y; int r, g, b; y = piece / 4; x = piece % 4; r = ((4 - x) * 255) / 4; g = ((4 - y) * 255) / 4; b = 128; sprintf (buf, "#%02x%02x%02x", r, g, b); return buf; } static gboolean piece_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model, *text; #if 0 g_print ("In piece_enter_notify\n"); #endif model = goo_canvas_item_get_model (item); text = g_object_get_data (G_OBJECT (model), "text"); g_object_set (text, "fill_color", "white", NULL); return FALSE; } static gboolean piece_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { GooCanvasItemModel *model, *text; #if 0 g_print ("In piece_leave_notify\n"); #endif model = goo_canvas_item_get_model (item); text = g_object_get_data (G_OBJECT (model), "text"); g_object_set (text, "fill_color", "black", NULL); return FALSE; } static gboolean piece_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GooCanvasItemModel **board; GooCanvasItemModel *model, *text; int num, pos, newpos; int x, y; double dx = 0.0, dy = 0.0; int move; model = goo_canvas_item_get_model (item); canvas = goo_canvas_item_get_canvas (item); board = g_object_get_data (G_OBJECT (canvas), "board"); num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (model), "piece_num")); pos = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (model), "piece_pos")); text = g_object_get_data (G_OBJECT (model), "text"); #if 0 g_print ("In piece_event pos: %i,%i num: %i\n", pos % 4, pos / 4, num + 1); #endif y = pos / 4; x = pos % 4; move = TRUE; if ((y > 0) && (board[(y - 1) * 4 + x] == NULL)) { dx = 0.0; dy = -1.0; y--; } else if ((y < 3) && (board[(y + 1) * 4 + x] == NULL)) { dx = 0.0; dy = 1.0; y++; } else if ((x > 0) && (board[y * 4 + x - 1] == NULL)) { dx = -1.0; dy = 0.0; x--; } else if ((x < 3) && (board[y * 4 + x + 1] == NULL)) { dx = 1.0; dy = 0.0; x++; } else move = FALSE; if (move) { newpos = y * 4 + x; board[pos] = NULL; board[newpos] = model; g_object_set_data (G_OBJECT (model), "piece_pos", GINT_TO_POINTER (newpos)); goo_canvas_item_model_translate (model, dx * PIECE_SIZE, dy * PIECE_SIZE); test_win (board); } return FALSE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (goo_canvas_item_model_get_parent (model) && GOO_IS_CANVAS_GROUP_MODEL (model)) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (piece_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (piece_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (piece_button_press), NULL); } } #define SCRAMBLE_MOVES 256 static void scramble (GtkObject *object, gpointer data) { GooCanvas *canvas; GooCanvasItemModel **board; int i; int pos, oldpos; int dir; int x, y; srand (time (NULL)); canvas = data; board = g_object_get_data (G_OBJECT (canvas), "board"); /* First, find the blank spot */ for (pos = 0; pos < 16; pos++) if (board[pos] == NULL) break; /* "Move the blank spot" around in order to scramble the pieces */ for (i = 0; i < SCRAMBLE_MOVES; i++) { retry_scramble: dir = rand () % 4; x = y = 0; if ((dir == 0) && (pos > 3)) /* up */ y = -1; else if ((dir == 1) && (pos < 12)) /* down */ y = 1; else if ((dir == 2) && ((pos % 4) != 0)) /* left */ x = -1; else if ((dir == 3) && ((pos % 4) != 3)) /* right */ x = 1; else goto retry_scramble; oldpos = pos + y * 4 + x; board[pos] = board[oldpos]; board[oldpos] = NULL; g_object_set_data (G_OBJECT (board[pos]), "piece_pos", GINT_TO_POINTER (pos)); goo_canvas_item_model_translate (board[pos], -x * PIECE_SIZE, -y * PIECE_SIZE); pos = oldpos; } } GtkWidget * create_canvas_fifteen (void) { GtkWidget *vbox; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GtkWidget *button; GooCanvasItemModel **board; GooCanvasItemModel *root, *rect, *text; int i, x, y; char buf[20]; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, TRUE, TRUE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); /* Create the canvas and board */ canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); gtk_widget_set_size_request (canvas, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); board = g_new (GooCanvasItemModel *, 16); g_object_set_data (G_OBJECT (canvas), "board", board); g_signal_connect (canvas, "destroy", G_CALLBACK (free_stuff), board); for (i = 0; i < 15; i++) { y = i / 4; x = i % 4; board[i] = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (board[i], x * PIECE_SIZE, y * PIECE_SIZE); rect = goo_canvas_rect_model_new (board[i], 0, 0, PIECE_SIZE, PIECE_SIZE, "fill_color", get_piece_color (i), "stroke_color", "black", "line-width", 1.0, NULL); sprintf (buf, "%d", i + 1); text = goo_canvas_text_model_new (board[i], buf, PIECE_SIZE / 2.0, PIECE_SIZE / 2.0, -1, GTK_ANCHOR_CENTER, "font", "Sans bold 24", "fill_color", "black", NULL); g_object_set_data (G_OBJECT (board[i]), "text", text); g_object_set_data (G_OBJECT (board[i]), "piece_num", GINT_TO_POINTER (i)); g_object_set_data (G_OBJECT (board[i]), "piece_pos", GINT_TO_POINTER (i)); } board[15] = NULL; /* Scramble button */ button = gtk_button_new_with_label ("Scramble"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); g_object_set_data (G_OBJECT (button), "board", board); g_signal_connect (button, "clicked", G_CALLBACK (scramble), canvas); gtk_widget_show (button); return vbox; } goocanvas-1.0.0/demo/widgets-demo.c0000644000076400007640000002652411412723611014110 00000000000000#include #include GtkWidget *canvas; GooCanvasItem *move_item; int num_added_widgets = 0; GList *added_widget_items; static void add_widget_clicked (GtkWidget *button, gpointer data) { GooCanvasItem *root, *witem; GtkWidget *widget; if (num_added_widgets % 2) widget = gtk_label_new ("Hello World"); else widget = gtk_entry_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); witem = goo_canvas_widget_new (root, widget, num_added_widgets * 50, num_added_widgets * 50, 200, 50, NULL); added_widget_items = g_list_prepend (added_widget_items, witem); num_added_widgets++; } static void remove_widget_clicked (GtkWidget *button, gpointer data) { GooCanvasItem *witem; if (!added_widget_items) return; witem = added_widget_items->data; goo_canvas_item_remove (witem); added_widget_items = g_list_delete_link (added_widget_items, added_widget_items); num_added_widgets--; } static void move_widget_clicked (GtkWidget *button, gpointer data) { static gint move_index = 0; static gdouble moves[][4] = { { 50, 50, -1, -1 }, { 300, 100, -1, -1 }, { 200, 200, -1, -1 }, { 400, 100, -1, -1 }, }; g_object_set (move_item, "x", moves[move_index][0], "y", moves[move_index][1], "width", moves[move_index][2], "height", moves[move_index][3], NULL); move_index = (move_index + 1) % 4; } static void change_anchor_clicked (GtkWidget *button, gpointer data) { static GtkAnchorType anchor = GTK_ANCHOR_CENTER; g_print ("Setting anchor to: %i\n", anchor); g_object_set (move_item, "anchor", anchor, NULL); anchor++; if (anchor > GTK_ANCHOR_EAST) anchor = GTK_ANCHOR_CENTER; } static void change_widget_clicked (GtkWidget *button, gpointer data) { GooCanvasItem *witem; GtkWidget *old_widget, *widget; if (!added_widget_items) return; witem = added_widget_items->data; g_object_get (witem, "widget", &old_widget, NULL); if (GTK_IS_ENTRY (old_widget)) widget = gtk_label_new ("Hello World"); else widget = gtk_entry_new (); g_object_set (witem, "widget", widget, NULL); } static void hide_item_clicked (GtkWidget *button, gpointer data) { g_object_set (move_item, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); } static void show_item_clicked (GtkWidget *button, gpointer data) { g_object_set (move_item, "visibility", GOO_CANVAS_ITEM_VISIBLE, NULL); } static void hide_canvas_clicked (GtkWidget *button, gpointer data) { gtk_widget_hide (canvas); } static void show_canvas_clicked (GtkWidget *button, gpointer data) { gtk_widget_show (canvas); } static void change_transform_clicked (GtkWidget *button, gpointer data) { goo_canvas_item_translate (move_item, 25.0, 25.0); } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } static gboolean on_focus_in (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-in event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-color", "black", NULL); return FALSE; } static gboolean on_focus_out (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-out event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-pattern", NULL, NULL); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received button-press event\n", id ? id : "unknown"); canvas = goo_canvas_item_get_canvas (item); goo_canvas_grab_focus (canvas, item); return TRUE; } static gboolean on_key_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received key-press event\n", id ? id : "unknown"); return FALSE; } static void create_focus_box (GtkWidget *canvas, gdouble x, gdouble y, gdouble width, gdouble height, gchar *color) { GooCanvasItem *root, *item; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); item = goo_canvas_rect_new (root, x, y, width, height, "stroke-pattern", NULL, "fill-color", color, "line-width", 5.0, "can-focus", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", color); g_signal_connect (item, "focus_in_event", G_CALLBACK (on_focus_in), NULL); g_signal_connect (item, "focus_out_event", G_CALLBACK (on_focus_out), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "key_press_event", G_CALLBACK (on_key_press), NULL); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *hbox, *w, *scrolled_win; GtkWidget *label, *entry, *textview; GtkTextBuffer *buffer; GooCanvasItem *root, *witem; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label ("Add Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (add_widget_clicked), NULL); w = gtk_button_new_with_label ("Remove Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (remove_widget_clicked), NULL); w = gtk_button_new_with_label ("Move Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_widget_clicked), NULL); w = gtk_button_new_with_label ("Change Anchor"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_anchor_clicked), NULL); w = gtk_button_new_with_label ("Change Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_widget_clicked), NULL); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label ("Hide Canvas"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (hide_canvas_clicked), NULL); w = gtk_button_new_with_label ("Show Canvas"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (show_canvas_clicked), NULL); w = gtk_button_new_with_label ("Hide Item"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (hide_item_clicked), NULL); w = gtk_button_new_with_label ("Show Item"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (show_item_clicked), NULL); w = gtk_button_new_with_label ("Change Transform"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_transform_clicked), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ label = gtk_label_new ("Hello World"); witem = goo_canvas_widget_new (root, label, 50, 50, 200, 100, NULL); g_object_set_data (G_OBJECT (witem), "id", "hello"); entry = gtk_entry_new (); move_item = goo_canvas_widget_new (root, entry, 50, 250, 200, 50, NULL); g_object_set_data (G_OBJECT (move_item), "id", "entry1"); entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), "Size: -1 x -1"); witem = goo_canvas_widget_new (root, entry, 50, 300, -1, -1, NULL); g_object_set_data (G_OBJECT (witem), "id", "entry2"); entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), "Size: 100 x -1"); witem = goo_canvas_widget_new (root, entry, 50, 350, 100, -1, NULL); g_object_set_data (G_OBJECT (witem), "id", "entry3"); /* Use a textview so we can see the width & height of the widget. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_NEVER, GTK_POLICY_NEVER); textview = gtk_text_view_new (); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)); gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer), "Size: -1 x 100", -1); gtk_widget_show (textview); gtk_container_add (GTK_CONTAINER (scrolled_win), textview); gtk_widget_set_size_request (scrolled_win, 160, 50); witem = goo_canvas_widget_new (root, scrolled_win, 50, 400, -1, 100, NULL); g_object_set_data (G_OBJECT (witem), "id", "scrolledwin"); /* Create a vbox item with several child entry widgets to check focus traversal.*/ vbox = gtk_vbox_new (FALSE, 4); entry = gtk_entry_new (); gtk_widget_show (entry); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); entry = gtk_entry_new (); gtk_widget_show (entry); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); entry = gtk_entry_new (); gtk_widget_show (entry); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); witem = goo_canvas_widget_new (root, vbox, 50, 600, -1, -1, NULL); g_object_set_data (G_OBJECT (witem), "id", "vbox"); /* Create a few normal canvas items that take keyboard focus. */ create_focus_box (canvas, 110, 80, 50, 30, "red"); create_focus_box (canvas, 300, 160, 50, 30, "orange"); create_focus_box (canvas, 500, 50, 50, 30, "yellow"); gtk_widget_show (canvas); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } goocanvas-1.0.0/demo/mv-table-demo.c0000644000076400007640000002073011412723611014142 00000000000000#include #include static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } static GooCanvasItemModel* create_item (GooCanvasItemModel *table, gdouble width, gdouble height, gint row, gint column, gint rows, gint columns, gboolean x_expand, gboolean x_shrink, gboolean x_fill, gboolean y_expand, gboolean y_shrink, gboolean y_fill) { GooCanvasItemModel *model; model = goo_canvas_rect_model_new (table, 0, 0, width, height, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, model, "row", row, "column", column, "rows", rows, "columns", columns, "x-expand", x_expand, "x-fill", x_fill, "x-shrink", x_shrink, "y-expand", y_expand, "y-fill", y_fill, "y-shrink", y_shrink, NULL); return model; } void create_table1 (GtkWidget *canvas, GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItemModel *table, *items[9]; GooCanvasItem *item; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_model_new (parent, "width", width, "height", height, NULL); goo_canvas_item_model_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 1, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 1, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 2, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { item = goo_canvas_get_item (GOO_CANVAS (canvas), items[i]); goo_canvas_item_get_bounds (item, &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } /* Creates a table with items spanning multiple cells */ void create_table2 (GtkWidget *canvas, GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItemModel *table, *items[9]; GooCanvasItem *item; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_model_new (parent, "width", width, "height", height, NULL); goo_canvas_item_model_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 2, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 3, 2, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 3, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 3, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 3, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 3, 2, 1, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { item = goo_canvas_get_item (GOO_CANVAS (canvas), items[i]); goo_canvas_item_get_bounds (item, &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } void setup_canvas (GtkWidget *canvas) { GooCanvasItemModel *root; root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_print ("\nTable at default size...\n"); create_table1 (canvas, root, 50, 50, -1, -1, FALSE); g_print ("\nTable at reduced size...\n"); create_table1 (canvas, root, 250, 50, 30, 30, FALSE); g_print ("\nTable at enlarged size...\n"); create_table1 (canvas, root, 450, 50, 100, 100, FALSE); g_print ("\nTable with grid lines at default size...\n"); create_table1 (canvas, root, 50, 250, -1, -1, TRUE); g_print ("\nTable with grid lines at reduced size...\n"); create_table1 (canvas, root, 250, 250, 30, 30, TRUE); g_print ("\nTable with grid lines at enlarged size...\n"); create_table1 (canvas, root, 450, 250, 150, 150, TRUE); g_print ("Multispanning table with grid lines at default size...\n"); create_table2 (canvas, root, 50, 450, -1, -1, TRUE); g_print ("Multispanning table with grid lines at reduced size...\n"); create_table2 (canvas, root, 250, 450, 30, 30, TRUE); g_print ("Multispanning table with grid lines at enlarged size...\n"); create_table2 (canvas, root, 450, 450, 150, 150, TRUE); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Normal Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nNormal Canvas...\n"); setup_canvas (canvas); label = gtk_label_new ("Integer Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create bottom canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); g_object_set (canvas, "integer-layout", TRUE, NULL); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nInteger Layout Canvas...\n"); setup_canvas (canvas); gtk_main (); return 0; } goocanvas-1.0.0/demo/demo-paths.c0000644000076400007640000001157011412723611013554 00000000000000#include #include #include #include static GooCanvasItem *path1; static gboolean on_background_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GList *items, *elem; g_print ("Button Press Item: %p\n", target); canvas = goo_canvas_item_get_canvas (item); items = goo_canvas_get_items_at (canvas, event->x_root, event->y_root, FALSE); for (elem = items; elem; elem = elem->next) g_print (" clicked items: %p\n", elem->data); g_list_free (items); return TRUE; } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root, *path; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_signal_connect (root, "button_press_event", G_CALLBACK (on_background_button_press), NULL); /* Test the simple commands like moveto and lineto: MmZzLlHhVv. */ path1 = goo_canvas_path_new (root, "M 20 20 L 40 40", NULL); path = goo_canvas_path_new (root, "M30 20 l20, 20", NULL); path = goo_canvas_path_new (root, "M 60 20 H 80", NULL); path = goo_canvas_path_new (root, "M60 40 h20", NULL); path = goo_canvas_path_new (root, "M 100,20 V 40", NULL); path = goo_canvas_path_new (root, "M 120 20 v 20", NULL); path = goo_canvas_path_new (root, "M 140 20 h20 v20 h-20 z", NULL); path = goo_canvas_path_new (root, "M 180 20 h20 v20 h-20 z m 5,5 h10 v10 h-10 z", "fill-color", "red", "fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); path = goo_canvas_path_new (root, "M 220 20 L 260 20 L 240 40 z", "fill-color", "red", "stroke-color", "blue", "line-width", 3.0, NULL); /* Test the bezier curve commands: CcSsQqTt. */ path = goo_canvas_path_new (root, "M20,100 C20,50 100,50 100,100 S180,150 180,100", NULL); path = goo_canvas_path_new (root, "M220,100 c0,-50 80,-50 80,0 s80,50 80,0", NULL); path = goo_canvas_path_new (root, "M20,200 Q60,130 100,200 T180,200", NULL); path = goo_canvas_path_new (root, "M220,200 q40,-70 80,0 t80,0", NULL); /* Test the elliptical arc commands: Aa. */ path = goo_canvas_path_new (root, "M200,500 h-150 a150,150 0 1,0 150,-150 z", "fill-color", "red", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M175,475 v-150 a150,150 0 0,0 -150,150 z", "fill-color", "yellow", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M400,600 l 50,-25 " "a25,25 -30 0,1 50,-25 l 50,-25 " "a25,50 -30 0,1 50,-25 l 50,-25 " "a25,75 -30 0,1 50,-25 l 50,-25 " "a25,100 -30 0,1 50,-25 l 50,-25", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 525,75 a100,50 0 0,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 725,75 a100,50 0 0,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 525,200 a100,50 0 1,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 725,200 a100,50 0 1,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); } static void move_path_clicked (GtkWidget *button, GooCanvas *canvas) { static gint count = 0; gchar *data; if (count == 0) data = "M130,70 L317,70"; else if (count == 1) data = "M130,170 L317,170"; else data = "M130,270 L317,270"; g_object_set (path1, "data", data, NULL); count = (count + 1) % 3; } GtkWidget * create_paths_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); w = gtk_button_new_with_label ("Move Path"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_path_clicked), canvas); return vbox; } goocanvas-1.0.0/demo/demo-features.c0000644000076400007640000000670411412723611014256 00000000000000#include #include #include #include #include #include #include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItem *parent1, *parent2, *parent; if (event->button != 1 || event->type != GDK_BUTTON_PRESS) return FALSE; g_print ("In on_button_press\n"); parent1 = g_object_get_data (G_OBJECT (item), "parent1"); parent2 = g_object_get_data (G_OBJECT (item), "parent2"); parent = goo_canvas_item_get_parent (item); g_object_ref (item); goo_canvas_item_remove (item); if (parent == parent1) goo_canvas_item_add_child (parent2, item, -1); else goo_canvas_item_add_child (parent1, item, -1); g_object_unref (item); return TRUE; } GtkWidget * create_canvas_features (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GooCanvasItem *root, *item; GooCanvasItem *parent1; GooCanvasItem *parent2; GooCanvasItem *group; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ w = gtk_label_new ("Reparent test: click on the items to switch them between parents"); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, 400, 200); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 400, 200); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); /* First parent and box */ parent1 = goo_canvas_group_new (root, NULL); goo_canvas_rect_new (parent1, 0, 0, 200, 200, "fill_color", "tan", NULL); /* Second parent and box */ parent2 = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (parent2, 200, 0); goo_canvas_rect_new (parent2, 0, 0, 200, 200, "fill_color", "#204060", NULL); /* Big circle to be reparented */ item = goo_canvas_ellipse_new (parent1, 100, 100, 90, 90, "stroke_color", "black", "fill_color", "mediumseagreen", "line-width", 3.0, NULL); g_object_set_data (G_OBJECT (item), "parent1", parent1); g_object_set_data (G_OBJECT (item), "parent2", parent2); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); /* A group to be reparented */ group = goo_canvas_group_new (parent2, NULL); goo_canvas_item_translate (group, 100, 100); goo_canvas_ellipse_new (group, 0, 0, 50, 50, "stroke_color", "black", "fill_color", "wheat", "line_width", 3.0, NULL); goo_canvas_ellipse_new (group, 0, 0, 25, 25, "fill_color", "steelblue", NULL); g_object_set_data (G_OBJECT (group), "parent1", parent1); g_object_set_data (G_OBJECT (group), "parent2", parent2); g_signal_connect (group, "button_press_event", G_CALLBACK (on_button_press), NULL); return vbox; } goocanvas-1.0.0/demo/mv-demo-paths.c0000644000076400007640000001075311412723611014176 00000000000000#include #include #include #include static GooCanvasItemModel *path1; static GooCanvasItemModel* create_canvas_model (void) { GooCanvasItemModel *root, *path; root = goo_canvas_group_model_new (NULL, NULL); /* Test the simple commands like moveto and lineto: MmZzLlHhVv. */ path1 = goo_canvas_path_model_new (root, "M 20 20 L 40 40", NULL); path = goo_canvas_path_model_new (root, "M30 20 l20, 20", NULL); path = goo_canvas_path_model_new (root, "M 60 20 H 80", NULL); path = goo_canvas_path_model_new (root, "M60 40 h20", NULL); path = goo_canvas_path_model_new (root, "M 100,20 V 40", NULL); path = goo_canvas_path_model_new (root, "M 120 20 v 20", NULL); path = goo_canvas_path_model_new (root, "M 140 20 h20 v20 h-20 z", NULL); path = goo_canvas_path_model_new (root, "M 180 20 h20 v20 h-20 z m 5,5 h10 v10 h-10 z", "fill-color", "red", "fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); path = goo_canvas_path_model_new (root, "M 220 20 L 260 20 L 240 40 z", "fill-color", "red", "stroke-color", "blue", "line-width", 3.0, NULL); /* Test the bezier curve commands: CcSsQqTt. */ path = goo_canvas_path_model_new (root, "M20,100 C20,50 100,50 100,100 S180,150 180,100", NULL); path = goo_canvas_path_model_new (root, "M220,100 c0,-50 80,-50 80,0 s80,50 80,0", NULL); path = goo_canvas_path_model_new (root, "M20,200 Q60,130 100,200 T180,200", NULL); path = goo_canvas_path_model_new (root, "M220,200 q40,-70 80,0 t80,0", NULL); /* Test the elliptical arc commands: Aa. */ path = goo_canvas_path_model_new (root, "M200,500 h-150 a150,150 0 1,0 150,-150 z", "fill-color", "red", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M175,475 v-150 a150,150 0 0,0 -150,150 z", "fill-color", "yellow", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M400,600 l 50,-25 " "a25,25 -30 0,1 50,-25 l 50,-25 " "a25,50 -30 0,1 50,-25 l 50,-25 " "a25,75 -30 0,1 50,-25 l 50,-25 " "a25,100 -30 0,1 50,-25 l 50,-25", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 525,75 a100,50 0 0,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 725,75 a100,50 0 0,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 525,200 a100,50 0 1,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 725,200 a100,50 0 1,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); return root; } static void move_path_clicked (GtkWidget *button, GooCanvas *canvas) { static gint count = 0; gchar *data; if (count == 0) data = "M130,70 L317,70"; else if (count == 1) data = "M130,170 L317,170"; else data = "M130,270 L317,270"; g_object_set (path1, "data", data, NULL); count = (count + 1) % 3; } GtkWidget * create_paths_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GooCanvasItemModel *root; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = create_canvas_model (); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); w = gtk_button_new_with_label ("Move Path"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_path_clicked), canvas); return vbox; } goocanvas-1.0.0/demo/demo-large-rect.c0000644000076400007640000001454411412723611014466 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-rect.c - a demo item that exceeds the cairo 16-bit size limit. * Note that it doesn't support rotations or shears. */ #include #include "goocanvas.h" #include "demo-large-rect.h" /* Use the GLib convenience macro to define the type. GooDemoLargeRect is the class struct, goo_demo_large_rect is the function prefix, and our class is a subclass of GOO_TYPE_CANVAS_ITEM_SIMPLE. */ G_DEFINE_TYPE (GooDemoLargeRect, goo_demo_large_rect, GOO_TYPE_CANVAS_ITEM_SIMPLE) /* The standard object initialization function. */ static void goo_demo_large_rect_init (GooDemoLargeRect *demo_large_rect) { demo_large_rect->x = 0.0; demo_large_rect->y = 0.0; demo_large_rect->width = 0.0; demo_large_rect->height = 0.0; } /* The convenience function to create new items. This should start with a parent argument and end with a variable list of object properties to fit in with the standard canvas items. */ GooCanvasItem* goo_demo_large_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooDemoLargeRect *demo_large_rect; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_DEMO_LARGE_RECT, NULL); demo_large_rect = (GooDemoLargeRect*) item; demo_large_rect->x = x; demo_large_rect->y = y; demo_large_rect->width = width; demo_large_rect->height = height; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* The update method. This is called when the canvas is initially shown and also whenever the object is updated and needs to change its size and/or shape. It should calculate its new bounds in its own coordinate space, storing them in simple->bounds. */ static void goo_demo_large_rect_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoLargeRect *item = (GooDemoLargeRect*) simple; gdouble half_line_width; /* We can quickly compute the bounds as being just the rectangle's size plus half the line width around each edge. */ half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; simple->bounds.x1 = item->x - half_line_width; simple->bounds.y1 = item->y - half_line_width; simple->bounds.x2 = item->x + item->width + half_line_width; simple->bounds.y2 = item->y + item->height + half_line_width; } static void create_large_rect_path (GooDemoLargeRect *rect, cairo_t *cr, const GooCanvasBounds *bounds, gdouble line_width, gdouble x, gdouble y, gdouble width, gdouble height) { GooCanvasItem *item = (GooCanvasItem*) rect; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) rect; GooCanvas *canvas = simple->canvas; GooCanvasBounds tmp_bounds = *bounds; gdouble x1 = x, y1 = y, x2 = x + width, y2 = y + height; /* Transform the coordinates to the canvas device space, so we can clamp the line to the bounds to be painted. */ goo_canvas_convert_from_item_space (canvas, item, &x1, &y1); goo_canvas_convert_from_item_space (canvas, item, &x2, &y2); /* Extend the bounds a bit to account for the line width, so when we clamp the rect to the bounds the outside edges aren't visible. */ tmp_bounds.x1 -= line_width; tmp_bounds.y1 -= line_width; tmp_bounds.x2 += line_width; tmp_bounds.y2 += line_width; /* If the rect is completely outside the bounds just return. */ if (x1 > tmp_bounds.x2 || x2 < tmp_bounds.x1 || y1 > tmp_bounds.y2 || y2 < tmp_bounds.y1) return; /* Clamp the rect to the bounds. */ if (x1 < tmp_bounds.x1) x1 = tmp_bounds.x1; if (x2 > tmp_bounds.x2) x2 = tmp_bounds.x2; if (y1 < tmp_bounds.y1) y1 = tmp_bounds.y1; if (y2 > tmp_bounds.y2) y2 = tmp_bounds.y2; /* Convert back to item space. */ goo_canvas_convert_to_item_space (canvas, item, &x1, &y1); goo_canvas_convert_to_item_space (canvas, item, &x2, &y2); /* Create the path. */ cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y1); cairo_line_to (cr, x2, y2); cairo_line_to (cr, x1, y2); cairo_close_path (cr); } /* The paint method. This should draw the item on the given cairo_t, using the item's own coordinate space. */ static void goo_demo_large_rect_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoLargeRect *item = (GooDemoLargeRect*) simple; gdouble line_width; line_width = goo_canvas_item_simple_get_line_width (simple); create_large_rect_path (item, cr, bounds, line_width, item->x, item->y, item->width, item->height); goo_canvas_item_simple_paint_path (simple, cr); } /* Hit detection. This should check if the given coordinate (in the item's coordinate space) is within the item. If it is it should return TRUE, otherwise it should return FALSE. */ static gboolean goo_demo_large_rect_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooDemoLargeRect *item = (GooDemoLargeRect*) simple; gdouble half_line_width; /* We assume the item covers its rectangle + line widths. */ half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; if ((x < item->x - half_line_width) || (x > item->x + item->width + half_line_width) || (y < item->y - half_line_width) || (y > item->y + item->height + half_line_width)) return FALSE; return TRUE; } /* The class initialization function. Here we set the class' update(), paint() and is_item_at() methods. */ static void goo_demo_large_rect_class_init (GooDemoLargeRectClass *klass) { GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; simple_class->simple_update = goo_demo_large_rect_update; simple_class->simple_paint = goo_demo_large_rect_paint; simple_class->simple_is_item_at = goo_demo_large_rect_is_item_at; } goocanvas-1.0.0/demo/units-demo.c0000644000076400007640000001157411512447276013616 00000000000000#include #include cairo_pattern_t *flower_pattern; gdouble flower_width, flower_height; static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { gchar *id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s item received 'motion-notify' signal\n", id ? id : "Unknown"); return FALSE; } static void setup_canvas (GtkWidget *canvas, GtkUnit units, gchar *units_name) { GooCanvasItem *root, *item; gchar buffer[256], font_desc[64]; double *d; double data[4][12] = { /* Pixels */ { 100, 100, 200, 20, 10, 200, 310, 24, 310, 100, 20, 20 }, /* Points */ { 100, 100, 200, 20, 10, 200, 310, 24, 310, 100, 20, 20 }, /* Inches */ { 1, 1, 3, 0.5, 0.16, 3, 4, 0.3, 4.2, 1, 0.5, 0.5 }, /* MM */ { 30, 30, 100, 10, 5, 80, 60, 10, 135, 30, 10, 10 } }; d = data[units]; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); item = goo_canvas_rect_new (root, d[0], d[1], d[2], d[3], NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); sprintf (buffer, "This box is %gx%g %s", d[2], d[3], units_name); sprintf (font_desc, "Sans %gpx", d[4]); item = goo_canvas_text_new (root, buffer, d[0] + d[2] / 2, d[1] + d[3] / 2, -1, GTK_ANCHOR_CENTER, "font", font_desc, NULL); sprintf (buffer, "This font is %g %s high", d[7], units_name); sprintf (font_desc, "Sans %gpx", d[7]); item = goo_canvas_text_new (root, buffer, d[5], d[6], -1, GTK_ANCHOR_CENTER, "font", font_desc, NULL); item = goo_canvas_image_new (root, NULL, d[8], d[9], "pattern", flower_pattern, "width", d[10], "height", d[11], "scale-to-fit", TRUE, NULL); } static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } GtkWidget * create_canvas (GtkUnit units, gchar *units_name) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GtkAdjustment *adj; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); canvas = goo_canvas_new (); w = gtk_label_new ("Zoom:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 100.00, 0.05, 0.50, 0.0)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (scrolled_win); /* Create the canvas. */ gtk_widget_set_size_request (canvas, 600, 450); setup_canvas (canvas, units, units_name); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); g_object_set (canvas, "units", units, "anchor", GTK_ANCHOR_CENTER, NULL); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); return vbox; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window, *notebook; cairo_surface_t *surface; gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); notebook = gtk_notebook_new (); gtk_widget_show (notebook); gtk_container_add (GTK_CONTAINER (window), notebook); surface = cairo_image_surface_create_from_png ("flower.png"); flower_width = cairo_image_surface_get_width (surface); flower_height = cairo_image_surface_get_height (surface); flower_pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_PIXEL, "pixels"), gtk_label_new ("Pixels")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_POINTS, "points"), gtk_label_new ("Points")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_INCH, "inches"), gtk_label_new ("Inches")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_MM, "millimeters"), gtk_label_new ("Millimeters")); gtk_main (); return 0; } goocanvas-1.0.0/demo/mv-demo.c0000644000076400007640000011266611512447223013072 00000000000000/* * GooCanvas Demo. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * main.c - demo app. */ #include #include #include #include #include #include #include #if CAIRO_HAS_PDF_SURFACE #include #endif #include static GooCanvasItemModel *ellipse2, *textitem; static gboolean dragging = FALSE; static double drag_x, drag_y; GtkWidget *create_canvas_fifteen (void); GtkWidget *create_canvas_features (void); GtkWidget *create_canvas_arrowhead (void); GtkWidget *create_canvas_scalability (void); GtkWidget *create_grabs_page (void); GtkWidget *create_events_page (void); GtkWidget *create_paths_page (void); GtkWidget *create_focus_page (void); GtkWidget *create_animation_page (void); GtkWidget *create_clipping_page (void); GtkWidget *create_table_page (void); #if CAIRO_HAS_PDF_SURFACE static void write_pdf_clicked (GtkWidget *button, GooCanvas *canvas) { cairo_surface_t *surface; cairo_t *cr; g_print ("In write_pdf_clicked\n"); surface = cairo_pdf_surface_create ("demo.pdf", 9 * 72, 10 * 72); cr = cairo_create (surface); /* Place it in the middle of our 9x10 page. */ cairo_translate (cr, 20, 130); goo_canvas_render (canvas, cr, NULL, 1.0); cairo_show_page (cr); cairo_surface_destroy (surface); cairo_destroy (cr); } #endif static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } static void center_toggled (GtkToggleButton *button, gpointer data) { /*foo_canvas_set_center_scroll_region (data, gtk_toggle_button_get_active (button));*/ } static void anchor_toggled (GtkWidget *button, GooCanvas *canvas) { GtkAnchorType anchor; anchor = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "anchor")); if (GTK_TOGGLE_BUTTON (button)->active) g_object_set (canvas, "anchor", anchor, NULL); } static void scroll_to_50_50_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 50, 50); } static void scroll_to_500_500_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 500, 500); } static void scroll_to_250_250_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 250, 250); } static void animate_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { #if 1 goo_canvas_item_model_animate (ellipse2, 100, 100, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif #if 0 goo_canvas_item_model_animate (textitem, -300, -200, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif } static void stop_animation_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_item_model_stop_animation (ellipse2); } static void change_bounds_clicked (GtkWidget *button, GooCanvas *canvas) { static gdouble bounds[4][4] = { { -100, -100, 200, 200 }, { 100, 100, 200, 200 }, { 0, 0, 300, 300 }, { 0, 0, 604, 454 } }; static gint bounds_num = 0; gboolean automatic_bounds = TRUE; gboolean bounds_from_origin = FALSE; gdouble bounds_padding = 50.0; if (bounds_num < 4) { automatic_bounds = FALSE; goo_canvas_set_bounds (canvas, bounds[bounds_num][0], bounds[bounds_num][1], bounds[bounds_num][2], bounds[bounds_num][3]); } else if (bounds_num == 4) { bounds_from_origin = TRUE; bounds_padding = 50.0; } g_object_set (G_OBJECT (canvas), "automatic-bounds", automatic_bounds, "bounds-from-origin", bounds_from_origin, "bounds-padding", bounds_padding, NULL); bounds_num = (bounds_num + 1) % 6; } static void move_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { static int last_state = 0; #if 0 g_print ("Moving ellipse\n"); #endif goo_canvas_item_model_set_transform (ellipse2, NULL); if (last_state == 0) { g_object_set (ellipse2, "center-x", 300.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "red", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A red ellipse", NULL); last_state = 1; } else if (last_state == 1) { g_object_set (ellipse2, "center-x", 390.0, "center-y", 150.0, "radius-x", 45.0, "radius-y", 40.0, "fill-color", "brown", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A brown ellipse", NULL); last_state = 2; } else if (last_state == 2) { g_object_set (ellipse2, "center-x", 0.0, "center-y", 0.0, "radius-y", 30.0, NULL); goo_canvas_item_model_set_simple_transform (ellipse2, 100, 100, 1, 0); last_state = 3; } else if (last_state == 3) { goo_canvas_item_model_set_simple_transform (ellipse2, 200, 100, 2, 0); last_state = 4; } else if (last_state == 4) { goo_canvas_item_model_set_simple_transform (ellipse2, 200, 200, 1, 45); last_state = 5; } else if (last_state == 5) { goo_canvas_item_model_set_simple_transform (ellipse2, 50, 50, 0.2, 225); last_state = 6; } else { g_object_set (ellipse2, "center-x", 335.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "purple", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A purple ellipse", NULL); last_state = 0; } } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); #if 0 g_print ("received 'motion-notify' signal at %g, %g\n", event->x, event->y); #endif if (dragging && (event->state & GDK_BUTTON1_MASK)) { double new_x = event->x; double new_y = event->y; #if 0 g_print ("Translating by %g, %g\n", new_x - drag_x, new_y - drag_y); #endif goo_canvas_item_model_translate (model, new_x - drag_x, new_y - drag_y); } return TRUE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); GooCanvas *canvas; GdkCursor *fleur; #if 0 g_print ("%p received 'button-press' signal at %g, %g (root: %g, %g)\n", item, event->x, event->y, event->x_root, event->y_root); #endif switch (event->button) { case 1: if (event->state & GDK_SHIFT_MASK) { goo_canvas_item_model_remove (model); } else { drag_x = event->x; drag_y = event->y; fleur = gdk_cursor_new (GDK_FLEUR); canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); dragging = TRUE; } break; case 2: goo_canvas_item_model_lower (model, NULL); break; case 3: goo_canvas_item_model_raise (model, NULL); break; default: break; } return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; #if 0 g_print ("received 'button-release' signal\n"); #endif canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); dragging = FALSE; return TRUE; } static gboolean on_background_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { #if 1 g_print ("background item view received 'button-press' signal\n"); #endif return TRUE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (!goo_canvas_item_model_get_parent (model)) { g_signal_connect (item, "button_press_event", G_CALLBACK (on_background_button_press), NULL); } else if (!g_object_get_data (G_OBJECT (model), "skip-signal-connection")) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } } GtkWidget * create_canvas_primitives (GooCanvasItemModel *model, GooCanvasItemModel *static_model) { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *w; GtkWidget *scrolled_win, *canvas; GtkAdjustment *adj; GSList *group = NULL; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("Drag an item with button 1. Click button 2 on an item to lower it, or button 3 to raise it."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Create the canvas */ canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "automatic-bounds", TRUE, "bounds-from-origin", FALSE, "bounds-padding", 4.0, "background-color-rgb", 0xC3C3FF, "has-tooltip", TRUE, #if 0 "redraw-when-scrolled", TRUE, #endif NULL); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 604, 454); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); /* Zoom */ w = gtk_label_new ("Zoom:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.0)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Center: */ w = gtk_check_button_new_with_label("Center scroll region"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); /*gtk_widget_show (w);*/ g_signal_connect (w, "toggled", G_CALLBACK (center_toggled), canvas); /* Move Ellipse */ w = gtk_button_new_with_label("Move Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_ellipse_clicked), canvas); /* Animate Ellipse */ w = gtk_button_new_with_label("Animate Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (animate_ellipse_clicked), canvas); /* Stop Animation */ w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), canvas); #if CAIRO_HAS_PDF_SURFACE /* Create PDF */ w = gtk_button_new_with_label("Write PDF"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (write_pdf_clicked), canvas); #endif w = gtk_button_new_with_label("Change Bounds"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_bounds_clicked), canvas); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Scroll to */ w = gtk_label_new ("Scroll To:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_button_new_with_label("50,50"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_50_50_clicked), canvas); w = gtk_button_new_with_label("250,250"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_250_250_clicked), canvas); w = gtk_button_new_with_label("500,500"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_500_500_clicked), canvas); /* Scroll anchor */ w = gtk_label_new ("Anchor:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_radio_button_new_with_label (group, "NW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NW)); w = gtk_radio_button_new_with_label (group, "N"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_N)); w = gtk_radio_button_new_with_label (group, "NE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NE)); w = gtk_radio_button_new_with_label (group, "W"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_W)); w = gtk_radio_button_new_with_label (group, "C"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_CENTER)); w = gtk_radio_button_new_with_label (group, "E"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_E)); w = gtk_radio_button_new_with_label (group, "SW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SW)); w = gtk_radio_button_new_with_label (group, "S"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_S)); w = gtk_radio_button_new_with_label (group, "SE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SE)); /* Layout the stuff */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); /* Set the model on the canvas view. The canvas view will then create item views to render each of the items. */ goo_canvas_set_root_item_model (GOO_CANVAS (canvas), model); goo_canvas_set_static_root_item_model (GOO_CANVAS (canvas), static_model); #if 0 g_signal_connect_after (canvas, "key_press_event", G_CALLBACK (key_press), NULL); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_grab_focus (canvas); #endif return vbox; } static void setup_heading (GooCanvasItemModel *root, char *text, int pos) { double x = (pos % 3) * 200 + 100; double y = (pos / 3) * 150 + 5; GooCanvasItemModel *item; item = goo_canvas_text_model_new (root, text, x, y, -1, GTK_ANCHOR_N, "font", "Sans 12", NULL); goo_canvas_item_model_skew_y (item, 30, x, y); /*goo_canvas_item_rotate (item, 30, x, y);*/ } static void setup_divisions (GooCanvasItemModel *root) { GooCanvasItemModel *group, *item; group = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (group, 2, 2); item = goo_canvas_rect_model_new (group, 0, 0, 600, 450, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 0, 150, 600, 150, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 0, 300, 600, 300, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 200, 0, 200, 450, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 400, 0, 400, 450, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); #if 1 setup_heading (group, "Rectangles", 0); setup_heading (group, "Ellipses", 1); setup_heading (group, "Texts", 2); setup_heading (group, "Images", 3); setup_heading (group, "Lines", 4); /*setup_heading (group, "No Curves", 5);*/ /*setup_heading (group, "Arcs", 6);*/ setup_heading (group, "Polygons", 7); /*setup_heading (group, "Widgets", 8);*/ #endif } /* FIXME: I think we may need to check byte order. */ static cairo_pattern_t* create_stipple (const char *color_name, guchar stipple_data[16]) { cairo_surface_t *surface; cairo_pattern_t *pattern; GdkColor color; gdk_color_parse (color_name, &color); stipple_data[2] = stipple_data[14] = color.red >> 8; stipple_data[1] = stipple_data[13] = color.green >> 8; stipple_data[0] = stipple_data[12] = color.blue >> 8; surface = cairo_image_surface_create_for_data (stipple_data, CAIRO_FORMAT_ARGB32, 2, 2, 8); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); return pattern; } static void setup_rectangles (GooCanvasItemModel *root) { GooCanvasItemModel *item; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; item = goo_canvas_rect_model_new (root, 20, 30, 50, 30, "stroke-color", "red", "line-width", 8.0, "tooltip", "Red stroked rectangle", NULL); pattern = create_stipple ("mediumseagreen", stipple_data); item = goo_canvas_rect_model_new (root, 90, 40, 90, 60, "fill-pattern", pattern, "stroke-color", "black", "line-width", 4.0, "tooltip", "Medium Sea Green stippled rectangle", NULL); cairo_pattern_destroy (pattern); item = goo_canvas_rect_model_new (root, 10, 80, 70, 60, "fill-color", "steelblue", /*"fill-pattern", NULL,*/ "tooltip", "Steel Blue rectangle", NULL); item = goo_canvas_rect_model_new (root, 20, 90, 70, 60, "fill-color-rgba", 0x3cb37180, "stroke-color", "blue", "line-width", 2.0, "tooltip", "Partially transparent rectangle", NULL); item = goo_canvas_rect_model_new (root, 110, 80, 50, 30, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color-rgba", 0x3cb3f180, "tooltip", "Rectangle with rounded corners", NULL); } static void setup_ellipses (GooCanvasItemModel *root) { GooCanvasItemModel *ellipse1, *ellipse3; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; ellipse1 = goo_canvas_ellipse_model_new (root, 245, 45, 25, 15, "stroke-color", "goldenrod", "line-width", 8.0, NULL); #if 1 ellipse2 = goo_canvas_ellipse_model_new (root, 335, 70, 45, 30, "fill-color", "wheat", "stroke-color", "midnightblue", "line-width", 4.0, "title", "An ellipse", NULL); #if 0 goo_canvas_item_model_rotate (ellipse2, 45, 335, 70); #endif pattern = create_stipple ("cadetblue", stipple_data); ellipse3 = goo_canvas_ellipse_model_new (root, 245, 110, 35, 30, "fill-pattern", pattern, "stroke-color", "black", "line-width", 1.0, NULL); cairo_pattern_destroy (pattern); #endif #if 0 { GooCanvasItem *clone = goo_canvas_clone_model_new (root, ellipse1); goo_canvas_item_translate (clone, 100, 100); } #endif } #define VERTICES 10 #define RADIUS 60.0 static void polish_diamond (GooCanvasItemModel *root) { GooCanvasItemModel *group, *item; int i, j; double a, x1, y1, x2, y2; group = goo_canvas_group_model_new (root, "line-width", 1.0, "line-cap", CAIRO_LINE_CAP_ROUND, NULL); goo_canvas_item_model_translate (group, 270, 230); for (i = 0; i < VERTICES; i++) { a = 2.0 * M_PI * i / VERTICES; x1 = RADIUS * cos (a); y1 = RADIUS * sin (a); for (j = i + 1; j < VERTICES; j++) { a = 2.0 * M_PI * j / VERTICES; x2 = RADIUS * cos (a); y2 = RADIUS * sin (a); item = goo_canvas_polyline_model_new_line (group, x1, y1, x2, y2, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); } } } #define SCALE 7.0 static void make_hilbert (GooCanvasItemModel *root) { char hilbert[] = "urdrrulurulldluuruluurdrurddldrrruluurdrurddldrddlulldrdldrrurd"; char *c; double *pp, *p; GooCanvasItemModel *item; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (strlen (hilbert) + 1); points->coords[0] = 340.0; points->coords[1] = 290.0; pp = points->coords; for (c = hilbert, p = points->coords + 2; *c; c++, p += 2, pp += 2) switch (*c) { case 'u': p[0] = pp[0]; p[1] = pp[1] - SCALE; break; case 'd': p[0] = pp[0]; p[1] = pp[1] + SCALE; break; case 'l': p[0] = pp[0] - SCALE; p[1] = pp[1]; break; case 'r': p[0] = pp[0] + SCALE; p[1] = pp[1]; break; } pattern = create_stipple ("red", stipple_data); item = goo_canvas_polyline_model_new (root, FALSE, 0, "points", points, "line-width", 4.0, "stroke-pattern", pattern, "line-cap", CAIRO_LINE_CAP_SQUARE, "line-join", CAIRO_LINE_JOIN_MITER, NULL); cairo_pattern_destroy (pattern); goo_canvas_points_unref (points); } static void setup_lines (GooCanvasItemModel *root) { GooCanvasItemModel *polyline1, *polyline2, *polyline3, *polyline4, *polyline5; polish_diamond (root); make_hilbert (root); /* Arrow tests */ polyline1 = goo_canvas_polyline_model_new (root, FALSE, 4, 340.0, 170.0, 340.0, 230.0, 390.0, 230.0, 390.0, 170.0, "stroke-color", "midnightblue", "line-width", 3.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); polyline2 = goo_canvas_polyline_model_new (root, FALSE, 2, 356.0, 180.0, 374.0, 220.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); polyline3 = goo_canvas_polyline_model_new (root, FALSE, 2, 356.0, 220.0, 374.0, 180.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); /* Test polyline without any coords. */ polyline4 = goo_canvas_polyline_model_new (root, FALSE, 0, NULL); /* Test polyline with 1 coord and arrows. */ polyline5 = goo_canvas_polyline_model_new (root, FALSE, 1, 356.0, 220.0, "start-arrow", TRUE, "end-arrow", TRUE, NULL); } static void setup_polygons (GooCanvasItemModel *root) { GooCanvasItemModel *polyline1, *polyline2; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (3); points->coords[0] = 210.0; points->coords[1] = 320.0; points->coords[2] = 210.0; points->coords[3] = 380.0; points->coords[4] = 260.0; points->coords[5] = 350.0; pattern = create_stipple ("blue", stipple_data); polyline1 = goo_canvas_polyline_model_new (root, TRUE, 0, "line-width", 1.0, "points", points, "fill_pattern", pattern, "stroke_color", "black", NULL); cairo_pattern_destroy (pattern); goo_canvas_points_unref (points); points = goo_canvas_points_new (14); points->coords[0] = 270.0; points->coords[1] = 330.0; points->coords[2] = 270.0; points->coords[3] = 430.0; points->coords[4] = 390.0; points->coords[5] = 430.0; points->coords[6] = 390.0; points->coords[7] = 330.0; points->coords[8] = 310.0; points->coords[9] = 330.0; points->coords[10] = 310.0; points->coords[11] = 390.0; points->coords[12] = 350.0; points->coords[13] = 390.0; points->coords[14] = 350.0; points->coords[15] = 370.0; points->coords[16] = 330.0; points->coords[17] = 370.0; points->coords[18] = 330.0; points->coords[19] = 350.0; points->coords[20] = 370.0; points->coords[21] = 350.0; points->coords[22] = 370.0; points->coords[23] = 410.0; points->coords[24] = 290.0; points->coords[25] = 410.0; points->coords[26] = 290.0; points->coords[27] = 330.0; polyline2 = goo_canvas_polyline_model_new (root, TRUE, 0, "points", points, "fill_color", "tan", "stroke_color", "black", "line-width", 3.0, NULL); goo_canvas_points_unref (points); } static GooCanvasItemModel * make_anchor (GooCanvasItemModel *root, double x, double y) { GooCanvasItemModel *group, *item; cairo_matrix_t transform = { 0.8, 0.2, -0.3, 0.5, x, y }; group = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (group, x, y); #if 1 g_object_set (group, "transform", &transform, NULL); #endif item = goo_canvas_rect_model_new (group, -2.5, -2.5, 4, 4, "line-width", 1.0, NULL); return group; } static void setup_texts (GooCanvasItemModel *root) { cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; #if 1 pattern = create_stipple ("blue", stipple_data); goo_canvas_text_model_new (make_anchor (root, 420, 20), "Anchor NW", 0, 0, -1, GTK_ANCHOR_NW, "font", "Sans Bold 24", "fill_pattern", pattern, NULL); cairo_pattern_destroy (pattern); goo_canvas_text_model_new (make_anchor (root, 470, 75), "Anchor center\nJustify center\nMultiline text\nb8bit text ÅÄÖåäö", 0, 0, -1, GTK_ANCHOR_CENTER, "font", "monospace bold 14", "alignment", PANGO_ALIGN_CENTER, "fill_color", "firebrick", NULL); #endif #if 0 goo_canvas_text_model_new (make_anchor (root, 590, 140), "Clipped text\nClipped text\nClipped text\nClipped text\nClipped text\nClipped text", 0, 0, -1, GTK_ANCHOR_SE, "font", "Sans 12", /*"clip", TRUE,*/ /*"clip_width", 50.0,*/ /*"clip_height", 55.0,*/ /*"x_offset", 10.0,*/ "fill_color", "darkgreen", NULL); #endif #if 1 textitem = goo_canvas_text_model_new (make_anchor (root, 420, 240), "This is a very long paragraph that will need to be wrapped over several lines so we can see what happens to line-breaking as the view is zoomed in and out.", 0, 0, 180, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "goldenrod", NULL); #endif #if 1 textitem = goo_canvas_text_model_new (root, "Ellipsized text.", 20, 420, 115, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "blue", "ellipsize", PANGO_ELLIPSIZE_END, NULL); #endif } static void setup_invisible_texts (GooCanvasItemModel *root) { goo_canvas_text_model_new (root, "Visible above 0.8x", 500, 330, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_rect_model_new (root, 410.5, 322.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_text_model_new (root, "Visible above 1.5x", 500, 350, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_rect_model_new (root, 410.5, 342.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_text_model_new (root, "Visible above 3.0x", 500, 370, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); goo_canvas_rect_model_new (root, 410.5, 362.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); /* This should never be seen. */ goo_canvas_text_model_new (root, "Always Invisible", 500, 390, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); goo_canvas_rect_model_new (root, 410.5, 350.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); } static void plant_flower (GooCanvasItemModel *root, double x, double y, GtkAnchorType anchor, double opacity) { cairo_pattern_t *pattern; cairo_surface_t *surface; GooCanvasItemModel *image; double w, h; surface = cairo_image_surface_create_from_png ("flower.png"); w = cairo_image_surface_get_width (surface); h = cairo_image_surface_get_height (surface); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); image = goo_canvas_image_model_new (root, NULL, x, y, "pattern", pattern, "width", w * 1.5, "height", h * 2, "scale-to-fit", TRUE, "alpha", opacity, NULL); cairo_pattern_destroy (pattern); } static void setup_images (GooCanvasItemModel *root) { GdkPixbuf *im; GooCanvasItemModel *image; im = gdk_pixbuf_new_from_file ("toroid.png", NULL); if (im) { double w = gdk_pixbuf_get_width (im); double h = gdk_pixbuf_get_height (im); image = goo_canvas_image_model_new (root, im, 100.0 - w / 2, 225.0 - h / 2, "width", w, "height", h, /* "anchor", GTK_ANCHOR_CENTER, */ NULL); g_object_unref(im); } else g_warning ("Could not find the toroid.png sample file"); plant_flower (root, 20.0, 170.0, GTK_ANCHOR_NW, 0.3); plant_flower (root, 180.0, 170.0, GTK_ANCHOR_NE, 0.5); plant_flower (root, 20.0, 280.0, GTK_ANCHOR_SW, 0.7); plant_flower (root, 180.0, 280.0, GTK_ANCHOR_SE, 1.0); } static GooCanvasItemModel* create_static_model () { GooCanvasItemModel *static_root, *group, *item; static_root = goo_canvas_group_model_new (NULL, NULL); group = goo_canvas_group_model_new (static_root, NULL); item = goo_canvas_polyline_model_new_line (group, 40.0, 410.0, 40.0, 330.0, "stroke-color", "midnightblue", "line-width", 3.0, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); item = goo_canvas_polyline_model_new_line (group, 32.0, 370.0, 48.0, 370.0, "stroke-color", "midnightblue", "line-width", 3.0, NULL); item = goo_canvas_text_model_new (group, "N", 40, 320, -1, GTK_ANCHOR_S, "font", "Sans 12", NULL); return static_root; } static void test_simple_transforms (GooCanvasItemModel *root) { #if 0 GooCanvasItemModel *item; int rotation, x, y; double scale, x_out, y_out, scale_out, rotation_out, max_error = 0.0000001; item = goo_canvas_rect_model_new (root, 20, 30, 50, 30, NULL); for (rotation = 0; rotation < 360; rotation += 20) { scale = 0.1; while (scale < 10) { g_print ("Rotation: %i Scale: %g\n", rotation, scale); for (x = -100; x < 100; x += 10) { for (y = -100; y < 100; y += 10) { goo_canvas_item_model_set_simple_transform (item, x, y, scale, rotation); goo_canvas_item_model_get_simple_transform (item, &x_out, &y_out, &scale_out, &rotation_out); if (fabs (x_out - x) > max_error || fabs (y_out - y) > max_error || fabs (scale_out - scale) > max_error || fabs (rotation_out - rotation) > max_error) { g_print ("IN X:%i Y:%i Scale:%g Rotation:%i -> %g, %g, %g, %g\n", x, y, scale, rotation, x_out, y_out, scale_out, rotation_out); } } } scale += 0.1; } } #endif } static void setup_grids (GooCanvasItemModel *root) { GooCanvasItemModel *item; item = goo_canvas_grid_model_new (root, 80, 310, 90, 90, 10, 10, 5, 5, "stroke-color", "yellow", "fill-color", "pink", "border-width", 2.0, "border-color", "red", "vert-grid-line-color", "lightblue", "horz-grid-line-width", 1.0, "vert-grid-line-width", 1.0, "vert-grid-lines-on-top", TRUE, NULL); } static GooCanvasItemModel* create_model (void) { GooCanvasItemModel *root; root = goo_canvas_group_model_new (NULL, NULL); /* Setup canvas items */ #if 1 setup_divisions (root); setup_rectangles (root); setup_ellipses (root); setup_lines (root); setup_polygons (root); setup_texts (root); setup_images (root); setup_invisible_texts (root); setup_grids (root); #endif #if 0 setup_widgets (root); #endif test_simple_transforms (root); return root; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } static GtkWidget* create_window (GooCanvasItemModel *model, GooCanvasItemModel *static_model) { GtkWidget *window, *notebook; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); notebook = gtk_notebook_new (); gtk_widget_show (notebook); gtk_container_add (GTK_CONTAINER (window), notebook); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_primitives (model, static_model), gtk_label_new ("Primitives")); #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_arrowhead (), gtk_label_new ("Arrowhead")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_fifteen (), gtk_label_new ("Fifteen")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_features (), gtk_label_new ("Features")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_scalability (), gtk_label_new ("Scalability")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_grabs_page (), gtk_label_new ("Grabs")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_events_page (), gtk_label_new ("Events")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_paths_page (), gtk_label_new ("Paths")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_focus_page (), gtk_label_new ("Focus")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_animation_page (), gtk_label_new ("Animation")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_clipping_page (), gtk_label_new ("Clipping")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_table_page (), gtk_label_new ("Table")); #endif return window; } int main (int argc, char *argv[]) { GooCanvasItemModel *model, *static_model; GtkWidget *window; gtk_set_locale (); gtk_init (&argc, &argv); model = create_model (); static_model = create_static_model (); /* Create 2 windows to show off multiple views. */ window = create_window (model, static_model); #if 1 window = create_window (model, static_model); #endif g_object_unref (model); g_object_unref (static_model); gtk_main (); return 0; } goocanvas-1.0.0/demo/mv-generic-position-demo.c0000644000076400007640000002066611412723611016341 00000000000000#include #include typedef enum { MODE_MOVE, MODE_RESIZE } Mode; Mode drag_mode; GooCanvasItem *drag_item = NULL; gdouble drag_x = 0.0; gdouble drag_y = 0.0; gdouble item_x = 0.0; gdouble item_y = 0.0; gdouble item_width = 0.0; gdouble item_height = 0.0; static gboolean on_button_press_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); if (event->state & GDK_CONTROL_MASK) { if (event->button == 1 || event->button == 3) { if (event->button == 1) drag_mode = MODE_MOVE; else drag_mode = MODE_RESIZE; drag_item = item; drag_x = event->x; drag_y = event->y; g_object_get (G_OBJECT (model), "x", &item_x, "y", &item_y, "width", &item_width, "height", &item_height, NULL); goo_canvas_pointer_grab (GOO_CANVAS (user_data), item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, NULL, event->time); return TRUE; } } return FALSE; } static gboolean on_button_release_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { if (drag_item == item && drag_item != NULL) { goo_canvas_pointer_ungrab (GOO_CANVAS (user_data), drag_item, event->time); drag_item = NULL; return TRUE; } return FALSE; } static gboolean on_motion_notify_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventMotion *event, gpointer user_data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); if (drag_item == item && drag_item != NULL) { gdouble rel_x = event->x - drag_x; gdouble rel_y = event->y - drag_y; if (drag_mode == MODE_MOVE) { g_object_set (G_OBJECT (model), "x", item_x + rel_x, "y", item_y + rel_y, NULL); } else { gdouble new_width = MAX (item_width + rel_x, 5.0); gdouble new_height = MAX (item_height + rel_y, 5.0); g_object_set (G_OBJECT (model), "width", new_width, "height", new_height, NULL); } return TRUE; } return FALSE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (g_object_get_data (G_OBJECT (model), "setup-dnd-signals")) { g_signal_connect (G_OBJECT (item), "button-press-event", G_CALLBACK (on_button_press_event_cb), canvas); g_signal_connect (G_OBJECT (item), "button-release-event", G_CALLBACK (on_button_release_event_cb), canvas); /* g_signal_connect (G_OBJECT (item), "grab-broken-event", G_CALLBACK (on_button_release_event_cb), canvas);*/ g_signal_connect (G_OBJECT (item), "motion-notify-event", G_CALLBACK (on_motion_notify_event_cb), canvas); } } static GooCanvasItemModel* create_model (GdkPixbuf *pixbuf) { GooCanvasItemModel *root; GooCanvasItemModel *item; GooCanvasItemModel* child; root = goo_canvas_group_model_new (NULL, NULL); /* Test clipping of GooCanvasGroup: We put the rectangle and the ellipse into * a group with width=200 and height=200. */ item = goo_canvas_group_model_new (root, "x", 50.0, "y", 350.0, "width", 200.0, "height", 200.0, NULL); /*goo_canvas_item_model_rotate(item, 45.0, 150.0, 450.0);*/ child = goo_canvas_rect_model_new (item, 0.0, 0.0, 100, 100, "fill-color", "blue", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_rotate(child, 45.0, 50.0, 50.0); child = goo_canvas_ellipse_model_new (item, 150, 00, 50, 50, "fill-color", "red", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); item = goo_canvas_polyline_model_new (root, FALSE, 5.0, 250.0, 350.0, 275.0, 400.0, 300.0, 350.0, 325.0, 400.0, 350.0, 350.0, "stroke-color", "cyan", "line-width", 5.0, NULL); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_path_model_new (root, "M20,500 C20,450 100,450 100,500", "stroke-color", "green", "line-width", 5.0, NULL); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_image_model_new (root, pixbuf, 150, 450, /*"fill-color", "yellow", */NULL); g_object_unref (pixbuf); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_text_model_new (root, "Hello, World!", 250, 450, -1, GTK_ANCHOR_NW, "fill-color", "magenta", "wrap", PANGO_WRAP_WORD_CHAR, NULL); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_table_model_new (root, "horz-grid-line-width", 2.0, "vert-grid-line-width", 2.0, "row-spacing", 2.0, "column-spacing", 2.0, NULL); goo_canvas_item_model_translate (item, 10.0, 10.0); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); child = goo_canvas_rect_model_new (item, 10.0, 10.0, 50.0, 50.0, "fill-color", "blue", "x", 10.0, "y", 25.0, NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties (item, child, "column", 0, "row", 0, "columns", 1, "rows", 1, NULL); /*goo_canvas_item_model_translate (child, 10.0, 10.0);*/ child = goo_canvas_rect_model_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties (item, child, "column", 1, "row", 0, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_model_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "green", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties(item, child, "column", 0, "row", 1, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_model_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "yellow", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties (item, child, "column", 1, "row", 1, "columns", 1, "rows", 1, NULL); return root; } static GtkWidget* create_window (GooCanvasItemModel *model) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Use Ctrl+Left Click to move items or Ctrl+Right Click to resize items"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "integer-layout", TRUE, NULL); /* gtk_widget_set_size_request (canvas, 600, 250);*/ goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), model); return window; } int main (int argc, char *argv[]) { GtkWidget *window; GooCanvasItemModel *model; GdkPixbuf *pixbuf; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); pixbuf = gtk_widget_render_icon (window, GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG, NULL); model = create_model (pixbuf); /* Create 2 windows to show off multiple views. */ window = create_window (model); #if 1 window = create_window (model); #endif g_object_unref (model); gtk_main (); return 0; } goocanvas-1.0.0/demo/mv-scalability-demo.c0000644000076400007640000002122211412723611015350 00000000000000#include #include #include #if 1 #define N_GROUP_COLS 25 #define N_GROUP_ROWS 200 #define N_COLS 10 #define N_ROWS 10 #define ITEM_WIDTH 400 #define PADDING 10 #if 1 #define ROTATE #endif #else /* This tests a very wide canvas, nearly up to the 31-bit GDK window size limit. */ #define N_GROUP_COLS 100000 #define N_GROUP_ROWS 1 #define N_COLS 10 #define N_ROWS 1 #define ITEM_WIDTH 1000 #define PADDING 100 #endif #define N_TOTAL_ID_ITEMS (N_GROUP_COLS * N_GROUP_ROWS) * (N_COLS * N_ROWS) /* The maximum length of a string identifying an item (i.e. its coords). */ #define MAX_ID_LEN 20 #if 1 #define SET_STYLE #endif #if 1 #define USE_TEXT #endif #if 1 #define SET_IDS #endif #if 0 #define USE_PIXMAP #endif #if 0 #define ONLY_ONE #endif double total_width, total_height; double left_offset, top_offset; char ids[N_TOTAL_ID_ITEMS][MAX_ID_LEN]; GdkPixbuf *pixbuf = NULL; cairo_pattern_t *pattern = NULL; double item_width, item_height; double cell_width, cell_height; double group_width, group_height; static clock_t start; static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItem *ancestor = target; gchar *id; while (ancestor) { id = g_object_get_data (G_OBJECT (ancestor), "id"); if (id) { g_print ("%s item received 'motion-notify' signal\n", id); return TRUE; } ancestor = goo_canvas_item_get_parent (ancestor); } return TRUE; } static void init_ids (void) { int group_i, group_j, i, j; int id_item_num = 0;; for (group_i = 0; group_i < N_GROUP_COLS; group_i++) { for (group_j = 0; group_j < N_GROUP_ROWS; group_j++) { double group_x = left_offset + (group_i * group_width); double group_y = top_offset + (group_j * group_height); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { double item_x = (i * cell_width) + PADDING; double item_y = (j * cell_height) + PADDING; sprintf (ids[id_item_num++], "%.10g, %.10g", group_x + item_x, group_y + item_y); } } } } } static void setup_canvas (GtkWidget *canvas) { GooCanvasItemModel *root, *group, *model; GooCanvasItem *item; int group_i, group_j, i, j; int total_items = 0, id_item_num = 0;; GdkColor color = { 0, 0, 0, 0, }; GooCanvasStyle *style, *style2; GValue tmpval = { 0 }; cairo_matrix_t item_matrix; GQuark id_quark = g_quark_from_static_string ("id"); root = goo_canvas_group_model_new (NULL, "font", "Sans 8", NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); item = goo_canvas_get_item (GOO_CANVAS (canvas), root); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); style = goo_canvas_style_new (); gdk_color_parse ("mediumseagreen", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); style2 = goo_canvas_style_new (); gdk_color_parse ("steelblue", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style2, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); for (group_i = 0; group_i < N_GROUP_COLS; group_i++) { for (group_j = 0; group_j < N_GROUP_ROWS; group_j++) { double group_x = left_offset + (group_i * group_width); double group_y = top_offset + (group_j * group_height); group = goo_canvas_group_model_new (root, NULL); total_items++; goo_canvas_item_model_translate (group, group_x, group_y); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { double item_x = (i * cell_width) + PADDING; double item_y = (j * cell_height) + PADDING; #ifdef ROTATE double rotation = (i % 10 * 2) * M_PI / 180; double rotation_x = item_x + item_width / 2; double rotation_y = item_y + item_height / 2; #endif #ifdef USE_PIXMAP model = goo_canvas_image_model_new (group, NULL, item_x, item_y, "pattern", pattern, "width", item_width, "height", item_height, NULL); #else model = goo_canvas_rect_model_new (group, item_x, item_y, item_width, item_height, NULL); #ifdef SET_STYLE goo_canvas_item_model_set_style (model, (j % 2) ? style : style2); #endif #ifdef ROTATE cairo_matrix_init_identity (&item_matrix); cairo_matrix_translate (&item_matrix, rotation_x, rotation_y); cairo_matrix_rotate (&item_matrix, rotation); cairo_matrix_translate (&item_matrix, -rotation_x, -rotation_y); goo_canvas_item_model_set_transform (model, &item_matrix); #endif #endif #ifdef SET_IDS item = goo_canvas_get_item (GOO_CANVAS (canvas), model); g_object_set_qdata (G_OBJECT (item), id_quark, ids[id_item_num]); #endif #if 0 g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); #endif #ifdef USE_TEXT model = goo_canvas_text_model_new (group, ids[id_item_num], item_x + item_width / 2, item_y + item_height / 2, item_width, GTK_ANCHOR_CENTER, "height", item_height, /*"alignment", PANGO_ALIGN_CENTER,*/ NULL); /* FIXME: This is slightly naughty, but much faster. */ GOO_CANVAS_TEXT_MODEL (model)->text_data.alignment = PANGO_ALIGN_CENTER; #else model = goo_canvas_rect_model_new (group, item_x + 20, item_y + 4, item_width - 40, item_height - 8, NULL); #endif #ifdef ROTATE goo_canvas_item_model_set_transform (model, &item_matrix); #endif id_item_num++; total_items += 2; #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } if (pattern) cairo_pattern_destroy (pattern); g_print ("Total items: %i\n", total_items); } static gboolean on_expose_event (GtkWidget *canvas, GdkEvent *event, gpointer unused_data) { static gboolean first_time = TRUE; if (first_time) { printf ("Update Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); first_time = FALSE; } return FALSE; } GtkWidget * create_canvas (void) { GtkWidget *canvas; #ifdef USE_PIXMAP pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); item_width = gdk_pixbuf_get_width (pixbuf); item_height = gdk_pixbuf_get_height (pixbuf); pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); #else pixbuf = NULL; item_width = ITEM_WIDTH; item_height = 19; #endif cell_width = item_width + PADDING * 2; cell_height = item_height + PADDING * 2; group_width = N_COLS * cell_width; group_height = N_ROWS * cell_height; total_width = N_GROUP_COLS * group_width; total_height = N_GROUP_ROWS * group_height; /* We use -ve offsets to test if -ve coords are handled correctly. */ left_offset = -total_width / 2; top_offset = -total_height / 2; #ifdef SET_IDS init_ids (); #endif /* Create the canvas. */ canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); start = clock(); setup_canvas (canvas); printf ("Create Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); start = clock(); goo_canvas_set_bounds (GOO_CANVAS (canvas), left_offset, top_offset, left_offset + total_width, top_offset + total_height); gtk_widget_show (canvas); g_signal_connect (canvas, "expose_event", G_CALLBACK (on_expose_event), NULL); return canvas; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = create_canvas (); #if 0 exit (0); #endif gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); gtk_main (); return 0; } goocanvas-1.0.0/demo/demo-large-items.c0000644000076400007640000001063111512447262014651 00000000000000#include #include #include #include "demo-large-line.h" #include "demo-large-rect.h" /* * We need to make sure that that (MAX_ZOOM * canvas width) < 2^31 so we stay * within the GDK window size limit (a signed 32-bit int). * * The canvas width is 107374182 * 2 = 214748364. * Multiply by MAX_ZOOM (10) = 2147483640. * 2^31 = 2147483648 so we are just inside the GDK limit. */ #if 1 #define CANVAS_TOP -107374182 #define CANVAS_BOTTOM 107374182 #define CANVAS_LEFT -107374182 #define CANVAS_RIGHT 107374182 #else #define CANVAS_TOP 0 #define CANVAS_BOTTOM 10000 #define CANVAS_LEFT 0 #define CANVAS_RIGHT 10000 #endif #define MAX_ZOOM 10 static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItem *ancestor = target; gchar *id; while (ancestor) { id = g_object_get_data (G_OBJECT (ancestor), "id"); if (id) { g_print ("%s item received 'motion-notify' signal\n", id); return TRUE; } ancestor = goo_canvas_item_get_parent (ancestor); } return TRUE; } static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } GtkWidget * create_large_items_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GtkAdjustment *adj; GooCanvasItem *root, *item; gchar *text; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); text = g_strdup_printf ("This is a very large canvas, from (%i, %i) to (%i, %i).\nThe maximum zoom is %i. At this scale the canvas comes very close to the GDK window size limit (32-bit gint).\nThe items have been specially written to work around cairo's limits (transformed coords must be < +/- 32768).", CANVAS_LEFT, CANVAS_TOP, CANVAS_RIGHT, CANVAS_BOTTOM, MAX_ZOOM); w = gtk_label_new (text); g_free (text); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); /* Create the canvas. */ canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_signal_connect (root, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); #if 1 item = goo_demo_large_rect_new (root, CANVAS_LEFT + 10, CANVAS_TOP + 10, CANVAS_RIGHT - CANVAS_LEFT - 20, CANVAS_BOTTOM - CANVAS_TOP - 20, "fill-color", "yellow", NULL); g_object_set_data (G_OBJECT (item), "id", "Large Yellow Rect"); #endif #if 1 item = goo_demo_large_rect_new (root, CANVAS_LEFT + 100, CANVAS_TOP + 100, CANVAS_RIGHT - CANVAS_LEFT - 200, 50, "fill-color", "orange", NULL); g_object_set_data (G_OBJECT (item), "id", "Large Orange Rect"); #endif #if 1 item = goo_demo_large_line_new (root, CANVAS_LEFT + 100, CANVAS_TOP + 200, CANVAS_RIGHT - 100, CANVAS_TOP + 200, "stroke-color", "purple", "line-width", 10.0, NULL); g_object_set_data (G_OBJECT (item), "id", "Large Purple Line"); #endif #if 1 item = goo_demo_large_line_new (root, CANVAS_LEFT + 100, CANVAS_TOP + 300, CANVAS_RIGHT - 100, CANVAS_BOTTOM - 100, "stroke-color", "blue", "line-width", 10.0, NULL); g_object_set_data (G_OBJECT (item), "id", "Large Blue Line"); /*goo_canvas_item_rotate (item, 10, CANVAS_LEFT + 100, CANVAS_TOP + 200);*/ #endif goo_canvas_set_bounds (GOO_CANVAS (canvas), CANVAS_LEFT, CANVAS_TOP, CANVAS_RIGHT, CANVAS_BOTTOM); gtk_widget_show (canvas); /* Zoom */ w = gtk_label_new ("Zoom:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 10.00, 0.05, 0.50, 0.0)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); return vbox; } goocanvas-1.0.0/demo/Makefile.in0000644000076400007640000006170611512612655013430 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ noinst_PROGRAMS = demo$(EXEEXT) table-demo$(EXEEXT) \ generic-position-demo$(EXEEXT) simple-demo$(EXEEXT) \ scalability-demo$(EXEEXT) units-demo$(EXEEXT) \ widgets-demo$(EXEEXT) mv-demo$(EXEEXT) mv-table-demo$(EXEEXT) \ mv-generic-position-demo$(EXEEXT) mv-simple-demo$(EXEEXT) \ mv-scalability-demo$(EXEEXT) subdir = demo DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_demo_OBJECTS = demo.$(OBJEXT) demo-fifteen.$(OBJEXT) \ demo-scalability.$(OBJEXT) demo-grabs.$(OBJEXT) \ demo-arrowhead.$(OBJEXT) demo-features.$(OBJEXT) \ demo-events.$(OBJEXT) demo-paths.$(OBJEXT) \ demo-focus.$(OBJEXT) demo-item.$(OBJEXT) \ demo-animation.$(OBJEXT) demo-clipping.$(OBJEXT) \ demo-table.$(OBJEXT) demo-large-line.$(OBJEXT) \ demo-large-items.$(OBJEXT) demo-large-rect.$(OBJEXT) demo_OBJECTS = $(am_demo_OBJECTS) am__DEPENDENCIES_1 = demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_generic_position_demo_OBJECTS = generic-position-demo.$(OBJEXT) generic_position_demo_OBJECTS = $(am_generic_position_demo_OBJECTS) generic_position_demo_DEPENDENCIES = \ $(top_builddir)/src/libgoocanvas.la $(am__DEPENDENCIES_1) am_mv_demo_OBJECTS = mv-demo.$(OBJEXT) mv-demo-fifteen.$(OBJEXT) \ mv-demo-scalability.$(OBJEXT) mv-demo-grabs.$(OBJEXT) \ mv-demo-arrowhead.$(OBJEXT) mv-demo-features.$(OBJEXT) \ mv-demo-events.$(OBJEXT) mv-demo-paths.$(OBJEXT) \ mv-demo-focus.$(OBJEXT) mv-demo-animation.$(OBJEXT) \ mv-demo-clipping.$(OBJEXT) mv-demo-table.$(OBJEXT) mv_demo_OBJECTS = $(am_mv_demo_OBJECTS) mv_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_mv_generic_position_demo_OBJECTS = \ mv-generic-position-demo.$(OBJEXT) mv_generic_position_demo_OBJECTS = \ $(am_mv_generic_position_demo_OBJECTS) mv_generic_position_demo_DEPENDENCIES = \ $(top_builddir)/src/libgoocanvas.la $(am__DEPENDENCIES_1) am_mv_scalability_demo_OBJECTS = mv-scalability-demo.$(OBJEXT) mv_scalability_demo_OBJECTS = $(am_mv_scalability_demo_OBJECTS) mv_scalability_demo_DEPENDENCIES = \ $(top_builddir)/src/libgoocanvas.la $(am__DEPENDENCIES_1) am_mv_simple_demo_OBJECTS = mv-simple-demo.$(OBJEXT) mv_simple_demo_OBJECTS = $(am_mv_simple_demo_OBJECTS) mv_simple_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_mv_table_demo_OBJECTS = mv-table-demo.$(OBJEXT) mv_table_demo_OBJECTS = $(am_mv_table_demo_OBJECTS) mv_table_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_scalability_demo_OBJECTS = scalability-demo.$(OBJEXT) scalability_demo_OBJECTS = $(am_scalability_demo_OBJECTS) scalability_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_simple_demo_OBJECTS = simple-demo.$(OBJEXT) simple_demo_OBJECTS = $(am_simple_demo_OBJECTS) simple_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_table_demo_OBJECTS = table-demo.$(OBJEXT) table_demo_OBJECTS = $(am_table_demo_OBJECTS) table_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_units_demo_OBJECTS = units-demo.$(OBJEXT) units_demo_OBJECTS = $(am_units_demo_OBJECTS) units_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_widgets_demo_OBJECTS = widgets-demo.$(OBJEXT) widgets_demo_OBJECTS = $(am_widgets_demo_OBJECTS) widgets_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(demo_SOURCES) $(generic_position_demo_SOURCES) \ $(mv_demo_SOURCES) $(mv_generic_position_demo_SOURCES) \ $(mv_scalability_demo_SOURCES) $(mv_simple_demo_SOURCES) \ $(mv_table_demo_SOURCES) $(scalability_demo_SOURCES) \ $(simple_demo_SOURCES) $(table_demo_SOURCES) \ $(units_demo_SOURCES) $(widgets_demo_SOURCES) DIST_SOURCES = $(demo_SOURCES) $(generic_position_demo_SOURCES) \ $(mv_demo_SOURCES) $(mv_generic_position_demo_SOURCES) \ $(mv_scalability_demo_SOURCES) $(mv_simple_demo_SOURCES) \ $(mv_table_demo_SOURCES) $(scalability_demo_SOURCES) \ $(simple_demo_SOURCES) $(table_demo_SOURCES) \ $(units_demo_SOURCES) $(widgets_demo_SOURCES) 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@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ @PACKAGE_CFLAGS@ demo_SOURCES = \ demo.c demo-fifteen.c demo-scalability.c demo-grabs.c \ demo-arrowhead.c demo-features.c demo-events.c \ demo-paths.c demo-focus.c demo-item.h demo-item.c demo-animation.c \ demo-clipping.c demo-table.c demo-large-line.h demo-large-line.c \ demo-large-items.c demo-large-rect.h demo-large-rect.c demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) -lm mv_demo_SOURCES = \ mv-demo.c mv-demo-fifteen.c mv-demo-scalability.c mv-demo-grabs.c \ mv-demo-arrowhead.c mv-demo-features.c mv-demo-events.c \ mv-demo-paths.c mv-demo-focus.c mv-demo-animation.c \ mv-demo-clipping.c mv-demo-table.c mv_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) -lm table_demo_SOURCES = \ table-demo.c table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_table_demo_SOURCES = \ mv-table-demo.c mv_table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) simple_demo_SOURCES = \ simple-demo.c simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_simple_demo_SOURCES = \ mv-simple-demo.c mv_simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) scalability_demo_SOURCES = \ scalability-demo.c scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_scalability_demo_SOURCES = \ mv-scalability-demo.c mv_scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) units_demo_SOURCES = \ units-demo.c units_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) widgets_demo_SOURCES = \ widgets-demo.c widgets_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) generic_position_demo_SOURCES = \ generic-position-demo.c generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_generic_position_demo_SOURCES = \ mv-generic-position-demo.c mv_generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) EXTRA_DIST = flower.png toroid.png all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.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) --gnu demo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu demo/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_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 demo$(EXEEXT): $(demo_OBJECTS) $(demo_DEPENDENCIES) @rm -f demo$(EXEEXT) $(LINK) $(demo_OBJECTS) $(demo_LDADD) $(LIBS) generic-position-demo$(EXEEXT): $(generic_position_demo_OBJECTS) $(generic_position_demo_DEPENDENCIES) @rm -f generic-position-demo$(EXEEXT) $(LINK) $(generic_position_demo_OBJECTS) $(generic_position_demo_LDADD) $(LIBS) mv-demo$(EXEEXT): $(mv_demo_OBJECTS) $(mv_demo_DEPENDENCIES) @rm -f mv-demo$(EXEEXT) $(LINK) $(mv_demo_OBJECTS) $(mv_demo_LDADD) $(LIBS) mv-generic-position-demo$(EXEEXT): $(mv_generic_position_demo_OBJECTS) $(mv_generic_position_demo_DEPENDENCIES) @rm -f mv-generic-position-demo$(EXEEXT) $(LINK) $(mv_generic_position_demo_OBJECTS) $(mv_generic_position_demo_LDADD) $(LIBS) mv-scalability-demo$(EXEEXT): $(mv_scalability_demo_OBJECTS) $(mv_scalability_demo_DEPENDENCIES) @rm -f mv-scalability-demo$(EXEEXT) $(LINK) $(mv_scalability_demo_OBJECTS) $(mv_scalability_demo_LDADD) $(LIBS) mv-simple-demo$(EXEEXT): $(mv_simple_demo_OBJECTS) $(mv_simple_demo_DEPENDENCIES) @rm -f mv-simple-demo$(EXEEXT) $(LINK) $(mv_simple_demo_OBJECTS) $(mv_simple_demo_LDADD) $(LIBS) mv-table-demo$(EXEEXT): $(mv_table_demo_OBJECTS) $(mv_table_demo_DEPENDENCIES) @rm -f mv-table-demo$(EXEEXT) $(LINK) $(mv_table_demo_OBJECTS) $(mv_table_demo_LDADD) $(LIBS) scalability-demo$(EXEEXT): $(scalability_demo_OBJECTS) $(scalability_demo_DEPENDENCIES) @rm -f scalability-demo$(EXEEXT) $(LINK) $(scalability_demo_OBJECTS) $(scalability_demo_LDADD) $(LIBS) simple-demo$(EXEEXT): $(simple_demo_OBJECTS) $(simple_demo_DEPENDENCIES) @rm -f simple-demo$(EXEEXT) $(LINK) $(simple_demo_OBJECTS) $(simple_demo_LDADD) $(LIBS) table-demo$(EXEEXT): $(table_demo_OBJECTS) $(table_demo_DEPENDENCIES) @rm -f table-demo$(EXEEXT) $(LINK) $(table_demo_OBJECTS) $(table_demo_LDADD) $(LIBS) units-demo$(EXEEXT): $(units_demo_OBJECTS) $(units_demo_DEPENDENCIES) @rm -f units-demo$(EXEEXT) $(LINK) $(units_demo_OBJECTS) $(units_demo_LDADD) $(LIBS) widgets-demo$(EXEEXT): $(widgets_demo_OBJECTS) $(widgets_demo_DEPENDENCIES) @rm -f widgets-demo$(EXEEXT) $(LINK) $(widgets_demo_OBJECTS) $(widgets_demo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-animation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-arrowhead.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-clipping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-features.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-fifteen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-focus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-grabs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-item.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-large-items.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-large-line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-large-rect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-paths.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-scalability.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-table.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic-position-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-animation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-arrowhead.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-clipping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-features.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-fifteen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-focus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-grabs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-paths.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-scalability.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-table.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-generic-position-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-scalability-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-simple-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-table-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scalability-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/units-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/widgets-demo.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 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 $(PROGRAMS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ 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-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 -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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS 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-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-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags 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: goocanvas-1.0.0/demo/mv-demo-table.c0000644000076400007640000002404011412723611014140 00000000000000#include #include #include #define DEMO_RECT_ITEM 0 #define DEMO_TEXT_ITEM 1 static GooCanvas *canvas; static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { gchar *id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id ? id : "unknown", event->x, event->y, event->x_root, event->y_root); return TRUE; } static void create_demo_item (GooCanvasItemModel *table, gint demo_item_type, gint row, gint column, gint rows, gint columns, gchar *text) { GooCanvasItemModel *model = NULL; GooCanvasItem *item; GValue value = { 0 }; guint new_row; switch (demo_item_type) { case DEMO_RECT_ITEM: model = goo_canvas_rect_model_new (table, 0, 0, 38, 19, "fill-color", "red", NULL); break; case DEMO_TEXT_ITEM: model = goo_canvas_text_model_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); break; } g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, row); goo_canvas_item_model_set_child_property (table, model, "row", &value); g_value_set_uint (&value, column); goo_canvas_item_model_set_child_property (table, model, "column", &value); g_value_set_uint (&value, rows); goo_canvas_item_model_set_child_property (table, model, "rows", &value); g_value_set_uint (&value, columns); goo_canvas_item_model_set_child_property (table, model, "columns", &value); /* Test the get function. */ goo_canvas_item_model_get_child_property (table, model, "row", &value); new_row = g_value_get_uint (&value); if (new_row != row) g_warning ("Got bad row setting: %i should be: %i\n", new_row, row); #if 1 goo_canvas_item_model_set_child_properties (table, model, "x-expand", TRUE, "x-fill", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); #endif item = goo_canvas_get_item (canvas, model); g_object_set_data (G_OBJECT (item), "id", text); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } static GooCanvasItemModel* create_table (GooCanvasItemModel *parent, gint row, gint column, gint embedding_level, gdouble x, gdouble y, gdouble rotation, gdouble scale, gint demo_item_type) { GooCanvasItemModel *table; /* Add a few simple items. */ table = goo_canvas_table_model_new (parent, "row-spacing", 4.0, "column-spacing", 4.0, NULL); goo_canvas_item_model_translate (table, x, y); #if 1 goo_canvas_item_model_rotate (table, rotation, 0, 0); #endif #if 1 goo_canvas_item_model_scale (table, scale, scale); #endif if (row != -1) goo_canvas_item_model_set_child_properties (parent, table, "row", row, "column", column, #if 1 "x-expand", TRUE, "x-fill", TRUE, #endif #if 0 "y-expand", TRUE, "y-fill", TRUE, #endif NULL); if (embedding_level) { gint level = embedding_level - 1; create_table (table, 0, 0, level, 50, 50, 0, 0.7, demo_item_type); create_table (table, 0, 1, level, 50, 50, 45, 1.0, demo_item_type); create_table (table, 0, 2, level, 50, 50, 90, 1.0, demo_item_type); create_table (table, 1, 0, level, 50, 50, 135, 1.0, demo_item_type); create_table (table, 1, 1, level, 50, 50, 180, 1.5, demo_item_type); create_table (table, 1, 2, level, 50, 50, 225, 1.0, demo_item_type); create_table (table, 2, 0, level, 50, 50, 270, 1.0, demo_item_type); create_table (table, 2, 1, level, 50, 50, 315, 1.0, demo_item_type); create_table (table, 2, 2, level, 50, 50, 360, 2.0, demo_item_type); } else { create_demo_item (table, demo_item_type, 0, 0, 1, 1, "(0,0)"); create_demo_item (table, demo_item_type, 0, 1, 1, 1, "(1,0)"); create_demo_item (table, demo_item_type, 0, 2, 1, 1, "(2,0)"); create_demo_item (table, demo_item_type, 1, 0, 1, 1, "(0,1)"); create_demo_item (table, demo_item_type, 1, 1, 1, 1, "(1,1)"); create_demo_item (table, demo_item_type, 1, 2, 1, 1, "(2,1)"); create_demo_item (table, demo_item_type, 2, 0, 1, 1, "(0,2)"); create_demo_item (table, demo_item_type, 2, 1, 1, 1, "(1,2)"); create_demo_item (table, demo_item_type, 2, 2, 1, 1, "(2,2)"); } return table; } static void create_demo_table (GooCanvasItemModel *root, gdouble x, gdouble y, gdouble width, gdouble height) { GooCanvasItemModel *table, *square, *circle, *triangle; GooCanvasItem *item; table = goo_canvas_table_model_new (root, "row-spacing", 4.0, "column-spacing", 4.0, "width", width, "height", height, NULL); goo_canvas_item_model_translate (table, x, y); square = goo_canvas_rect_model_new (table, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, square, "row", 0, "column", 0, "x-shrink", TRUE, NULL); item = goo_canvas_get_item (canvas, square); g_object_set_data (G_OBJECT (item), "id", "Red square"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); circle = goo_canvas_ellipse_model_new (table, 0.0, 0.0, 25.0, 25.0, "fill-color", "blue", NULL); goo_canvas_item_model_set_child_properties (table, circle, "row", 0, "column", 1, "x-shrink", TRUE, NULL); item = goo_canvas_get_item (canvas, circle); g_object_set_data (G_OBJECT (item), "id", "Blue circle"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); triangle = goo_canvas_polyline_model_new (table, TRUE, 3, 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, "fill-color", "yellow", NULL); goo_canvas_item_model_set_child_properties (table, triangle, "row", 0, "column", 2, "x-shrink", TRUE, NULL); item = goo_canvas_get_item (canvas, triangle); g_object_set_data (G_OBJECT (item), "id", "Yellow triangle"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } static void create_width_for_height_table (GooCanvasItemModel *root, gdouble x, gdouble y, gdouble width, gdouble height, gdouble rotation) { GooCanvasItemModel *table, *model; GooCanvasItem *item; gchar *text = "This is a long paragraph that will have to be split over a few lines so we can see if its allocated height changes when its allocated width is changed."; table = goo_canvas_table_model_new (root, #if 1 "width", width, "height", height, #endif NULL); goo_canvas_item_model_translate (table, x, y); goo_canvas_item_model_rotate (table, rotation, 0, 0); model = goo_canvas_rect_model_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, model, "row", 0, "column", 0, "x-shrink", TRUE, NULL); #if 1 model = goo_canvas_text_model_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); goo_canvas_item_model_set_child_properties (table, model, "row", 1, "column", 0, "x-expand", TRUE, "x-fill", TRUE, "x-shrink", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); item = goo_canvas_get_item (canvas, model); g_object_set_data (G_OBJECT (item), "id", "Text Item"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); #endif model = goo_canvas_rect_model_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, model, "row", 2, "column", 0, "x-shrink", TRUE, NULL); } GtkWidget * create_table_page (void) { GtkWidget *vbox, *scrolled_win; GooCanvasItemModel *root, *table; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = (GooCanvas*) goo_canvas_new (); gtk_widget_set_size_request ((GtkWidget*) canvas, 600, 450); goo_canvas_set_bounds (canvas, 0, 0, 1000, 2000); gtk_container_add (GTK_CONTAINER (scrolled_win), (GtkWidget*) canvas); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (canvas, root); g_object_unref (root); #if 1 create_demo_table (root, 400, 200, -1, -1); create_demo_table (root, 400, 260, 100, -1); #endif #if 1 create_table (root, -1, -1, 0, 10, 10, 0, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 180, 10, 30, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 350, 10, 60, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 500, 10, 90, 1.0, DEMO_TEXT_ITEM); #endif #if 1 table = create_table (root, -1, -1, 0, 30, 150, 0, 1.0, DEMO_TEXT_ITEM); g_object_set (table, "width", 300.0, "height", 100.0, NULL); #endif #if 1 create_table (root, -1, -1, 1, 200, 200, 30, 0.8, DEMO_TEXT_ITEM); #endif #if 0 table = create_table (root, -1, -1, 0, 10, 700, 0, 1.0, DEMO_WIDGET_ITEM); g_object_set (table, "width", 300.0, "height", 200.0, NULL); #endif create_width_for_height_table (root, 100, 1000, 200, -1, 0); #if 1 create_width_for_height_table (root, 100, 1200, 300, -1, 0); create_width_for_height_table (root, 500, 1000, 200, -1, 30); create_width_for_height_table (root, 500, 1200, 300, -1, 30); #endif gtk_widget_show ((GtkWidget*) canvas); return vbox; } goocanvas-1.0.0/demo/Makefile.am0000644000076400007640000000504211412723611013400 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ @PACKAGE_CFLAGS@ # -DG_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED \ # -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED \ # -DGTK_DISABLE_DEPRECATED noinst_PROGRAMS = demo table-demo generic-position-demo simple-demo scalability-demo units-demo widgets-demo mv-demo mv-table-demo mv-generic-position-demo mv-simple-demo mv-scalability-demo demo_SOURCES = \ demo.c demo-fifteen.c demo-scalability.c demo-grabs.c \ demo-arrowhead.c demo-features.c demo-events.c \ demo-paths.c demo-focus.c demo-item.h demo-item.c demo-animation.c \ demo-clipping.c demo-table.c demo-large-line.h demo-large-line.c \ demo-large-items.c demo-large-rect.h demo-large-rect.c demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) -lm mv_demo_SOURCES = \ mv-demo.c mv-demo-fifteen.c mv-demo-scalability.c mv-demo-grabs.c \ mv-demo-arrowhead.c mv-demo-features.c mv-demo-events.c \ mv-demo-paths.c mv-demo-focus.c mv-demo-animation.c \ mv-demo-clipping.c mv-demo-table.c mv_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) -lm table_demo_SOURCES = \ table-demo.c table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_table_demo_SOURCES = \ mv-table-demo.c mv_table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) simple_demo_SOURCES = \ simple-demo.c simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_simple_demo_SOURCES = \ mv-simple-demo.c mv_simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) scalability_demo_SOURCES = \ scalability-demo.c scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_scalability_demo_SOURCES = \ mv-scalability-demo.c mv_scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) units_demo_SOURCES = \ units-demo.c units_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) widgets_demo_SOURCES = \ widgets-demo.c widgets_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) generic_position_demo_SOURCES = \ generic-position-demo.c generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_generic_position_demo_SOURCES = \ mv-generic-position-demo.c mv_generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) EXTRA_DIST = flower.png toroid.png goocanvas-1.0.0/demo/demo-item.c0000644000076400007640000000777611412723611013410 00000000000000/* * GooCanvas Demo. Copyright (C) 2006 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-item.c - a simple demo item. */ #include #include "goocanvas.h" #include "demo-item.h" /* Use the GLib convenience macro to define the type. GooDemoItem is the class struct, goo_demo_item is the function prefix, and our class is a subclass of GOO_TYPE_CANVAS_ITEM_SIMPLE. */ G_DEFINE_TYPE (GooDemoItem, goo_demo_item, GOO_TYPE_CANVAS_ITEM_SIMPLE) /* The standard object initialization function. */ static void goo_demo_item_init (GooDemoItem *demo_item) { demo_item->x = 0.0; demo_item->y = 0.0; demo_item->width = 0.0; demo_item->height = 0.0; } /* The convenience function to create new items. This should start with a parent argument and end with a variable list of object properties to fit in with the standard canvas items. */ GooCanvasItem* goo_demo_item_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooDemoItem *demo_item; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_DEMO_ITEM, NULL); demo_item = (GooDemoItem*) item; demo_item->x = x; demo_item->y = y; demo_item->width = width; demo_item->height = height; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* The update method. This is called when the canvas is initially shown and also whenever the object is updated and needs to change its size and/or shape. It should calculate its new bounds in its own coordinate space, storing them in simple->bounds. */ static void goo_demo_item_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoItem *demo_item = (GooDemoItem*) simple; /* Compute the new bounds. */ simple->bounds.x1 = demo_item->x; simple->bounds.y1 = demo_item->y; simple->bounds.x2 = demo_item->x + demo_item->width; simple->bounds.y2 = demo_item->y + demo_item->height; } /* The paint method. This should draw the item on the given cairo_t, using the item's own coordinate space. */ static void goo_demo_item_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoItem *demo_item = (GooDemoItem*) simple; cairo_move_to (cr, demo_item->x, demo_item->y); cairo_line_to (cr, demo_item->x, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y); cairo_close_path (cr); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_fill (cr); } /* Hit detection. This should check if the given coordinate (in the item's coordinate space) is within the item. If it is it should return TRUE, otherwise it should return FALSE. */ static gboolean goo_demo_item_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooDemoItem *demo_item = (GooDemoItem*) simple; if (x < demo_item->x || (x > demo_item->x + demo_item->width) || y < demo_item->y || (y > demo_item->y + demo_item->height)) return FALSE; return TRUE; } /* The class initialization function. Here we set the class' update(), paint() and is_item_at() methods. */ static void goo_demo_item_class_init (GooDemoItemClass *klass) { GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; simple_class->simple_update = goo_demo_item_update; simple_class->simple_paint = goo_demo_item_paint; simple_class->simple_is_item_at = goo_demo_item_is_item_at; } goocanvas-1.0.0/demo/demo-large-rect.h0000644000076400007640000000321411412723611014463 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-rect.h - a demo item that exceeds the cairo 16-bit size limit. */ #ifndef __GOO_DEMO_LARGE_RECT_H__ #define __GOO_DEMO_LARGE_RECT_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_DEMO_LARGE_RECT (goo_demo_large_rect_get_type ()) #define GOO_DEMO_LARGE_RECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_DEMO_LARGE_RECT, GooDemoLargeRect)) #define GOO_DEMO_LARGE_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_DEMO_LARGE_RECT, GooDemoLargeRectClass)) #define GOO_IS_DEMO_LARGE_RECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_DEMO_LARGE_RECT)) #define GOO_IS_DEMO_LARGE_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_DEMO_LARGE_RECT)) #define GOO_DEMO_LARGE_RECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_DEMO_LARGE_RECT, GooDemoLargeRectClass)) typedef struct _GooDemoLargeRect GooDemoLargeRect; typedef struct _GooDemoLargeRectClass GooDemoLargeRectClass; struct _GooDemoLargeRect { GooCanvasItemSimple parent_object; gdouble x, y, width, height; }; struct _GooDemoLargeRectClass { GooCanvasItemSimpleClass parent_class; }; GType goo_demo_large_rect_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_demo_large_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_DEMO_LARGE_RECT_H__ */ goocanvas-1.0.0/demo/generic-position-demo.c0000644000076400007640000001676211412723611015723 00000000000000#include #include typedef enum { MODE_MOVE, MODE_RESIZE } Mode; Mode drag_mode; GooCanvasItem *drag_item = NULL; gdouble drag_x = 0.0; gdouble drag_y = 0.0; gdouble item_x = 0.0; gdouble item_y = 0.0; gdouble item_width = 0.0; gdouble item_height = 0.0; static gboolean on_button_press_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { if (event->state & GDK_CONTROL_MASK) { if (event->button == 1 || event->button == 3) { if (event->button == 1) drag_mode = MODE_MOVE; else drag_mode = MODE_RESIZE; drag_item = item; drag_x = event->x; drag_y = event->y; g_object_get (G_OBJECT (item), "x", &item_x, "y", &item_y, "width", &item_width, "height", &item_height, NULL); goo_canvas_pointer_grab (GOO_CANVAS (user_data), item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, NULL, event->time); return TRUE; } } return FALSE; } static gboolean on_button_release_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { if (drag_item == item && drag_item != NULL) { goo_canvas_pointer_ungrab (GOO_CANVAS (user_data), drag_item, event->time); drag_item = NULL; return TRUE; } return FALSE; } static gboolean on_motion_notify_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventMotion *event, gpointer user_data) { if (drag_item == item && drag_item != NULL) { gdouble rel_x = event->x - drag_x; gdouble rel_y = event->y - drag_y; if (drag_mode == MODE_MOVE) { g_object_set (G_OBJECT (item), "x", item_x + rel_x, "y", item_y + rel_y, NULL); } else { gdouble new_width = MAX (item_width + rel_x, 5.0); gdouble new_height = MAX (item_height + rel_y, 5.0); g_object_set (G_OBJECT (item), "width", new_width, "height", new_height, NULL); } return TRUE; } return FALSE; } static void setup_dnd_handlers (GooCanvas *canvas, GooCanvasItem *item) { g_signal_connect (G_OBJECT (item), "button-press-event", G_CALLBACK (on_button_press_event_cb), canvas); g_signal_connect (G_OBJECT (item), "button-release-event", G_CALLBACK (on_button_release_event_cb), canvas); /* g_signal_connect (G_OBJECT (item), "grab-broken-event", G_CALLBACK (on_button_release_event_cb), canvas);*/ g_signal_connect (G_OBJECT (item), "motion-notify-event", G_CALLBACK (on_motion_notify_event_cb), canvas); } void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root; GooCanvasItem *item; GdkPixbuf *pixbuf; GtkWidget *button; GooCanvasItem* child; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Test clipping of GooCanvasGroup: We put the rectangle and the ellipse into * a group with width=200 and height=200. */ item = goo_canvas_group_new (root, "x", 50.0, "y", 350.0, "width", 200.0, "height", 200.0, NULL); /*goo_canvas_item_rotate(item, 45.0, 150.0, 450.0);*/ child = goo_canvas_rect_new (item, 0.0, 0.0, 100, 100, "fill-color", "blue", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_rotate(child, 45.0, 50.0, 50.0); child = goo_canvas_ellipse_new (item, 150, 00, 50, 50, "fill-color", "red", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); item = goo_canvas_polyline_new (root, FALSE, 5.0, 250.0, 350.0, 275.0, 400.0, 300.0, 350.0, 325.0, 400.0, 350.0, 350.0, "stroke-color", "cyan", "line-width", 5.0, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); item = goo_canvas_path_new (root, "M20,500 C20,450 100,450 100,500", "stroke-color", "green", "line-width", 5.0, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); pixbuf = gtk_widget_render_icon (GTK_WIDGET (canvas), GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG, NULL); item = goo_canvas_image_new (root, pixbuf, 150, 450, /*"fill-color", "yellow", */NULL); g_object_unref (pixbuf); setup_dnd_handlers (GOO_CANVAS (canvas), item); item = goo_canvas_text_new (root, "Hello, World!", 250, 450, -1, GTK_ANCHOR_NW, "fill-color", "magenta", "wrap", PANGO_WRAP_WORD_CHAR, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); button = gtk_label_new ("GtkLabel"); item = goo_canvas_widget_new (root, button, 50, 550, -1, -1, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); item = goo_canvas_table_new (root, "horz-grid-line-width", 2.0, "vert-grid-line-width", 2.0, "row-spacing", 2.0, "column-spacing", 2.0, NULL); goo_canvas_item_translate (item, 10.0, 10.0); setup_dnd_handlers (GOO_CANVAS (canvas), item); child = goo_canvas_rect_new (item, 10.0, 10.0, 50.0, 50.0, "fill-color", "blue", "x", 10.0, "y", 25.0, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 0, "row", 0, "columns", 1, "rows", 1, NULL); /*goo_canvas_item_translate (child, 10.0, 10.0);*/ child = goo_canvas_rect_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 1, "row", 0, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "green", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 0, "row", 1, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "yellow", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 1, "row", 1, "columns", 1, "rows", 1, NULL); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Use Ctrl+Left Click to move items or Ctrl+Right Click to resize items"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "integer-layout", TRUE, NULL); /* gtk_widget_set_size_request (canvas, 600, 250);*/ goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); gtk_main (); return 0; } goocanvas-1.0.0/demo/toroid.png0000644000076400007640000004102511412723611013353 00000000000000‰PNG  IHDR€NèÜgAMA† 1è–_ IDATxÚì¼{°åÙUß÷Y{ÿç}Î}ßîÛ}»{¦gz^fô–’ñ2 ÀÈ@•ãØeBʱƒ‹ÂŽ$•„`W*6±qQeRñŠ$e„ ‰Œ4Òh4šg÷ôû¾ï=ïßï·÷^ùcÿúv+ÈPe —„rº~unß¾}Ï9¿½öZßïw}×þÂ=Éu¡yʼnáæ»Úú -äÐíðÌî“áƒã«áP\ïŒ}ó¹·&?¼ñ ½ÏŠÑjŠ‹Ÿr¹öYÿÛã=ÿ\«oάž5µzf­;à,AÝp—ç&ao¸§/ÂË®”Ð/{í/ÿû×ÃÝúúz·)–L,)†DÔI‰W§^f&Õn¶!oXÿŽä¯/}“¾©sJûi$u¨Ì…ÙóÉöåÈGDýöÃ?(ß·xO8‘g«ˆõBu˜º/Ú+ûÝ3w=$ç6î w·ZØ<ÅH??; Åx;Ù¾y‘«Wž“§_|ªúøÞ–>5ëUWR¯…*þë%¾öÀ˜¼6Ù0¯HNÉC麞M–Ù´ ]²‰A䢿i¶Ç/úOµï×oZùnygçnŸg™’)$Òz”pãqA«À…o:‹‹’Šz^N™îÀÉ3ž¥“J+SR«$‰BX✠!Ì¡Z¶“âÚ‹úòÍËá…íkæùý]e<Ôkã‘Ù.fº[~RzU…þÿð'ҥГ®Y'§- 9­]VÉi±žÞkÞ%¹d‰~:ÐÜ6›()Fl0ÈLÕ!ÍÕ·6Õ4*™ÄEO$ É$áúï‹N¯VÜ÷nKï´'óHb F·ŸJ¸þÇ+ßaää=^£¤rÄ `UÔx07P‰h8¯ÁŸ)åÄÈ|$:>R7RŒM1›0ŸMÅMÌöçž ÿÕ¥+î!hù wÔHK‹MsWþ}æþôM<`_¯+,KW -rO*ÔV"VUPIªRgÄU%k@Þ…¼¹;5uH2Eöÿ Õ›¯ä®o³zâÑ€u"™Ía牔ËTñèwZÖ/x”YH!5*™7:=)D¥TLĪj¨ EŒUÔ+åf#a6R&G0"£4am©qðkï+àâUÿᯕHþý¾œBBOúÉýöõÍÿLk½Õfà»jµ„´Î³Ç—€µ¨­D­R¥"$J’@¿Ñ“ÛanGnŒh   uŒ(·2®¬’Á]°ôâ+E‚¢©ÈÁó)Ï| äþ·&,ßãñN1 !ŒPŽv®t®²Ø…•$5 ň›€ŸA¨™•çAT‘¾‚ùŽŽÜ(o|E±ø–צ?yéª\!ܺ+©eui`9†'ŠŠ½¿X †”޹ÏÞÕy»<Üý.ä¯ ›vC/bš$©"v² ÆÔ¹ÉÄ£^Q*ÂBw‰³{x®|š¹<¨'Äà)…ëØTY~µA“€ŸA’€›Z.~ÔÓ[7œ|%T¥’ a¼ó…yûw½í.ÖVöf—U8WBYÀ|¤ø:-eqs#¸9”‰¢f3¨ ¡‘+½&΍ Š .ŠÖ‹ëƒ"&ÒDŦàPµYª(Tokã¯PP5@‚ˆ7:|>4]„ÞCà5@¤9ê& ן(Yý¾B7ÎyõÛ›º;Ù"”AÄ¡‰ ¨”*¼ƒ¢„ñw¡“Ã#÷‹v›*Z¡½¶ "¨ž\Jh§ÞÀÚ ,·³€/à¡uát ¯´,ËVX ÊÍÔ²rÿ ó‹ßu¿ù¾3+Öü·¿¯;/î†|íeÁH+;ÍÝ‹o³ß|ú'ô ' §Zm[!U0 $hOÌã VÈR$” t>ƒj> •¢ó :hË`]1:C²‚v£A 6x¬zŒõ¤VÉQÅä¥@ñ%…€äg`é9Õ¬”0FÏPí$ÜülÉÒ™„Á†a:„<RÚ<ñXãyÅ77™ëXÊQÀÔTÒIĤ˜ 4Ÿ ‰Uª*fƒ­›0ú+žNŽ´2¬¨¬ö«`ƒp°/„Ji[xìœ%—@`¥#ƒÕ}¬¨TîZ–¿óÈjxí+Õ¶rÏZÛ<ôâ®ÿÚ Ts÷â_–wÝó·ô­çqë-h$°(Æ!¢à]̼‰HÍ¡(,ØÒI‘™Aý1ò˜+¾ôd+’Y“ñÕL·Ig±…MbJÔULwæøënÔpúçsZK9‡— 2í¼É¥?(ðSX¾/¡ò®€NËpñ‰ŠýKއÞjHÚ%Ã#) 5æØ’ÄÔLÞUZ)„©pñY%(LÆ0 éš V±¢hP ¬t * ×·#`=»j8Ñ„~îÞÔ_(+ÖZøÁ™6ô×à,©‘ͯ% ºÒz}ãÙŸá/½ò»ü™vJ/ƒ†Ô:Äy£I;Ë¡,™NGÅ ¬äã‚G Ðha—2q£Tf ³Àl<¥³Ñ¡»ºÊáËÛ¾|D–Cžƒ `ç`4!ëÃÒÙ6³Ã ÕZˆý—×Í5èœV†û%yãë³+X\‡“÷ “O( O ™/ ;Jq¤d: èw¡ÛTò3–§>‹’ó0)V•Ü€/#8YìZúŒF–­GÃÀCkBUM~ö÷Œ±Tš@K` B˜+š(˹v¾6ÀÐþwš÷<öõu›÷„h'µlb"6Ó€Þ˜1¯fHžH J¨@Ôh,¨UçÑYÀ·…Π.K˜íî@éa.PxÆÕ4N54=ߢÜr¸aÀ¸È’ldñF&,®v&pt³$µ± íš%pëê-º]عî fÁh¤móY¸ mh§Š(rmÌ•µ¦pf ñ^Õ×µˆƒÔCfÀUÊt6 l´Ìƒš !1´ºoZnÛ2mfïÒ‘ûõ¹—mEýŸ_dfÕ¼úÜß“ÿàUï ÷­dÚo@#‰Ì(ÆyÌþ½4?AÝ™5Êå&t-’:‚ *âj“è ª€zU“Ê£SÇxTH¾ÜÒl½OiagÓSÕùt '³ið«ŠN4’$‰uÉŠ0h·¤ÝÈuë™}üÒ9m_öûhÒ…Þ˜î‰a÷9åà’²´),žR†{±r5º¢»/ÃÎ%…z0è¡‹‹°Ø‡^ š)ä‰gó´áâ³±²MÆ@P1=,¬Bo€£Z•¨/ÛQÍ3hˆ°¹á´ÙÆ#ÕÉLÛFË¡:§°´Ø 5¥lÍÑ4Àz;©¬Š4SC š:¯`¢J&B•]VJQõ6*—©¢D$®ýãgí{ûIræý×üOMƒ^üª€¬/~?§O~Gp É÷-¤^rãÿÜ>ô Û…¤!H¦xIš(¦.pÞG€ç+4T¨ñÐJ1ƒ:¯Ðy%̽2W´RÌ©ieÎ;ôY[À8‚ppËPõá0Œ7‘¼6Ö„ê0à&Q8H ëªÃ@5†7b`qS(¦J5¼ö.©†h¿ ‹kÐíCUŠîì)Z°§4ï…ÅvJ–´¡¬®¤ŒG%á#øLpF'³ VWÐdO¯ïL)Ê@ÓB'1PÅþEÐ^ÛOŠW´ôQš‹b@mÝ–ÎTé¶3ò ¹6”Vâùáæ[Œýçÿû÷£“À¥×°Òi=<ÐÎÀµa’Ö*í”pùPht”^M°™¢ $9ÌGȤB­Äö >DàW:(+NÕ¶ «(JÕI “…'X‹,eМ#XT=\VÌè!ø+ˆkŠzUR…þ£Ý³Š›(:ŽòƒI¡¹l(gŠ0¹ðSht¡µ$2Ù jœaÿF <ˆ•«¿ ýEa>‚á®rtfÃÈ ÂTX´Y=Õ#̯ÉÊúÒ‹ppgšÕ}Q!mvñL¹¹;ÃH-X¯„2ªzÞ#‰ zï‚å¥Ý€WQÕÈ**ê«ö%ØZ4µÄb€\[©2B½¦Ú÷¬…7íé?ú­­êoÌ•í—Äd‘’•0sñkL±Œj™C3‡¼Åø` i"ƒtv=BõDâ;Nn¡™ (ïÐQ@-fc - 8ÂTQW!Yy†v+äõYÈ%ÅìsT¥¹!ôÎ yO 3Eg‚T5KèF¦Pí+nW)Gu»bÝPLÑòP(ÅQDäÝ%è/ “ì^V·az˜FCÈ“ ßw–vs¤§NNùcFØß+YëóxP\åГƻ,,,L‘dO€€ÉSÔähYÀÄÇà æ +»ÚÃßÁÈÅ,pI±÷fø£)º"Ø!=/dS!Q¥Ù€¬!a{Iê4îþ¬#T#Å*n¥\›AÞÆÛžêüB½ý˜•ý­¨…R9%EO”O}ªâÑW¾Ì=›pb9ÌÆÊî®çDßDdªJ9ž ý&£ém¿(¢¯$€R” N9×É æEÜáDl€ NyÙNPð ˆ Db+…̃9R.È.Ùw?=2Ÿxjþå–sGzÿ3õ>cĤÉYV—¿•f3'Ï…,Ò\°‰ˆIDÓ\tqUÌêi!kÄO’ Y*dM‘VW¨ÆÂþHØÃÖÝ™ˆ©¼HÇ ê„Ñ\˜T¬æ•H'ixÑ›áÀ 3'¤"ÒK„ªm‘¾Jº¨’. Í…Tl*¢U™#Ì™#â‘$1)o¨ø  ! Ýe7U™l!Õñ%b ²´&’5D¶¯"Dº=dyÕˆ¯DÊ™Š€Èl†„¢”Sk^š©È“Ÿ 2ª¬÷œ[ùÈNœGZSY;yBÞÿ¡kâ=br¦%’)RÈdŽŒgÈd†x‡/’HoŽô‹xµçH³Dò I $©/3Gt†ØÁÇ÷eØ Ò˜©´½ÚåvòÈSýÔ$èå?;I¤Ù:#'¾Ûœ¿û;í`1‘……Óne©©iJA©q‹†(âP:B»ëwÃ|ÓÝ: €6{à–€ 4 ä-ð%¡˜Á1¶›Ú=œÂÜCÁì‰rbˆ^ÁXPæÈB ]SAsE-hRë±iL½õÇI¢œ\lGÙ2U­ƒ«ëâÿ1Dw‘ˆáÊóñÐj)UÍžçž ×^4ì^):(<õLàž3Î't[ÂŽÂK7<¯Û˜*‚°·=aïúÎE„_yØAZ÷I©Ì„aÝIg°ì ÑÓh<¸ú3ÙÅÓ$Äd›ÖϾSÄûP¤‚Ï"ÖH¦ÊciX{WÇþÍ_=tŸõ>ÿ2€HnN|¯yýkþG^õÈù³çÎû“'ϺյÅÐ[4Ú[‚Á*2XGºËHÞ l ÆÆ¼Ú`²6ªØ=IS$ï‚›B#…Nz¡ßEMt^!& Ó)ìÏ`æ¡ðHC°@¸6£ ÆÑç%« j& Ø,êPâZ¤™s˜ î„ h ª‰5 o(aë:uåj·“°C™¨˜h "±Qõëv”'-ó±a:X ,„éî=+^¾(l®¤<ó’§,…nèŠã3ϱ“„Ä)êb ¼t/ìA9†f mUüíT|œ‚¿Õÿ®D @Ôxƒ8©í–ÐAN&æÌ§—ö‚~îßÒï½Å¼òÁìW–OkšŒ‹+¦.æ¶äf2H[Ðè#i—Úï˜M¡Ù‰‹XA²&Æ4ñ±X¶B3vY$O¯H1F¯`T«‚F¡s­nˆ ÈP éa)nkkt\S"3ûwª«‘ PÖpÚIãôêðÏëœÐ4òqQ'/¼ðIý»ÕTZy“3h´­$ÒòôV¤ìo+eíñ£»øìiËÓ_ò%,¶…jnÙy¿goÔ%X…ùfláh =`ÑDÕzÑ+¥B)h•œ%¸ãSLHÍPlT¸êK1«ññB"J_5©Ä,~¦âñ*’ù?öÔúOúõÕoÅXù²Å{¡¾ê ¨õ…É!i!šGŸG*`È»HÖ_`²”´Ý#„It\f©` ìàp‹‘ pu¶'0/A ÒOÂV‰ŒÙ–«ú¸ºÊ i¬ ¶;dß ×-Å'Í ÿZ£ø/ë¡I¤4Ka&êíÎèEù­OûÿüàùðËn"×ij•̇×ùÝë_Ô¿wx=¼|ÀÇ Æ4ÛæQrQ0b0(F…vÓÓïgìn)ÞE)úèHY]HØÝ !AèfÂÖ~äú½Äru/DÔN$?ÓYô4Ú)žjL÷®ª™ …Áz‹h‚b‰Í”%EH0äXXLíÅÀ`±Ø`À¬¨œ3l¾¨b^ úÁÛ–ì;ËÿɵŸÐW>ø5kZ½¨è5ºÐhǶ[–ÇÞh£y3~5 iÄç,ƒ$EÄCK¡×ÀtZˆ¡2bse­ýgu*»H""óáñ?‚ÃèdÑb>úìõs×ìƒ:°VÎ70ýúøáEý˜¯Ãã4å!óˆü]s{’“%sœnéKáÏ”/†ßõúY<Å1’MXP LRܶYýI‡úßOrºÓ7ok¶õ‚5JšB«-핹°yÆÜSL9}´ë2#‘mt²¸$‡žD`©™°µçSËî¡?\,SI? qÇ» :sXu«©Un©7Ÿ­ÖÔÏ)–B³ƒŒ€e®9К^´àiËÁ2?~Mù­/"F'Å“¢Ù–.œ9!­>Úì@ÚŒu]Rp)xkkâ¡åжö®ÊZMsdR•ˆMY\;Áð0°dÐZãº:$UÜá˜ðôKàçÐO¡È1­¶óÏMÿºÙÈþ†·É÷èN°Æ'CÿŒþœ…ÇeªO…Oé{ÃgYvIHÄáµd Ïì+˜çÇž~™¿î+Xî¾Â¿Us½r0÷ÿâàËØØ„^³6º=ypiÙ~ïÒ¢¾¾‘éÊh® ãƒA”‘C%òù½©?vö™P'Ïœ‹LRÁ`+•F¥˜€DÏD}ëŒE°uy ƒG€œÊÏàÅQÉ ™³î,S©8xücWü¿züoKCF]çIRƒÿÜö¿dì^ÐC÷q;f__,þ©NÕ¯Õéµd2™†§õñÝð­ýÍí=~ßÓÏsÖ¬Ð4±3-‘u*¨c"¶Jf°V –]rFäLH™R’ТŊôèÒÄ×hÈ­ý÷ÜXRšJ‚à X¬&,ˆk~œpý&ü¡%Ií½þû°zâAŒ´æ!ÄH áÿËEb±ª|Ôñ‹ 3L±¤ÝFå–]7a:*X§d”§Œ¡Šm·Åä·>ü¸ÿГ[¦ÕËf1{§šfêGáKÿ e8Âq¤‡þc:Û_/ó«ªT!0+*¹ºs~ç`$Ÿ-*³SyB+— QLÛ‘ôI%tÆÐ †QHØ×œ‚„S§pƒÃÒ¥É&6èÓ"EñÑ[£­—Yê HIÈÈŽ‹H‚Ôÿ®—ÿ?ª¿˜fóœö{÷RÍëjàjO~a©õu×Á×*KÓ¼—H@«:04´ŸïaL+ÑÒ çNp?+œ¥CK xRpŒ™%S<C…¡¨ƒ Ä’ÓÀS¢€’3ÐéBYI´˜¿lŽžfÐ{¯u·ÁßîÜY‹HŠÖÒ/Zã€y=1žÄ¯Û±*}t2E®îÃÙ,~#¨1Oæp·Ç̇H9½ÃÀ"‚ù ùÐ[ŸÐNÃG§|d¯i>xß’ýù>þ<¡vÎ×bŽ:œç4÷Ê:gµO”Ô²OÀaˆ[Ò‘“˜RQ2¯¹‚E(ëKÉPÚÜylÁ ´LWæ6Aµ 7¶ìŸyOH;BÖ¤{ùI$¨Ob‹7Iã/¨f‘°Î¦0ÚL³µ‰fË itüìåEÔú(Kœ÷ó[¦7‡ÉV^ÞþÂ×ã©_ÇÞLÿgvØ}hÁþ˶øUDZ´Øä4ägu‘žft°ä˜è´' ¸z.Т…K àqK…¥ÄÖ Yûì#YlÑ4m쉄$]‘ÞÊ·SµÛ’d u!mD5ðö…ÄDÚæöa|[ËçÐîyn짆&²¿‡fZ=Œ K¤Â^:D?ú‘úÏ^þç߈‹s‚ú½B?ô¹=ù+÷çæX£ußiÎp¿ÜÅ9]¡«9-,†–IÈR‹º’à«Úœ°rr¡ "¥¼78,=Dµˆ”³Ž±=I6Y?ó3ººùƒê¼a2Œz¹tãî7½ø,¦žÁª¥ ztÓ ¤ë0xìbÝ .믌°µ‹4r¨2 è,G« ߘ>qóÓZèßài%Ÿ™…ÅϽBºï=Å€))N ÒKÕÈ1™¥˜4DõŽH˜`¸gO äõ÷ )9 Û 2 IDATG$™±Mš‰a{!‘“§~*XÓÀ•à˸£M ‹Q¥VÔõµv'x‡½ŒŽ¢*¸xÚ܈æuÇ= Ùº‰ú÷Ñp*z²M…Ÿ¶0ç~ä§eöÏÂá³ÿó7jH0'_gîþ'oÔ o?VHhSa™HB‚Á“’«a:-F3rÓ€¼7£Ô„‰‚àè’6–)‹d ê.Ad·È ’«²$éB"ÁÏ:Q•¨Š˜Ú;.R;iDÍR¢Tªº})Át]|èÄÝ_wºÄW°û4açY$í<ŒbÁQW0m¬vÍêƒ?ÌáÅ÷EnYíB˜~ƒ,üÂ2ý7?$gÿÚÛÂCï\eAh‘“’i<+­÷k‚`UH<äÖÒ_X y×Xéãwö(¿ô³ñtŽ×ŠŠŠ@…Ô B$”3¦4‘º™H4°l2|ŒõÞ»EEô–Ë¡,¢åë–Û‚ô˜ÊlLîÅïwï‡t)Ö|*ЍG®†°ûy°wCþ0ª­H1C¦­›ö¡ÿ »ðýïÓ¤›èüéÏêøÓ?‹[Á(àq·^Àth¾úQsÏñ:}ð›Oéò`@‹ IÝà‘º«w« Tk (…wìïîbö0‰!1&ÙÈHP„Fþ• OA ñ”¤Øú7ǵLÔØD¯^þ¯m«¹é+‰¯©HYlêcÜü”s° Ð:Çd5:_PA†— ;Ÿ߄ޛQY7sþ2¿ ÕKàÀOîoHëî×iâ‘îC¯?¼¤ÓÏýÿ8Ì .zNãì½OÈÊ›^É}?zAϬ¯é2!ÜïcªŽJ@=/ ‘xB-áÆ+%ÅÕç‡x¤þ;x<Ž’Š‚’1S–Qlý: J„!ê ?žÿÒÙ»ü/…¥•7`“ïâ(Z;%5˜â°-f‰|ÉVÑ`ë±oAª)ºódwj¼ µ'cÒho‘r=|©vÐêØ»ëSæ¨mÓìuúÅ Õ˜.ôßnÆOÅ´ñuµô¶AãôÙøñWË#ï9«§Ö–ôúÚ2999 )‚ÅÔ•ÙÔ>­;~Cˆr¯úZ®¸ÿêñzÆ6 8‡Ç¨pTÌ)˜1#¥ Q÷c6ÃÙ ž¦æØ:'(‚¯U€R¨B©uDðÜ7½®åÓÇ`šýoÕçF%É ®¨Ç¶kpW•0Þ®õ€fôú:3¨Dx5m!É&Ò,u…b¯öH Šë†‚f¨_Á—“ø h_ ‹×Ç7°´Ih‘²i²¾Õ¤S©Ë}?ù󎕾iuQ—¤§MiÔ²ËíôêÅwuZ_ðb%öõ^“àŽÝ«¦„áø'=OY͙ޓ!ä$tX &39­ÈHÉ´½CÕqoQkü¯<'Ó«Û¡x!©ã½Á≿BÒX¾½@î¶®6žß:á–9dvõÈbTCýÖµ0¤®¬u‚:`<µ¡?ÉÀœŒ¾ç0„ÚåfȲÚüx«ræµ2%!ÆGL]+U,ŠÅ‰è€†ô—rî={rúMéÖº>z®Çæ ©MAf8ÆïzÉþèûgÕ{å?÷˜¼ûÛÃÉ,õ¡|´½W½h?õ=O„¼o[/ÿ“”lðJyëß ßûÎ3á®d>9YMå"ÏDÈRKž ꮘ¢¡n²ÕKZs…M1â³O¥3RM1žªnã(Ž@‰£D™s,M0•„-½AÉœœ@VÛDÒc·p,á)† ôjROO4è­¼5‘xª€«µ€<¾´8­Q"@×ô6ýó_ªEž<î~êVr "…&ª·ìPõ1š*1È¢üÌ)`¿v¹ÅÅ75N–Ú{+,)YÒ$‹:0I”AQ™2áy&úyrmÈÝò=]ÝÈHë[a4ÇɘàÍý§äÕ¿~Z-ÐwšÚ“xã\d"IÈÏÒ{z]ξ÷$÷òZý¶ÁIÎÐ"#'#¿C¸IÛ¬=ܦyÚR] l}n—ñxDzÜðŒaà uPV•̤œhlRå£ÙM˜OÉI(T(q¾£ÄGe” B“œ¶ælÈnêÛlž6q’8Ã@å¦uü‘ßûWÆImcQñ¾ *wìêŠ!´jëŠs¨D©8$1ÃxƒñžPë~A½ÃCH¡n!³P/¸Ff Ð["RZ«=ÐüFÆ·ní-¬Ì± .±–~¯ËB»Éè`Âl2%hÁ\.2æ Dg¬ð*œ£©½º>ÞªŽÊÄ\ã¢~˜9GœÓojÝË·´Z´ï`ä€ò7©—3xÇÁþÃÑEFþ)ÆîIZ,sJ¾“®n’ÕAÄñBÅXpÄ‹ü.C½Ìpžo£Iï}Ûz7W2ä‹ú!ÆÑg… ¼‰ÜKBV´/wâË7 ÃÃ7þHi\SÌšg4,u˜í5(GsŠù3ÕZÑÓ;ø¼¯3‚g¦Êt8戜¾iÒb‰9‡tê»rˆ2gNEY½˜ÝFZ¤ Èh’‘УbJÅœ?6ׯü±ßù­©ò1 ÐùäÓrtã÷Xºû¯ªÖ;¼"å,“iÛ±-¸!*¬$¸[H_oëÖêu­$Õ=ÄžCÝç£>ìûzXlø0­waCÇ^k#5&Œ8ô—(ü3$–xŒµÆäz‚P¸c¤}«æZ„ Wù(úÎpŽ·ÓbpL¸äŽI™—äÙ ×II8Ë#œä,Y-Çêñn¿sçûš†ö®—T×'‰§@%(,§ÛhÑj4hhÓoô™íMíì#e ¨Ë«…Ü€gŽ2eÆ4LТKO‚cÊ@:TZÖ,b^†€­ƒ`LB—”N]wì,ün¸øÏÆø/|…éàPèþå_”Öò»Èû§Pêí@¶ŽšØø¸1&Td‰Å—¡nÿúhçÓ óÚ^g€6Á>ò¥8Ãp¡‡aC†¡]/Â0Ns„Ç×£PI]ýbUHIXäa6g¹ÿ® &û ®½<©å9KÁSrMþon†OÒf•{x}ÎÕþì©…œmóy^ˆA8Áœãµu ¸šOƒÇÖÕøn*c†ìs}½ÎˆCæŒQõ$$X„l–Òœe4i0¸ÑeÉô8Ù_caiþQ‡ÑlŸ‘ð”T8<Šg LÓ£É2`O·éJ«}fL9dÎŒy]bqmÖùu,³ù‡õ…_{RwI£óÆÃ]qQ.ÿ«üœŠmà¦0¹í{‹I„baŠº9yšbÚ ³£)ž[6ðøC°qáƒÔ—Aå4È è•z·ú­v²;F“zßNªú9`iÑ!ç4Xgc°ÉæÉ;7 v¶ê±ñh†mDz/Oq#|”Œ§y =ÎÕÌÕ>mƒRÉ„çõ™3a™MNË#tt¹Fì‘fšúÅ ›0a‡—Ùâ»\§dNFJ‹ :´iÑ$''­‹™2£âJØâæÁ6-2ÖíK2`Qi²Öu;PQðÌfL™2eY»,É2»ºÌY¡Ã!; õ†ŒŽæ¸9Jñ7ötò‰-}覎?îÐÃ?å|€P…áõ_6ÅoÕþÉo!8˜\‚ù![F’^ þ ÔMÀWœ:9à†ŒøÙ%Ð)TÛÀ…Èó@€ØGcëŸY—M †&ЦZÚã÷Yt¹Ç¤–Ñ"3Mfá‹Ï!SxrÇÀ„˜”#ù§{‚œÄŽ’(-ÕôE­>š³¾½öÚß÷­µAõŒITÔ£]g;Äáþ“}ÙáÎà"áø%3Çd·žÛªuXÍÉ x¬=È_R*¶¨°Íáh hšªßA™£L µ±± $”UN\efUj#‹J£­I:EÂw‚¯9'Å'8m?ƒÌJ¢š‚FÎA2àwô+X8lð›<…k\÷Ù¢±BbSRpÈ6wy“1;”äxtèÑc‰%z,×mZ²+mmaK¬4¢¬¥[­kj'aʈBÆÜb‹.+ti­5{ì“@BLDLNŸŽè눱,Ã竇½2¿‘äÿ»èÝGÄ”ùeIí³Z Ð.¢q1;DÇAÔ¡R§è.õ¹p¾AgL¶¾GU&µG@\Ú† ÂôP“>º Õu›zföiiV"Çza÷ÀÎSŽ„¹qÈæ –K"±…ÃJ¯AîÞá­É—Iô>kâi>Üý v¾DVÆTæu-,l\b¹Á×Ù¡Ïi.ÈßdMwy‹[hÀ§Å+¬²É*,‹UÖ½ ÚVO5PHÊ*¯]×°„…‹K›&=:øx@E@DÈÉ’h!¨˜2%&aFFÊŒ” A—;r|³ºú…„òÞ{=Ô5­æÉºÊJáö>IU8Âê!¬:ºgÜ=XëdÅ*çÎzlnøÜ¿ñ"i41‡£õúYÔsbHCånc$¹I‹…I³ó¬2½­ó×üؤ‡Ü|_,:ä66¶]1,¯q-øWb}À æCÝß¡­NLcJ¦F€Qx–O)§\«žeÀ-šô9¯žá’ÿq²¬U+CLy¢‰«\ª;Üå*‡X(|ÚôXc… NÈ Î¶79Ñ]¥È4ñ,dšO˜–S=aª"]‡7"$%&%¡¤D!iѤK)3&L©Èé ‡1c†LˆMÁ7cFJŠ‹¢-<û-îßÙeôâ{•2Õt.çÓ«BW}Ñhýº.´À?ˆ j{-2y¥|.^ôÙ¾õãƒmsyO8[Kµ8– E\9@ ÁÁÔx®ˆ— ýØûøSÊX˜Äl#q(™2ª®°_¾@Θ'9kšç,ãqDÎ M†Dá ›^_q#y‘=} ÅøpïU› ›P#¾ßaXmq¯úBH |:,±Â:kö:OlžÆ*Ãñ”0›0%&$6MÍ1!ѱÏ3J2l¬Eá(ЄDää´°€’!“’™R±¢ECÎdâ^Ѿ\ÕlÛOÐzF|] ×QA_]"žeä:4«YãIŸþ’ÇÛ“Ëì”ß§¢¢Ç).5ža³y†ýј” Pàá³¾ÔeÂ7gWÁwñéÐg…“œîžâC7F»ƒ!A5"d@Șˆ‰ ~h‚?%2ßGL 0fBÀ”œ Ÿ6m,”GŒÅH Ë7¹µ;cæg¤r®ýƒ¶%—_Õ·¾Q?=j”¤áw(ã‰ÕoHg½A ª¼¦‹Õ:¥î2™„\f6¹I™ŒIÔ6jÀÜ 4ï¯÷r…ÄC™Ž·ºÈ~ Q-ó ×n…‹B>ì×HÙ4>k¬ð4mCWš\‡”ÌTØ4p¥Ãnvƒ­â5r|z¬‹'8ç=M0™逊6.kþ2‰˜p+¼NȰ¶UãâÓ¥ÏINú'¸ôø{böCBDŒ‰™2%gfhÞÂp Å‚ÈM‰™1ejÀ0%$$ 'Em|,$) /Ë·_ÿ/ýê^p„ú†VNfUTz_Ž\­îÿ}Q¯À÷UB¼D²ÿ†€KÂZÚÔ¥qp3Ë…OœX­)“kF 6‚ËF‹Ñ–GìEÅŠ.ÏBÖÈÀö±1  ‰¦ä€”‡Ì¸Gɺ½j%ž¤ËE©s,\|Fúvª×Éáà³ÌYNŠbÓrHF€…¢+úä"ã~| h “ø{¬²aŸäìê;÷Âcv ˜ßµiš¯OŸ%–Ì¿mšxX(4%!&Œ™0aB@H„Bâ‹.‘ˆy]\¿þ¦~ç¯Cf¯î1þR(¢­yº+ÆÞÐ÷þvDüÒ{­~œûJòàÙjð{¢ýÔßkõw5ZR܇ø%ðÛä¥@ŠÇAn@õA_jªy&8RôŽfZÉí«è!ˆ"˜/NÊHÀÒKÆ„”¢ ©HP¦žnsžçH™P ¨° ÏpŸÞ6Aöi±Ê2qi–$ Q€Ç2)‡Ùm"µŸ—&-–é²FÇ^f{/f˜ï2å€Ô§E‹UVéÉMíÓÐÆÆ|ÒOeøÃ”˜€=¶Øf‹-¶Øa›3<ìÓfÄ!gô&§X¦«—8+7W¨FA”»zòwû„_DcUTS³Oò>f€ã;B~@6zQçc(ÿ B Ê ÖõÕQÆßÅŒ1’o·ÀbŽFvÅH•b†:4ŒÈ5­‘󶦄Š)š #´û©P¸ôhr†§Q4(˜S§òšDj‘2`Ä R€Æ£GŸs,s’”˜C49-–PØŒÙ&dŸ’ …¢G“=ÖéÊ>EžrXn1à -Úœàgü3|äÂyVídb#«ÂjáT8Xx8´ðéÓceú´Ðäl³Ã¡0&"6ˤA!3ïyý½/¥»Gs)t¦Ñ3ŽÝHúÁ@C²ÁP%Vû#éQŒ¢b )û5\˜Z€áº€½8ï«ÅVP0T†õ«yê¢0E03}° ÚôÄלË2-6ñ9Â"gLΒĤý&)Bn3ãÐØxô8à !‘DìÒ¤ƒGÀ”æÔP§þ6]Vé°ŒÖ%{ÜgÀ›œå¢û$O?Ëé‹=&û3ÊÒŒ"]¸Ž?‹êiætir[Þ=«ÿûãÛì}½ÕùL§ëYQÒ°õ­êµŒ™ýÔcs~2ÔZoB¾ ÊøPþÇ¢G•dM¡Ö!» :5Vº ö Ò4Åß|ÚUµh‰Ì]=屟åHsæŸóÂpõJrpèà±NƒeŠ‚ Êc+?gBÄC2Æh l«‹Yz±¥Õ,‡-,š~ƒ^¯IÃr¹@hÀ8>àµ.lk·ßDL¸,¾óõ[úÞWªy]%¤×Lž~K¿ORït†Îv©&/RÜùùÍ¡+ŸÖn=gpÄ|<¦æHÌÊ—‹U/é??¶ê«cÅ"Æ"jcá™â°fζLaW „mŽ¡QÓs&«´Ù0,Û}$1©)ë×­•.-–pp˜r”¬°†oì–•á(Žx ‰k½%.=³Êéßjâ㦔ùÑøÇÅÜ8cwó틽â9ñÚÓÃï¾ÛjûqªüŸ!á RôäUŠëWÐÉ!ϬK<©«pñ֌К#_n‚ÁñLP›‚7/!51ÌØ£ 6[BË¤ÔˆŠ„ŠÔôÕI,x´i±†¦l69 ¹á)êê¢aØy ›#,MÚÔ“ƒkoïÑ”>i^GâHE¯ÛÂõ%·BvoÌ¢™Ùãsrj'Of¸üÜ|=#➸=zŽo}!bzëgÑ»üÿýÆYäé?êÉ?¥§tY+€µP˜©–,N`±ŒM ×¼•Gõ‚8 3rnjVv­è)c=Ó|µa„ä&-V±ñÉÌqÏ2ü:‹ŒƒÑ-†ÂññÉ™¢(iàa™Vîšž²±Ì‘®nʰÍ× WÚõ_¯j=£$%©ìVƒ.*,c\‹C¾Áå¸\½ðç9ùàÇ^FzˆÎï qî4þÇÑîI´Ûœ[ª…YsõÞ]·„Y‹ Ê…wþˆÆt Ìûæíù ¥ùÊ Ÿ,RÐ̦.ql×upñiÒÁÁ1ÙEã`›MÁ2Á¯ƒn›Ÿ9XÆõ#ñ» '!!`,wË7xå­;úÆ›#ö¯Oôd+fz7¯Ý3•€žDØ%Õ­ŒlW×wˆòK€Gz)}pÏwZŸ¬~üupš[ lKàESX´°i€X48Ï·iVëQe}|fæ¼óÖ¡G‡‡¦&·Žqó)Ü6M\Z¸¦ˆ”بZj^À2YÅY¡&z@“‘“PŠDÅöôe._þnõí¿H™Ý®¹ú=†Gÿ²à]škQ' ñQðNKÚOIÖ“tOIÚí–¢!¥aŽ£„éÆ9bXÆysµÂÁ¥e `‡”ĦˆTÆq4·œÔ¦M,¹Ñê´îÌݦÿÏ1™ÅÆ6¯]wùä"$Ãwx뛯Ußýüˆñ·5åÏÝŒÁÏ݇°œ·²´IDAT@6ë‹ÞìžÀ»¨Xú´Åò36«[´úІ¥Kµ XçgîºÚ·pp±P$$ì (MÈ{†z÷nàâ9¡±hãÐÀ6¿a›5?ßû-*R—‡Üìsw3Žqðö¡Þ{i¤Ÿ˜Þ+ߣ4û+üÈô'=÷k+ŸµYû—µXtÜy 3v,s|S”"Î#}ÿfÊÐuX:ï` ‡&¶Ñ³–mäzÆî”Œ1 ×xy]€šU¬“½¤"Ay«¯?o?»UÝúÚŒé÷5åìgµÿ’à‡ÂÕ”4?fÓûŒÃÚï9t6,Z]…%$*­D2œé­W§ÜûbNxE¢ÖZlþY›3ŸkÐ[uð…ezz•°µÐe‘ˆÃÛn¿žë íqêSVÏ4h)W4ð„ÂÒˆ2ωö§bp¸§ï¼¶§ïþË”Á‹%ed.I~—·Uÿ ì‡êKœÓ’ƪaÔ’Št¿$½;ïç7Äuèüv‹“Ú »fÓôlá®gŒ¿è­Ÿ²ÿ|IrS#¤ƒ÷”G÷£6M…Ýwp…ºH¿•èàfJü°¤Ø{4还ÿ ’JåøÐíIEND®B`‚goocanvas-1.0.0/config.guess0000755000076400007640000012761511310245766012762 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 # Free Software Foundation, Inc. timestamp='2009-11-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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 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 tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # 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'` exit ;; 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:*:[456]) 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:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-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*: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 ;; 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 echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-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 or32-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 ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-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 ;; 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 ;; 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: goocanvas-1.0.0/docs/0000755000076400007640000000000011512612761011433 500000000000000goocanvas-1.0.0/docs/coordinates.xml0000644000076400007640000000725511412724263014420 00000000000000 Coordinate Spaces and Limits 3 GOOCANVAS Library Coordinate Spaces and Limits how coordinates are used. Coordinate Spaces Items in the canvas typically have a number of properties specifying their location and size. For example the #GooCanvasRect item has #GooCanvasRect:x, #GooCanvasRect:y, #GooCanvasRect:width and #GooCanvasRect:height properties. However, items can also have a transformation matrix (e.g. the #GooCanvasItem:transform property). Transformation matrices modify the item's coordinate space in some way. Modifications include translation (moving the origin), rotation, scaling, and skewing, or combinations of these. Thus the final position of the item on the canvas can be altered dramatically. The simple animation features in #GooCanvas are accomplished by modifying the item's transformation matrix over time. (See goo_canvas_item_animate().) Since items are in a hierarchy it is possible to move or rotate an entire group of items by simply changing the transformation matrix of the group containing them. The coordinate space used within the item itself (e.g. where the #GooCanvasRect:x and #GooCanvasRect:y properties of a #GooCanvasRect are specified) is referred to as "Item Space". The coordinate space used by the entire canvas is referred to as "Canvas Space" (or "Device Space"). "Item Space" and "Canvas Space" may or may not be the same, depending on whether the item or any of its ancestors have a transformation matrix set. (Note that the entire canvas may also be scrolled and/or zoomed, which means that there may be additional transformations above "Canvas Space".) Functions are provided to convert between coordinate spaces, e.g. goo_canvas_convert_to_item_space() and goo_canvas_convert_from_item_space() convert canvas space coordinates to item space and vice versa. Coordinate Limits GooCanvas uses the Cairo graphics library to render canvas items. For performance reasons Cairo uses 32-bit fixed point integers internally when rendering graphics, with 24 bits used for the integer part of values and 8 bits used for the fractional part. This means that values are limited to roughly +/- 8,388,608. (Prior to Cairo 1.6 16 bits were used for the integer part and 16 bits for the fractional part, meaning values were limited to +/- 32,768.) GooCanvas includes code to work around the Cairo limits to some extent. Subclasses of GooCanvasItemSimple (including all builtin items) can use any desired translation using a transformation matrix. But item space coordinates (modified by any scale, rotation or skew) must be within the Cairo limits. It is possible to create new canvas items that avoid the Cairo limits completely. For an example of this see the "Large Items" page in the GooCanvas demo application, and the corresponding code. goocanvas-1.0.0/docs/overview.xml0000644000076400007640000000515111412724214013741 00000000000000 Overview 3 GOOCANVAS Library Overview a quick tour of GooCanvas. Features Optional model/view split. Uses interfaces for items and views. Basic items - rect/ellipse/polyline/text/image/grid/group. Path item, using SVG path specification strings. Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.) Embedded GTK+ widgets. Layers/stacking order with raise/lower functions. Cascading styles - line width/style/dashes, colors, fill patterns. Affine transformations for all items - rotations/scales/skews. Event handling - button/motion events, "pointer-events" property like SVG. Grabs - support for pointer and keyboard grabs. Keyboard focus traversal. Accessibility (item title and description properties and hierarchy stuff). Printing (output to a given cairo_t). Scrolling. Zooming. Static items that don't move as the canvas is scrolled or zoomed. Item visibility setting - on/off/above zoom threshold. Simple animation. Scalable - support for thousands of items over a large canvas area. Support for different units - pixels/points/inches/millimeters. goocanvas-1.0.0/docs/wysiwyg.xml0000644000076400007640000000451711412724242013623 00000000000000 WYSIWYG Printing 3 GOOCANVAS Library WYSIWYG Printing how to use the canvas to create accurate printed output. WYSIWYG Printing Screen Resolution The GooCanvas #GooCanvas:resolution-x and #GooCanvas:resolution-y properties must be set correctly. They both default to 96dpi, which corresponds to a typical monitor. To get a more accurate figure you might be able to use gdk_screen_get_resolution(), but this isn't always guaranteed to be correct. If accuracy is very important a method should be provided for the user to calibrate the screen. Units The GooCanvas #GooCanvas:units property must be set to one of %GTK_UNIT_MM, %GTK_UNIT_POINTS or %GTK_UNIT_INCH (it defaults to %GTK_UNIT_PIXEL). All values used within the canvas are assumed to be in the specified units, including font sizes. Font Sizes Absolute font sizes must be used (to prevent the fonts being mistakenly scaled by Pango as well as by GooCanvas). To specify absolute font sizes add "px" after the font size, e.g. instead of "Sans 9" use "Sans 9px". Font sizes must be converted to the units used by the canvas. For example, if a 9 point "Sans" font is desired but #GooCanvas:units is set to %GTK_UNIT_MM, then the size must first be converted into millimeters: (9 / 72) * 25.4 = 3.175mm. So the font used would be "Sans 3.175px". Example Code The units-demo application that comes with the GooCanvas source code demonstrates the use of different units and absolute font sizes. goocanvas-1.0.0/docs/model-view-canvas.xml0000644000076400007640000001066111412724234015420 00000000000000 Model/View Canvas Example 3 GOOCANVAS Library Model/View Canvas Example how to create a model/view canvas. Model View Canvas Example Here's a complete example application that creates a model-view #GooCanvas with a rectangle and a text item in it. #include <stdlib.h> #include <goocanvas.h> static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItemModel *root, *rect_model, *text_model; GooCanvasItem *rect_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_group_model_new (NULL, NULL); /* Add a few simple items. */ rect_model = goo_canvas_rect_model_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_model = goo_canvas_text_model_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_model_rotate (text_model, 45, 300, 300); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); /* Connect a signal handler for the rectangle item. */ rect_item = goo_canvas_get_item (GOO_CANVAS (canvas), rect_model); g_signal_connect (rect_item, "button_press_event", (GtkSignalFunc) on_rect_button_press, NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-1.0.0/docs/simple-canvas.xml0000644000076400007640000001023211412724227014635 00000000000000 Simple Canvas Example 3 GOOCANVAS Library Simple Canvas Example how to create a simple canvas. Simple Canvas Example Here's a complete example application that creates a #GooCanvas with a rectangle and a text item in it: #include <stdlib.h> #include <goocanvas.h> static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItem *root, *rect_item, *text_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_rotate (text_item, 45, 300, 300); /* Connect a signal handler for the rectangle item. */ g_signal_connect (rect_item, "button_press_event", (GtkSignalFunc) on_rect_button_press, NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-1.0.0/docs/goocanvas.types0000644000076400007640000000233711512612761014426 00000000000000goo_canvas_line_dash_get_type goo_cairo_matrix_get_type goo_cairo_pattern_get_type goo_cairo_fill_rule_get_type goo_cairo_operator_get_type goo_cairo_antialias_get_type goo_cairo_line_cap_get_type goo_cairo_line_join_get_type goo_canvas_widget_get_type goo_canvas_rect_get_type goo_canvas_rect_model_get_type goo_canvas_item_get_type goo_canvas_animate_type_get_type goo_canvas_path_command_type_get_type goo_canvas_pointer_events_get_type goo_canvas_item_visibility_get_type goo_canvas_item_model_get_type goo_canvas_group_get_type goo_canvas_group_model_get_type goo_canvas_path_get_type goo_canvas_path_model_get_type goo_canvas_accessible_factory_get_type goo_canvas_item_accessible_factory_get_type goo_canvas_widget_accessible_factory_get_type goo_canvas_ellipse_get_type goo_canvas_ellipse_model_get_type goo_canvas_style_get_type goo_canvas_get_type goo_canvas_text_get_type goo_canvas_text_model_get_type goo_canvas_points_get_type goo_canvas_polyline_get_type goo_canvas_polyline_model_get_type goo_canvas_item_simple_get_type goo_canvas_item_model_simple_get_type goo_canvas_image_get_type goo_canvas_image_model_get_type goo_canvas_table_get_type goo_canvas_table_model_get_type goo_canvas_grid_get_type goo_canvas_grid_model_get_type goocanvas-1.0.0/docs/architecture.xml0000644000076400007640000001262411412724253014563 00000000000000 Underlying Architecture 3 GOOCANVAS Library Underlying Architecture how the canvas fits together. Underlying Architecture The GooCanvas Widget #GooCanvas is a #GtkWidget (it is actually a subclass of #GtkContainer), and so can be placed in an interface just like any normal widget. Usually a #GooCanvas widget would be placed inside a #GtkScrolledWindow in order to enable scrolling of the canvas. The size of the canvas can be set explicitly using goo_canvas_set_bounds(), or if the #GooCanvas:automatic-bounds property is set to %TRUE the bounds will be automatically calculated to include all of the canvas items. The units used in the canvas can be set with the #GooCanvas:units property. The canvas units can be pixels, points, inches or millimeters and apply to the canvas and all items. The Structure of the Simple Canvas The simple canvas consists of a hierarchy of canvas items. The root item is automatically created by the canvas and can be accessed using goo_canvas_get_root_item(). New items and groups can then be created and added to the root item. Each item in the canvas keeps a #GooCanvasBounds structure which stores the bounding rectangle of the item and all of its descendants. This makes it easy to find out which items in the canvas need repainting or which item the mouse is over. (The bounds are stored in the canvas coordinate space, which is the coordinate space of the entire canvas, after any item transformation matrices have been applied.) The Structure of the Model/View Canvas The model/view canvas consists of a hierarchy of item models, and an identical hierarchy of canvas items, with each canvas item corresponding to one item model. The hierarchy of item models can be used in several #GooCanvas widgets, to allow multiple views of the same model. Though different canvas items will be used in each #GooCanvas. The root item model is set with goo_canvas_set_root_item_model(). The canvas will automatically create canvas items to display the hierarchy of item models, and will automatically add and remove canvas items as the item model hierarchy is changed. The Update Procedure When items are added to the canvas or their properties are changed they may need to recalculate their bounds. To do this they set an internal flag such as @need_update, and make a call to goo_canvas_item_request_update(). #GooCanvas handles all the update requests at once, to avoid multiple redraws of the same parts of the canvas. To do this it installs an idle handler, goo_canvas_idle_handler(), which is called as soon as the application is idle (and before any part of the canvas is redrawn). The idle handler calls goo_canvas_item_update() on the root item, which recursively calls goo_canvas_item_update() on any items as necessary, recalculating their bounds and requesting redraws as appropriate. If a container item (e.g. #GooCanvasGroup) is changed it needs to ensure that all descendants recalculate their bounds so it calls goo_canvas_item_update() for all of its children with the @entire_tree argument set to %TRUE. How Changes to Items are Handled When an item is changed (e.g. if the #GooCanvasRect:x property of a #GooCanvasRect is changed), the item calls goo_canvas_item_simple_changed() with a flag indicating if the bounds of the item need to be recalculated. If the bounds don't need to be recalculated, then goo_canvas_request_redraw() is called to simply request that the item is redrawn. This results in a call to gdk_window_invalidate_rect() and the redraw proceeds just like a normal #GtkWidget. However, if the bounds do need to be recalculated then goo_canvas_item_request_update() is called to request that the item be updated the next time the canvas performs an update. How Changes are Handled in the Model/View Canvas In the Model/View canvas it is the underlying item models which are initially changed. The item models emit "changed" signals which the items respond to. For the standard canvas items the goo_canvas_item_model_simple_changed() signal handler is called, which calls goo_canvas_item_simple_changed() and the procedure continues as in the simple canvas case above. goocanvas-1.0.0/docs/tmpl/0000755000076400007640000000000011512612761012407 500000000000000goocanvas-1.0.0/docs/tmpl/goocanvasgroupmodel.sgml0000644000076400007640000000135211512612761017272 00000000000000 GooCanvasGroupModel @parent: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasellipsemodel.sgml0000644000076400007640000000211411512612761017570 00000000000000 GooCanvasEllipseModel @parent: @center_x: @center_y: @radius_x: @radius_y: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvastablemodel.sgml0000644000076400007640000000431511512612761017227 00000000000000 GooCanvasTableModel @parent: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasimage.sgml0000644000076400007640000000174011512612761016200 00000000000000 GooCanvasImage @parent: @pixbuf: @x: @y: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasstyle.sgml0000644000076400007640000000431011512612761016252 00000000000000 GooCanvasStyle @parent: @properties: @id: @value: @void: @Returns: @style: @Returns: @style: @Returns: @style: @parent: @style: @property_id: @Returns: @style: @property_id: @value: @style: @cr: @Returns: @style: @cr: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvas-unused.sgml0000644000076400007640000000000011512612761016462 00000000000000goocanvas-1.0.0/docs/tmpl/goocanvasitemmodel.sgml0000644000076400007640000001407711512612761017104 00000000000000 goocanvasitemmodel @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @arg2: @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @get_n_children: @get_child: @add_child: @move_child: @remove_child: @get_child_property: @set_child_property: @get_parent: @set_parent: @create_item: @get_transform: @set_transform: @get_style: @set_style: @child_added: @child_moved: @child_removed: @changed: @child_notify: @animation_finished: @model: @tx: @ty: @model: @sx: @sy: @model: @degrees: @cx: @cy: @model: @degrees: @cx: @cy: @model: @degrees: @cx: @cy: @model: @transform: @Returns: @model: @transform: @model: @x: @y: @scale: @rotation: @Returns: @model: @x: @y: @scale: @rotation: @model: @x: @y: @scale: @degrees: @absolute: @duration: @step_time: @type: @model: @model: @above: @model: @below: @model: @model: @Returns: @model: @parent: @model: @Returns: @model: @Returns: @model: @child_num: @Returns: @model: @child: @position: @model: @old_position: @new_position: @model: @child_num: @model: @child: @Returns: @model: @Returns: @model: @style: @mclass: @property_id: @pspec: @mclass: @n_properties: @Returns: @mclass: @property_name: @Returns: @model: @child: @property_name: @value: @model: @child: @property_name: @value: @model: @child: @Varargs: @model: @child: @var_args: @model: @child: @Varargs: @model: @child: @var_args: goocanvas-1.0.0/docs/tmpl/goocanvaspolylinemodel.sgml0000644000076400007640000000270011512612761017767 00000000000000 GooCanvasPolylineModel @parent: @close_path: @num_points: @Varargs: @Returns: @parent: @x1: @y1: @x2: @y2: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasitemmodelsimple.sgml0000644000076400007640000000402711512612761020310 00000000000000 GooCanvasItemModelSimple @parent: @simple_data: goocanvas-1.0.0/docs/tmpl/goocanvasimagemodel.sgml0000644000076400007640000000203011512612761017212 00000000000000 GooCanvasImageModel @parent: @pixbuf: @x: @y: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvastext.sgml0000644000076400007640000000233711512612761016105 00000000000000 GooCanvasText @parent: @string: @x: @y: @width: @anchor: @Varargs: @Returns: @text: @ink_rect: @logical_rect: goocanvas-1.0.0/docs/tmpl/goocanvasitemsimple.sgml0000644000076400007640000000651411512612761017272 00000000000000 GooCanvasItemSimple @canvas: @parent: @model: @simple_data: @bounds: @need_update: @need_entire_subtree_update: @style: @transform: @clip_path_commands: @tooltip: @visibility_threshold: @visibility: @pointer_events: @can_focus: @own_style: @clip_fill_rule: @is_static: @simple_create_path: @simple_update: @simple_paint: @simple_is_item_at: @item: @item: @Returns: @item: @cr: @bounds: @item: @cr: @bounds: @item: @cr: @bounds: @item: @x: @y: @cr: @pointer_events: @Returns: @item: @cr: @item: @recompute_bounds: @item: @model: goocanvas-1.0.0/docs/tmpl/goocanvasellipse.sgml0000644000076400007640000000202411512612761016547 00000000000000 GooCanvasEllipse @parent: @center_x: @center_y: @radius_x: @radius_y: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasgrid.sgml0000644000076400007640000000454411512612761016050 00000000000000 GooCanvasGrid @parent: @x: @y: @width: @height: @x_step: @y_step: @x_offset: @y_offset: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvastextmodel.sgml0000644000076400007640000000225011512612761017120 00000000000000 GooCanvasTextModel @parent: @string: @x: @y: @width: @anchor: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvaswidget.sgml0000644000076400007640000000156611512612761016407 00000000000000 GooCanvasWidget @parent: @widget: @x: @y: @width: @height: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasutils.sgml0000644000076400007640000000633211512612761016260 00000000000000 GooCanvas Types @x1: @y1: @x2: @y2: @GOO_CANVAS_ITEM_HIDDEN: @GOO_CANVAS_ITEM_INVISIBLE: @GOO_CANVAS_ITEM_VISIBLE: @GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD: @GOO_CANVAS_EVENTS_VISIBLE_MASK: @GOO_CANVAS_EVENTS_PAINTED_MASK: @GOO_CANVAS_EVENTS_FILL_MASK: @GOO_CANVAS_EVENTS_STROKE_MASK: @GOO_CANVAS_EVENTS_NONE: @GOO_CANVAS_EVENTS_VISIBLE_PAINTED: @GOO_CANVAS_EVENTS_VISIBLE_FILL: @GOO_CANVAS_EVENTS_VISIBLE_STROKE: @GOO_CANVAS_EVENTS_VISIBLE: @GOO_CANVAS_EVENTS_PAINTED: @GOO_CANVAS_EVENTS_FILL: @GOO_CANVAS_EVENTS_STROKE: @GOO_CANVAS_EVENTS_ALL: @GOO_CANVAS_ANIMATE_FREEZE: @GOO_CANVAS_ANIMATE_RESET: @GOO_CANVAS_ANIMATE_RESTART: @GOO_CANVAS_ANIMATE_BOUNCE: @coords: @num_points: @ref_count: @num_points: @Returns: @points: @Returns: @points: @ref_count: @num_dashes: @dashes: @dash_offset: @num_dashes: @Varargs: @Returns: @num_dashes: @dashes: @Returns: @dash: @Returns: @dash: @GOO_CANVAS_PATH_MOVE_TO: @GOO_CANVAS_PATH_CLOSE_PATH: @GOO_CANVAS_PATH_LINE_TO: @GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: @GOO_CANVAS_PATH_VERTICAL_LINE_TO: @GOO_CANVAS_PATH_CURVE_TO: @GOO_CANVAS_PATH_SMOOTH_CURVE_TO: @GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: @GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: @GOO_CANVAS_PATH_ELLIPTICAL_ARC: @path_data: @Returns: @commands: @cr: goocanvas-1.0.0/docs/tmpl/goocanvaspath.sgml0000644000076400007640000000141111512612761016045 00000000000000 GooCanvasPath @parent: @path_data: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasitem.sgml0000644000076400007640000002246711512612761016065 00000000000000 goocanvasitem @goocanvasitem: the object which received the signal. @arg1: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @arg2: @arg3: @arg4: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @get_canvas: @set_canvas: @get_n_children: @get_child: @request_update: @add_child: @move_child: @remove_child: @get_child_property: @set_child_property: @get_transform_for_child: @get_parent: @set_parent: @get_bounds: @get_items_at: @update: @paint: @get_requested_area: @allocate_area: @get_transform: @set_transform: @get_style: @set_style: @is_visible: @get_requested_height: @get_model: @set_model: @enter_notify_event: @leave_notify_event: @motion_notify_event: @button_press_event: @button_release_event: @focus_in_event: @focus_out_event: @key_press_event: @key_release_event: @grab_broken_event: @child_notify: @query_tooltip: @get_is_static: @set_is_static: @animation_finished: @scroll_event: @item: @tx: @ty: @item: @sx: @sy: @item: @degrees: @cx: @cy: @item: @degrees: @cx: @cy: @item: @degrees: @cx: @cy: @item: @transform: @Returns: @item: @transform: @item: @x: @y: @scale: @rotation: @Returns: @item: @x: @y: @scale: @rotation: @item: @bounds: @item: @Returns: @item: @Returns: @item: @is_static: @item: @x: @y: @scale: @degrees: @absolute: @duration: @step_time: @type: @item: @item: @above: @item: @below: @item: @item: @Returns: @item: @canvas: @item: @Returns: @item: @parent: @item: @Returns: @item: @model: @item: @Returns: @item: @Returns: @item: @child_num: @Returns: @item: @child: @Returns: @item: @child: @position: @item: @old_position: @new_position: @item: @child_num: @item: @child: @transform: @Returns: @item: @Returns: @item: @style: @item: @item: @item: @entire_tree: @cr: @bounds: @item: @cr: @requested_area: @Returns: @item: @cr: @width: @Returns: @item: @cr: @requested_area: @allocated_area: @x_offset: @y_offset: @item: @x: @y: @cr: @is_pointer_event: @parent_is_visible: @found_items: @Returns: @item: @cr: @bounds: @scale: @iclass: @property_id: @pspec: @iclass: @n_properties: @Returns: @iclass: @property_name: @Returns: @item: @child: @property_name: @value: @item: @child: @property_name: @value: @item: @child: @Varargs: @item: @child: @var_args: @item: @child: @Varargs: @item: @child: @var_args: goocanvas-1.0.0/docs/tmpl/goocanvasrectmodel.sgml0000644000076400007640000000161411512612761017074 00000000000000 GooCanvasRectModel @parent: @x: @y: @width: @height: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/dummy.sgml0000644000076400007640000000000011512612761014334 00000000000000goocanvas-1.0.0/docs/tmpl/goocanvastable.sgml0000644000076400007640000000410511512612761016203 00000000000000 GooCanvasTable @parent: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasgroup.sgml0000644000076400007640000000130611512612761016250 00000000000000 GooCanvasGroup @parent: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasrect.sgml0000644000076400007640000000153611512612761016056 00000000000000 GooCanvasRect @parent: @x: @y: @width: @height: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvaspolyline.sgml0000644000076400007640000000256311512612761016755 00000000000000 GooCanvasPolyline @parent: @close_path: @num_points: @Varargs: @Returns: @parent: @x1: @y1: @x2: @y2: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvas.sgml0000644000076400007640000001355311512612761015202 00000000000000 GooCanvas @goocanvas: the object which received the signal. @arg1: @arg2: @goocanvas: the object which received the signal. @arg1: @arg2: @create_item: @item_created: @void: @Returns: @canvas: @Returns: @canvas: @item: @canvas: @Returns: @canvas: @model: @canvas: @Returns: @canvas: @item: @canvas: @Returns: @canvas: @model: @canvas: @left: @top: @right: @bottom: @canvas: @left: @top: @right: @bottom: @canvas: @Returns: @canvas: @scale: @canvas: @model: @Returns: @canvas: @x: @y: @is_pointer_event: @Returns: @canvas: @x: @y: @is_pointer_event: @Returns: @canvas: @area: @inside_area: @allow_overlaps: @include_containers: @Returns: @canvas: @left: @top: @canvas: @cr: @bounds: @scale: @canvas: @x: @y: @canvas: @x: @y: @canvas: @item: @x: @y: @canvas: @item: @x: @y: @canvas: @item: @bounds: @canvas: @item: @event_mask: @cursor: @time: @Returns: @canvas: @item: @time: @canvas: @item: @canvas: @item: @owner_events: @time: @Returns: @canvas: @item: @time: @canvas: @Returns: @canvas: @model: @Returns: @canvas: @model: @canvas: @witem: @canvas: @witem: @canvas: @canvas: @canvas: @bounds: @canvas: @bounds: @is_static: @canvas: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvasgridmodel.sgml0000644000076400007640000000476611512612761017077 00000000000000 GooCanvasGridModel @parent: @x: @y: @width: @height: @x_step: @y_step: @x_offset: @y_offset: @Varargs: @Returns: goocanvas-1.0.0/docs/tmpl/goocanvaspathmodel.sgml0000644000076400007640000000146211512612761017074 00000000000000 GooCanvasPathModel @parent: @path_data: @Varargs: @Returns: goocanvas-1.0.0/docs/goocanvas-sections.txt0000644000076400007640000004006511512612761015726 00000000000000
goocanvastable GooCanvasTable GooCanvasTable goo_canvas_table_new GOO_CANVAS_TABLE GOO_IS_CANVAS_TABLE GOO_TYPE_CANVAS_TABLE goo_canvas_table_get_type GOO_CANVAS_TABLE_CLASS GOO_IS_CANVAS_TABLE_CLASS GOO_CANVAS_TABLE_GET_CLASS GooCanvasTableData GooCanvasTableDimension GooCanvasTableLayoutData GooCanvasTableClass
goocanvastablemodel GooCanvasTableModel GooCanvasTableModel goo_canvas_table_model_new GOO_TYPE_CANVAS_TABLE_MODEL goo_canvas_table_model_get_type GOO_CANVAS_TABLE_MODEL GOO_CANVAS_TABLE_MODEL_CLASS GOO_IS_CANVAS_TABLE_MODEL GOO_IS_CANVAS_TABLE_MODEL_CLASS GOO_CANVAS_TABLE_MODEL_GET_CLASS GooCanvasTableModelClass
goocanvasrect GooCanvasRect GooCanvasRect goo_canvas_rect_new GOO_CANVAS_RECT GOO_IS_CANVAS_RECT GOO_TYPE_CANVAS_RECT goo_canvas_rect_get_type GOO_CANVAS_RECT_CLASS GOO_IS_CANVAS_RECT_CLASS GOO_CANVAS_RECT_GET_CLASS GooCanvasRectData GooCanvasRectClass
goocanvasrectmodel GooCanvasRectModel GooCanvasRectModel goo_canvas_rect_model_new GOO_TYPE_CANVAS_RECT_MODEL goo_canvas_rect_model_get_type GOO_CANVAS_RECT_MODEL GOO_CANVAS_RECT_MODEL_CLASS GOO_IS_CANVAS_RECT_MODEL GOO_IS_CANVAS_RECT_MODEL_CLASS GOO_CANVAS_RECT_MODEL_GET_CLASS GooCanvasRectModelClass
goocanvasitem GooCanvasItem GooCanvasItemIface goo_canvas_item_translate goo_canvas_item_scale goo_canvas_item_rotate goo_canvas_item_skew_x goo_canvas_item_skew_y goo_canvas_item_get_transform goo_canvas_item_set_transform goo_canvas_item_get_simple_transform goo_canvas_item_set_simple_transform goo_canvas_item_get_bounds goo_canvas_item_is_visible goo_canvas_item_get_is_static goo_canvas_item_set_is_static goo_canvas_item_animate goo_canvas_item_stop_animation goo_canvas_item_raise goo_canvas_item_lower goo_canvas_item_remove goo_canvas_item_get_canvas goo_canvas_item_set_canvas goo_canvas_item_get_parent goo_canvas_item_set_parent goo_canvas_item_get_model goo_canvas_item_set_model goo_canvas_item_is_container goo_canvas_item_get_n_children goo_canvas_item_get_child goo_canvas_item_find_child goo_canvas_item_add_child goo_canvas_item_move_child goo_canvas_item_remove_child goo_canvas_item_get_transform_for_child goo_canvas_item_get_style goo_canvas_item_set_style goo_canvas_item_request_update goo_canvas_item_ensure_updated goo_canvas_item_update goo_canvas_item_get_requested_area goo_canvas_item_get_requested_height goo_canvas_item_allocate_area goo_canvas_item_get_items_at goo_canvas_item_paint goo_canvas_item_class_install_child_property goo_canvas_item_class_list_child_properties goo_canvas_item_class_find_child_property goo_canvas_item_get_child_property goo_canvas_item_set_child_property goo_canvas_item_get_child_properties goo_canvas_item_get_child_properties_valist goo_canvas_item_set_child_properties goo_canvas_item_set_child_properties_valist GOO_CANVAS_ITEM GOO_IS_CANVAS_ITEM GOO_TYPE_CANVAS_ITEM goo_canvas_item_get_type GOO_CANVAS_ITEM_GET_IFACE
goocanvasitemmodel GooCanvasItemModel GooCanvasItemModelIface goo_canvas_item_model_translate goo_canvas_item_model_scale goo_canvas_item_model_rotate goo_canvas_item_model_skew_x goo_canvas_item_model_skew_y goo_canvas_item_model_get_transform goo_canvas_item_model_set_transform goo_canvas_item_model_get_simple_transform goo_canvas_item_model_set_simple_transform goo_canvas_item_model_animate goo_canvas_item_model_stop_animation goo_canvas_item_model_raise goo_canvas_item_model_lower goo_canvas_item_model_remove goo_canvas_item_model_get_parent goo_canvas_item_model_set_parent goo_canvas_item_model_is_container goo_canvas_item_model_get_n_children goo_canvas_item_model_get_child goo_canvas_item_model_add_child goo_canvas_item_model_move_child goo_canvas_item_model_remove_child goo_canvas_item_model_find_child goo_canvas_item_model_get_style goo_canvas_item_model_set_style goo_canvas_item_model_class_install_child_property goo_canvas_item_model_class_list_child_properties goo_canvas_item_model_class_find_child_property goo_canvas_item_model_get_child_property goo_canvas_item_model_set_child_property goo_canvas_item_model_get_child_properties goo_canvas_item_model_get_child_properties_valist goo_canvas_item_model_set_child_properties goo_canvas_item_model_set_child_properties_valist GOO_CANVAS_ITEM_MODEL GOO_IS_CANVAS_ITEM_MODEL GOO_TYPE_CANVAS_ITEM_MODEL goo_canvas_item_model_get_type GOO_CANVAS_ITEM_MODEL_GET_IFACE
goocanvasgroup GooCanvasGroup GooCanvasGroup goo_canvas_group_new GOO_CANVAS_GROUP GOO_IS_CANVAS_GROUP GOO_TYPE_CANVAS_GROUP goo_canvas_group_get_type GOO_CANVAS_GROUP_CLASS GOO_IS_CANVAS_GROUP_CLASS GOO_CANVAS_GROUP_GET_CLASS GooCanvasGroupClass
goocanvasgroupmodel GooCanvasGroupModel GooCanvasGroupModel goo_canvas_group_model_new GOO_TYPE_CANVAS_GROUP_MODEL goo_canvas_group_model_get_type GOO_CANVAS_GROUP_MODEL GOO_CANVAS_GROUP_MODEL_CLASS GOO_IS_CANVAS_GROUP_MODEL GOO_IS_CANVAS_GROUP_MODEL_CLASS GOO_CANVAS_GROUP_MODEL_GET_CLASS GooCanvasGroupModelClass
goocanvaspath GooCanvasPath GooCanvasPath goo_canvas_path_new GOO_CANVAS_PATH GOO_IS_CANVAS_PATH GOO_TYPE_CANVAS_PATH goo_canvas_path_get_type GOO_CANVAS_PATH_CLASS GOO_IS_CANVAS_PATH_CLASS GOO_CANVAS_PATH_GET_CLASS GooCanvasPathData goo_canvas_path_command_type_get_type GOO_TYPE_CANVAS_PATH_COMMAND_TYPE GooCanvasPathClass
goocanvaspathmodel GooCanvasPathModel GooCanvasPathModel goo_canvas_path_model_new GOO_TYPE_CANVAS_PATH_MODEL GOO_CANVAS_PATH_MODEL goo_canvas_path_model_get_type GOO_CANVAS_PATH_MODEL_CLASS GOO_IS_CANVAS_PATH_MODEL GOO_IS_CANVAS_PATH_MODEL_CLASS GOO_CANVAS_PATH_MODEL_GET_CLASS GooCanvasPathModelClass
goocanvasellipse GooCanvasEllipse GooCanvasEllipse goo_canvas_ellipse_new GOO_CANVAS_ELLIPSE GOO_IS_CANVAS_ELLIPSE GOO_TYPE_CANVAS_ELLIPSE goo_canvas_ellipse_get_type GOO_CANVAS_ELLIPSE_CLASS GOO_IS_CANVAS_ELLIPSE_CLASS GOO_CANVAS_ELLIPSE_GET_CLASS GooCanvasEllipseData GooCanvasEllipseClass
goocanvasellipsemodel GooCanvasEllipseModel GooCanvasEllipseModel goo_canvas_ellipse_model_new GOO_TYPE_CANVAS_ELLIPSE_MODEL GOO_CANVAS_ELLIPSE_MODEL goo_canvas_ellipse_model_get_type GOO_CANVAS_ELLIPSE_MODEL_CLASS GOO_IS_CANVAS_ELLIPSE_MODEL GOO_IS_CANVAS_ELLIPSE_MODEL_CLASS GOO_CANVAS_ELLIPSE_MODEL_GET_CLASS GooCanvasEllipseModelClass
goocanvas GooCanvas GooCanvas GooCanvasClass goo_canvas_new goo_canvas_get_root_item goo_canvas_set_root_item goo_canvas_get_root_item_model goo_canvas_set_root_item_model goo_canvas_get_static_root_item goo_canvas_set_static_root_item goo_canvas_get_static_root_item_model goo_canvas_set_static_root_item_model goo_canvas_get_bounds goo_canvas_set_bounds goo_canvas_get_scale goo_canvas_set_scale goo_canvas_get_item goo_canvas_get_item_at goo_canvas_get_items_at goo_canvas_get_items_in_area goo_canvas_scroll_to goo_canvas_render goo_canvas_convert_to_pixels goo_canvas_convert_from_pixels goo_canvas_convert_to_item_space goo_canvas_convert_from_item_space goo_canvas_convert_bounds_to_item_space goo_canvas_pointer_grab goo_canvas_pointer_ungrab goo_canvas_grab_focus goo_canvas_keyboard_grab goo_canvas_keyboard_ungrab goo_canvas_create_cairo_context goo_canvas_create_item goo_canvas_unregister_item goo_canvas_register_widget_item goo_canvas_unregister_widget_item goo_canvas_update goo_canvas_request_update goo_canvas_request_redraw goo_canvas_request_item_redraw goo_canvas_get_default_line_width GOO_CANVAS GOO_IS_CANVAS GOO_TYPE_CANVAS goo_canvas_get_type GOO_CANVAS_CLASS GOO_IS_CANVAS_CLASS GOO_CANVAS_GET_CLASS
goocanvastext GooCanvasText GooCanvasText goo_canvas_text_new goo_canvas_text_get_natural_extents GOO_CANVAS_TEXT GOO_IS_CANVAS_TEXT GOO_TYPE_CANVAS_TEXT goo_canvas_text_get_type GOO_CANVAS_TEXT_CLASS GOO_IS_CANVAS_TEXT_CLASS GOO_CANVAS_TEXT_GET_CLASS GooCanvasTextData GooCanvasTextClass
goocanvastextmodel GooCanvasTextModel GooCanvasTextModel goo_canvas_text_model_new GOO_TYPE_CANVAS_TEXT_MODEL GOO_CANVAS_TEXT_MODEL goo_canvas_text_model_get_type GOO_CANVAS_TEXT_MODEL_CLASS GOO_IS_CANVAS_TEXT_MODEL GOO_IS_CANVAS_TEXT_MODEL_CLASS GOO_CANVAS_TEXT_MODEL_GET_CLASS GooCanvasTextModelClass
goocanvaspolyline GooCanvasPolyline GooCanvasPolyline goo_canvas_polyline_new goo_canvas_polyline_new_line GOO_CANVAS_POLYLINE GOO_IS_CANVAS_POLYLINE GOO_TYPE_CANVAS_POLYLINE goo_canvas_polyline_get_type GOO_CANVAS_POLYLINE_CLASS GOO_IS_CANVAS_POLYLINE_CLASS GOO_CANVAS_POLYLINE_GET_CLASS GooCanvasPolylineData NUM_ARROW_POINTS GooCanvasPolylineArrowData GooCanvasPolylineClass
goocanvaspolylinemodel GooCanvasPolylineModel GooCanvasPolylineModel goo_canvas_polyline_model_new goo_canvas_polyline_model_new_line GOO_TYPE_CANVAS_POLYLINE_MODEL GOO_CANVAS_POLYLINE_MODEL goo_canvas_polyline_model_get_type GOO_CANVAS_POLYLINE_MODEL_CLASS GOO_IS_CANVAS_POLYLINE_MODEL GOO_IS_CANVAS_POLYLINE_MODEL_CLASS GOO_CANVAS_POLYLINE_MODEL_GET_CLASS GooCanvasPolylineModelClass
goocanvasitemsimple GooCanvasItemSimple GooCanvasItemSimple GooCanvasItemSimpleData GooCanvasItemSimpleClass goo_canvas_item_simple_check_style goo_canvas_item_simple_get_line_width goo_canvas_item_simple_get_path_bounds goo_canvas_item_simple_user_bounds_to_device goo_canvas_item_simple_user_bounds_to_parent goo_canvas_item_simple_check_in_path goo_canvas_item_simple_paint_path goo_canvas_item_simple_changed goo_canvas_item_simple_set_model GOO_CANVAS_ITEM_SIMPLE GOO_IS_CANVAS_ITEM_SIMPLE GOO_TYPE_CANVAS_ITEM_SIMPLE goo_canvas_item_simple_get_type GOO_CANVAS_ITEM_SIMPLE_CLASS GOO_IS_CANVAS_ITEM_SIMPLE_CLASS GOO_CANVAS_ITEM_SIMPLE_GET_CLASS
goocanvasitemmodelsimple GooCanvasItemModelSimple GooCanvasItemModelSimple GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE goo_canvas_item_model_simple_get_type GOO_CANVAS_ITEM_MODEL_SIMPLE GOO_CANVAS_ITEM_MODEL_SIMPLE_CLASS GOO_IS_CANVAS_ITEM_MODEL_SIMPLE GOO_IS_CANVAS_ITEM_MODEL_SIMPLE_CLASS GOO_CANVAS_ITEM_MODEL_SIMPLE_GET_CLASS GooCanvasItemModelSimpleClass
goocanvasimage GooCanvasImage GooCanvasImage goo_canvas_image_new GOO_CANVAS_IMAGE GOO_IS_CANVAS_IMAGE GOO_TYPE_CANVAS_IMAGE goo_canvas_image_get_type GOO_CANVAS_IMAGE_CLASS GOO_IS_CANVAS_IMAGE_CLASS GOO_CANVAS_IMAGE_GET_CLASS GooCanvasImageData GooCanvasImageClass
goocanvasimagemodel GooCanvasImageModel GooCanvasImageModel goo_canvas_image_model_new GOO_TYPE_CANVAS_IMAGE_MODEL GOO_CANVAS_IMAGE_MODEL goo_canvas_image_model_get_type GOO_CANVAS_IMAGE_MODEL_CLASS GOO_IS_CANVAS_IMAGE_MODEL GOO_IS_CANVAS_IMAGE_MODEL_CLASS GOO_CANVAS_IMAGE_MODEL_GET_CLASS GooCanvasImageModelClass
goocanvasgrid GooCanvasGrid GooCanvasGrid goo_canvas_grid_new GOO_CANVAS_GRID GOO_IS_CANVAS_GRID GOO_TYPE_CANVAS_GRID goo_canvas_grid_get_type GOO_CANVAS_GRID_CLASS GOO_IS_CANVAS_GRID_CLASS GOO_CANVAS_GRID_GET_CLASS GooCanvasGridData GooCanvasGridClass
goocanvasgridmodel GooCanvasGridModel GooCanvasGridModel goo_canvas_grid_model_new GOO_CANVAS_GRID_MODEL GOO_IS_CANVAS_GRID_MODEL GOO_TYPE_CANVAS_GRID_MODEL goo_canvas_grid_model_get_type GOO_CANVAS_GRID_MODEL_CLASS GOO_IS_CANVAS_GRID_MODEL_CLASS GOO_CANVAS_GRID_MODEL_GET_CLASS GooCanvasGridModelClass
goocanvaswidget GooCanvasWidget GooCanvasWidget goo_canvas_widget_new GOO_CANVAS_WIDGET GOO_CANVAS_WIDGET_CLASS GOO_CANVAS_WIDGET_GET_CLASS GOO_IS_CANVAS_WIDGET GOO_IS_CANVAS_WIDGET_CLASS goo_canvas_widget_get_type GOO_TYPE_CANVAS_WIDGET GooCanvasWidgetClass
goocanvasstyle GooCanvasStyle GooCanvasStyle GooCanvasStyleProperty goo_canvas_style_new goo_canvas_style_copy goo_canvas_style_get_parent goo_canvas_style_set_parent goo_canvas_style_get_property goo_canvas_style_set_property goo_canvas_style_set_fill_options goo_canvas_style_set_stroke_options goo_canvas_style_antialias_id goo_canvas_style_fill_pattern_id goo_canvas_style_fill_rule_id goo_canvas_style_font_desc_id goo_canvas_style_hint_metrics_id goo_canvas_style_line_cap_id goo_canvas_style_line_dash_id goo_canvas_style_line_join_id goo_canvas_style_line_join_miter_limit_id goo_canvas_style_line_width_id goo_canvas_style_operator_id goo_canvas_style_stroke_pattern_id GOO_CANVAS_STYLE GOO_CANVAS_STYLE_CLASS GOO_CANVAS_STYLE_GET_CLASS GOO_IS_CANVAS_STYLE GOO_IS_CANVAS_STYLE_CLASS GOO_TYPE_CANVAS_STYLE goo_canvas_style_get_type GooCanvasStyleClass
goocanvasutils GooCanvas Types GooCanvasBounds GooCanvasItemVisibility GooCanvasPointerEvents GooCanvasAnimateType GooCanvasPoints goo_canvas_points_new goo_canvas_points_ref goo_canvas_points_unref GooCanvasLineDash goo_canvas_line_dash_new goo_canvas_line_dash_newv goo_canvas_line_dash_ref goo_canvas_line_dash_unref GooCanvasPathCommandType GooCanvasPathCommand goo_canvas_parse_path_data goo_canvas_create_path GooCairoAntialias GooCairoFillRule GooCairoHintMetrics GooCairoLineCap GooCairoLineJoin GooCairoOperator GooCairoMatrix GooCairoPattern GOO_TYPE_CANVAS_POINTS goo_canvas_points_get_type GOO_TYPE_CANVAS_POINTER_EVENTS goo_canvas_pointer_events_get_type GOO_TYPE_CANVAS_ITEM_VISIBILITY goo_canvas_item_visibility_get_type GOO_TYPE_CAIRO_MATRIX goo_cairo_matrix_get_type goo_cairo_matrix_copy goo_cairo_matrix_free GOO_TYPE_CAIRO_PATTERN goo_cairo_pattern_get_type GOO_TYPE_CANVAS_LINE_DASH goo_canvas_line_dash_get_type GOO_TYPE_CAIRO_ANTIALIAS GOO_TYPE_CAIRO_FILL_RULE GOO_TYPE_CAIRO_LINE_CAP GOO_TYPE_CAIRO_LINE_JOIN GOO_TYPE_CAIRO_OPERATOR GOO_TYPE_CANVAS_ANIMATE_TYPE goo_cairo_antialias_get_type goo_cairo_fill_rule_get_type goo_cairo_line_cap_get_type goo_cairo_line_join_get_type goo_cairo_operator_get_type goo_canvas_animate_type_get_type GOO_TYPE_CAIRO_HINT_METRICS goo_cairo_hint_metrics_get_type GOO_TYPE_CANVAS_BOUNDS goo_canvas_bounds_get_type goo_canvas_accessible_factory_get_type goo_canvas_item_accessible_factory_get_type goo_canvas_widget_accessible_factory_get_type
goocanvas-1.0.0/docs/goocanvas-overrides.txt0000644000076400007640000000000011412723611016056 00000000000000goocanvas-1.0.0/docs/Makefile.in0000644000076400007640000005032011512612655013422 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### 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@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/gtk-doc.make subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/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@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = goocanvas # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = ../src # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = --query-child-properties=goo_canvas_query_child_properties # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/src/*.h CFILE_GLOB = $(top_srcdir)/src/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = goocanvasmarshal.h goocanvasprivate.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = \ overview.xml \ simple-canvas.xml \ model-view-canvas.xml \ wysiwyg.xml \ architecture.xml \ coordinates.xml \ creating-items.xml # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = $(expand_content_files) # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src @PACKAGE_CFLAGS@ GTKDOC_LIBS = @PACKAGE_LIBS@ $(top_builddir)/src/libgoocanvas.la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ pdf-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ $(srcdir)/pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(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) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/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_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 $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local 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 \ maintainer-clean-local 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 all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local 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 \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/html @mkdir $(srcdir)/html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options=--path="$(srcdir)"; \ fi; \ cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building PDF' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/$(DOC_MODULE).pdf @mkpdf_imgdirs=""; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \ fi; \ done; \ fi; \ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: @installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo '-- Installing '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ mv -f $${installdir}/$(DOC_MODULE).devhelp \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl cp $(srcdir)/html/* $(distdir)/html -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ cd $(distdir) && rm -f $(DISTCLEANFILES) $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # 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: goocanvas-1.0.0/docs/creating-items.xml0000644000076400007640000003024411412724271015012 00000000000000 Creating New Items 3 GOOCANVAS Library Creating New Items how to create new canvas items. How to Create New Canvas Items There are 3 ways to create new canvas items, listed here in increasing order of complexity: Creating a simple subclass of GooCanvasItemSimple. Creating a regular subclass of GooCanvasItemSimple. Implementing the GooCanvasItem interface. These will be discussed in turn below. (It is also possible to create new container items by subclassing #GooCanvasGroup, but that is not covered here.) The final part of this section covers creating item models. Creating a Simple Subclass of GooCanvasItemSimple For items that consist of a simple graphic element such as a line, rectangle or circle, it is possible to create a subclass of #GooCanvasItemSimple and override just one method, simple_create_path(). (This method is used for the #GooCanvasEllipse and #GooCanvasPath items.) The simple_create_path() method should create a path using the given cairo context. The path will be drawn using the stroke, fill and other painting properties from #GooCanvasItemSimple. This example shows the simple_create_path() method for a simple rectangular item, MyItem: static void my_item_simple_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { MyItem *item = (MyItem*) simple; cairo_rectangle (cr, item->x, item->y, item->width, item->height); } Whenever the item is changed in some way it should call goo_canvas_item_simple_changed(), passing a boolean value indicating whether the item's bounds need to be recalculated or if it only needs to be repainted. The #GooCanvasItemSimple code will take care of updating the item and repainting the appropriate parts of the canvas. Creating a Regular Subclass of GooCanvasItemSimple Most items will need more than a simple line or rectangle, so they will need to create a subclass of #GooCanvasItemSimple and override three methods, simple_update(), simple_paint() and simple_is_item_at(). The simple_update() method should compute the bounds of the item, in the item's coordinate space, and place them in the bounds member of #GooCanvasItemSimple-struct. Note that the cairo context passed to this function may have transformations applied to it, so cairo_identity_matrix() should be called before using it. The simple_paint() method should paint the item using the given cairo context. To use the stroke and fill properties from #GooCanvasItemSimple to paint parts of the item call goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() before calling cairo_stroke() and cairo_fill(). (The item's style can be found in GOO_CANVAS_ITEM_SIMPLE (item)->simple_data->style). The simple_is_item_at() method should return %TRUE if the given coordinate (in the item's coordinate space) is inside the item. (The is_pointer_event argument can be ignored for most purposes since the #GooCanvasItemSimple code will take care of it.) This example code shows the simple_update(), simple_paint() and simple_is_item_at() methods for a rectangular item (the complete item's source code can be found in the GooCanvas demo directory, in demo-item.h and demo-item.c): static void goo_demo_item_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoItem *demo_item = (GooDemoItem*) simple; /* Compute the new bounds. */ simple->bounds.x1 = demo_item->x; simple->bounds.y1 = demo_item->y; simple->bounds.x2 = demo_item->x + demo_item->width; simple->bounds.y2 = demo_item->y + demo_item->height; } static void goo_demo_item_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoItem *demo_item = (GooDemoItem*) simple; cairo_move_to (cr, demo_item->x, demo_item->y); cairo_line_to (cr, demo_item->x, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y); cairo_close_path (cr); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_fill (cr); } static gboolean goo_demo_item_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooDemoItem *demo_item = (GooDemoItem*) simple; if (x < demo_item->x || (x > demo_item->x + demo_item->width) || y < demo_item->y || (y > demo_item->y + demo_item->height)) return FALSE; return TRUE; } As with the simple #GooCanvasItemSimple subclass, the item should call goo_canvas_item_simple_changed() whenever it is changed, to ensure that the item's bounds are recomputed and it is repainted if necessary. Implementing the GooCanvasItem Interface The most complicated way to create new canvas items is to implement the #GooCanvasItem interface directly. This should not be needed in most cases, but may be desired if the developer wants to avoid the memory and processor overheads associated with the #GooCanvasItemSimple class, or if the developer wants to turn an existing application object into a canvas item. At a minimum the canvas item must implement these 6 methods: get_parent() - the item's parent should be returned. set_parent() - the item's parent should be stored (though it should not add a reference to the parent). get_bounds() - returns the bounds of the item, in canvas space. The item should ensure that the bounds are up-to-date before returning them, calling goo_canvas_item_ensure_updated() if necessary. update() - if the item has been changed since the last update, or if the entire_tree flag is %TRUE, the item's bounds should be recomputed (in canvas space). It should also request a redraw of the old bounds and the new bounds, so the display is updated appropriately. The new bounds should be returned in the bounds argument. paint() - if the item's bounds intersect the given bounds then the item should be painted on the given cairo context. The scale parameter is only used to check if the item should be visible, according to the item's #GooCanvasItem:visibility and #GooCanvasItem:visibility-threshold property settings. get_items_at() - if the given point is inside the item then a pointer to the item should be added to the start of the list of found items. The list is then returned. The canvas item must also implement the #GooCanvasItem:parent, #GooCanvasItem:title, #GooCanvasItem:description, #GooCanvasItem:visibility, #GooCanvasItem:visibility-threshold, #GooCanvasItem:transform and #GooCanvasItem:pointer-events properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.) If the canvas item will be used within a container that does item layout, such as #GooCanvasTable, it must implement the first two methods here at least: get_requested_area() - returns the requested area of the item, in the parent's coordinate space. allocate_area() - allocates the item's area, in the parent's coordinate space. get_requested_height() - returns the requested height of the item, given a particular allocated width, in the parent's coordinate space. (This only needed for items that change height as their width is changed, such as text items.) If the canvas item supports a transformation matrix it must implement: get_transform() - returns the item's transformation matrix. set_transform() - sets the item's transformation matrix. If the canvas item supports a #GooCanvasStyle setting, it must implement: get_style() - returns the item's style. set_style() - sets the item's style. Since #GooCanvasItemSimple implements most of the above methods and properties its source code is a good place to look for help. Creating Item Models As with creating canvas items, to create item models it is possible to subclass #GooCanvasItemModelSimple or to implement the #GooCanvasItemModel interface directly. Subclassing #GooCanvasItemModelSimple is very easy, since only one method from the #GooCanvasItemModel interface must be implemented - create_item(). This should return a new canvas item for viewing the item model in a canvas. (It may be called multiple times if multiple canvases are viewing the same canvas model.) The #GooCanvasItemModelSimple subclass should emit the "changed" signal whenever it has changed, with a boolean flag indicating if the bounds need to be recomputed. The canvas items will connect to this signal and request an update or a redraw as appropriate. To implement the #GooCanvasItemModel interface directly, the class must implement the get_parent(), set_parent() and create_item() methods. It may also implement get_transform(), set_transform(), get_style() and set_style() methods if desired. The class must also implement the #GooCanvasItemModel:parent, #GooCanvasItemModel:title, #GooCanvasItemModel:description, #GooCanvasItemModel:can-focus, #GooCanvasItemModel:visibility, #GooCanvasItemModel:visibility-threshold, #GooCanvasItemModel:transform and #GooCanvasItemModel:pointer-events properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.) goocanvas-1.0.0/docs/Makefile.am0000644000076400007640000000572711412723611013416 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=goocanvas # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=../src # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS=--query-child-properties=goo_canvas_query_child_properties # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS= # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/src/*.h CFILE_GLOB=$(top_srcdir)/src/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES=goocanvasmarshal.h goocanvasprivate.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= \ overview.xml \ simple-canvas.xml \ model-view-canvas.xml \ wysiwyg.xml \ architecture.xml \ coordinates.xml \ creating-items.xml # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files= $(expand_content_files) # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src @PACKAGE_CFLAGS@ GTKDOC_LIBS=@PACKAGE_LIBS@ $(top_builddir)/src/libgoocanvas.la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += goocanvas-1.0.0/docs/goocanvas-docs.sgml0000644000076400007640000000430511412723611015143 00000000000000 GooCanvas Reference Manual Introduction Core Objects Standard Canvas Items Standard Canvas Item Models Miscellaneous goocanvas-1.0.0/docs/html/0000755000076400007640000000000011512612762012400 500000000000000goocanvas-1.0.0/docs/html/goocanvas-model-view-canvas.html0000644000076400007640000004663411512612761020521 00000000000000 Model/View Canvas Example

Model/View Canvas Example

Model/View Canvas Example — how to create a model/view canvas.

Model View Canvas Example

Here's a complete example application that creates a model-view GooCanvas with a rectangle and a text item in it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <stdlib.h>
#include <goocanvas.h>


static gboolean on_rect_button_press (GooCanvasItem  *view,
                                      GooCanvasItem  *target,
                                      GdkEventButton *event,
                                      gpointer        data);

static gboolean on_delete_event      (GtkWidget      *window,
                                      GdkEvent       *event,
                                      gpointer        unused_data);


int
main (int argc, char *argv[])
{
  GtkWidget *window, *scrolled_win, *canvas;
  GooCanvasItemModel *root, *rect_model, *text_model;
  GooCanvasItem *rect_item;

  /* Initialize GTK+. */
  gtk_set_locale ();
  gtk_init (&argc, &argv);

  /* Create the window and widgets. */
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
  gtk_widget_show (window);
  g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event,
                    NULL);

  scrolled_win = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
                                       GTK_SHADOW_IN);
  gtk_widget_show (scrolled_win);
  gtk_container_add (GTK_CONTAINER (window), scrolled_win);

  canvas = goo_canvas_new ();
  gtk_widget_set_size_request (canvas, 600, 450);
  goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000);
  gtk_widget_show (canvas);
  gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);

  root = goo_canvas_group_model_new (NULL, NULL);

  /* Add a few simple items. */
  rect_model = goo_canvas_rect_model_new (root, 100, 100, 400, 400,
                                          "line-width", 10.0,
                                          "radius-x", 20.0,
                                          "radius-y", 10.0,
                                          "stroke-color", "yellow",
                                          "fill-color", "red",
                                          NULL);

  text_model = goo_canvas_text_model_new (root, "Hello World", 300, 300, -1,
                                          GTK_ANCHOR_CENTER,
                                          "font", "Sans 24",
                                          NULL);
  goo_canvas_item_model_rotate (text_model, 45, 300, 300);

  goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root);

  /* Connect a signal handler for the rectangle item. */
  rect_item = goo_canvas_get_item (GOO_CANVAS (canvas), rect_model);
  g_signal_connect (rect_item, "button_press_event",
                    (GtkSignalFunc) on_rect_button_press, NULL);

  /* Pass control to the GTK+ main event loop. */
  gtk_main ();

  return 0;
}


/* This handles button presses in item views. We simply output a message to
   the console. */
static gboolean
on_rect_button_press (GooCanvasItem  *item,
                      GooCanvasItem  *target,
                      GdkEventButton *event,
                      gpointer        data)
{
  g_print ("rect item received button press event\n");
  return TRUE;
}


/* This is our handler for the "delete-event" signal of the window, which
   is emitted when the 'x' close button is clicked. We just exit here. */
static gboolean
on_delete_event (GtkWidget *window,
                 GdkEvent  *event,
                 gpointer   unused_data)
{
  exit (0);
}
goocanvas-1.0.0/docs/html/GooCanvasTable.html0000644000076400007640000007764111512612762016055 00000000000000 GooCanvasTable

GooCanvasTable

GooCanvasTable — a table container to layout items.

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGroup
               +----GooCanvasTable

Implemented Interfaces

GooCanvasTable implements GooCanvasItem.

Properties

  "column-spacing"           gdouble               : Read / Write
  "homogeneous-columns"      gboolean              : Read / Write
  "homogeneous-rows"         gboolean              : Read / Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "row-spacing"              gdouble               : Read / Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "x-border-spacing"         gdouble               : Read / Write
  "y-border-spacing"         gdouble               : Read / Write

Child Properties

  "bottom-padding"           gdouble               : Read / Write
  "column"                   guint                 : Read / Write
  "columns"                  guint                 : Read / Write
  "left-padding"             gdouble               : Read / Write
  "right-padding"            gdouble               : Read / Write
  "row"                      guint                 : Read / Write
  "rows"                     guint                 : Read / Write
  "top-padding"              gdouble               : Read / Write
  "x-align"                  gdouble               : Read / Write
  "x-expand"                 gboolean              : Read / Write
  "x-fill"                   gboolean              : Read / Write
  "x-shrink"                 gboolean              : Read / Write
  "y-align"                  gdouble               : Read / Write
  "y-expand"                 gboolean              : Read / Write
  "y-fill"                   gboolean              : Read / Write
  "y-shrink"                 gboolean              : Read / Write

Description

GooCanvasTable is a table container used to lay out other canvas items. It is used in a similar way to how the GtkTable widget is used to lay out GTK+ widgets.

Items are added to the table using the normal methods, then goo_canvas_item_set_child_properties() is used to specify how each child item is to be positioned within the table (i.e. which row and column it is in, how much padding it should have and whether it should expand or shrink).

GooCanvasTable is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasTable will affect all children of the GooCanvasTable (unless the children override the property setting).

GooCanvasTable implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events".

To create a GooCanvasTable use goo_canvas_table_new().

To get or set the properties of an existing GooCanvasTable, use g_object_get() and g_object_set().

Details

GooCanvasTable

typedef struct _GooCanvasTable GooCanvasTable;

The GooCanvasTable struct contains private data only.


goo_canvas_table_new ()

GooCanvasItem*      goo_canvas_table_new                (GooCanvasItem *parent,
                                                         ...);

Creates a new table item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new table item.

Here's an example showing how to create a table with a square, a circle and a triangle in it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
GooCanvasItem *table, *square, *circle, *triangle;

table = goo_canvas_table_new (root,
                              "row-spacing", 4.0,
                              "column-spacing", 4.0,
                              NULL);
goo_canvas_item_translate (table, 400, 200);

square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0,
                              "fill-color", "red",
                              NULL);
goo_canvas_item_set_child_properties (table, square,
                                      "row", 0,
                                      "column", 0,
                                      NULL);

circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0,
                                 "fill-color", "blue",
                                 NULL);
goo_canvas_item_set_child_properties (table, circle,
                                      "row", 0,
                                      "column", 1,
                                      NULL);

triangle = goo_canvas_polyline_new (table, TRUE, 3,
                                    25.0, 0.0, 0.0, 50.0, 50.0, 50.0,
                                    "fill-color", "yellow",
                                    NULL);
goo_canvas_item_set_child_properties (table, triangle,
                                      "row", 0,
                                      "column", 2,
                                      NULL);

Property Details

The "column-spacing" property

  "column-spacing"           gdouble               : Read / Write

The default space between columns.

Allowed values: >= 0

Default value: 0


The "homogeneous-columns" property

  "homogeneous-columns"      gboolean              : Read / Write

If all columns are the same width.

Default value: FALSE


The "homogeneous-rows" property

  "homogeneous-rows"         gboolean              : Read / Write

If all rows are the same height.

Default value: FALSE


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between rows.

Allowed values: >= 0

Default value: 0


The "row-spacing" property

  "row-spacing"              gdouble               : Read / Write

The default space between rows.

Allowed values: >= 0

Default value: 0


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between columns.

Allowed values: >= 0

Default value: 0


The "x-border-spacing" property

  "x-border-spacing"         gdouble               : Read / Write

The amount of spacing between the lefmost and rightmost cells and the border grid line.

Allowed values: >= 0

Default value: 0


The "y-border-spacing" property

  "y-border-spacing"         gdouble               : Read / Write

The amount of spacing between the topmost and bottommost cells and the border grid line.

Allowed values: >= 0

Default value: 0

Child Property Details

The "bottom-padding" child property

  "bottom-padding"           gdouble               : Read / Write

Extra space to add below the item.

Allowed values: >= 0

Default value: 0


The "column" child property

  "column"                   guint                 : Read / Write

The column to place the item in.

Allowed values: <= 65535

Default value: 0


The "columns" child property

  "columns"                  guint                 : Read / Write

The number of columns that the item spans.

Allowed values: <= 65535

Default value: 1


The "left-padding" child property

  "left-padding"             gdouble               : Read / Write

Extra space to add to the left of the item.

Allowed values: >= 0

Default value: 0


The "right-padding" child property

  "right-padding"            gdouble               : Read / Write

Extra space to add to the right of the item.

Allowed values: >= 0

Default value: 0


The "row" child property

  "row"                      guint                 : Read / Write

The row to place the item in.

Allowed values: <= 65535

Default value: 0


The "rows" child property

  "rows"                     guint                 : Read / Write

The number of rows that the item spans.

Allowed values: <= 65535

Default value: 1


The "top-padding" child property

  "top-padding"              gdouble               : Read / Write

Extra space to add above the item.

Allowed values: >= 0

Default value: 0


The "x-align" child property

  "x-align"                  gdouble               : Read / Write

The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned.

Allowed values: [0,1]

Default value: 0.5


The "x-expand" child property

  "x-expand"                 gboolean              : Read / Write

If the item expands horizontally as the table expands.

Default value: FALSE


The "x-fill" child property

  "x-fill"                   gboolean              : Read / Write

If the item fills all horizontal allocated space.

Default value: FALSE


The "x-shrink" child property

  "x-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size horizontally.

Default value: FALSE


The "y-align" child property

  "y-align"                  gdouble               : Read / Write

The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned.

Allowed values: [0,1]

Default value: 0.5


The "y-expand" child property

  "y-expand"                 gboolean              : Read / Write

If the item expands vertically as the table expands.

Default value: FALSE


The "y-fill" child property

  "y-fill"                   gboolean              : Read / Write

If the item fills all vertical allocated space.

Default value: FALSE


The "y-shrink" child property

  "y-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size vertically.

Default value: FALSE

goocanvas-1.0.0/docs/html/GooCanvasGroup.html0000644000076400007640000002552111512612762016110 00000000000000 GooCanvasGroup

GooCanvasGroup

GooCanvasGroup — a group of items.

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGroup
               +----GooCanvasTable

Implemented Interfaces

GooCanvasGroup implements GooCanvasItem.

Properties

  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasGroup represents a group of items. Groups can be nested to any depth, to create a hierarchy of items. Items are ordered within each group, with later items being displayed above earlier items.

GooCanvasGroup is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasGroup will affect all children of the GooCanvasGroup (unless the children override the property setting).

GooCanvasGroup implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events".

If the "width" and "height" properties are set to positive values then the group is clipped to the given size.

To create a GooCanvasGroup use goo_canvas_group_new().

To get or set the properties of an existing GooCanvasGroup, use g_object_get() and g_object_set().

Details

GooCanvasGroup

typedef struct _GooCanvasGroup GooCanvasGroup;

The GooCanvasGroup struct contains private data only.


goo_canvas_group_new ()

GooCanvasItem*      goo_canvas_group_new                (GooCanvasItem *parent,
                                                         ...);

Creates a new group item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new group item.

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the group, or -1 to use the default height.

Default value: -1


The "width" property

  "width"                    gdouble               : Read / Write

The width of the group, or -1 to use the default width.

Default value: -1


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the group.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the group.

Default value: 0

goocanvas-1.0.0/docs/html/GooCanvasEllipseModel.html0000644000076400007640000004226211512612762017373 00000000000000 GooCanvasEllipseModel

GooCanvasEllipseModel

GooCanvasEllipseModel — a model for ellipse items.

Synopsis

                    GooCanvasEllipseModel;
GooCanvasItemModel* goo_canvas_ellipse_model_new        (GooCanvasItemModel *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasEllipseModel

Implemented Interfaces

GooCanvasEllipseModel implements GooCanvasItemModel.

Properties

  "center-x"                 gdouble               : Read / Write
  "center-y"                 gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasEllipseModel represents a model for ellipse items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasEllipseModel use goo_canvas_ellipse_model_new().

To get or set the properties of an existing GooCanvasEllipseModel, use g_object_get() and g_object_set().

The ellipse can be specified either with the "center-x", "center-y", "radius-x" and "radius-y" properties, or with the "x", "y", "width" and "height" properties.

To respond to events such as mouse clicks on the ellipse you must connect to the signal handlers of the corresponding GooCanvasEllipse objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasEllipseModel

typedef struct _GooCanvasEllipseModel GooCanvasEllipseModel;

The GooCanvasEllipseModel struct contains private data only.


goo_canvas_ellipse_model_new ()

GooCanvasItemModel* goo_canvas_ellipse_model_new        (GooCanvasItemModel *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);

Creates a new ellipse model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

center_x :

the x coordinate of the center of the ellipse.

center_y :

the y coordinate of the center of the ellipse.

radius_x :

the horizontal radius of the ellipse.

radius_y :

the vertical radius of the ellipse.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new ellipse model.

Here's an example showing how to create an ellipse centered at (100.0, 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. It is drawn with a red outline with a width of 5.0 and filled with blue:

1
2
3
4
5
GooCanvasItemModel *ellipse = goo_canvas_ellipse_model_new (mygroup, 100.0, 100.0, 50.0, 30.0,
                                                            "stroke-color", "red",
                                                            "line-width", 5.0,
                                                            "fill-color", "blue",
                                                            NULL);

Property Details

The "center-x" property

  "center-x"                 gdouble               : Read / Write

The x coordinate of the center of the ellipse.

Default value: 0


The "center-y" property

  "center-y"                 gdouble               : Read / Write

The y coordinate of the center of the ellipse.

Default value: 0


The "height" property

  "height"                   gdouble               : Read / Write

The height of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the ellipse.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left side of the ellipse.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top of the ellipse.

Default value: 0

goocanvas-1.0.0/docs/html/GooCanvasImageModel.html0000644000076400007640000003703011512612762017015 00000000000000 GooCanvasImageModel

GooCanvasImageModel

GooCanvasImageModel — a model for image items.

Synopsis

                    GooCanvasImageModel;
GooCanvasItemModel* goo_canvas_image_model_new          (GooCanvasItemModel *parent,
                                                         GdkPixbuf *pixbuf,
                                                         gdouble x,
                                                         gdouble y,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasImageModel

Implemented Interfaces

GooCanvasImageModel implements GooCanvasItemModel.

Properties

  "alpha"                    gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "pattern"                  GooCairoPattern*      : Read / Write
  "pixbuf"                   GdkPixbuf*            : Write
  "scale-to-fit"             gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasImageModel represent a model for image items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "operator" and "pointer-events".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasImageModel use goo_canvas_image_model_new().

To get or set the properties of an existing GooCanvasImageModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the image you must connect to the signal handlers of the corresponding GooCanvasImage objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasImageModel

typedef struct _GooCanvasImageModel GooCanvasImageModel;

The GooCanvasImageModel struct contains private data only.


goo_canvas_image_model_new ()

GooCanvasItemModel* goo_canvas_image_model_new          (GooCanvasItemModel *parent,
                                                         GdkPixbuf *pixbuf,
                                                         gdouble x,
                                                         gdouble y,
                                                         ...);

Creates a new image model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

pixbuf :

the GdkPixbuf containing the image data, or NULL.

x :

the x coordinate of the image.

y :

the y coordinate of the image.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new image model.

Here's an example showing how to create an image at (100.0, 100.0), using the given pixbuf at its natural width and height:

1
2
GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0,
                                                        NULL);

Property Details

The "alpha" property

  "alpha"                    gdouble               : Read / Write

The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque.

Allowed values: [0,1]

Default value: 1


The "height" property

  "height"                   gdouble               : Read / Write

The height of the image.

Allowed values: >= 0

Default value: 0


The "pattern" property

  "pattern"                  GooCairoPattern*      : Read / Write

The cairo pattern to paint.


The "pixbuf" property

  "pixbuf"                   GdkPixbuf*            : Write

The GdkPixbuf to display.


The "scale-to-fit" property

  "scale-to-fit"             gboolean              : Read / Write

If the image is scaled to fit the width and height settings.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the image.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the image.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the image.

Default value: 0

goocanvas-1.0.0/docs/html/goocanvas-overview.html0000644000076400007640000000771211512612762017041 00000000000000 Overview

Overview

Overview — a quick tour of GooCanvas.

Features

  • Optional model/view split.

  • Uses interfaces for items and views.

  • Basic items - rect/ellipse/polyline/text/image/grid/group.

  • Path item, using SVG path specification strings.

  • Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.)

  • Embedded GTK+ widgets.

  • Layers/stacking order with raise/lower functions.

  • Cascading styles - line width/style/dashes, colors, fill patterns.

  • Affine transformations for all items - rotations/scales/skews.

  • Event handling - button/motion events, "pointer-events" property like SVG.

  • Grabs - support for pointer and keyboard grabs.

  • Keyboard focus traversal.

  • Accessibility (item title and description properties and hierarchy stuff).

  • Printing (output to a given cairo_t).

  • Scrolling.

  • Zooming.

  • Static items that don't move as the canvas is scrolled or zoomed.

  • Item visibility setting - on/off/above zoom threshold.

  • Simple animation.

  • Scalable - support for thousands of items over a large canvas area.

  • Support for different units - pixels/points/inches/millimeters.

goocanvas-1.0.0/docs/html/GooCanvasGrid.html0000644000076400007640000010156111512612762015700 00000000000000 GooCanvasGrid

GooCanvasGrid

GooCanvasGrid — a grid item.

Synopsis

                    GooCanvasGrid;
GooCanvasItem*      goo_canvas_grid_new                 (GooCanvasItem *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGrid

Implemented Interfaces

GooCanvasGrid implements GooCanvasItem.

Properties

  "border-color"             gchar*                : Write
  "border-color-rgba"        guint                 : Read / Write
  "border-pattern"           GooCairoPattern*      : Read / Write
  "border-pixbuf"            GdkPixbuf*            : Write
  "border-width"             gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "horz-grid-line-color"     gchar*                : Write
  "horz-grid-line-color-rgba" guint                 : Read / Write
  "horz-grid-line-pattern"   GooCairoPattern*      : Read / Write
  "horz-grid-line-pixbuf"    GdkPixbuf*            : Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "show-horz-grid-lines"     gboolean              : Read / Write
  "show-vert-grid-lines"     gboolean              : Read / Write
  "vert-grid-line-color"     gchar*                : Write
  "vert-grid-line-color-rgba" guint                 : Read / Write
  "vert-grid-line-pattern"   GooCairoPattern*      : Read / Write
  "vert-grid-line-pixbuf"    GdkPixbuf*            : Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "vert-grid-lines-on-top"   gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "x-offset"                 gdouble               : Read / Write
  "x-step"                   gdouble               : Read / Write
  "y"                        gdouble               : Read / Write
  "y-offset"                 gdouble               : Read / Write
  "y-step"                   gdouble               : Read / Write

Description

GooCanvasGrid represents a grid item. A grid consists of a number of equally-spaced horizontal and vertical grid lines, plus an optional border.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasGrid use goo_canvas_grid_new().

To get or set the properties of an existing GooCanvasGrid, use g_object_get() and g_object_set().

The grid's position and size is specified with the "x", "y", "width" and "height" properties.

The "x-step" and "y-step" properties specify the distance between grid lines. The "x-offset" and "y-offset" properties specify the distance before the first grid lines.

The horizontal or vertical grid lines can be hidden using the "show-horz-grid-lines" and "show-vert-grid-lines" properties.

The width of the border can be set using the "border-width" property. The border is drawn outside the area specified with the "x", "y", "width" and "height" properties.

Other properties allow the colors and widths of the grid lines to be set. The grid line color and width properties override the standard "stroke-color" and "line-width" properties, enabling different styles for horizontal and vertical grid lines.

Details

GooCanvasGrid

typedef struct _GooCanvasGrid GooCanvasGrid;

The GooCanvasGrid struct contains private data only.


goo_canvas_grid_new ()

GooCanvasItem*      goo_canvas_grid_new                 (GooCanvasItem *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Creates a new grid item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the grid.

y :

the y coordinate of the top of the grid.

width :

the width of the grid.

height :

the height of the grid.

x_step :

the distance between the vertical grid lines.

y_step :

the distance between the horizontal grid lines.

x_offset :

the distance before the first vertical grid line.

y_offset :

the distance before the first horizontal grid line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new grid item.

Here's an example showing how to create a grid:

1
2
3
4
5
6
7
8
9
10
GooCanvasItem *grid = goo_canvas_grid_new (mygroup, 100.0, 100.0, 400.0, 200.0,
                                           20.0, 20.0, 10.0, 10.0,
                                           "horz-grid-line-width", 4.0,
                                           "horz-grid-line-color", "yellow",
                                           "vert-grid-line-width", 2.0,
                                           "vert-grid-line-color", "red",
                                           "border-width", 3.0,
                                           "border-color", "white",
                                           "fill-color", "blue",
                                           NULL);

Property Details

The "border-color" property

  "border-color"             gchar*                : Write

The color to use for the border.

Default value: NULL


The "border-color-rgba" property

  "border-color-rgba"        guint                 : Read / Write

The color to use for the border, specified as a 32-bit integer value.

Default value: 0


The "border-pattern" property

  "border-pattern"           GooCairoPattern*      : Read / Write

The cairo pattern to paint the border with.


The "border-pixbuf" property

  "border-pixbuf"            GdkPixbuf*            : Write

The pixbuf to use to draw the border.


The "border-width" property

  "border-width"             gdouble               : Read / Write

The width of the border around the grid.

Default value: -1


The "height" property

  "height"                   gdouble               : Read / Write

The height of the grid.

Allowed values: >= 0

Default value: 0


The "horz-grid-line-color" property

  "horz-grid-line-color"     gchar*                : Write

The color to use for the horizontal grid lines.

Default value: NULL


The "horz-grid-line-color-rgba" property

  "horz-grid-line-color-rgba" guint                 : Read / Write

The color to use for the horizontal grid lines, specified as a 32-bit integer value.

Default value: 0


The "horz-grid-line-pattern" property

  "horz-grid-line-pattern"   GooCairoPattern*      : Read / Write

The cairo pattern to paint the horizontal grid lines with.


The "horz-grid-line-pixbuf" property

  "horz-grid-line-pixbuf"    GdkPixbuf*            : Write

The pixbuf to use to draw the horizontal grid lines.


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the horizontal grid lines.

Default value: -1


The "show-horz-grid-lines" property

  "show-horz-grid-lines"     gboolean              : Read / Write

If the horizontal grid lines are shown.

Default value: TRUE


The "show-vert-grid-lines" property

  "show-vert-grid-lines"     gboolean              : Read / Write

If the vertical grid lines are shown.

Default value: TRUE


The "vert-grid-line-color" property

  "vert-grid-line-color"     gchar*                : Write

The color to use for the vertical grid lines.

Default value: NULL


The "vert-grid-line-color-rgba" property

  "vert-grid-line-color-rgba" guint                 : Read / Write

The color to use for the vertical grid lines, specified as a 32-bit integer value.

Default value: 0


The "vert-grid-line-pattern" property

  "vert-grid-line-pattern"   GooCairoPattern*      : Read / Write

The cairo pattern to paint the vertical grid lines with.


The "vert-grid-line-pixbuf" property

  "vert-grid-line-pixbuf"    GdkPixbuf*            : Write

The pixbuf to use to draw the vertical grid lines.


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the vertical grid lines.

Default value: -1


The "vert-grid-lines-on-top" property

  "vert-grid-lines-on-top"   gboolean              : Read / Write

If the vertical grid lines are painted above the horizontal grid lines.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the grid.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the grid.

Default value: 0


The "x-offset" property

  "x-offset"                 gdouble               : Read / Write

The distance before the first vertical grid line.

Allowed values: >= 0

Default value: 0


The "x-step" property

  "x-step"                   gdouble               : Read / Write

The distance between the vertical grid lines.

Allowed values: >= 0

Default value: 10


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the grid.

Default value: 0


The "y-offset" property

  "y-offset"                 gdouble               : Read / Write

The distance before the first horizontal grid line.

Allowed values: >= 0

Default value: 0


The "y-step" property

  "y-step"                   gdouble               : Read / Write

The distance between the horizontal grid lines.

Allowed values: >= 0

Default value: 10

goocanvas-1.0.0/docs/html/right.png0000644000076400007640000000073011512612761014142 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ2 I%Á=eIDATxœ­”!oÂ@†Ÿ.'**M0$ÄÁ$¿?1~¢vIeEuLlÉ&–Ô4‚ä Í¶B»Ý›œ¹|÷>ï—ûî …$ݶ©oc<”´ÑA©¤×€X’ò9²|t$DÞ9nnBäíÈjµò‘BRIsIªë:HîŸ8ŽU…œùëùPÖÚN™1fc­sNÎ95Mã§–ɵ¤ ׿ŸØŒ1~¸pEòe$ïIž°€Ç î7nrDòf!;Ã`¨çÝ'äykíÎI’øáû䲤sI_]ÿÇy—‡‘€ÅÀ^^I>O>Á¡ø­§²š?YBIEND®B`‚goocanvas-1.0.0/docs/html/GooCanvasGroupModel.html0000644000076400007640000002714311512612762017073 00000000000000 GooCanvasGroupModel

GooCanvasGroupModel

GooCanvasGroupModel — a model for a group of items.

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasGroupModel
               +----GooCanvasTableModel

Implemented Interfaces

GooCanvasGroupModel implements GooCanvasItemModel.

Properties

  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasGroupModel represents a group of items. Groups can be nested to any depth, to create a hierarchy of items. Items are ordered within each group, with later items being displayed above earlier items.

GooCanvasGroupModel is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasGroupModel will affect all children of the GooCanvasGroupModel (unless the children override the property setting).

GooCanvasGroupModel implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(), and the properties such as "visibility" and "pointer-events".

To create a GooCanvasGroupModel use goo_canvas_group_model_new().

To get or set the properties of an existing GooCanvasGroupModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the group you must connect to the signal handlers of the corresponding GooCanvasGroup objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasGroupModel

typedef struct _GooCanvasGroupModel GooCanvasGroupModel;

The GooCanvasGroupModel struct contains private data only.


goo_canvas_group_model_new ()

GooCanvasItemModel* goo_canvas_group_model_new          (GooCanvasItemModel *parent,
                                                         ...);

Creates a new group item.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new group model.

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the group, or -1 to use the default height.

Default value: -1


The "width" property

  "width"                    gdouble               : Read / Write

The width of the group, or -1 to use the default width.

Default value: -1


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the group.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the group.

Default value: 0

goocanvas-1.0.0/docs/html/ch05.html0000644000076400007640000000337611512612762013756 00000000000000 Miscellaneous

Miscellaneous

GooCanvas Types — types used in GooCanvas.
goocanvas-1.0.0/docs/html/goocanvas-architecture.html0000644000076400007640000002337111512612762017654 00000000000000 Underlying Architecture

Underlying Architecture

Underlying Architecture — how the canvas fits together.

Underlying Architecture

The GooCanvas Widget

GooCanvas is a GtkWidget (it is actually a subclass of GtkContainer), and so can be placed in an interface just like any normal widget. Usually a GooCanvas widget would be placed inside a GtkScrolledWindow in order to enable scrolling of the canvas.

The size of the canvas can be set explicitly using goo_canvas_set_bounds(), or if the "automatic-bounds" property is set to TRUE the bounds will be automatically calculated to include all of the canvas items. The units used in the canvas can be set with the "units" property. The canvas units can be pixels, points, inches or millimeters and apply to the canvas and all items.


The Structure of the Simple Canvas

The simple canvas consists of a hierarchy of canvas items. The root item is automatically created by the canvas and can be accessed using goo_canvas_get_root_item(). New items and groups can then be created and added to the root item.

Each item in the canvas keeps a GooCanvasBounds structure which stores the bounding rectangle of the item and all of its descendants. This makes it easy to find out which items in the canvas need repainting or which item the mouse is over. (The bounds are stored in the canvas coordinate space, which is the coordinate space of the entire canvas, after any item transformation matrices have been applied.)


The Structure of the Model/View Canvas

The model/view canvas consists of a hierarchy of item models, and an identical hierarchy of canvas items, with each canvas item corresponding to one item model.

The hierarchy of item models can be used in several GooCanvas widgets, to allow multiple views of the same model. Though different canvas items will be used in each GooCanvas.

The root item model is set with goo_canvas_set_root_item_model(). The canvas will automatically create canvas items to display the hierarchy of item models, and will automatically add and remove canvas items as the item model hierarchy is changed.


The Update Procedure

When items are added to the canvas or their properties are changed they may need to recalculate their bounds. To do this they set an internal flag such as need_update, and make a call to goo_canvas_item_request_update().

GooCanvas handles all the update requests at once, to avoid multiple redraws of the same parts of the canvas. To do this it installs an idle handler, goo_canvas_idle_handler(), which is called as soon as the application is idle (and before any part of the canvas is redrawn).

The idle handler calls goo_canvas_item_update() on the root item, which recursively calls goo_canvas_item_update() on any items as necessary, recalculating their bounds and requesting redraws as appropriate.

If a container item (e.g. GooCanvasGroup) is changed it needs to ensure that all descendants recalculate their bounds so it calls goo_canvas_item_update() for all of its children with the entire_tree argument set to TRUE.


How Changes to Items are Handled

When an item is changed (e.g. if the "x" property of a GooCanvasRect is changed), the item calls goo_canvas_item_simple_changed() with a flag indicating if the bounds of the item need to be recalculated.

If the bounds don't need to be recalculated, then goo_canvas_request_redraw() is called to simply request that the item is redrawn. This results in a call to gdk_window_invalidate_rect() and the redraw proceeds just like a normal GtkWidget.

However, if the bounds do need to be recalculated then goo_canvas_item_request_update() is called to request that the item be updated the next time the canvas performs an update.


How Changes are Handled in the Model/View Canvas

In the Model/View canvas it is the underlying item models which are initially changed. The item models emit "changed" signals which the items respond to. For the standard canvas items the goo_canvas_item_model_simple_changed() signal handler is called, which calls goo_canvas_item_simple_changed() and the procedure continues as in the simple canvas case above.

goocanvas-1.0.0/docs/html/GooCanvasTextModel.html0000644000076400007640000004460011512612762016720 00000000000000 GooCanvasTextModel

GooCanvasTextModel

GooCanvasTextModel — a model for text items.

Synopsis

                    GooCanvasTextModel;
GooCanvasItemModel* goo_canvas_text_model_new           (GooCanvasItemModel *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasTextModel

Implemented Interfaces

GooCanvasTextModel implements GooCanvasItemModel.

Properties

  "alignment"                PangoAlignment        : Read / Write
  "anchor"                   GtkAnchorType         : Read / Write
  "ellipsize"                PangoEllipsizeMode    : Read / Write
  "height"                   gdouble               : Read / Write
  "text"                     gchar*                : Read / Write
  "use-markup"               gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "wrap"                     PangoWrapMode         : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasTextModel represents a model for text items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "fill-color".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasTextModel use goo_canvas_text_model_new().

To get or set the properties of an existing GooCanvasTextModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the text item you must connect to the signal handlers of the corresponding GooCanvasText objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasTextModel

typedef struct _GooCanvasTextModel GooCanvasTextModel;

The GooCanvasTextModel struct contains private data only.


goo_canvas_text_model_new ()

GooCanvasItemModel* goo_canvas_text_model_new           (GooCanvasItemModel *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);

Creates a new text model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

string :

the text to display.

x :

the x coordinate of the text.

y :

the y coordinate of the text.

width :

the width of the text item, or -1 for unlimited width.

anchor :

the position of the text relative to the given x and y coordinates. For example an anchor of GDK_ANCHOR_NW will result in the top-left of the text being placed at the given x and y coordinates. An anchor of GDK_ANCHOR_CENTER will result in the center of the text being placed at the x and y coordinates.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new text model.

Here's an example showing how to create a text item with the bottom right of the text box placed at (500,500):

1
2
3
GooCanvasItemModel *text = goo_canvas_text_model_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE,
                                                      "fill-color", "blue",
                                                      NULL);

Property Details

The "alignment" property

  "alignment"                PangoAlignment        : Read / Write

How to align the text.

Default value: PANGO_ALIGN_LEFT


The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

How to position the text relative to the given x and y coordinates.

Default value: GTK_ANCHOR_NORTH_WEST


The "ellipsize" property

  "ellipsize"                PangoEllipsizeMode    : Read / Write

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.

Default value: PANGO_ELLIPSIZE_NONE


The "height" property

  "height"                   gdouble               : Read / Write

The height to use to layout the text, or -1 to let the text use as much vertical space as needed.

Default value: -1


The "text" property

  "text"                     gchar*                : Read / Write

The text to display.

Default value: NULL


The "use-markup" property

  "use-markup"               gboolean              : Read / Write

Whether to parse PangoMarkup in the text, to support different styles.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width to use to layout the text, or -1 to let the text use as much horizontal space as needed.

Default value: -1


The "wrap" property

  "wrap"                     PangoWrapMode         : Read / Write

The preferred method of wrapping the string if a width has been set.

Default value: PANGO_WRAP_WORD


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the text.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the text.

Default value: 0

goocanvas-1.0.0/docs/html/goocanvas-GooCanvas-Types.html0000644000076400007640000012147711512612762020162 00000000000000 GooCanvas Types

GooCanvas Types

GooCanvas Types — types used in GooCanvas.

Description

This section describes the types used throughout GooCanvas.

Details

GooCanvasBounds

typedef struct {
  gdouble x1, y1, x2, y2;
} GooCanvasBounds;

GooCanvasBounds represents the bounding box of an item in the canvas.

gdouble x1;

the left edge.

gdouble y1;

the top edge.

gdouble x2;

the right edge.

gdouble y2;

the bottom edge.

enum GooCanvasItemVisibility

typedef enum
{
  GOO_CANVAS_ITEM_HIDDEN			= 0,
  GOO_CANVAS_ITEM_INVISIBLE			= 1,
  GOO_CANVAS_ITEM_VISIBLE			= 2,
  GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD = 3
} GooCanvasItemVisibility;

The GooCanvasItemVisibility enumeration is used to specify when a canvas item is visible.

GOO_CANVAS_ITEM_HIDDEN

the item is invisible, and is not allocated any space in layout container items such as GooCanvasTable.

GOO_CANVAS_ITEM_INVISIBLE

the item is invisible, but it is still allocated space in layout container items.

GOO_CANVAS_ITEM_VISIBLE

the item is visible.

GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD

the item is visible when the canvas scale setting is greater than or equal to the item's visibility threshold setting.

enum GooCanvasPointerEvents

typedef enum
{
  GOO_CANVAS_EVENTS_VISIBLE_MASK = 1 << 0,
  GOO_CANVAS_EVENTS_PAINTED_MASK = 1 << 1,
  GOO_CANVAS_EVENTS_FILL_MASK		= 1 << 2,
  GOO_CANVAS_EVENTS_STROKE_MASK		= 1 << 3,

  GOO_CANVAS_EVENTS_NONE		= 0,
  GOO_CANVAS_EVENTS_VISIBLE_PAINTED = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_VISIBLE_FILL = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK,
  GOO_CANVAS_EVENTS_VISIBLE_STROKE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_VISIBLE		= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_PAINTED		= GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_FILL		= GOO_CANVAS_EVENTS_FILL_MASK,
  GOO_CANVAS_EVENTS_STROKE		= GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_ALL			= GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK
} GooCanvasPointerEvents;

Specifies when an item receives pointer events such as mouse clicks.

GOO_CANVAS_EVENTS_VISIBLE_MASK

a mask indicating that the item only receives events when it is visible.

GOO_CANVAS_EVENTS_PAINTED_MASK

a mask indicating that the item only receives events when the specified parts of it are painted.

GOO_CANVAS_EVENTS_FILL_MASK

a mask indicating that the filled part of the item receives events.

GOO_CANVAS_EVENTS_STROKE_MASK

a mask indicating that the stroked part of the item receives events.

GOO_CANVAS_EVENTS_NONE

the item doesn't receive events at all.

GOO_CANVAS_EVENTS_VISIBLE_PAINTED

the item receives events in its painted areas when it is visible (the default).

GOO_CANVAS_EVENTS_VISIBLE_FILL

the item's interior receives events when it is visible.

GOO_CANVAS_EVENTS_VISIBLE_STROKE

the item's perimeter receives events when it is visible.

GOO_CANVAS_EVENTS_VISIBLE

the item receives events when it is visible, whether it is painted or not.

GOO_CANVAS_EVENTS_PAINTED

the item receives events in its painted areas, whether it is visible or not.

GOO_CANVAS_EVENTS_FILL

the item's interior receives events, whether it is visible or painted or not.

GOO_CANVAS_EVENTS_STROKE

the item's perimeter receives events, whether it is visible or painted or not.

GOO_CANVAS_EVENTS_ALL

the item's perimeter and interior receive events, whether it is visible or painted or not.

enum GooCanvasAnimateType

typedef enum
{
  GOO_CANVAS_ANIMATE_FREEZE,
  GOO_CANVAS_ANIMATE_RESET,
  GOO_CANVAS_ANIMATE_RESTART,
  GOO_CANVAS_ANIMATE_BOUNCE
} GooCanvasAnimateType;

GooCanvasAnimateType is used to specify what happens when the end of an animation is reached.

GOO_CANVAS_ANIMATE_FREEZE

the item remains in the final position.

GOO_CANVAS_ANIMATE_RESET

the item is moved back to the initial position.

GOO_CANVAS_ANIMATE_RESTART

the animation is restarted from the initial position.

GOO_CANVAS_ANIMATE_BOUNCE

the animation bounces back and forth between the start and end positions.

GooCanvasPoints

typedef struct {
  double *coords;
  int num_points;
  int ref_count;
} GooCanvasPoints;

GooCairoPoints represents an array of points.

double *coords;

the coordinates of the points, in pairs.

int num_points;

the number of points.

int ref_count;

the reference count of the struct.

goo_canvas_points_new ()

GooCanvasPoints*    goo_canvas_points_new               (int num_points);

Creates a new GooCanvasPoints struct with space for the given number of points. It should be freed with goo_canvas_points_unref().

num_points :

the number of points to create space for.

Returns :

a new GooCanvasPoints struct.

goo_canvas_points_ref ()

GooCanvasPoints*    goo_canvas_points_ref               (GooCanvasPoints *points);

Increments the reference count of the given GooCanvasPoints struct.

points :

a GooCanvasPoints struct.

Returns :

the GooCanvasPoints struct.

goo_canvas_points_unref ()

void                goo_canvas_points_unref             (GooCanvasPoints *points);

Decrements the reference count of the given GooCanvasPoints struct, freeing it if the reference count falls to zero.

points :

a GooCanvasPoints struct.

GooCanvasLineDash

typedef struct {
  int ref_count;
  int num_dashes;
  double *dashes;
  double dash_offset;
} GooCanvasLineDash;

GooCanvasLineDash specifies a dash pattern to be used when drawing items.

int ref_count;

the reference count of the struct.

int num_dashes;

the number of dashes and gaps between them.

double *dashes;

the sizes of each dash and gap.

double dash_offset;

the start offset into the dash pattern.

goo_canvas_line_dash_new ()

GooCanvasLineDash*  goo_canvas_line_dash_new            (gint num_dashes,
                                                         ...);

Creates a new dash pattern.

num_dashes :

the number of dashes and gaps in the pattern.

... :

the length of each dash and gap.

Returns :

a new dash pattern.

goo_canvas_line_dash_newv ()

GooCanvasLineDash*  goo_canvas_line_dash_newv           (gint num_dashes,
                                                         double *dashes);

Creates a new dash pattern. Takes ownership of the dashes vector.

num_dashes :

the number of dashes and gaps in the pattern.

dashes :

a g_new-allocated vector of doubles, the length of each dash and gap.

Returns :

a new dash pattern.

goo_canvas_line_dash_ref ()

GooCanvasLineDash*  goo_canvas_line_dash_ref            (GooCanvasLineDash *dash);

Increments the reference count of the dash pattern.

dash :

a GooCanvasLineDash.

Returns :

the dash pattern.

goo_canvas_line_dash_unref ()

void                goo_canvas_line_dash_unref          (GooCanvasLineDash *dash);

Decrements the reference count of the dash pattern. If it falls to 0 it is freed.

dash :

a GooCanvasLineDash.

enum GooCanvasPathCommandType

typedef enum
{
  /* Simple commands like moveto and lineto: MmZzLlHhVv. */
  GOO_CANVAS_PATH_MOVE_TO,
  GOO_CANVAS_PATH_CLOSE_PATH,
  GOO_CANVAS_PATH_LINE_TO,
  GOO_CANVAS_PATH_HORIZONTAL_LINE_TO,
  GOO_CANVAS_PATH_VERTICAL_LINE_TO,

  /* Bezier curve commands: CcSsQqTt. */
  GOO_CANVAS_PATH_CURVE_TO,
  GOO_CANVAS_PATH_SMOOTH_CURVE_TO,
  GOO_CANVAS_PATH_QUADRATIC_CURVE_TO,
  GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO,

  /* The elliptical arc commands: Aa. */
  GOO_CANVAS_PATH_ELLIPTICAL_ARC
} GooCanvasPathCommandType;

GooCanvasPathCommandType specifies the type of each command in the path. See the path element in the Scalable Vector Graphics (SVG) specification for more details.

GOO_CANVAS_PATH_MOVE_TO

move to the given point.

GOO_CANVAS_PATH_CLOSE_PATH

close the current path, drawing a line from the current position to the start of the path.

GOO_CANVAS_PATH_LINE_TO

draw a line to the given point.

GOO_CANVAS_PATH_HORIZONTAL_LINE_TO

draw a horizontal line to the given x coordinate.

GOO_CANVAS_PATH_VERTICAL_LINE_TO

draw a vertical line to the given y coordinate.

GOO_CANVAS_PATH_CURVE_TO

draw a bezier curve using two control points to the given point.

GOO_CANVAS_PATH_SMOOTH_CURVE_TO

draw a bezier curve using a reflection of the last control point of the last curve as the first control point, and one new control point, to the given point.

GOO_CANVAS_PATH_QUADRATIC_CURVE_TO

draw a quadratic bezier curve using a single control point to the given point.

GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO

draw a quadratic bezier curve using a reflection of the control point from the previous curve as the control point, to the given point.

GOO_CANVAS_PATH_ELLIPTICAL_ARC

draw an elliptical arc, using the given 2 radii, the x axis rotation, and the 2 flags to disambiguate the arc, to the given point.

union GooCanvasPathCommand


GooCanvasPathCommand holds the data for each command in the path.

The relative flag specifies that the coordinates for the command are relative to the current point. Otherwise they are assumed to be absolute coordinates.


goo_canvas_parse_path_data ()

GArray*             goo_canvas_parse_path_data          (const gchar *path_data);

Parses the given SVG path specification string.

path_data :

the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Returns :

a GArray of GooCanvasPathCommand elements.

goo_canvas_create_path ()

void                goo_canvas_create_path              (GArray *commands,
                                                         cairo_t *cr);

Creates the path specified by the given GooCanvasPathCommand array.

commands :

an array of GooCanvasPathCommand.

cr :

a cairo context.

GooCairoAntialias

typedef cairo_antialias_t GooCairoAntialias;

GooCairoAntialias is simply a wrapper for the cairo_antialias_t type, allowing it to be used for GObject properties.

See the cairo_antialias_t documentation.


GooCairoFillRule

typedef cairo_fill_rule_t GooCairoFillRule;

GooCairoFillRule is simply a wrapper for the cairo_fill_rule_t type, allowing it to be used for GObject properties.

See the cairo_fill_rule_t documentation.


GooCairoHintMetrics

typedef cairo_hint_metrics_t GooCairoHintMetrics;

GooCairoHintMetrics is simply a wrapper for the cairo_hint_metrics_t type, allowing it to be used for GObject properties.

See the cairo_hint_metrics_t documentation.


GooCairoLineCap

typedef cairo_line_cap_t GooCairoLineCap;

GooCairoLineCap is simply a wrapper for the cairo_line_cap_t type, allowing it to be used for GObject properties.

See the cairo_line_cap_t documentation.


GooCairoLineJoin

typedef cairo_line_join_t GooCairoLineJoin;

GooCairoLineJoin is simply a wrapper for the cairo_line_join_t type, allowing it to be used for GObject properties.

See the cairo_line_join_t documentation.


GooCairoOperator

typedef cairo_operator_t GooCairoOperator;

GooCairoOperator is simply a wrapper for the cairo_operator_t type, allowing it to be used for GObject properties.

See the cairo_operator_t documentation.


GooCairoMatrix

typedef cairo_matrix_t		GooCairoMatrix;

GooCairoMatrix is simply a wrapper for the cairo_matrix_t type, allowing it to be used for GObject properties.

See the cairo_matrix_t documentation.


GooCairoPattern

typedef cairo_pattern_t		GooCairoPattern;

GooCairoPattern is simply a wrapper for the cairo_pattern_t type, allowing it to be used for GObject properties.

See the cairo_pattern_t documentation.

goocanvas-1.0.0/docs/html/GooCanvasImage.html0000644000076400007640000003456611512612762016047 00000000000000 GooCanvasImage

GooCanvasImage

GooCanvasImage — an image item.

Synopsis

                    GooCanvasImage;
GooCanvasItem*      goo_canvas_image_new                (GooCanvasItem *parent,
                                                         GdkPixbuf *pixbuf,
                                                         gdouble x,
                                                         gdouble y,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasImage

Implemented Interfaces

GooCanvasImage implements GooCanvasItem.

Properties

  "alpha"                    gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "pattern"                  GooCairoPattern*      : Read / Write
  "pixbuf"                   GdkPixbuf*            : Write
  "scale-to-fit"             gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasImage represents an image item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "operator" and "pointer-events".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasImage use goo_canvas_image_new().

To get or set the properties of an existing GooCanvasImage, use g_object_get() and g_object_set().

Details

GooCanvasImage

typedef struct _GooCanvasImage GooCanvasImage;

The GooCanvasImage struct contains private data only.


goo_canvas_image_new ()

GooCanvasItem*      goo_canvas_image_new                (GooCanvasItem *parent,
                                                         GdkPixbuf *pixbuf,
                                                         gdouble x,
                                                         gdouble y,
                                                         ...);

Creates a new image item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

pixbuf :

the GdkPixbuf containing the image data, or NULL.

x :

the x coordinate of the image.

y :

the y coordinate of the image.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new image item.

Here's an example showing how to create an image at (100.0, 100.0), using the given pixbuf at its natural width and height:

1
2
GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0,
                                             NULL);

Property Details

The "alpha" property

  "alpha"                    gdouble               : Read / Write

The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque.

Allowed values: [0,1]

Default value: 1


The "height" property

  "height"                   gdouble               : Read / Write

The height of the image.

Allowed values: >= 0

Default value: 0


The "pattern" property

  "pattern"                  GooCairoPattern*      : Read / Write

The cairo pattern to paint.


The "pixbuf" property

  "pixbuf"                   GdkPixbuf*            : Write

The GdkPixbuf to display.


The "scale-to-fit" property

  "scale-to-fit"             gboolean              : Read / Write

If the image is scaled to fit the width and height settings.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the image.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the image.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the image.

Default value: 0

goocanvas-1.0.0/docs/html/GooCanvasText.html0000644000076400007640000005002511512612762015735 00000000000000 GooCanvasText

GooCanvasText

GooCanvasText — a text item.

Synopsis

                    GooCanvasText;
GooCanvasItem*      goo_canvas_text_new                 (GooCanvasItem *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);
void                goo_canvas_text_get_natural_extents (GooCanvasText *text,
                                                         PangoRectangle *ink_rect,
                                                         PangoRectangle *logical_rect);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasText

Implemented Interfaces

GooCanvasText implements GooCanvasItem.

Properties

  "alignment"                PangoAlignment        : Read / Write
  "anchor"                   GtkAnchorType         : Read / Write
  "ellipsize"                PangoEllipsizeMode    : Read / Write
  "height"                   gdouble               : Read / Write
  "text"                     gchar*                : Read / Write
  "use-markup"               gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "wrap"                     PangoWrapMode         : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasText represents a text item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "fill-color".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

The "width" and "height" properties specify the area of the item. If it exceeds that area because there is too much text, it is clipped. The properties can be set to -1 to disable clipping.

To create a GooCanvasText use goo_canvas_text_new().

To get or set the properties of an existing GooCanvasText, use g_object_get() and g_object_set().

Details

GooCanvasText

typedef struct _GooCanvasText GooCanvasText;

The GooCanvasText struct contains private data only.


goo_canvas_text_new ()

GooCanvasItem*      goo_canvas_text_new                 (GooCanvasItem *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);

Creates a new text item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

string :

the text to display.

x :

the x coordinate of the text.

y :

the y coordinate of the text.

width :

the width of the text item, or -1 for unlimited width.

anchor :

the position of the text relative to the given x and y coordinates. For example an anchor of GDK_ANCHOR_NW will result in the top-left of the text being placed at the given x and y coordinates. An anchor of GDK_ANCHOR_CENTER will result in the center of the text being placed at the x and y coordinates.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new text item.

Here's an example showing how to create a text item with the bottom right of the text box placed at (500,500):

1
2
3
GooCanvasItem *text = goo_canvas_text_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE,
                                           "fill-color", "blue",
                                           NULL);


goo_canvas_text_get_natural_extents ()

void                goo_canvas_text_get_natural_extents (GooCanvasText *text,
                                                         PangoRectangle *ink_rect,
                                                         PangoRectangle *logical_rect);

Gets the natural extents of the text, in the text item's coordinate space.

The final extents of the text may be different, if the text item is placed in a layout container such as GooCanvasTable.

text :

a GooCanvasText.

ink_rect :

the location to return the ink rect, or NULL.

logical_rect :

the location to return the logical rect, or NULL.

Property Details

The "alignment" property

  "alignment"                PangoAlignment        : Read / Write

How to align the text.

Default value: PANGO_ALIGN_LEFT


The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

How to position the text relative to the given x and y coordinates.

Default value: GTK_ANCHOR_NORTH_WEST


The "ellipsize" property

  "ellipsize"                PangoEllipsizeMode    : Read / Write

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.

Default value: PANGO_ELLIPSIZE_NONE


The "height" property

  "height"                   gdouble               : Read / Write

The height to use to layout the text, or -1 to let the text use as much vertical space as needed.

Default value: -1


The "text" property

  "text"                     gchar*                : Read / Write

The text to display.

Default value: NULL


The "use-markup" property

  "use-markup"               gboolean              : Read / Write

Whether to parse PangoMarkup in the text, to support different styles.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width to use to layout the text, or -1 to let the text use as much horizontal space as needed.

Default value: -1


The "wrap" property

  "wrap"                     PangoWrapMode         : Read / Write

The preferred method of wrapping the string if a width has been set.

Default value: PANGO_WRAP_WORD


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the text.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the text.

Default value: 0

goocanvas-1.0.0/docs/html/goocanvas-wysiwyg.html0000644000076400007640000001044611512612762016713 00000000000000 WYSIWYG Printing

WYSIWYG Printing

WYSIWYG Printing — how to use the canvas to create accurate printed output.

WYSIWYG Printing

Screen Resolution

The GooCanvas "resolution-x" and "resolution-y" properties must be set correctly. They both default to 96dpi, which corresponds to a typical monitor. To get a more accurate figure you might be able to use gdk_screen_get_resolution(), but this isn't always guaranteed to be correct. If accuracy is very important a method should be provided for the user to calibrate the screen.


Units

The GooCanvas "units" property must be set to one of GTK_UNIT_MM, GTK_UNIT_POINTS or GTK_UNIT_INCH (it defaults to GTK_UNIT_PIXEL). All values used within the canvas are assumed to be in the specified units, including font sizes.


Font Sizes

Absolute font sizes must be used (to prevent the fonts being mistakenly scaled by Pango as well as by GooCanvas). To specify absolute font sizes add "px" after the font size, e.g. instead of "Sans 9" use "Sans 9px".

Font sizes must be converted to the units used by the canvas. For example, if a 9 point "Sans" font is desired but "units" is set to GTK_UNIT_MM, then the size must first be converted into millimeters: (9 / 72) * 25.4 = 3.175mm. So the font used would be "Sans 3.175px".


Example Code

The units-demo application that comes with the GooCanvas source code demonstrates the use of different units and absolute font sizes.

goocanvas-1.0.0/docs/html/GooCanvasTableModel.html0000644000076400007640000010210011512612762017011 00000000000000 GooCanvasTableModel

GooCanvasTableModel

GooCanvasTableModel — a model for a table container to layout items.

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasGroupModel
               +----GooCanvasTableModel

Implemented Interfaces

GooCanvasTableModel implements GooCanvasItemModel.

Properties

  "column-spacing"           gdouble               : Read / Write
  "homogeneous-columns"      gboolean              : Read / Write
  "homogeneous-rows"         gboolean              : Read / Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "row-spacing"              gdouble               : Read / Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "x-border-spacing"         gdouble               : Read / Write
  "y-border-spacing"         gdouble               : Read / Write

Child Properties

  "bottom-padding"           gdouble               : Read / Write
  "column"                   guint                 : Read / Write
  "columns"                  guint                 : Read / Write
  "left-padding"             gdouble               : Read / Write
  "right-padding"            gdouble               : Read / Write
  "row"                      guint                 : Read / Write
  "rows"                     guint                 : Read / Write
  "top-padding"              gdouble               : Read / Write
  "x-align"                  gdouble               : Read / Write
  "x-expand"                 gboolean              : Read / Write
  "x-fill"                   gboolean              : Read / Write
  "x-shrink"                 gboolean              : Read / Write
  "y-align"                  gdouble               : Read / Write
  "y-expand"                 gboolean              : Read / Write
  "y-fill"                   gboolean              : Read / Write
  "y-shrink"                 gboolean              : Read / Write

Description

GooCanvasTableModel is a model for a table container used to lay out other canvas items. It is used in a similar way to how the GtkTable widget is used to lay out GTK+ widgets.

Item models are added to the table using the normal methods, then goo_canvas_item_model_set_child_properties() is used to specify how each child item is to be positioned within the table (i.e. which row and column it is in, how much padding it should have and whether it should expand or shrink).

GooCanvasTableModel is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasTableModel will affect all children of the GooCanvasTableModel (unless the children override the property setting).

GooCanvasTableModel implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events".

To create a GooCanvasTableModel use goo_canvas_table_model_new().

To get or set the properties of an existing GooCanvasTableModel, use g_object_get() and g_object_set().

Details

GooCanvasTableModel

typedef struct _GooCanvasTableModel GooCanvasTableModel;

The GooCanvasTableModel struct contains private data only.


goo_canvas_table_model_new ()

GooCanvasItemModel* goo_canvas_table_model_new          (GooCanvasItemModel *parent,
                                                         ...);

Creates a new table model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new table model.

Here's an example showing how to create a table with a square, a circle and a triangle in it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
GooCanvasItemModel *table, *square, *circle, *triangle;

table = goo_canvas_table_model_new (root,
                                    "row-spacing", 4.0,
                                    "column-spacing", 4.0,
                                    NULL);
goo_canvas_item_model_translate (table, 400, 200);

square = goo_canvas_rect_model_new (table, 0.0, 0.0, 50.0, 50.0,
                                    "fill-color", "red",
                                    NULL);
goo_canvas_item_model_set_child_properties (table, square,
                                            "row", 0,
                                            "column", 0,
                                            NULL);

circle = goo_canvas_ellipse_model_new (table, 0.0, 0.0, 25.0, 25.0,
                                       "fill-color", "blue",
                                       NULL);
goo_canvas_item_model_set_child_properties (table, circle,
                                            "row", 0,
                                            "column", 1,
                                            NULL);

triangle = goo_canvas_polyline_model_new (table, TRUE, 3,
                                          25.0, 0.0, 0.0, 50.0, 50.0, 50.0,
                                          "fill-color", "yellow",
                                          NULL);
goo_canvas_item_model_set_child_properties (table, triangle,
                                            "row", 0,
                                            "column", 2,
                                            NULL);

Property Details

The "column-spacing" property

  "column-spacing"           gdouble               : Read / Write

The default space between columns.

Allowed values: >= 0

Default value: 0


The "homogeneous-columns" property

  "homogeneous-columns"      gboolean              : Read / Write

If all columns are the same width.

Default value: FALSE


The "homogeneous-rows" property

  "homogeneous-rows"         gboolean              : Read / Write

If all rows are the same height.

Default value: FALSE


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between rows.

Allowed values: >= 0

Default value: 0


The "row-spacing" property

  "row-spacing"              gdouble               : Read / Write

The default space between rows.

Allowed values: >= 0

Default value: 0


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between columns.

Allowed values: >= 0

Default value: 0


The "x-border-spacing" property

  "x-border-spacing"         gdouble               : Read / Write

The amount of spacing between the lefmost and rightmost cells and the border grid line.

Allowed values: >= 0

Default value: 0


The "y-border-spacing" property

  "y-border-spacing"         gdouble               : Read / Write

The amount of spacing between the topmost and bottommost cells and the border grid line.

Allowed values: >= 0

Default value: 0

Child Property Details

The "bottom-padding" child property

  "bottom-padding"           gdouble               : Read / Write

Extra space to add below the item.

Allowed values: >= 0

Default value: 0


The "column" child property

  "column"                   guint                 : Read / Write

The column to place the item in.

Allowed values: <= 65535

Default value: 0


The "columns" child property

  "columns"                  guint                 : Read / Write

The number of columns that the item spans.

Allowed values: <= 65535

Default value: 1


The "left-padding" child property

  "left-padding"             gdouble               : Read / Write

Extra space to add to the left of the item.

Allowed values: >= 0

Default value: 0


The "right-padding" child property

  "right-padding"            gdouble               : Read / Write

Extra space to add to the right of the item.

Allowed values: >= 0

Default value: 0


The "row" child property

  "row"                      guint                 : Read / Write

The row to place the item in.

Allowed values: <= 65535

Default value: 0


The "rows" child property

  "rows"                     guint                 : Read / Write

The number of rows that the item spans.

Allowed values: <= 65535

Default value: 1


The "top-padding" child property

  "top-padding"              gdouble               : Read / Write

Extra space to add above the item.

Allowed values: >= 0

Default value: 0


The "x-align" child property

  "x-align"                  gdouble               : Read / Write

The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned.

Allowed values: [0,1]

Default value: 0.5


The "x-expand" child property

  "x-expand"                 gboolean              : Read / Write

If the item expands horizontally as the table expands.

Default value: FALSE


The "x-fill" child property

  "x-fill"                   gboolean              : Read / Write

If the item fills all horizontal allocated space.

Default value: FALSE


The "x-shrink" child property

  "x-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size horizontally.

Default value: FALSE


The "y-align" child property

  "y-align"                  gdouble               : Read / Write

The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned.

Allowed values: [0,1]

Default value: 0.5


The "y-expand" child property

  "y-expand"                 gboolean              : Read / Write

If the item expands vertically as the table expands.

Default value: FALSE


The "y-fill" child property

  "y-fill"                   gboolean              : Read / Write

If the item fills all vertical allocated space.

Default value: FALSE


The "y-shrink" child property

  "y-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size vertically.

Default value: FALSE

goocanvas-1.0.0/docs/html/GooCanvasItemModelSimple.html0000644000076400007640000005432211512612762020046 00000000000000 GooCanvasItemModelSimple

GooCanvasItemModelSimple

GooCanvasItemModelSimple — the base class for the standard canvas item models.

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasRectModel
         +----GooCanvasGroupModel
         +----GooCanvasPathModel
         +----GooCanvasEllipseModel
         +----GooCanvasTextModel
         +----GooCanvasPolylineModel
         +----GooCanvasImageModel
         +----GooCanvasGridModel

Implemented Interfaces

GooCanvasItemModelSimple implements GooCanvasItemModel.

Properties

  "antialias"                GooCairoAntialias     : Read / Write
  "clip-fill-rule"           GooCairoFillRule      : Read / Write
  "clip-path"                gchar*                : Write
  "fill-color"               gchar*                : Write
  "fill-color-rgba"          guint                 : Read / Write
  "fill-pattern"             GooCairoPattern*      : Read / Write
  "fill-pixbuf"              GdkPixbuf*            : Write
  "fill-rule"                GooCairoFillRule      : Read / Write
  "font"                     gchar*                : Read / Write
  "font-desc"                PangoFontDescription*  : Read / Write
  "hint-metrics"             GooCairoHintMetrics   : Read / Write
  "line-cap"                 GooCairoLineCap       : Read / Write
  "line-dash"                GooCanvasLineDash*    : Read / Write
  "line-join"                GooCairoLineJoin      : Read / Write
  "line-join-miter-limit"    gdouble               : Read / Write
  "line-width"               gdouble               : Read / Write
  "operator"                 GooCairoOperator      : Read / Write
  "stroke-color"             gchar*                : Write
  "stroke-color-rgba"        guint                 : Read / Write
  "stroke-pattern"           GooCairoPattern*      : Read / Write
  "stroke-pixbuf"            GdkPixbuf*            : Write

Description

GooCanvasItemModelSimple is used as a base class for the standard canvas item models. It can also be used as the base class for new custom canvas item models.

It provides default implementations for many of the GooCanvasItemModel methods.

Subclasses of GooCanvasItemModelSimple only need to implement the create_item() method of the GooCanvasItemModel interface, to create the default canvas item to view the item model.

Details

GooCanvasItemModelSimple

typedef struct {
  GooCanvasItemModel *parent;
  GooCanvasItemSimpleData simple_data;
} GooCanvasItemModelSimple;

The GooCanvasItemModelSimple struct contains the basic data needed to implement canvas item models.

GooCanvasItemModel *parent;

the parent model.

GooCanvasItemSimpleData simple_data;

data used by the canvas item for viewing the model.

Property Details

The "antialias" property

  "antialias"                GooCairoAntialias     : Read / Write

The antialiasing mode to use.

Default value: CAIRO_ANTIALIAS_GRAY


The "clip-fill-rule" property

  "clip-fill-rule"           GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are clipped.

Default value: CAIRO_FILL_RULE_WINDING


The "clip-path" property

  "clip-path"                gchar*                : Write

The sequence of commands describing the clip path of the item, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Default value: NULL


The "fill-color" property

  "fill-color"               gchar*                : Write

The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.

Default value: NULL


The "fill-color-rgba" property

  "fill-color-rgba"          guint                 : Read / Write

The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL.

Default value: 0


The "fill-pattern" property

  "fill-pattern"             GooCairoPattern*      : Read / Write

The pattern to use to paint the interior of the item, or NULL to disable painting.


The "fill-pixbuf" property

  "fill-pixbuf"              GdkPixbuf*            : Write

The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.


The "fill-rule" property

  "fill-rule"                GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are filled.

Default value: CAIRO_FILL_RULE_WINDING


The "font" property

  "font"                     gchar*                : Read / Write

The base font to use for the text.

Default value: NULL


The "font-desc" property

  "font-desc"                PangoFontDescription*  : Read / Write

The attributes specifying which font to use.


The "hint-metrics" property

  "hint-metrics"             GooCairoHintMetrics   : Read / Write

The hinting to be used for font metrics.

Default value: CAIRO_HINT_METRICS_OFF


The "line-cap" property

  "line-cap"                 GooCairoLineCap       : Read / Write

The line cap style to use.

Default value: CAIRO_LINE_CAP_BUTT


The "line-dash" property

  "line-dash"                GooCanvasLineDash*    : Read / Write

The dash pattern to use.


The "line-join" property

  "line-join"                GooCairoLineJoin      : Read / Write

The line join style to use.

Default value: CAIRO_LINE_JOIN_MITER


The "line-join-miter-limit" property

  "line-join-miter-limit"    gdouble               : Read / Write

The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit.

Allowed values: >= 0

Default value: 10


The "line-width" property

  "line-width"               gdouble               : Read / Write

The line width to use for the item's perimeter.

Allowed values: >= 0

Default value: 2


The "operator" property

  "operator"                 GooCairoOperator      : Read / Write

The compositing operator to use.

Default value: CAIRO_OPERATOR_OVER


The "stroke-color" property

  "stroke-color"             gchar*                : Write

The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.

Default value: NULL


The "stroke-color-rgba" property

  "stroke-color-rgba"        guint                 : Read / Write

The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL.

Default value: 0


The "stroke-pattern" property

  "stroke-pattern"           GooCairoPattern*      : Read / Write

The pattern to use to paint the perimeter of the item, or NULL disable painting.


The "stroke-pixbuf" property

  "stroke-pixbuf"            GdkPixbuf*            : Write

The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.

goocanvas-1.0.0/docs/html/goocanvas-simple-canvas.html0000644000076400007640000004425611512612762017741 00000000000000 Simple Canvas Example

Simple Canvas Example

Simple Canvas Example — how to create a simple canvas.

Simple Canvas Example

Here's a complete example application that creates a GooCanvas with a rectangle and a text item in it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include <stdlib.h>
#include <goocanvas.h>


static gboolean on_rect_button_press (GooCanvasItem  *view,
                                      GooCanvasItem  *target,
                                      GdkEventButton *event,
                                      gpointer        data);

static gboolean on_delete_event      (GtkWidget      *window,
                                      GdkEvent       *event,
                                      gpointer        unused_data);


int
main (int argc, char *argv[])
{
  GtkWidget *window, *scrolled_win, *canvas;
  GooCanvasItem *root, *rect_item, *text_item;

  /* Initialize GTK+. */
  gtk_set_locale ();
  gtk_init (&argc, &argv);

  /* Create the window and widgets. */
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
  gtk_widget_show (window);
  g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event,
                    NULL);

  scrolled_win = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
                                       GTK_SHADOW_IN);
  gtk_widget_show (scrolled_win);
  gtk_container_add (GTK_CONTAINER (window), scrolled_win);

  canvas = goo_canvas_new ();
  gtk_widget_set_size_request (canvas, 600, 450);
  goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000);
  gtk_widget_show (canvas);
  gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);

  root = goo_canvas_get_root_item (GOO_CANVAS (canvas));

  /* Add a few simple items. */
  rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400,
                                   "line-width", 10.0,
                                   "radius-x", 20.0,
                                   "radius-y", 10.0,
                                   "stroke-color", "yellow",
                                   "fill-color", "red",
                                   NULL);

  text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1,
                                   GTK_ANCHOR_CENTER,
                                   "font", "Sans 24",
                                   NULL);
  goo_canvas_item_rotate (text_item, 45, 300, 300);

  /* Connect a signal handler for the rectangle item. */
  g_signal_connect (rect_item, "button_press_event",
                    (GtkSignalFunc) on_rect_button_press, NULL);

  /* Pass control to the GTK+ main event loop. */
  gtk_main ();

  return 0;
}


/* This handles button presses in item views. We simply output a message to
   the console. */
static gboolean
on_rect_button_press (GooCanvasItem  *item,
                      GooCanvasItem  *target,
                      GdkEventButton *event,
                      gpointer        data)
{
  g_print ("rect item received button press event\n");
  return TRUE;
}


/* This is our handler for the "delete-event" signal of the window, which
   is emitted when the 'x' close button is clicked. We just exit here. */
static gboolean
on_delete_event (GtkWidget *window,
                 GdkEvent  *event,
                 gpointer   unused_data)
{
  exit (0);
}
goocanvas-1.0.0/docs/html/GooCanvasEllipse.html0000644000076400007640000003774611512612762016425 00000000000000 GooCanvasEllipse

GooCanvasEllipse

GooCanvasEllipse — an ellipse item.

Synopsis

                    GooCanvasEllipse;
GooCanvasItem*      goo_canvas_ellipse_new              (GooCanvasItem *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasEllipse

Implemented Interfaces

GooCanvasEllipse implements GooCanvasItem.

Properties

  "center-x"                 gdouble               : Read / Write
  "center-y"                 gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasEllipse represents an ellipse item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasEllipse use goo_canvas_ellipse_new().

To get or set the properties of an existing GooCanvasEllipse, use g_object_get() and g_object_set().

The ellipse can be specified either with the "center-x", "center-y", "radius-x" and "radius-y" properties, or with the "x", "y", "width" and "height" properties.

Details

GooCanvasEllipse

typedef struct _GooCanvasEllipse GooCanvasEllipse;

The GooCanvasEllipse struct contains private data only.


goo_canvas_ellipse_new ()

GooCanvasItem*      goo_canvas_ellipse_new              (GooCanvasItem *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);

Creates a new ellipse item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

center_x :

the x coordinate of the center of the ellipse.

center_y :

the y coordinate of the center of the ellipse.

radius_x :

the horizontal radius of the ellipse.

radius_y :

the vertical radius of the ellipse.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new ellipse item.

Here's an example showing how to create an ellipse centered at (100.0, 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. It is drawn with a red outline with a width of 5.0 and filled with blue:

1
2
3
4
5
GooCanvasItem *ellipse = goo_canvas_ellipse_new (mygroup, 100.0, 100.0, 50.0, 30.0,
                                                 "stroke-color", "red",
                                                 "line-width", 5.0,
                                                 "fill-color", "blue",
                                                 NULL);

Property Details

The "center-x" property

  "center-x"                 gdouble               : Read / Write

The x coordinate of the center of the ellipse.

Default value: 0


The "center-y" property

  "center-y"                 gdouble               : Read / Write

The y coordinate of the center of the ellipse.

Default value: 0


The "height" property

  "height"                   gdouble               : Read / Write

The height of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the ellipse.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left side of the ellipse.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top of the ellipse.

Default value: 0

goocanvas-1.0.0/docs/html/GooCanvasItemModel.html0000644000076400007640000032267611512612762016706 00000000000000 GooCanvasItemModel

GooCanvasItemModel

GooCanvasItemModel — the interface for canvas item models.

Synopsis

                    GooCanvasItemModel;
                    GooCanvasItemModelIface;

void                goo_canvas_item_model_translate     (GooCanvasItemModel *model,
                                                         gdouble tx,
                                                         gdouble ty);
void                goo_canvas_item_model_scale         (GooCanvasItemModel *model,
                                                         gdouble sx,
                                                         gdouble sy);
void                goo_canvas_item_model_rotate        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_model_skew_x        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_model_skew_y        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
gboolean            goo_canvas_item_model_get_transform (GooCanvasItemModel *model,
                                                         cairo_matrix_t *transform);
void                goo_canvas_item_model_set_transform (GooCanvasItemModel *model,
                                                         const cairo_matrix_t *transform);
gboolean            goo_canvas_item_model_get_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);
void                goo_canvas_item_model_set_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);

void                goo_canvas_item_model_animate       (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);
void                goo_canvas_item_model_stop_animation
                                                        (GooCanvasItemModel *model);

void                goo_canvas_item_model_raise         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *above);
void                goo_canvas_item_model_lower         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *below);

void                goo_canvas_item_model_remove        (GooCanvasItemModel *model);

GooCanvasItemModel* goo_canvas_item_model_get_parent    (GooCanvasItemModel *model);
void                goo_canvas_item_model_set_parent    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *parent);

gboolean            goo_canvas_item_model_is_container  (GooCanvasItemModel *model);
gint                goo_canvas_item_model_get_n_children
                                                        (GooCanvasItemModel *model);
GooCanvasItemModel* goo_canvas_item_model_get_child     (GooCanvasItemModel *model,
                                                         gint child_num);
void                goo_canvas_item_model_add_child     (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         gint position);
void                goo_canvas_item_model_move_child    (GooCanvasItemModel *model,
                                                         gint old_position,
                                                         gint new_position);
void                goo_canvas_item_model_remove_child  (GooCanvasItemModel *model,
                                                         gint child_num);
gint                goo_canvas_item_model_find_child    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child);

GooCanvasStyle*     goo_canvas_item_model_get_style     (GooCanvasItemModel *model);
void                goo_canvas_item_model_set_style     (GooCanvasItemModel *model,
                                                         GooCanvasStyle *style);

void                goo_canvas_item_model_class_install_child_property
                                                        (GObjectClass *mclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);
GParamSpec**        goo_canvas_item_model_class_list_child_properties
                                                        (GObjectClass *mclass,
                                                         guint *n_properties);
GParamSpec*         goo_canvas_item_model_class_find_child_property
                                                        (GObjectClass *mclass,
                                                         const gchar *property_name);
void                goo_canvas_item_model_get_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         GValue *value);
void                goo_canvas_item_model_set_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         const GValue *value);
void                goo_canvas_item_model_get_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);
void                goo_canvas_item_model_get_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);
void                goo_canvas_item_model_set_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);
void                goo_canvas_item_model_set_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);

Object Hierarchy

  GInterface
   +----GooCanvasItemModel

Prerequisites

GooCanvasItemModel requires GObject.

Properties

  "can-focus"                gboolean              : Read / Write
  "description"              gchar*                : Read / Write
  "parent"                   GooCanvasItemModel*   : Read / Write
  "pointer-events"           GooCanvasPointerEvents  : Read / Write
  "title"                    gchar*                : Read / Write
  "tooltip"                  gchar*                : Read / Write
  "transform"                GooCairoMatrix*       : Read / Write
  "visibility"               GooCanvasItemVisibility  : Read / Write
  "visibility-threshold"     gdouble               : Read / Write

Signals

  "animation-finished"                             : Run Last
  "changed"                                        : Run Last
  "child-added"                                    : Run Last
  "child-moved"                                    : Run Last
  "child-notify"                                   : Run First / No Recursion / Has Details / No Hooks
  "child-removed"                                  : Run Last

Description

GooCanvasItemModel defines the interface that models for canvas items must implement, and contains methods for operating on canvas item models.

Details

GooCanvasItemModel

typedef struct _GooCanvasItemModel GooCanvasItemModel;

GooCanvasItemModel is a typedef used for objects that implement the GooCanvasItemModel interface.

(There is no actual GooCanvasItemModel struct, since it is only an interface. But using 'GooCanvasItemModel' is more helpful than using 'GObject'.)


GooCanvasItemModelIface

typedef struct {
  /* Virtual methods that group models must implement. */
  gint		       (* get_n_children)		(GooCanvasItemModel *model);
  GooCanvasItemModel*  (* get_child)			(GooCanvasItemModel *model,
							 gint			 child_num);

  /* Virtual methods that group models may implement. */
  void                 (* add_child)			(GooCanvasItemModel *model,
							 GooCanvasItemModel *child,
							 gint			 position);
  void                 (* move_child)			(GooCanvasItemModel *model,
							 gint			 old_position,
							 gint			 new_position);
  void                 (* remove_child)			(GooCanvasItemModel *model,
							 gint			 child_num);
  void                 (* get_child_property)		(GooCanvasItemModel *model,
							 GooCanvasItemModel *child,
							 guint			 property_id,
							 GValue			*value,
							 GParamSpec		*pspec);
  void                 (* set_child_property)		(GooCanvasItemModel *item,
							 GooCanvasItemModel *child,
							 guint			 property_id,
							 const GValue		*value,
							 GParamSpec		*pspec);

  /* Virtual methods that all item models must implement. */
  GooCanvasItemModel*  (* get_parent)			(GooCanvasItemModel *model);
  void                 (* set_parent)			(GooCanvasItemModel *model,
							 GooCanvasItemModel *parent);

  GooCanvasItem*       (* create_item)			(GooCanvasItemModel *model,
							 GooCanvas		*canvas);

  /* Virtual methods that all item models may implement. */
  gboolean             (* get_transform)		(GooCanvasItemModel *model,
							 cairo_matrix_t         *transform);
  void                 (* set_transform)		(GooCanvasItemModel *model,
							 const cairo_matrix_t *transform);
  GooCanvasStyle*      (* get_style)			(GooCanvasItemModel *model);
  void                 (* set_style)			(GooCanvasItemModel *model,
							 GooCanvasStyle		*style);

  /* Signals. */
  void                 (* child_added)			(GooCanvasItemModel *model,
							 gint			 child_num);
  void                 (* child_moved)			(GooCanvasItemModel *model,
							 gint			 old_child_num,
							 gint			 new_child_num);
  void                 (* child_removed)		(GooCanvasItemModel *model,
							 gint			 child_num);
  void                 (* changed)			(GooCanvasItemModel *model,
							 gboolean		 recompute_bounds);
  void                 (* child_notify)			(GooCanvasItemModel *model,
							 GParamSpec		*pspec);

  void		       (* animation_finished)		(GooCanvasItemModel     *model,
							 gboolean                stopped);
} GooCanvasItemModelIface;

GooCanvasItemModelIFace holds the virtual methods that make up the GooCanvasItemModel interface.

Simple item models only need to implement the get_parent(), set_parent() and create_item() methods.

Items that support transforms should also implement get_transform() and set_transform(). Items that support styles should implement get_style() and set_style().

Container items must implement get_n_children() and get_child(). Containers that support dynamic changes to their children should implement add_child(), move_child() and remove_child(). Layout containers like GooCanvasTable may implement get_child_property() and set_child_property().

get_n_children ()

returns the number of children of the model.

get_child ()

returns the child at the given index.

add_child ()

adds a child.

move_child ()

moves a child up or down the stacking order.

remove_child ()

removes a child.

get_child_property ()

gets a child property of a given child model, e.g. the "row" or "column" property of a model in a GooCanvasTableModel.

set_child_property ()

sets a child property for a given child model.

get_parent ()

gets the model's parent.

set_parent ()

sets the model's parent.

create_item ()

creates a default canvas item to view the model.

get_transform ()

gets the model's transformation matrix.

set_transform ()

sets the model's transformation matrix.

get_style ()

gets the model's style.

set_style ()

sets the model's style.

child_added ()

signal emitted when a child is added.

child_moved ()

signal emitted when a child is moved in the stacking order.

child_removed ()

signal emitted when a child is removed.

changed ()

signal emitted when the model has changed.

child_notify ()

signal emitted when a child property has changed.

animation_finished ()

signal emitted when the model's animation has finished.

goo_canvas_item_model_translate ()

void                goo_canvas_item_model_translate     (GooCanvasItemModel *model,
                                                         gdouble tx,
                                                         gdouble ty);

Translates the origin of the model's coordinate system by the given amounts.

model :

an item model.

tx :

the amount to move the origin in the horizontal direction.

ty :

the amount to move the origin in the vertical direction.

goo_canvas_item_model_scale ()

void                goo_canvas_item_model_scale         (GooCanvasItemModel *model,
                                                         gdouble sx,
                                                         gdouble sy);

Scales the model's coordinate system by the given amounts.

model :

an item model.

sx :

the amount to scale the horizontal axis.

sy :

the amount to scale the vertical axis.

goo_canvas_item_model_rotate ()

void                goo_canvas_item_model_rotate        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Rotates the model's coordinate system by the given amount, about the given origin.

model :

an item model.

degrees :

the clockwise angle of rotation.

cx :

the x coordinate of the origin of the rotation.

cy :

the y coordinate of the origin of the rotation.

goo_canvas_item_model_skew_x ()

void                goo_canvas_item_model_skew_x        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the model's coordinate system along the x axis by the given amount, about the given origin.

model :

an item model.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_model_skew_y ()

void                goo_canvas_item_model_skew_y        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the model's coordinate system along the y axis by the given amount, about the given origin.

model :

an item model.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_model_get_transform ()

gboolean            goo_canvas_item_model_get_transform (GooCanvasItemModel *model,
                                                         cairo_matrix_t *transform);

Gets the transformation matrix of an item model.

model :

an item model.

transform :

the place to store the transform.

Returns :

TRUE if a transform is set.

goo_canvas_item_model_set_transform ()

void                goo_canvas_item_model_set_transform (GooCanvasItemModel *model,
                                                         const cairo_matrix_t *transform);

Sets the transformation matrix of an item model.

model :

an item model.

transform :

the new transformation matrix, or NULL to reset the transformation to the identity matrix.

goo_canvas_item_model_get_simple_transform ()

gboolean            goo_canvas_item_model_get_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);

This function can be used to get the position, scale and rotation of an item model, providing that the model has a simple transformation matrix (e.g. set with goo_canvas_item_model_set_simple_transform(), or using a combination of simple translate, scale and rotate operations). If the model has a complex transformation matrix the results will be incorrect.

model :

an item model.

x :

returns the x coordinate of the origin of the model's coordinate space.

y :

returns the y coordinate of the origin of the model's coordinate space.

scale :

returns the scale of the model.

rotation :

returns the clockwise rotation of the model, in degrees (0-360).

Returns :

TRUE if a transform is set.

goo_canvas_item_model_set_simple_transform ()

void                goo_canvas_item_model_set_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);

A convenience function to set the item model's transformation matrix.

model :

an item model.

x :

the x coordinate of the origin of the model's coordinate space.

y :

the y coordinate of the origin of the model's coordinate space.

scale :

the scale of the model.

rotation :

the clockwise rotation of the model, in degrees.

goo_canvas_item_model_animate ()

void                goo_canvas_item_model_animate       (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);

Animates a model from its current position to the given offsets, scale and rotation.

model :

an item model.

x :

the final x coordinate.

y :

the final y coordinate.

scale :

the final scale.

degrees :

the final rotation. This can be negative to rotate anticlockwise, and can also be greater than 360 to rotate a number of times.

absolute :

if the x, y, scale and degrees values are absolute, or relative to the current transform. Note that absolute animations only work if the model currently has a simple transform. If the model has a shear or some other complicated transform it may result in strange animations.

duration :

the duration of the animation, in milliseconds (1/1000ths of a second).

step_time :

the time between each animation step, in milliseconds.

type :

specifies what happens when the animation finishes.

goo_canvas_item_model_stop_animation ()

void                goo_canvas_item_model_stop_animation
                                                        (GooCanvasItemModel *model);

Stops any current animation for the given model, leaving it at its current position.

model :

an item model.

goo_canvas_item_model_raise ()

void                goo_canvas_item_model_raise         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *above);

Raises a model in the stacking order.

model :

an item model.

above :

the item model to raise model above, or NULL to raise model to the top of the stack.

goo_canvas_item_model_lower ()

void                goo_canvas_item_model_lower         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *below);

Lowers a model in the stacking order.

model :

an item model.

below :

the item model to lower model below, or NULL to lower model to the bottom of the stack.

goo_canvas_item_model_remove ()

void                goo_canvas_item_model_remove        (GooCanvasItemModel *model);

Removes a model from its parent. If the model is in a canvas it will be removed.

This would normally also result in the model being freed.

model :

an item model.

goo_canvas_item_model_get_parent ()

GooCanvasItemModel* goo_canvas_item_model_get_parent    (GooCanvasItemModel *model);

Gets the parent of the given model.

model :

an item model.

Returns :

the parent model, or NULL if the model has no parent.

goo_canvas_item_model_set_parent ()

void                goo_canvas_item_model_set_parent    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *parent);

This function is only intended to be used when implementing new canvas item models (specifically container models such as GooCanvasGroupModel). It sets the parent of the child model.

model :

an item model.

parent :

the new parent item model.

Note

This function cannot be used to add a model to a group or to change the parent of a model. To do that use the "parent" property.


goo_canvas_item_model_is_container ()

gboolean            goo_canvas_item_model_is_container  (GooCanvasItemModel *model);

Tests to see if the given item model is a container.

model :

an item model.

Returns :

TRUE if the item model is a container.

goo_canvas_item_model_get_n_children ()

gint                goo_canvas_item_model_get_n_children
                                                        (GooCanvasItemModel *model);

Gets the number of children of the container.

model :

an item model.

Returns :

the number of children.

goo_canvas_item_model_get_child ()

GooCanvasItemModel* goo_canvas_item_model_get_child     (GooCanvasItemModel *model,
                                                         gint child_num);

Gets the child at the given stack position.

model :

an item model.

child_num :

the position of a child in the container's stack.

Returns :

the child at the given stack position, or NULL if child_num is out of range.

goo_canvas_item_model_add_child ()

void                goo_canvas_item_model_add_child     (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         gint position);

Adds a child at the given stack position.

model :

an item model.

child :

the child to add.

position :

the position of the child, or -1 to place it last (at the top of the stacking order).

goo_canvas_item_model_move_child ()

void                goo_canvas_item_model_move_child    (GooCanvasItemModel *model,
                                                         gint old_position,
                                                         gint new_position);

Moves a child to a new stack position.

model :

an item model.

old_position :

the current position of the child.

new_position :

the new position of the child.

goo_canvas_item_model_remove_child ()

void                goo_canvas_item_model_remove_child  (GooCanvasItemModel *model,
                                                         gint child_num);

Removes the child at the given position.

model :

an item model.

child_num :

the position of the child to remove.

goo_canvas_item_model_find_child ()

gint                goo_canvas_item_model_find_child    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child);

Attempts to find the given child with the container's stack.

model :

an item model.

child :

the child to find.

Returns :

the position of the given child, or -1 if it isn't found.

goo_canvas_item_model_get_style ()

GooCanvasStyle*     goo_canvas_item_model_get_style     (GooCanvasItemModel *model);

Gets the model's style. If the model doesn't have its own style it will return its parent's style.

model :

an item model.

Returns :

the model's style.

goo_canvas_item_model_set_style ()

void                goo_canvas_item_model_set_style     (GooCanvasItemModel *model,
                                                         GooCanvasStyle *style);

Sets the model's style, by copying the properties from the given style.

model :

an item model.

style :

a style.

goo_canvas_item_model_class_install_child_property ()

void                goo_canvas_item_model_class_install_child_property
                                                        (GObjectClass *mclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);

This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel.

It installs a child property on a canvas item class.

mclass :

a GObjectClass

property_id :

the id for the property

pspec :

the GParamSpec for the property

goo_canvas_item_model_class_list_child_properties ()

GParamSpec**        goo_canvas_item_model_class_list_child_properties
                                                        (GObjectClass *mclass,
                                                         guint *n_properties);

This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel.

It returns all child properties of a canvas item class.

mclass :

a GObjectClass

n_properties :

location to return the number of child properties found

Returns :

a newly allocated array of GParamSpec*. The array must be freed with g_free().

goo_canvas_item_model_class_find_child_property ()

GParamSpec*         goo_canvas_item_model_class_find_child_property
                                                        (GObjectClass *mclass,
                                                         const gchar *property_name);

This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel.

It finds a child property of a canvas item class by name.

mclass :

a GObjectClass

property_name :

the name of the child property to find

Returns :

the GParamSpec of the child property or NULL if class has no child property with that name.

goo_canvas_item_model_get_child_property ()

void                goo_canvas_item_model_get_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         GValue *value);

Gets a child property of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

property_name :

the name of the child property to get.

value :

a location to return the value.

goo_canvas_item_model_set_child_property ()

void                goo_canvas_item_model_set_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         const GValue *value);

Sets a child property of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

property_name :

the name of the child property to set.

value :

the value to set the property to.

goo_canvas_item_model_get_child_properties ()

void                goo_canvas_item_model_get_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);

Gets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

... :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_model_get_child_properties_valist ()

void                goo_canvas_item_model_get_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);

Gets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

var_args :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_model_set_child_properties ()

void                goo_canvas_item_model_set_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);

Sets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

... :

pairs of property names and values, and a terminating NULL.

goo_canvas_item_model_set_child_properties_valist ()

void                goo_canvas_item_model_set_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);

Sets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

var_args :

pairs of property names and values, and a terminating NULL.

Property Details

The "can-focus" property

  "can-focus"                gboolean              : Read / Write

If the item can take the keyboard focus.

Default value: FALSE


The "description" property

  "description"              gchar*                : Read / Write

A description of the item for use by assistive technologies.

Default value: NULL


The "parent" property

  "parent"                   GooCanvasItemModel*   : Read / Write

The parent item model.


The "pointer-events" property

  "pointer-events"           GooCanvasPointerEvents  : Read / Write

Specifies when the item receives pointer events.

Default value: GOO_CANVAS_EVENTS_VISIBLE_MASK|GOO_CANVAS_EVENTS_PAINTED_MASK|GOO_CANVAS_EVENTS_FILL_MASK|GOO_CANVAS_EVENTS_STROKE_MASK


The "title" property

  "title"                    gchar*                : Read / Write

A short context-rich description of the item for use by assistive technologies.

Default value: NULL


The "tooltip" property

  "tooltip"                  gchar*                : Read / Write

The tooltip to display for the item.

Default value: NULL


The "transform" property

  "transform"                GooCairoMatrix*       : Read / Write

The transformation matrix of the item.


The "visibility" property

  "visibility"               GooCanvasItemVisibility  : Read / Write

When the canvas item is visible.

Default value: GOO_CANVAS_ITEM_VISIBLE


The "visibility-threshold" property

  "visibility-threshold"     gdouble               : Read / Write

The scale threshold at which the item becomes visible.

Allowed values: >= 0

Default value: 0

Signal Details

The "animation-finished" signal

void                user_function                      (GooCanvasItemModel *item,
                                                        gboolean            stopped,
                                                        gpointer            user_data)      : Run Last

Emitted when the item model animation has finished.

item :

the item model that received the signal.

stopped :

if the animation was explicitly stopped.

user_data :

user data set when the signal handler was connected.

The "changed" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gboolean            recompute_bounds,
                                                        gpointer            user_data)             : Run Last

Emitted when the item model has been changed.

model :

the item model that received the signal.

recompute_bounds :

if the bounds of the item need to be recomputed.

user_data :

user data set when the signal handler was connected.

The "child-added" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gint                child_num,
                                                        gpointer            user_data)      : Run Last

Emitted when a child has been added.

model :

the item model that received the signal.

child_num :

the index of the new child.

user_data :

user data set when the signal handler was connected.

The "child-moved" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gint                old_child_num,
                                                        gint                new_child_num,
                                                        gpointer            user_data)          : Run Last

Emitted when a child has been moved in the stacking order.

model :

the item model that received the signal.

old_child_num :

the old index of the child.

new_child_num :

the new index of the child.

user_data :

user data set when the signal handler was connected.

The "child-notify" signal

void                user_function                      (GooCanvasItemModel *item,
                                                        GParamSpec         *pspec,
                                                        gpointer            user_data)      : Run First / No Recursion / Has Details / No Hooks

Emitted for each child property that has changed. The signal's detail holds the property name.

item :

the item model that received the signal.

pspec :

the GParamSpec of the changed child property.

user_data :

user data set when the signal handler was connected.

The "child-removed" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gint                child_num,
                                                        gpointer            user_data)      : Run Last

Emitted when a child has been removed.

model :

the item model that received the signal.

child_num :

the index of the child that was removed.

user_data :

user data set when the signal handler was connected.
goocanvas-1.0.0/docs/html/GooCanvasGridModel.html0000644000076400007640000010504111512612762016656 00000000000000 GooCanvasGridModel

GooCanvasGridModel

GooCanvasGridModel — a model for grid items.

Synopsis

                    GooCanvasGridModel;
GooCanvasItemModel* goo_canvas_grid_model_new           (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasGridModel

Implemented Interfaces

GooCanvasGridModel implements GooCanvasItemModel.

Properties

  "border-color"             gchar*                : Write
  "border-color-rgba"        guint                 : Read / Write
  "border-pattern"           GooCairoPattern*      : Read / Write
  "border-pixbuf"            GdkPixbuf*            : Write
  "border-width"             gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "horz-grid-line-color"     gchar*                : Write
  "horz-grid-line-color-rgba" guint                 : Read / Write
  "horz-grid-line-pattern"   GooCairoPattern*      : Read / Write
  "horz-grid-line-pixbuf"    GdkPixbuf*            : Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "show-horz-grid-lines"     gboolean              : Read / Write
  "show-vert-grid-lines"     gboolean              : Read / Write
  "vert-grid-line-color"     gchar*                : Write
  "vert-grid-line-color-rgba" guint                 : Read / Write
  "vert-grid-line-pattern"   GooCairoPattern*      : Read / Write
  "vert-grid-line-pixbuf"    GdkPixbuf*            : Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "vert-grid-lines-on-top"   gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "x-offset"                 gdouble               : Read / Write
  "x-step"                   gdouble               : Read / Write
  "y"                        gdouble               : Read / Write
  "y-offset"                 gdouble               : Read / Write
  "y-step"                   gdouble               : Read / Write

Description

GooCanvasGridModel represents a model for grid items. A grid consists of a number of equally-spaced horizontal and vertical grid lines, plus an optional border.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasGridModel use goo_canvas_grid_model_new().

To get or set the properties of an existing GooCanvasGridModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the grid you must connect to the signal handlers of the corresponding GooCanvasGrid objects. (See goo_canvas_get_item() and "item-created".)

The grid's position and size is specified with the "x", "y", "width" and "height" properties.

The "x-step" and "y-step" properties specify the distance between grid lines. The "x-offset" and "y-offset" properties specify the distance before the first grid lines.

The horizontal or vertical grid lines can be hidden using the "show-horz-grid-lines" and "show-vert-grid-lines" properties.

The width of the border can be set using the "border-width" property. The border is drawn outside the area specified with the "x", "y", "width" and "height" properties.

Other properties allow the colors and widths of the grid lines to be set. The grid line color and width properties override the standard "stroke-color" and "line-width" properties, enabling different styles for horizontal and vertical grid lines.

Details

GooCanvasGridModel

typedef struct _GooCanvasGridModel GooCanvasGridModel;

The GooCanvasGridModel struct contains private data only.


goo_canvas_grid_model_new ()

GooCanvasItemModel* goo_canvas_grid_model_new           (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Creates a new grid model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the grid.

y :

the y coordinate of the top of the grid.

width :

the width of the grid.

height :

the height of the grid.

x_step :

the distance between the vertical grid lines.

y_step :

the distance between the horizontal grid lines.

x_offset :

the distance before the first vertical grid line.

y_offset :

the distance before the first horizontal grid line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new grid model.

Here's an example showing how to create a grid:

1
2
3
4
5
6
7
8
9
10
GooCanvasItemModel *grid = goo_canvas_grid_model_new (mygroup, 100.0, 100.0, 400.0, 200.0,
                                                      20.0, 20.0, 10.0, 10.0,
                                                      "horz-grid-line-width", 4.0,
                                                      "horz-grid-line-color", "yellow",
                                                      "vert-grid-line-width", 2.0,
                                                      "vert-grid-line-color", "red",
                                                      "border-width", 3.0,
                                                      "border-color", "white",
                                                      "fill-color", "blue",
                                                      NULL);

Property Details

The "border-color" property

  "border-color"             gchar*                : Write

The color to use for the border.

Default value: NULL


The "border-color-rgba" property

  "border-color-rgba"        guint                 : Read / Write

The color to use for the border, specified as a 32-bit integer value.

Default value: 0


The "border-pattern" property

  "border-pattern"           GooCairoPattern*      : Read / Write

The cairo pattern to paint the border with.


The "border-pixbuf" property

  "border-pixbuf"            GdkPixbuf*            : Write

The pixbuf to use to draw the border.


The "border-width" property

  "border-width"             gdouble               : Read / Write

The width of the border around the grid.

Default value: -1


The "height" property

  "height"                   gdouble               : Read / Write

The height of the grid.

Allowed values: >= 0

Default value: 0


The "horz-grid-line-color" property

  "horz-grid-line-color"     gchar*                : Write

The color to use for the horizontal grid lines.

Default value: NULL


The "horz-grid-line-color-rgba" property

  "horz-grid-line-color-rgba" guint                 : Read / Write

The color to use for the horizontal grid lines, specified as a 32-bit integer value.

Default value: 0


The "horz-grid-line-pattern" property

  "horz-grid-line-pattern"   GooCairoPattern*      : Read / Write

The cairo pattern to paint the horizontal grid lines with.


The "horz-grid-line-pixbuf" property

  "horz-grid-line-pixbuf"    GdkPixbuf*            : Write

The pixbuf to use to draw the horizontal grid lines.


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the horizontal grid lines.

Default value: -1


The "show-horz-grid-lines" property

  "show-horz-grid-lines"     gboolean              : Read / Write

If the horizontal grid lines are shown.

Default value: TRUE


The "show-vert-grid-lines" property

  "show-vert-grid-lines"     gboolean              : Read / Write

If the vertical grid lines are shown.

Default value: TRUE


The "vert-grid-line-color" property

  "vert-grid-line-color"     gchar*                : Write

The color to use for the vertical grid lines.

Default value: NULL


The "vert-grid-line-color-rgba" property

  "vert-grid-line-color-rgba" guint                 : Read / Write

The color to use for the vertical grid lines, specified as a 32-bit integer value.

Default value: 0


The "vert-grid-line-pattern" property

  "vert-grid-line-pattern"   GooCairoPattern*      : Read / Write

The cairo pattern to paint the vertical grid lines with.


The "vert-grid-line-pixbuf" property

  "vert-grid-line-pixbuf"    GdkPixbuf*            : Write

The pixbuf to use to draw the vertical grid lines.


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the vertical grid lines.

Default value: -1


The "vert-grid-lines-on-top" property

  "vert-grid-lines-on-top"   gboolean              : Read / Write

If the vertical grid lines are painted above the horizontal grid lines.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the grid.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the grid.

Default value: 0


The "x-offset" property

  "x-offset"                 gdouble               : Read / Write

The distance before the first vertical grid line.

Allowed values: >= 0

Default value: 0


The "x-step" property

  "x-step"                   gdouble               : Read / Write

The distance between the vertical grid lines.

Allowed values: >= 0

Default value: 10


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the grid.

Default value: 0


The "y-offset" property

  "y-offset"                 gdouble               : Read / Write

The distance before the first horizontal grid line.

Allowed values: >= 0

Default value: 0


The "y-step" property

  "y-step"                   gdouble               : Read / Write

The distance between the horizontal grid lines.

Allowed values: >= 0

Default value: 10

goocanvas-1.0.0/docs/html/ch02.html0000644000076400007640000000511511512612762013744 00000000000000 Core Objects

Core Objects

GooCanvas — the main canvas widget.
GooCanvasItem — the interface for canvas items.
GooCanvasItemModel — the interface for canvas item models.
GooCanvasItemSimple — the base class for the standard canvas items.
GooCanvasItemModelSimple — the base class for the standard canvas item models.
GooCanvasStyle — support for cascading style properties for canvas items.
goocanvas-1.0.0/docs/html/left.png0000644000076400007640000000071311512612761013760 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ1&¹³[(XIDATxœµ•!OÃPEïÛ*ˆ‰ŠID%~ꊯ˜ÄÕ"pæ'öŘ`sÜ–¥rKf–´‚¤â h—mi—ÇIžz}÷ܯIû¤–.pÚö\“`xä‹ ˆl‡?l·[²,H¬‡¯×k<Ï#Žcþ%\’AUx[S³7–n6ù¾¯år¹ßèõzE‰‡’s’žŒ1³ºö“²æÅj@œ—NL$ݤiª0 ¿5/ð}¿²\E‡Ž¤KIo¥Í“$a0üjÞdF£bŠkIê„‹æAh>ŸW¶lC'?“tk;|/t*I»ÝN«ÕÊZø^`Œy•4ë÷ûšN§r]×® çJÒÌó<«’½À“Út»Ýú€à`±Xàºî1@p´ä€¸d½÷ŽZ')høÖÚK¬ ª$V?%Å]€­+³L’sgUKà"ÿw5â3O·•ÜòIEND®B`‚goocanvas-1.0.0/docs/html/GooCanvasPathModel.html0000644000076400007640000004131611512612762016671 00000000000000 GooCanvasPathModel

GooCanvasPathModel

GooCanvasPathModel — a model for path items (a series of lines and curves).

Synopsis

                    GooCanvasPathModel;
GooCanvasItemModel* goo_canvas_path_model_new           (GooCanvasItemModel *parent,
                                                         const gchar *path_data,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasPathModel

Implemented Interfaces

GooCanvasPathModel implements GooCanvasItemModel.

Properties

  "data"                     gchar*                : Write
  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPathModel represents a model for path items, which are a series of one or more lines, bezier curves, or elliptical arcs.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

GooCanvasPathModel uses the same path specification strings as the Scalable Vector Graphics (SVG) path element. For details see the SVG specification.

To create a GooCanvasPathModel use goo_canvas_path_model_new().

To get or set the properties of an existing GooCanvasPathModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the path you must connect to the signal handlers of the corresponding GooCanvasPath objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasPathModel

typedef struct _GooCanvasPathModel GooCanvasPathModel;

The GooCanvasPathModel struct contains private data only.


goo_canvas_path_model_new ()

GooCanvasItemModel* goo_canvas_path_model_new           (GooCanvasItemModel *parent,
                                                         const gchar *path_data,
                                                         ...);

Creates a new path model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

path_data :

the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new path model.

Here's an example showing how to create a red line from (20,20) to (40,40):

1
2
3
4
GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup,
                                                      "M 20 20 L 40 40",
                                                      "stroke-color", "red",
                                                      NULL);

This example creates a cubic bezier curve from (20,100) to (100,100) with the control points at (20,50) and (100,50):

1
2
3
4
GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup,
                                                      "M20,100 C20,50 100,50 100,100",
                                                      "stroke-color", "blue",
                                                      NULL);

This example uses an elliptical arc to create a filled circle with one quarter missing:

1
2
3
4
5
6
GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup,
                                                      "M200,500 h-150 a150,150 0 1,0 150,-150 z",
                                                      "fill-color", "red",
                                                      "stroke-color", "blue",
                                                      "line-width", 5.0,
                                                      NULL);

Property Details

The "data" property

  "data"                     gchar*                : Write

The sequence of path commands.

Default value: NULL


The "height" property

  "height"                   gdouble               : Read / Write

The height of the path.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the path.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the path.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the path.

Default value: 0

goocanvas-1.0.0/docs/html/goocanvas-creating-items.html0000644000076400007640000007655311512612762020117 00000000000000 Creating New Items

Creating New Items

Creating New Items — how to create new canvas items.

How to Create New Canvas Items

There are 3 ways to create new canvas items, listed here in increasing order of complexity:

These will be discussed in turn below. (It is also possible to create new container items by subclassing GooCanvasGroup, but that is not covered here.)

The final part of this section covers creating item models.

Creating a Simple Subclass of GooCanvasItemSimple

For items that consist of a simple graphic element such as a line, rectangle or circle, it is possible to create a subclass of GooCanvasItemSimple and override just one method, simple_create_path(). (This method is used for the GooCanvasEllipse and GooCanvasPath items.)

The simple_create_path() method should create a path using the given cairo context. The path will be drawn using the stroke, fill and other painting properties from GooCanvasItemSimple.

This example shows the simple_create_path() method for a simple rectangular item, MyItem:

1
2
3
4
5
6
7
8
static void
my_item_simple_create_path (GooCanvasItemSimple *simple,
                            cairo_t             *cr)
{
  MyItem *item = (MyItem*) simple;

  cairo_rectangle (cr, item->x, item->y, item->width, item->height);
}

Whenever the item is changed in some way it should call goo_canvas_item_simple_changed(), passing a boolean value indicating whether the item's bounds need to be recalculated or if it only needs to be repainted. The GooCanvasItemSimple code will take care of updating the item and repainting the appropriate parts of the canvas.


Creating a Regular Subclass of GooCanvasItemSimple

Most items will need more than a simple line or rectangle, so they will need to create a subclass of GooCanvasItemSimple and override three methods, simple_update(), simple_paint() and simple_is_item_at().

The simple_update() method should compute the bounds of the item, in the item's coordinate space, and place them in the bounds member of GooCanvasItemSimple. Note that the cairo context passed to this function may have transformations applied to it, so cairo_identity_matrix() should be called before using it.

The simple_paint() method should paint the item using the given cairo context. To use the stroke and fill properties from GooCanvasItemSimple to paint parts of the item call goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() before calling cairo_stroke() and cairo_fill(). (The item's style can be found in GOO_CANVAS_ITEM_SIMPLE (item)->simple_data->style).

The simple_is_item_at() method should return TRUE if the given coordinate (in the item's coordinate space) is inside the item. (The is_pointer_event argument can be ignored for most purposes since the GooCanvasItemSimple code will take care of it.)

This example code shows the simple_update(), simple_paint() and simple_is_item_at() methods for a rectangular item (the complete item's source code can be found in the GooCanvas demo directory, in demo-item.h and demo-item.c):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
static void
goo_demo_item_update  (GooCanvasItemSimple *simple,
                       cairo_t             *cr)
{
  GooDemoItem *demo_item = (GooDemoItem*) simple;

  /* Compute the new bounds. */
  simple->bounds.x1 = demo_item->x;
  simple->bounds.y1 = demo_item->y;
  simple->bounds.x2 = demo_item->x + demo_item->width;
  simple->bounds.y2 = demo_item->y + demo_item->height;
}


static void
goo_demo_item_paint (GooCanvasItemSimple   *simple,
                     cairo_t               *cr,
                     const GooCanvasBounds *bounds)
{
  GooDemoItem *demo_item = (GooDemoItem*) simple;

  cairo_move_to (cr, demo_item->x, demo_item->y);
  cairo_line_to (cr, demo_item->x, demo_item->y + demo_item->height);
  cairo_line_to (cr, demo_item->x + demo_item->width,
                 demo_item->y + demo_item->height);
  cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y);
  cairo_close_path (cr);
  goo_canvas_style_set_fill_options (simple->simple_data->style, cr);
  cairo_fill (cr);
}


static gboolean
goo_demo_item_is_item_at (GooCanvasItemSimple *simple,
                          gdouble              x,
                          gdouble              y,
                          cairo_t             *cr,
                          gboolean             is_pointer_event)
{
  GooDemoItem *demo_item = (GooDemoItem*) simple;

  if (x < demo_item->x || (x > demo_item->x + demo_item->width)
      || y < demo_item->y || (y > demo_item->y + demo_item->height))
    return FALSE;

  return TRUE;
}

As with the simple GooCanvasItemSimple subclass, the item should call goo_canvas_item_simple_changed() whenever it is changed, to ensure that the item's bounds are recomputed and it is repainted if necessary.


Implementing the GooCanvasItem Interface

The most complicated way to create new canvas items is to implement the GooCanvasItem interface directly. This should not be needed in most cases, but may be desired if the developer wants to avoid the memory and processor overheads associated with the GooCanvasItemSimple class, or if the developer wants to turn an existing application object into a canvas item.

At a minimum the canvas item must implement these 6 methods:

  • get_parent() - the item's parent should be returned.

  • set_parent() - the item's parent should be stored (though it should not add a reference to the parent).

  • get_bounds() - returns the bounds of the item, in canvas space. The item should ensure that the bounds are up-to-date before returning them, calling goo_canvas_item_ensure_updated() if necessary.

  • update() - if the item has been changed since the last update, or if the entire_tree flag is TRUE, the item's bounds should be recomputed (in canvas space). It should also request a redraw of the old bounds and the new bounds, so the display is updated appropriately. The new bounds should be returned in the bounds argument.

  • paint() - if the item's bounds intersect the given bounds then the item should be painted on the given cairo context. The scale parameter is only used to check if the item should be visible, according to the item's "visibility" and "visibility-threshold" property settings.

  • get_items_at() - if the given point is inside the item then a pointer to the item should be added to the start of the list of found items. The list is then returned.

The canvas item must also implement the "parent", "title", "description", "visibility", "visibility-threshold", "transform" and "pointer-events" properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.)

If the canvas item will be used within a container that does item layout, such as GooCanvasTable, it must implement the first two methods here at least:

  • get_requested_area() - returns the requested area of the item, in the parent's coordinate space.

  • allocate_area() - allocates the item's area, in the parent's coordinate space.

  • get_requested_height() - returns the requested height of the item, given a particular allocated width, in the parent's coordinate space. (This only needed for items that change height as their width is changed, such as text items.)

If the canvas item supports a transformation matrix it must implement:

  • get_transform() - returns the item's transformation matrix.

  • set_transform() - sets the item's transformation matrix.

If the canvas item supports a GooCanvasStyle setting, it must implement:

  • get_style() - returns the item's style.

  • set_style() - sets the item's style.

Since GooCanvasItemSimple implements most of the above methods and properties its source code is a good place to look for help.


Creating Item Models

As with creating canvas items, to create item models it is possible to subclass GooCanvasItemModelSimple or to implement the GooCanvasItemModel interface directly.

Subclassing GooCanvasItemModelSimple is very easy, since only one method from the GooCanvasItemModel interface must be implemented - create_item(). This should return a new canvas item for viewing the item model in a canvas. (It may be called multiple times if multiple canvases are viewing the same canvas model.)

The GooCanvasItemModelSimple subclass should emit the "changed" signal whenever it has changed, with a boolean flag indicating if the bounds need to be recomputed. The canvas items will connect to this signal and request an update or a redraw as appropriate.

To implement the GooCanvasItemModel interface directly, the class must implement the get_parent(), set_parent() and create_item() methods. It may also implement get_transform(), set_transform(), get_style() and set_style() methods if desired.

The class must also implement the "parent", "title", "description", "can-focus", "visibility", "visibility-threshold", "transform" and "pointer-events" properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.)

goocanvas-1.0.0/docs/html/GooCanvasPolyline.html0000644000076400007640000005635611512612762016621 00000000000000 GooCanvasPolyline

GooCanvasPolyline

GooCanvasPolyline — a polyline item (a series of lines with optional arrows).

Synopsis

                    GooCanvasPolyline;
GooCanvasItem*      goo_canvas_polyline_new             (GooCanvasItem *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);
GooCanvasItem*      goo_canvas_polyline_new_line        (GooCanvasItem *parent,
                                                         gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasPolyline

Implemented Interfaces

GooCanvasPolyline implements GooCanvasItem.

Properties

  "arrow-length"             gdouble               : Read / Write
  "arrow-tip-length"         gdouble               : Read / Write
  "arrow-width"              gdouble               : Read / Write
  "close-path"               gboolean              : Read / Write
  "end-arrow"                gboolean              : Read / Write
  "height"                   gdouble               : Read / Write
  "points"                   GooCanvasPoints*      : Read / Write
  "start-arrow"              gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPolyline represents a polyline item, which is a series of one or more lines, with optional arrows at either end.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasPolyline use goo_canvas_polyline_new(), or goo_canvas_polyline_new_line() for a simple line between two points.

To get or set the properties of an existing GooCanvasPolyline, use g_object_get() and g_object_set().

Details

GooCanvasPolyline

typedef struct _GooCanvasPolyline GooCanvasPolyline;

The GooCanvasPolyline struct contains private data only.


goo_canvas_polyline_new ()

GooCanvasItem*      goo_canvas_polyline_new             (GooCanvasItem *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);

Creates a new polyline item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

close_path :

if the last point should be connected to the first.

num_points :

the number of points in the polyline.

... :

the pairs of coordinates for each point in the line, followed by optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline item.

Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300).

1
2
3
4
5
6
7
8
GooCanvasItem *polyline = goo_canvas_polyline_new (mygroup, TRUE, 3,
                                                   100.0, 100.0,
                                                   300.0, 100.0,
                                                   200.0, 300.0,
                                                   "stroke-color", "red",
                                                   "line-width", 5.0,
                                                   "fill-color", "blue",
                                                   NULL);


goo_canvas_polyline_new_line ()

GooCanvasItem*      goo_canvas_polyline_new_line        (GooCanvasItem *parent,
                                                         gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2,
                                                         ...);

Creates a new polyline item with a single line.

parent :

the parent item, or NULL.

x1 :

the x coordinate of the start of the line.

y1 :

the y coordinate of the start of the line.

x2 :

the x coordinate of the end of the line.

y2 :

the y coordinate of the end of the line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline item.

Here's an example showing how to create a line from (100,100) to (300,300).

1
2
3
4
5
6
GooCanvasItem *polyline = goo_canvas_polyline_new_line (mygroup,
                                                        100.0, 100.0,
                                                        300.0, 300.0,
                                                        "stroke-color", "red",
                                                        "line-width", 5.0,
                                                        NULL);

Property Details

The "arrow-length" property

  "arrow-length"             gdouble               : Read / Write

The length of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 5


The "arrow-tip-length" property

  "arrow-tip-length"         gdouble               : Read / Write

The length of the arrow tip, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "arrow-width" property

  "arrow-width"              gdouble               : Read / Write

The width of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "close-path" property

  "close-path"               gboolean              : Read / Write

If the last point should be connected to the first.

Default value: FALSE


The "end-arrow" property

  "end-arrow"                gboolean              : Read / Write

If an arrow should be displayed at the end of the polyline.

Default value: FALSE


The "height" property

  "height"                   gdouble               : Read / Write

The height of the polyline.

Allowed values: >= 0

Default value: 0


The "points" property

  "points"                   GooCanvasPoints*      : Read / Write

The array of points.


The "start-arrow" property

  "start-arrow"              gboolean              : Read / Write

If an arrow should be displayed at the start of the polyline.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the polyline.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left-most point of the polyline.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top-most point of the polyline.

Default value: 0

goocanvas-1.0.0/docs/html/GooCanvasRectModel.html0000644000076400007640000003672311512612762016700 00000000000000 GooCanvasRectModel

GooCanvasRectModel

GooCanvasRectModel — a model for rectangle items.

Synopsis

                    GooCanvasRectModel;
GooCanvasItemModel* goo_canvas_rect_model_new           (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasRectModel

Implemented Interfaces

GooCanvasRectModel implements GooCanvasItemModel.

Properties

  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasRectModel represents a model for rectangle items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasRectModel use goo_canvas_rect_model_new().

To get or set the properties of an existing GooCanvasRectModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the rectangle you must connect to the signal handlers of the corresponding GooCanvasRect objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasRectModel

typedef struct _GooCanvasRectModel GooCanvasRectModel;

The GooCanvasRectModel struct contains private data only.


goo_canvas_rect_model_new ()

GooCanvasItemModel* goo_canvas_rect_model_new           (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Creates a new rectangle item.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the rectangle.

y :

the y coordinate of the top of the rectangle.

width :

the width of the rectangle.

height :

the height of the rectangle.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new rectangle model.

Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100.

1
2
3
4
5
GooCanvasItemModel *rect = goo_canvas_rect_model_new (mygroup, 100.0, 100.0, 200.0, 100.0,
                                                      "stroke-color", "red",
                                                      "line-width", 5.0,
                                                      "fill-color", "blue",
                                                      NULL);

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the rectangle.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the rectangle.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the rectangle.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the rectangle.

Default value: 0

goocanvas-1.0.0/docs/html/style.css0000644000076400007640000001171011512612761014171 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { position: relative; padding-top:4.5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } goocanvas-1.0.0/docs/html/goocanvas.devhelp0000644000076400007640000020217311512612761015655 00000000000000 goocanvas-1.0.0/docs/html/index.html0000644000076400007640000001575011512612762014325 00000000000000 GooCanvas Reference Manual

Introduction
Overview — a quick tour of GooCanvas.
Simple Canvas Example — how to create a simple canvas.
Model/View Canvas Example — how to create a model/view canvas.
Underlying Architecture — how the canvas fits together.
Coordinate Spaces and Limits — how coordinates are used.
Creating New Items — how to create new canvas items.
WYSIWYG Printing — how to use the canvas to create accurate printed output.
Core Objects
GooCanvas — the main canvas widget.
GooCanvasItem — the interface for canvas items.
GooCanvasItemModel — the interface for canvas item models.
GooCanvasItemSimple — the base class for the standard canvas items.
GooCanvasItemModelSimple — the base class for the standard canvas item models.
GooCanvasStyle — support for cascading style properties for canvas items.
Standard Canvas Items
GooCanvasGroup — a group of items.
GooCanvasEllipse — an ellipse item.
GooCanvasGrid — a grid item.
GooCanvasImage — an image item.
GooCanvasPath — a path item (a series of lines and curves).
GooCanvasPolyline — a polyline item (a series of lines with optional arrows).
GooCanvasRect — a rectangle item.
GooCanvasText — a text item.
GooCanvasWidget — an embedded widget item.
GooCanvasTable — a table container to layout items.
Standard Canvas Item Models
GooCanvasGroupModel — a model for a group of items.
GooCanvasEllipseModel — a model for ellipse items.
GooCanvasGridModel — a model for grid items.
GooCanvasImageModel — a model for image items.
GooCanvasPathModel — a model for path items (a series of lines and curves).
GooCanvasPolylineModel — a model for polyline items (a series of lines with optional arrows).
GooCanvasRectModel — a model for rectangle items.
GooCanvasTextModel — a model for text items.
GooCanvasTableModel — a model for a table container to layout items.
Miscellaneous
GooCanvas Types — types used in GooCanvas.
goocanvas-1.0.0/docs/html/GooCanvasItemSimple.html0000644000076400007640000015702711512612762017073 00000000000000 GooCanvasItemSimple

GooCanvasItemSimple

GooCanvasItemSimple — the base class for the standard canvas items.

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasWidget
         +----GooCanvasRect
         +----GooCanvasGroup
         +----GooCanvasPath
         +----GooCanvasEllipse
         +----GooCanvasText
         +----GooCanvasPolyline
         +----GooCanvasImage
         +----GooCanvasGrid

Implemented Interfaces

GooCanvasItemSimple implements GooCanvasItem.

Properties

  "antialias"                GooCairoAntialias     : Read / Write
  "clip-fill-rule"           GooCairoFillRule      : Read / Write
  "clip-path"                gchar*                : Write
  "fill-color"               gchar*                : Write
  "fill-color-rgba"          guint                 : Read / Write
  "fill-pattern"             GooCairoPattern*      : Read / Write
  "fill-pixbuf"              GdkPixbuf*            : Write
  "fill-rule"                GooCairoFillRule      : Read / Write
  "font"                     gchar*                : Read / Write
  "font-desc"                PangoFontDescription*  : Read / Write
  "hint-metrics"             GooCairoHintMetrics   : Read / Write
  "line-cap"                 GooCairoLineCap       : Read / Write
  "line-dash"                GooCanvasLineDash*    : Read / Write
  "line-join"                GooCairoLineJoin      : Read / Write
  "line-join-miter-limit"    gdouble               : Read / Write
  "line-width"               gdouble               : Read / Write
  "operator"                 GooCairoOperator      : Read / Write
  "stroke-color"             gchar*                : Write
  "stroke-color-rgba"        guint                 : Read / Write
  "stroke-pattern"           GooCairoPattern*      : Read / Write
  "stroke-pixbuf"            GdkPixbuf*            : Write

Description

GooCanvasItemSimple is used as a base class for all of the standard canvas items. It can also be used as the base class for new custom canvas items.

It provides default implementations for many of the GooCanvasItem methods.

For very simple items, all that is needed is to implement the create_path() method. (GooCanvasEllipse, GooCanvasRect and GooCanvasPath do this.)

More complicated items need to implement the update(), paint() and is_item_at() methods instead. (GooCanvasImage, GooCanvasPolyline, GooCanvasText and GooCanvasWidget do this.) They may also need to override some of the other GooCanvasItem methods such as set_canvas(), set_parent() or allocate_area() if special code is needed. (GooCanvasWidget does this to make sure the GtkWidget is embedded in the GooCanvas widget correctly.)

Details

GooCanvasItemSimple

typedef struct {
  GooCanvas *canvas;
  GooCanvasItem *parent;
  GooCanvasItemModelSimple *model;
  GooCanvasItemSimpleData *simple_data;
  GooCanvasBounds bounds;
  guint need_update			: 1;
  guint need_entire_subtree_update      : 1;
} GooCanvasItemSimple;

The GooCanvasItemSimple struct contains the basic data needed to implement canvas items.

GooCanvas *canvas;

the canvas.

GooCanvasItem *parent;

the parent item.

GooCanvasItemModelSimple *model;

the item's model, if it has one.

GooCanvasItemSimpleData *simple_data;

data that is common to both the model and view classes. If the canvas item has a model, this will point to the model's GooCanvasItemSimpleData, otherwise the canvas item will have its own GooCanvasItemSimpleData.

GooCanvasBounds bounds;

the bounds of the item, in device space.

guint need_update : 1;

if the item needs to recompute its bounds and redraw.

guint need_entire_subtree_update : 1;

if all descendants need to be updated.

GooCanvasItemSimpleData

typedef struct {
  GooCanvasStyle *style;
  cairo_matrix_t *transform;
  GArray *clip_path_commands;
  gchar *tooltip;

  gdouble visibility_threshold;
  guint visibility			: 2;
  guint pointer_events			: 4;
  guint can_focus                       : 1;
  guint own_style                       : 1;
  guint clip_fill_rule			: 4;
  guint is_static			: 1;
} GooCanvasItemSimpleData;

This is the data common to both the model and view classes.

GooCanvasStyle *style;

the style to draw with.

cairo_matrix_t *transform;

the transformation matrix of the item, or NULL.

GArray *clip_path_commands;

an array of GooCanvasPathCommand specifying the clip path of the item, or NULL.

gchar *tooltip;

the item's tooltip.

gdouble visibility_threshold;

the threshold scale setting at which to show the item (if the visibility setting is set to VISIBLE_ABOVE_THRESHOLD).

guint visibility : 2;

the GooCanvasItemVisibility setting specifying whether the item is visible, invisible, or visible above a given canvas scale setting.

guint pointer_events : 4;

the GooCanvasPointerEvents setting specifying the events the item should receive.

guint can_focus : 1;

if the item can take the keyboard focus.

guint own_style : 1;

if the item has its own style, rather than using its parent's.

guint clip_fill_rule : 4;

the cairo_fill_rule_t setting specifying the fill rule used for the clip path.

guint is_static : 1;

if the item is static.

GooCanvasItemSimpleClass

typedef struct {
  void		 (* simple_create_path) (GooCanvasItemSimple   *simple,
					 cairo_t               *cr);

  void           (* simple_update) (GooCanvasItemSimple   *simple,
					 cairo_t               *cr);
  void           (* simple_paint) (GooCanvasItemSimple   *simple,
					 cairo_t               *cr,
					 const GooCanvasBounds *bounds);
  gboolean       (* simple_is_item_at)  (GooCanvasItemSimple   *simple,
					 gdouble                x,
					 gdouble                y,
					 cairo_t               *cr,
					 gboolean               is_pointer_event);
} GooCanvasItemSimpleClass;

The GooCanvasItemSimpleClass struct contains several methods that subclasses can override.

Simple items need only implement the create_path() method. More complex items must override the update(), paint() and is_item_at() methods instead.

simple_create_path ()

simple subclasses that draw basic shapes and paths only need to override this one method. It creates the path for the item. All updating, painting and hit-testing is provided automatically by the GooCanvasItemSimple class. (This method is used by the builtin GooCanvasEllipse, GooCanvasRect and GooCanvasPath items.) More complicated subclasses must override simple_update, simple_paint and simple_is_item_at instead.

simple_update ()

subclasses should override this to calculate their new bounds, in user space.

simple_paint ()

subclasses should override this to paint their item.

simple_is_item_at ()

subclasses should override this to do hit-testing.

goo_canvas_item_simple_check_style ()

void                goo_canvas_item_simple_check_style  (GooCanvasItemSimple *item);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods.

It ensures that the item's style is setup correctly. If the item has its own GooCanvasStyle it makes sure the parent is set correctly. If it doesn't have its own style it uses the parent item's style.

item :

a GooCanvasItemSimple.

goo_canvas_item_simple_get_line_width ()

gdouble             goo_canvas_item_simple_get_line_width
                                                        (GooCanvasItemSimple *item);

Gets the item's line width.

item :

a GooCanvasItemSimple.

Returns :

the item's line width.

goo_canvas_item_simple_get_path_bounds ()

void                goo_canvas_item_simple_get_path_bounds
                                                        (GooCanvasItemSimple *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods.

It calculates the bounds of the current path, using the item's style settings, and stores the results in the given GooCanvasBounds struct.

The returned bounds contains the bounding box of the path in device space, converted to user space coordinates. To calculate the bounds completely in user space, use cairo_identity_matrix() to temporarily reset the current transformation matrix to the identity matrix.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

bounds :

the GooCanvasBounds struct to store the resulting bounding box.

goo_canvas_item_simple_user_bounds_to_device ()

void                goo_canvas_item_simple_user_bounds_to_device
                                                        (GooCanvasItemSimple *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods.

It converts the item's bounds to a bounding box in the canvas (device) coordinate space.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

bounds :

the bounds of the item, in the item's coordinate space.

goo_canvas_item_simple_user_bounds_to_parent ()

void                goo_canvas_item_simple_user_bounds_to_parent
                                                        (GooCanvasItemSimple *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their get_requested_area() method.

It converts the item's bounds to a bounding box in its parent's coordinate space. If the item has no transformation matrix set then no conversion is needed.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

bounds :

the bounds of the item, in the item's coordinate space.

goo_canvas_item_simple_check_in_path ()

gboolean            goo_canvas_item_simple_check_in_path
                                                        (GooCanvasItemSimple *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         cairo_t *cr,
                                                         GooCanvasPointerEvents pointer_events);

This function is intended to be used by subclasses of GooCanvasItemSimple.

It checks if the given point is in the current path, using the item's style settings.

item :

a GooCanvasItemSimple.

x :

the x coordinate of the point.

y :

the y coordinate of the point.

cr :

a cairo context.

pointer_events :

specifies which parts of the path to check.

Returns :

TRUE if the given point is in the current path.

goo_canvas_item_simple_paint_path ()

void                goo_canvas_item_simple_paint_path   (GooCanvasItemSimple *item,
                                                         cairo_t *cr);

This function is intended to be used by subclasses of GooCanvasItemSimple.

It paints the current path, using the item's style settings.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

goo_canvas_item_simple_changed ()

void                goo_canvas_item_simple_changed      (GooCanvasItemSimple *item,
                                                         gboolean recompute_bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple.

It is used as a callback for the "changed" signal of the item models. It requests an update or redraw of the item as appropriate.

item :

a GooCanvasItemSimple.

recompute_bounds :

if the item's bounds need to be recomputed.

goo_canvas_item_simple_set_model ()

void                goo_canvas_item_simple_set_model    (GooCanvasItemSimple *item,
                                                         GooCanvasItemModel *model);

This function should be called by subclasses of GooCanvasItemSimple in their set_model() method.

item :

a GooCanvasItemSimple.

model :

the model that item will view.

Property Details

The "antialias" property

  "antialias"                GooCairoAntialias     : Read / Write

The antialiasing mode to use.

Default value: CAIRO_ANTIALIAS_GRAY


The "clip-fill-rule" property

  "clip-fill-rule"           GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are clipped.

Default value: CAIRO_FILL_RULE_WINDING


The "clip-path" property

  "clip-path"                gchar*                : Write

The sequence of commands describing the clip path of the item, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Default value: NULL


The "fill-color" property

  "fill-color"               gchar*                : Write

The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.

Default value: NULL


The "fill-color-rgba" property

  "fill-color-rgba"          guint                 : Read / Write

The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL.

Default value: 0


The "fill-pattern" property

  "fill-pattern"             GooCairoPattern*      : Read / Write

The pattern to use to paint the interior of the item, or NULL to disable painting.


The "fill-pixbuf" property

  "fill-pixbuf"              GdkPixbuf*            : Write

The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.


The "fill-rule" property

  "fill-rule"                GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are filled.

Default value: CAIRO_FILL_RULE_WINDING


The "font" property

  "font"                     gchar*                : Read / Write

The base font to use for the text.

Default value: NULL


The "font-desc" property

  "font-desc"                PangoFontDescription*  : Read / Write

The attributes specifying which font to use.


The "hint-metrics" property

  "hint-metrics"             GooCairoHintMetrics   : Read / Write

The hinting to be used for font metrics.

Default value: CAIRO_HINT_METRICS_OFF


The "line-cap" property

  "line-cap"                 GooCairoLineCap       : Read / Write

The line cap style to use.

Default value: CAIRO_LINE_CAP_BUTT


The "line-dash" property

  "line-dash"                GooCanvasLineDash*    : Read / Write

The dash pattern to use.


The "line-join" property

  "line-join"                GooCairoLineJoin      : Read / Write

The line join style to use.

Default value: CAIRO_LINE_JOIN_MITER


The "line-join-miter-limit" property

  "line-join-miter-limit"    gdouble               : Read / Write

The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit.

Allowed values: >= 0

Default value: 10


The "line-width" property

  "line-width"               gdouble               : Read / Write

The line width to use for the item's perimeter.

Allowed values: >= 0

Default value: 2


The "operator" property

  "operator"                 GooCairoOperator      : Read / Write

The compositing operator to use.

Default value: CAIRO_OPERATOR_OVER


The "stroke-color" property

  "stroke-color"             gchar*                : Write

The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.

Default value: NULL


The "stroke-color-rgba" property

  "stroke-color-rgba"        guint                 : Read / Write

The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL.

Default value: 0


The "stroke-pattern" property

  "stroke-pattern"           GooCairoPattern*      : Read / Write

The pattern to use to paint the perimeter of the item, or NULL disable painting.


The "stroke-pixbuf" property

  "stroke-pixbuf"            GdkPixbuf*            : Write

The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.

goocanvas-1.0.0/docs/html/GooCanvasRect.html0000644000076400007640000003445311512612762015715 00000000000000 GooCanvasRect

GooCanvasRect

GooCanvasRect — a rectangle item.

Synopsis

                    GooCanvasRect;
GooCanvasItem*      goo_canvas_rect_new                 (GooCanvasItem *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasRect

Implemented Interfaces

GooCanvasRect implements GooCanvasItem.

Properties

  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasRect represents a rectangle item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasRect use goo_canvas_rect_new().

To get or set the properties of an existing GooCanvasRect, use g_object_get() and g_object_set().

Details

GooCanvasRect

typedef struct _GooCanvasRect GooCanvasRect;

The GooCanvasRect struct contains private data only.


goo_canvas_rect_new ()

GooCanvasItem*      goo_canvas_rect_new                 (GooCanvasItem *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Creates a new rectangle item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the rectangle.

y :

the y coordinate of the top of the rectangle.

width :

the width of the rectangle.

height :

the height of the rectangle.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new rectangle item.

Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100.

1
2
3
4
5
GooCanvasItem *rect = goo_canvas_rect_new (mygroup, 100.0, 100.0, 200.0, 100.0,
                                           "stroke-color", "red",
                                           "line-width", 5.0,
                                           "fill-color", "blue",
                                           NULL);

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the rectangle.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the rectangle.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the rectangle.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the rectangle.

Default value: 0

goocanvas-1.0.0/docs/html/home.png0000644000076400007640000000121611512612761013755 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ1õÚKvIDATxœÕ•±kqÅ?ßrC‡ßàpà ~C„np¼¡CAAJ .B-\'G‡]:Ü “‚ƒCÇ -(ˆ8´à Ô€!…fD°€…çÒ“klbRÛÁoyüxïûîËïwpðIJº<°of_®-@ÒððçRH•´ÏfÖŸtèÂü¤^¯×ÓÚÚš’$Q«ÕÒ|“ôpâ’¶€gív;X^^&Ïs¢(bww—Z­F£ÑÀ9Çææ&Þû3à¶™ Æ’^IRµZUE.0Z]]Uš¦ ÃPY–Mü8óHÒGIÚÙÙÑìììæeŸkqqñÒ€™!ó  $ÛÛÛ¬¯¯3Œn eýþ{-/seeeìÔÃŒãXóóóåO‡Í·$ý8==UÇS™—é½×ÑÑQòRR€¤'ã–9-sÚÛÛ+B^ éC·Û•sîŸÍËÂ+%À°<7³ŸWô˜¿ õâ:™2IEND®B`‚goocanvas-1.0.0/docs/html/goocanvas-coordinates.html0000644000076400007640000001465411512612762017510 00000000000000 Coordinate Spaces and Limits

Coordinate Spaces and Limits

Coordinate Spaces and Limits — how coordinates are used.

Coordinate Spaces

Items in the canvas typically have a number of properties specifying their location and size. For example the GooCanvasRect item has "x", "y", "width" and "height" properties.

However, items can also have a transformation matrix (e.g. the "transform" property). Transformation matrices modify the item's coordinate space in some way. Modifications include translation (moving the origin), rotation, scaling, and skewing, or combinations of these. Thus the final position of the item on the canvas can be altered dramatically.

The simple animation features in GooCanvas are accomplished by modifying the item's transformation matrix over time. (See goo_canvas_item_animate().)

Since items are in a hierarchy it is possible to move or rotate an entire group of items by simply changing the transformation matrix of the group containing them.

The coordinate space used within the item itself (e.g. where the "x" and "y" properties of a GooCanvasRect are specified) is referred to as "Item Space". The coordinate space used by the entire canvas is referred to as "Canvas Space" (or "Device Space"). "Item Space" and "Canvas Space" may or may not be the same, depending on whether the item or any of its ancestors have a transformation matrix set. (Note that the entire canvas may also be scrolled and/or zoomed, which means that there may be additional transformations above "Canvas Space".)

Functions are provided to convert between coordinate spaces, e.g. goo_canvas_convert_to_item_space() and goo_canvas_convert_from_item_space() convert canvas space coordinates to item space and vice versa.

Coordinate Limits

GooCanvas uses the Cairo graphics library to render canvas items. For performance reasons Cairo uses 32-bit fixed point integers internally when rendering graphics, with 24 bits used for the integer part of values and 8 bits used for the fractional part. This means that values are limited to roughly +/- 8,388,608. (Prior to Cairo 1.6 16 bits were used for the integer part and 16 bits for the fractional part, meaning values were limited to +/- 32,768.)

GooCanvas includes code to work around the Cairo limits to some extent. Subclasses of GooCanvasItemSimple (including all builtin items) can use any desired translation using a transformation matrix. But item space coordinates (modified by any scale, rotation or skew) must be within the Cairo limits.

It is possible to create new canvas items that avoid the Cairo limits completely. For an example of this see the "Large Items" page in the GooCanvas demo application, and the corresponding code.

goocanvas-1.0.0/docs/html/ch01.html0000644000076400007640000000541511512612762013746 00000000000000 Introduction

Introduction

Overview — a quick tour of GooCanvas.
Simple Canvas Example — how to create a simple canvas.
Model/View Canvas Example — how to create a model/view canvas.
Underlying Architecture — how the canvas fits together.
Coordinate Spaces and Limits — how coordinates are used.
Creating New Items — how to create new canvas items.
WYSIWYG Printing — how to use the canvas to create accurate printed output.
goocanvas-1.0.0/docs/html/GooCanvasPolylineModel.html0000644000076400007640000006132111512612762017566 00000000000000 GooCanvasPolylineModel

GooCanvasPolylineModel

GooCanvasPolylineModel — a model for polyline items (a series of lines with optional arrows).

Synopsis

                    GooCanvasPolylineModel;
GooCanvasItemModel* goo_canvas_polyline_model_new       (GooCanvasItemModel *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);
GooCanvasItemModel* goo_canvas_polyline_model_new_line  (GooCanvasItemModel *parent,
                                                         gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasPolylineModel

Implemented Interfaces

GooCanvasPolylineModel implements GooCanvasItemModel.

Properties

  "arrow-length"             gdouble               : Read / Write
  "arrow-tip-length"         gdouble               : Read / Write
  "arrow-width"              gdouble               : Read / Write
  "close-path"               gboolean              : Read / Write
  "end-arrow"                gboolean              : Read / Write
  "height"                   gdouble               : Read / Write
  "points"                   GooCanvasPoints*      : Read / Write
  "start-arrow"              gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPolylineModel represents a model for polyline items, which are a series of one or more lines, with optional arrows at either end.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasPolylineModel use goo_canvas_polyline_model_new(), or goo_canvas_polyline_model_new_line() for a simple line between two points.

To get or set the properties of an existing GooCanvasPolylineModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the polyline you must connect to the signal handlers of the corresponding GooCanvasPolyline objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasPolylineModel

typedef struct _GooCanvasPolylineModel GooCanvasPolylineModel;

The GooCanvasPolylineModel struct contains private data only.


goo_canvas_polyline_model_new ()

GooCanvasItemModel* goo_canvas_polyline_model_new       (GooCanvasItemModel *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);

Creates a new polyline model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

close_path :

if the last point should be connected to the first.

num_points :

the number of points in the polyline.

... :

the pairs of coordinates for each point in the line, followed by optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline model.

Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300).

1
2
3
4
5
6
7
8
GooCanvasItemModel *polyline = goo_canvas_polyline_model_new (mygroup, TRUE, 3,
                                                              100.0, 100.0,
                                                              300.0, 100.0,
                                                              200.0, 300.0,
                                                              "stroke-color", "red",
                                                              "line-width", 5.0,
                                                              "fill-color", "blue",
                                                              NULL);


goo_canvas_polyline_model_new_line ()

GooCanvasItemModel* goo_canvas_polyline_model_new_line  (GooCanvasItemModel *parent,
                                                         gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2,
                                                         ...);

Creates a new polyline model with a single line.

parent :

the parent model, or NULL.

x1 :

the x coordinate of the start of the line.

y1 :

the y coordinate of the start of the line.

x2 :

the x coordinate of the end of the line.

y2 :

the y coordinate of the end of the line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline model.

Here's an example showing how to create a line from (100,100) to (300,300).

1
2
3
4
5
6
GooCanvasItemModel *polyline = goo_canvas_polyline_model_new_line (mygroup,
                                                                   100.0, 100.0,
                                                                   300.0, 300.0,
                                                                   "stroke-color", "red",
                                                                   "line-width", 5.0,
                                                                   NULL);

Property Details

The "arrow-length" property

  "arrow-length"             gdouble               : Read / Write

The length of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 5


The "arrow-tip-length" property

  "arrow-tip-length"         gdouble               : Read / Write

The length of the arrow tip, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "arrow-width" property

  "arrow-width"              gdouble               : Read / Write

The width of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "close-path" property

  "close-path"               gboolean              : Read / Write

If the last point should be connected to the first.

Default value: FALSE


The "end-arrow" property

  "end-arrow"                gboolean              : Read / Write

If an arrow should be displayed at the end of the polyline.

Default value: FALSE


The "height" property

  "height"                   gdouble               : Read / Write

The height of the polyline.

Allowed values: >= 0

Default value: 0


The "points" property

  "points"                   GooCanvasPoints*      : Read / Write

The array of points.


The "start-arrow" property

  "start-arrow"              gboolean              : Read / Write

If an arrow should be displayed at the start of the polyline.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the polyline.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left-most point of the polyline.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top-most point of the polyline.

Default value: 0

goocanvas-1.0.0/docs/html/goocanvas.devhelp20000644000076400007640000023236311512612761015743 00000000000000 goocanvas-1.0.0/docs/html/GooCanvas.html0000644000076400007640000037011311512612762015073 00000000000000 GooCanvas

GooCanvas

GooCanvas — the main canvas widget.

Synopsis

                    GooCanvas;
                    GooCanvasClass;

GtkWidget*          goo_canvas_new                      (void);

GooCanvasItem*      goo_canvas_get_root_item            (GooCanvas *canvas);
void                goo_canvas_set_root_item            (GooCanvas *canvas,
                                                         GooCanvasItem *item);
GooCanvasItemModel* goo_canvas_get_root_item_model      (GooCanvas *canvas);
void                goo_canvas_set_root_item_model      (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

GooCanvasItem*      goo_canvas_get_static_root_item     (GooCanvas *canvas);
void                goo_canvas_set_static_root_item     (GooCanvas *canvas,
                                                         GooCanvasItem *item);
GooCanvasItemModel* goo_canvas_get_static_root_item_model
                                                        (GooCanvas *canvas);
void                goo_canvas_set_static_root_item_model
                                                        (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

void                goo_canvas_get_bounds               (GooCanvas *canvas,
                                                         gdouble *left,
                                                         gdouble *top,
                                                         gdouble *right,
                                                         gdouble *bottom);
void                goo_canvas_set_bounds               (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top,
                                                         gdouble right,
                                                         gdouble bottom);
gdouble             goo_canvas_get_scale                (GooCanvas *canvas);
void                goo_canvas_set_scale                (GooCanvas *canvas,
                                                         gdouble scale);

GooCanvasItem*      goo_canvas_get_item                 (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);
GooCanvasItem*      goo_canvas_get_item_at              (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);
GList*              goo_canvas_get_items_at             (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);
GList*              goo_canvas_get_items_in_area        (GooCanvas *canvas,
                                                         const GooCanvasBounds *area,
                                                         gboolean inside_area,
                                                         gboolean allow_overlaps,
                                                         gboolean include_containers);

void                goo_canvas_scroll_to                (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top);
void                goo_canvas_render                   (GooCanvas *canvas,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

void                goo_canvas_convert_to_pixels        (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_from_pixels      (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_to_item_space    (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_from_item_space  (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_bounds_to_item_space
                                                        (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);

GdkGrabStatus       goo_canvas_pointer_grab             (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GdkEventMask event_mask,
                                                         GdkCursor *cursor,
                                                         guint32 time);
void                goo_canvas_pointer_ungrab           (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

void                goo_canvas_grab_focus               (GooCanvas *canvas,
                                                         GooCanvasItem *item);
GdkGrabStatus       goo_canvas_keyboard_grab            (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gboolean owner_events,
                                                         guint32 time);
void                goo_canvas_keyboard_ungrab          (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

cairo_t*            goo_canvas_create_cairo_context     (GooCanvas *canvas);
GooCanvasItem*      goo_canvas_create_item              (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);
void                goo_canvas_unregister_item          (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);
void                goo_canvas_register_widget_item     (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);
void                goo_canvas_unregister_widget_item   (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);
void                goo_canvas_update                   (GooCanvas *canvas);
void                goo_canvas_request_update           (GooCanvas *canvas);
void                goo_canvas_request_redraw           (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds);
void                goo_canvas_request_item_redraw      (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds,
                                                         gboolean is_static);
gdouble             goo_canvas_get_default_line_width   (GooCanvas *canvas);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GooCanvas

Implemented Interfaces

GooCanvas implements AtkImplementorIface and GtkBuildable.

Properties

  "anchor"                   GtkAnchorType         : Read / Write
  "automatic-bounds"         gboolean              : Read / Write
  "background-color"         gchar*                : Write
  "background-color-rgb"     guint                 : Write
  "bounds-from-origin"       gboolean              : Read / Write
  "bounds-padding"           gdouble               : Read / Write
  "clear-background"         gboolean              : Read / Write
  "integer-layout"           gboolean              : Read / Write
  "redraw-when-scrolled"     gboolean              : Read / Write
  "resolution-x"             gdouble               : Read / Write
  "resolution-y"             gdouble               : Read / Write
  "scale"                    gdouble               : Read / Write
  "scale-x"                  gdouble               : Read / Write
  "scale-y"                  gdouble               : Read / Write
  "units"                    GtkUnit               : Read / Write
  "x1"                       gdouble               : Read / Write
  "x2"                       gdouble               : Read / Write
  "y1"                       gdouble               : Read / Write
  "y2"                       gdouble               : Read / Write

Signals

  "item-created"                                   : Run Last
  "set-scroll-adjustments"                         : Run Last / Action

Description

GooCanvas is the main widget containing a number of canvas items.

Here is a simple example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <goocanvas.h>

static gboolean on_rect_button_press (GooCanvasItem  *view,
                                      GooCanvasItem  *target,
                                      GdkEventButton *event,
                                      gpointer        data);

int
main (int argc, char *argv[])
{
  GtkWidget *window, *scrolled_win, *canvas;
  GooCanvasItem *root, *rect_item, *text_item;

  /* Initialize GTK+. */
  gtk_set_locale ();
  gtk_init (&argc, &argv);

  /* Create the window and widgets. */
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
  gtk_widget_show (window);
  g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event,
                    NULL);

  scrolled_win = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
                                       GTK_SHADOW_IN);
  gtk_widget_show (scrolled_win);
  gtk_container_add (GTK_CONTAINER (window), scrolled_win);

  canvas = goo_canvas_new ();
  gtk_widget_set_size_request (canvas, 600, 450);
  goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000);
  gtk_widget_show (canvas);
  gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);

  root = goo_canvas_get_root_item (GOO_CANVAS (canvas));

  /* Add a few simple items. */
  rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400,
                                   "line-width", 10.0,
                                   "radius-x", 20.0,
                                   "radius-y", 10.0,
                                   "stroke-color", "yellow",
                                   "fill-color", "red",
                                   NULL);

  text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1,
                                   GTK_ANCHOR_CENTER,
                                   "font", "Sans 24",
                                   NULL);
  goo_canvas_item_rotate (text_item, 45, 300, 300);

  /* Connect a signal handler for the rectangle item. */
  g_signal_connect (rect_item, "button_press_event",
                    (GtkSignalFunc) on_rect_button_press, NULL);

  /* Pass control to the GTK+ main event loop. */
  gtk_main ();

  return 0;
}


/* This handles button presses in item views. We simply output a message to
   the console. */
static gboolean
on_rect_button_press (GooCanvasItem  *item,
                      GooCanvasItem  *target,
                      GdkEventButton *event,
                      gpointer        data)
{
  g_print ("rect item received button press event\n");
  return TRUE;
}

Details

GooCanvas

typedef struct _GooCanvas GooCanvas;

The GooCanvas struct contains private data only.


GooCanvasClass

typedef struct {
  GooCanvasItem* (* create_item)	    (GooCanvas          *canvas,
					     GooCanvasItemModel *model);

  /* Signals. */
  void           (* item_created)	    (GooCanvas          *canvas,
					     GooCanvasItem      *item,
					     GooCanvasItemModel *model);
} GooCanvasClass;

The GooCanvasClass struct contains one virtual method that subclasses may override.

create_item ()

a virtual method that subclasses may override to create custom canvas items for item models.

item_created ()

signal emitted when a new canvas item has been created. Applications can connect to this to setup signal handlers for the new item.

goo_canvas_new ()

GtkWidget*          goo_canvas_new                      (void);

Creates a new GooCanvas widget.

A GooCanvasGroup is created automatically as the root item of the canvas, though this can be overriden with goo_canvas_set_root_item() or goo_canvas_set_root_item_model().

Returns :

a new GooCanvas widget.

goo_canvas_get_root_item ()

GooCanvasItem*      goo_canvas_get_root_item            (GooCanvas *canvas);

Gets the root item of the canvas, usually a GooCanvasGroup.

canvas :

a GooCanvas.

Returns :

the root item, or NULL if there is no root item.

goo_canvas_set_root_item ()

void                goo_canvas_set_root_item            (GooCanvas *canvas,
                                                         GooCanvasItem *item);

Sets the root item of the canvas. Any existing canvas items are removed.

canvas :

a GooCanvas.

item :

the root canvas item.

goo_canvas_get_root_item_model ()

GooCanvasItemModel* goo_canvas_get_root_item_model      (GooCanvas *canvas);

Gets the root item model of the canvas.

canvas :

a GooCanvas.

Returns :

the root item model, or NULL if there is no root item model.

goo_canvas_set_root_item_model ()

void                goo_canvas_set_root_item_model      (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

Sets the root item model of the canvas.

A hierarchy of canvas items will be created, corresponding to the hierarchy of items in the model. Any current canvas items will be removed.

canvas :

a GooCanvas.

model :

a GooCanvasItemModel.

goo_canvas_get_static_root_item ()

GooCanvasItem*      goo_canvas_get_static_root_item     (GooCanvas *canvas);

Gets the static root item of the canvas.

Static items are exactly the same as ordinary canvas items, except that they do not move or change size when the canvas is scrolled or the scale changes.

Static items are added to the static root item in exactly the same way that ordinary items are added to the root item.

canvas :

a GooCanvas.

Returns :

the static root item, or NULL.

goo_canvas_set_static_root_item ()

void                goo_canvas_set_static_root_item     (GooCanvas *canvas,
                                                         GooCanvasItem *item);

Sets the static root item. Any existing static items are removed.

Static items are exactly the same as ordinary canvas items, except that they do not move or change size when the canvas is scrolled or the scale changes.

Static items are added to the static root item in exactly the same way that ordinary items are added to the root item.

canvas :

a GooCanvas.

item :

the static root item.

goo_canvas_get_static_root_item_model ()

GooCanvasItemModel* goo_canvas_get_static_root_item_model
                                                        (GooCanvas *canvas);

Gets the static root item model of the canvas.

Static item models are exactly the same as ordinary item models, except that the corresponding items do not move or change size when the canvas is scrolled or the scale changes.

Static items models are added to the static root item model in exactly the same way that ordinary item models are added to the root item model.

canvas :

a GooCanvas.

Returns :

the static root item model, or NULL.

goo_canvas_set_static_root_item_model ()

void                goo_canvas_set_static_root_item_model
                                                        (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

Sets the static root item model. Any existing static item models are removed.

Static item models are exactly the same as ordinary item models, except that the corresponding items do not move or change size when the canvas is scrolled or the scale changes.

Static items models are added to the static root item model in exactly the same way that ordinary item models are added to the root item model.

canvas :

a GooCanvas.

model :

the static root item model.

goo_canvas_get_bounds ()

void                goo_canvas_get_bounds               (GooCanvas *canvas,
                                                         gdouble *left,
                                                         gdouble *top,
                                                         gdouble *right,
                                                         gdouble *bottom);

Gets the bounds of the canvas, in canvas units.

By default, canvas units are pixels, though the "units" property can be used to change the units to points, inches or millimeters.

canvas :

a GooCanvas.

left :

a pointer to a gdouble to return the left edge, or NULL.

top :

a pointer to a gdouble to return the top edge, or NULL.

right :

a pointer to a gdouble to return the right edge, or NULL.

bottom :

a pointer to a gdouble to return the bottom edge, or NULL.

goo_canvas_set_bounds ()

void                goo_canvas_set_bounds               (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top,
                                                         gdouble right,
                                                         gdouble bottom);

Sets the bounds of the GooCanvas, in canvas units.

By default, canvas units are pixels, though the "units" property can be used to change the units to points, inches or millimeters.

canvas :

a GooCanvas.

left :

the left edge.

top :

the top edge.

right :

the right edge.

bottom :

the bottom edge.

goo_canvas_get_scale ()

gdouble             goo_canvas_get_scale                (GooCanvas *canvas);

Gets the current scale of the canvas.

The scale specifies the magnification factor of the canvas, e.g. if an item has a width of 2 pixels and the scale is set to 3, it will be displayed with a width of 2 x 3 = 6 pixels.

canvas :

a GooCanvas.

Returns :

the current scale setting.

goo_canvas_set_scale ()

void                goo_canvas_set_scale                (GooCanvas *canvas,
                                                         gdouble scale);

Sets the scale of the canvas.

The scale specifies the magnification factor of the canvas, e.g. if an item has a width of 2 pixels and the scale is set to 3, it will be displayed with a width of 2 x 3 = 6 pixels.

canvas :

a GooCanvas.

scale :

the new scale setting.

goo_canvas_get_item ()

GooCanvasItem*      goo_canvas_get_item                 (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

Gets the canvas item associated with the given GooCanvasItemModel. This is only useful when goo_canvas_set_root_item_model() has been used to set a model for the canvas.

For simple applications you can use goo_canvas_get_item() to set up signal handlers for your items, e.g.

1
2
3
item = goo_canvas_get_item (GOO_CANVAS (canvas), my_item);
g_signal_connect (item, "button_press_event",
                  (GtkSignalFunc) on_my_item_button_press, NULL);

More complex applications may want to use the "item-created" signal to hook up their signal handlers.

canvas :

a GooCanvas.

model :

a GooCanvasItemModel.

Returns :

the canvas item corresponding to the given GooCanvasItemModel, or NULL if no canvas item has been created for it yet.

goo_canvas_get_item_at ()

GooCanvasItem*      goo_canvas_get_item_at              (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);

Gets the item at the given point.

canvas :

a GooCanvas.

x :

the x coordinate of the point.

y :

the y coordinate of the point

is_pointer_event :

TRUE if the "pointer-events" property of items should be used to determine which parts of the item are tested.

Returns :

the item found at the given point, or NULL if no item was found.

goo_canvas_get_items_at ()

GList*              goo_canvas_get_items_at             (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);

Gets all items at the given point.

canvas :

a GooCanvas.

x :

the x coordinate of the point.

y :

the y coordinate of the point

is_pointer_event :

TRUE if the "pointer-events" property of items should be used to determine which parts of the item are tested.

Returns :

a list of items found at the given point, with the top item at the start of the list, or NULL if no items were found. The list must be freed with g_list_free().

goo_canvas_get_items_in_area ()

GList*              goo_canvas_get_items_in_area        (GooCanvas *canvas,
                                                         const GooCanvasBounds *area,
                                                         gboolean inside_area,
                                                         gboolean allow_overlaps,
                                                         gboolean include_containers);

Gets a list of items inside or outside a given area.

canvas :

a GooCanvas.

area :

the area to compare with each item's bounds.

inside_area :

TRUE if items inside area should be returned, or FALSE if items outside area should be returned.

allow_overlaps :

TRUE if items which are partly inside and partly outside should be returned.

include_containers :

TRUE if containers should be checked as well as normal items.

Returns :

a list of items in the given area, or NULL if no items are found. The list should be freed with g_list_free().

goo_canvas_scroll_to ()

void                goo_canvas_scroll_to                (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top);

Scrolls the canvas, placing the given point as close to the top-left of the view as possible.

canvas :

a GooCanvas.

left :

the x coordinate to scroll to.

top :

the y coordinate to scroll to.

goo_canvas_render ()

void                goo_canvas_render                   (GooCanvas *canvas,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

Renders all or part of a canvas to the given cairo context.

canvas :

a GooCanvas.

cr :

a cairo context.

bounds :

the area to render, or NULL to render the entire canvas.

scale :

the scale to compare with each item's visibility threshold to see if they should be rendered. This only affects items that have their visibility set to GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD.

goo_canvas_convert_to_pixels ()

void                goo_canvas_convert_to_pixels        (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from the canvas coordinate space to pixels.

The canvas coordinate space is specified in the call to goo_canvas_set_bounds().

The pixel coordinate space specifies pixels from the top-left of the entire canvas window, according to the current scale setting. See goo_canvas_set_scale().

canvas :

a GooCanvas.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_from_pixels ()

void                goo_canvas_convert_from_pixels      (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from pixels to the canvas coordinate space.

The pixel coordinate space specifies pixels from the top-left of the entire canvas window, according to the current scale setting. See goo_canvas_set_scale().

The canvas coordinate space is specified in the call to goo_canvas_set_bounds().

canvas :

a GooCanvas.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_to_item_space ()

void                goo_canvas_convert_to_item_space    (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from the canvas coordinate space to the given item's coordinate space, applying all transformation matrices including the item's own transformation matrix, if it has one.

canvas :

a GooCanvas.

item :

a GooCanvasItem.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_from_item_space ()

void                goo_canvas_convert_from_item_space  (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from the given item's coordinate space to the canvas coordinate space, applying all transformation matrices including the item's own transformation matrix, if it has one.

canvas :

a GooCanvas.

item :

a GooCanvasItem.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_bounds_to_item_space ()

void                goo_canvas_convert_bounds_to_item_space
                                                        (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);

Converts the given bounds in the canvas coordinate space to a bounding box in item space. This is useful in the item paint() methods to convert the bounds to be painted to the item's coordinate space.

canvas :

a GooCanvas.

item :

a GooCanvasItem.

bounds :

the bounds in canvas coordinate space, to be converted.

goo_canvas_pointer_grab ()

GdkGrabStatus       goo_canvas_pointer_grab             (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GdkEventMask event_mask,
                                                         GdkCursor *cursor,
                                                         guint32 time);

Attempts to grab the pointer for the given item.

canvas :

a GooCanvas.

item :

the item to grab the pointer for.

event_mask :

the events to receive during the grab.

cursor :

the cursor to display during the grab, or NULL.

time :

the time of the event that lead to the pointer grab. This should come from the relevant GdkEvent.

Returns :

GDK_GRAB_SUCCESS if the grab succeeded.

goo_canvas_pointer_ungrab ()

void                goo_canvas_pointer_ungrab           (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

Ungrabs the pointer, if the given item has the pointer grab.

canvas :

a GooCanvas.

item :

the item that has the grab.

time :

the time of the event that lead to the pointer ungrab. This should come from the relevant GdkEvent.

goo_canvas_grab_focus ()

void                goo_canvas_grab_focus               (GooCanvas *canvas,
                                                         GooCanvasItem *item);

Grabs the keyboard focus for the given item.

canvas :

a GooCanvas.

item :

the item to grab the focus.

goo_canvas_keyboard_grab ()

GdkGrabStatus       goo_canvas_keyboard_grab            (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gboolean owner_events,
                                                         guint32 time);

Attempts to grab the keyboard for the given item.

canvas :

a GooCanvas.

item :

the item to grab the keyboard for.

owner_events :

TRUE if keyboard events for this application will be reported normally, or FALSE if all keyboard events will be reported with respect to the grab item.

time :

the time of the event that lead to the keyboard grab. This should come from the relevant GdkEvent.

Returns :

GDK_GRAB_SUCCESS if the grab succeeded.

goo_canvas_keyboard_ungrab ()

void                goo_canvas_keyboard_ungrab          (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

Ungrabs the keyboard, if the given item has the keyboard grab.

canvas :

a GooCanvas.

item :

the item that has the keyboard grab.

time :

the time of the event that lead to the keyboard ungrab. This should come from the relevant GdkEvent.

goo_canvas_create_cairo_context ()

cairo_t*            goo_canvas_create_cairo_context     (GooCanvas *canvas);

Creates a cairo context, initialized with the default canvas settings.

canvas :

a GooCanvas.

Returns :

a new cairo context. It should be freed with cairo_destroy().

goo_canvas_create_item ()

GooCanvasItem*      goo_canvas_create_item              (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

This function is only intended to be used when implementing new canvas items, typically container items such as GooCanvasGroup.

It creates a new canvas item for the given item model, and recursively creates items for any children.

It uses the create_item() virtual method if it has been set. Subclasses of GooCanvas can define this method if they want to use custom views for items.

It emits the "item-created" signal after creating the view, so application code can connect signal handlers to the new view if desired.

canvas :

a GooCanvas.

model :

the item model to create a canvas item for.

Returns :

a new canvas item.

goo_canvas_unregister_item ()

void                goo_canvas_unregister_item          (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

This function is only intended to be used when implementing new canvas items.

It should be called in the finalize method of GooCanvasItem objects, to remove the canvas item from the GooCanvas's hash table.

canvas :

a GooCanvas.

model :

the item model whose canvas item is being finalized.

goo_canvas_register_widget_item ()

void                goo_canvas_register_widget_item     (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);

This function should only be used by GooCanvasWidget and subclass implementations.

It registers a widget item with the canvas, so that the canvas can do the necessary actions to move and resize the widget as needed.

canvas :

a GooCanvas.

witem :

a GooCanvasWidget item.

goo_canvas_unregister_widget_item ()

void                goo_canvas_unregister_widget_item   (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);

This function should only be used by GooCanvasWidget and subclass implementations.

It unregisters a widget item from the canvas, when the item is no longer in the canvas.

canvas :

a GooCanvas.

witem :

a GooCanvasWidget item.

goo_canvas_update ()

void                goo_canvas_update                   (GooCanvas *canvas);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

It updates any items that need updating.

If the bounds of items change, they will request a redraw of the old and new bounds so the display is updated correctly.

canvas :

a GooCanvas.

goo_canvas_request_update ()

void                goo_canvas_request_update           (GooCanvas *canvas);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

It schedules an update of the GooCanvas. This will be performed in the idle loop, after all pending events have been handled, but before the canvas has been repainted.

canvas :

a GooCanvas.

goo_canvas_request_redraw ()

void                goo_canvas_request_redraw           (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

Requests that the given bounds be redrawn. The bounds must be in the canvas coordinate space.

canvas :

a GooCanvas.

bounds :

the bounds to redraw, in device space.

goo_canvas_request_item_redraw ()

void                goo_canvas_request_item_redraw      (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds,
                                                         gboolean is_static);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

Requests that the given bounds be redrawn. If is_static is TRUE the bounds are assumed to be in the static item coordinate space, otherwise they are assumed to be in the canvas coordinate space.

If is_static is FALSE this function behaves the same as goo_canvas_request_redraw().

canvas :

a GooCanvas.

bounds :

the bounds of the item to redraw.

is_static :

if the item is static.

goo_canvas_get_default_line_width ()

gdouble             goo_canvas_get_default_line_width   (GooCanvas *canvas);

Gets the default line width, which depends on the current units setting.

canvas :

a GooCanvas.

Returns :

the default line width of the canvas.

Property Details

The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

Where to place the canvas when it is smaller than the widget's allocated area.

Default value: GTK_ANCHOR_NORTH_WEST


The "automatic-bounds" property

  "automatic-bounds"         gboolean              : Read / Write

If the bounds are automatically calculated based on the bounds of all the items in the canvas.

Default value: FALSE


The "background-color" property

  "background-color"         gchar*                : Write

The color to use for the canvas background.

Default value: NULL


The "background-color-rgb" property

  "background-color-rgb"     guint                 : Write

The color to use for the canvas background, specified as a 24-bit integer value, 0xRRGGBB.

Default value: 0


The "bounds-from-origin" property

  "bounds-from-origin"       gboolean              : Read / Write

If the automatic bounds are calculated from the origin.

Default value: TRUE


The "bounds-padding" property

  "bounds-padding"           gdouble               : Read / Write

The padding added to the automatic bounds.

Allowed values: >= 0

Default value: 0


The "clear-background" property

  "clear-background"         gboolean              : Read / Write

If the background is cleared before the canvas is painted.

Default value: TRUE


The "integer-layout" property

  "integer-layout"           gboolean              : Read / Write

If all item layout is done to the nearest integer.

Default value: FALSE


The "redraw-when-scrolled" property

  "redraw-when-scrolled"     gboolean              : Read / Write

If the canvas is completely redrawn when scrolled, to reduce the flicker of static items.

Default value: FALSE


The "resolution-x" property

  "resolution-x"             gdouble               : Read / Write

The horizontal resolution of the display, in dots per inch.

Allowed values: >= 0

Default value: 96


The "resolution-y" property

  "resolution-y"             gdouble               : Read / Write

The vertical resolution of the display, in dots per inch.

Allowed values: >= 0

Default value: 96


The "scale" property

  "scale"                    gdouble               : Read / Write

The magnification factor of the canvas.

Allowed values: >= 0

Default value: 1


The "scale-x" property

  "scale-x"                  gdouble               : Read / Write

The horizontal magnification factor of the canvas.

Allowed values: >= 0

Default value: 1


The "scale-y" property

  "scale-y"                  gdouble               : Read / Write

The vertical magnification factor of the canvas.

Allowed values: >= 0

Default value: 1


The "units" property

  "units"                    GtkUnit               : Read / Write

The units to use for the canvas.

Default value: GTK_UNIT_PIXEL


The "x1" property

  "x1"                       gdouble               : Read / Write

The x coordinate of the left edge of the canvas bounds, in canvas units.

Default value: 0


The "x2" property

  "x2"                       gdouble               : Read / Write

The x coordinate of the right edge of the canvas bounds, in canvas units.

Default value: 1000


The "y1" property

  "y1"                       gdouble               : Read / Write

The y coordinate of the top edge of the canvas bounds, in canvas units.

Default value: 0


The "y2" property

  "y2"                       gdouble               : Read / Write

The y coordinate of the bottom edge of the canvas bounds, in canvas units.

Default value: 1000

Signal Details

The "item-created" signal

void                user_function                      (GooCanvas          *canvas,
                                                        GooCanvasItem      *item,
                                                        GooCanvasItemModel *model,
                                                        gpointer            user_data)      : Run Last

This is emitted when a new canvas item is created, in model/view mode.

Applications can set up signal handlers for the new items here.

canvas :

the canvas.

item :

the new item.

model :

the item's model.

user_data :

user data set when the signal handler was connected.

The "set-scroll-adjustments" signal

void                user_function                      (GooCanvas     *canvas,
                                                        GtkAdjustment *hadjustment,
                                                        GtkAdjustment *vadjustment,
                                                        gpointer       user_data)        : Run Last / Action

This is used when the GooCanvas is placed inside a GtkScrolledWindow, to connect up the adjustments so scrolling works properly.

It isn't useful for applications.

canvas :

the canvas.

hadjustment :

the horizontal adjustment.

vadjustment :

the vertical adjustment.

user_data :

user data set when the signal handler was connected.
goocanvas-1.0.0/docs/html/ch03.html0000644000076400007640000000615411512612762013751 00000000000000 Standard Canvas Items

Standard Canvas Items

GooCanvasGroup — a group of items.
GooCanvasEllipse — an ellipse item.
GooCanvasGrid — a grid item.
GooCanvasImage — an image item.
GooCanvasPath — a path item (a series of lines and curves).
GooCanvasPolyline — a polyline item (a series of lines with optional arrows).
GooCanvasRect — a rectangle item.
GooCanvasText — a text item.
GooCanvasWidget — an embedded widget item.
GooCanvasTable — a table container to layout items.
goocanvas-1.0.0/docs/html/GooCanvasPath.html0000644000076400007640000003712511512612762015713 00000000000000 GooCanvasPath

GooCanvasPath

GooCanvasPath — a path item (a series of lines and curves).

Synopsis

                    GooCanvasPath;
GooCanvasItem*      goo_canvas_path_new                 (GooCanvasItem *parent,
                                                         const gchar *path_data,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasPath

Implemented Interfaces

GooCanvasPath implements GooCanvasItem.

Properties

  "data"                     gchar*                : Write
  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPath represents a path item, which is a series of one or more lines, bezier curves, or elliptical arcs.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

GooCanvasPath uses the same path specification strings as the Scalable Vector Graphics (SVG) path element. For details see the SVG specification.

To create a GooCanvasPath use goo_canvas_path_new().

To get or set the properties of an existing GooCanvasPath, use g_object_get() and g_object_set().

Details

GooCanvasPath

typedef struct _GooCanvasPath GooCanvasPath;

The GooCanvasPath struct contains private data only.


goo_canvas_path_new ()

GooCanvasItem*      goo_canvas_path_new                 (GooCanvasItem *parent,
                                                         const gchar *path_data,
                                                         ...);

Creates a new path item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

path_data :

the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new path item.

Here's an example showing how to create a red line from (20,20) to (40,40):

1
2
3
4
GooCanvasItem *path = goo_canvas_path_new (mygroup,
                                           "M 20 20 L 40 40",
                                           "stroke-color", "red",
                                           NULL);

This example creates a cubic bezier curve from (20,100) to (100,100) with the control points at (20,50) and (100,50):

1
2
3
4
GooCanvasItem *path = goo_canvas_path_new (mygroup,
                                           "M20,100 C20,50 100,50 100,100",
                                           "stroke-color", "blue",
                                           NULL);

This example uses an elliptical arc to create a filled circle with one quarter missing:

1
2
3
4
5
6
GooCanvasItem *path = goo_canvas_path_new (mygroup,
                                           "M200,500 h-150 a150,150 0 1,0 150,-150 z",
                                           "fill-color", "red",
                                           "stroke-color", "blue",
                                           "line-width", 5.0,
                                           NULL);

Property Details

The "data" property

  "data"                     gchar*                : Write

The sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Default value: NULL


The "height" property

  "height"                   gdouble               : Read / Write

The height of the path.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the path.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the path.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the path.

Default value: 0

goocanvas-1.0.0/docs/html/index.sgml0000644000076400007640000026025211512612761014321 00000000000000 goocanvas-1.0.0/docs/html/GooCanvasStyle.html0000644000076400007640000006430711512612762016121 00000000000000 GooCanvasStyle

GooCanvasStyle

GooCanvasStyle — support for cascading style properties for canvas items.

Object Hierarchy

  GObject
   +----GooCanvasStyle

Description

GooCanvasStyle provides support for cascading style properties for canvas items. It is intended to be used when implementing new canvas items.

Style properties are identified by a unique GQuark, and contain arbitrary data stored in a GValue.

GooCanvasStyle also provides a few convenience functions such as goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() which efficiently apply an item's standard style properties to the given cairo_t.

Details

GooCanvasStyle

typedef struct {
  GooCanvasStyle *parent;
  GArray *properties;
} GooCanvasStyle;

GooCanvasStyle holds the style properties of a canvas item, as well as a pointer to the parent style.

GooCanvasStyle *parent;

the parent style.

GArray *properties;

an array of GooCanvasStyleProperty property settings.

GooCanvasStyleProperty

typedef struct {
  GQuark id;
  GValue value;
} GooCanvasStyleProperty;

GooCanvasStyleProperty represents a property setting.

GQuark id;

the unique property identifier.

GValue value;

the value of the property.

goo_canvas_style_new ()

GooCanvasStyle*     goo_canvas_style_new                (void);

Creates a new GooCanvasStyle.

Returns :

a new GooCanvasStyle.

goo_canvas_style_copy ()

GooCanvasStyle*     goo_canvas_style_copy               (GooCanvasStyle *style);

Copies the given GooCanvasStyle, by copying all of its properties. Though the parent of the new style is left unset.

style :

a GooCanvasStyle.

Returns :

a copy of the given GooCanvasStyle.

goo_canvas_style_get_parent ()

GooCanvasStyle*     goo_canvas_style_get_parent         (GooCanvasStyle *style);

Gets the parent of the style.

style :

a style.

Returns :

the parent of the given style, or NULL.

goo_canvas_style_set_parent ()

void                goo_canvas_style_set_parent         (GooCanvasStyle *style,
                                                         GooCanvasStyle *parent);

Sets the parent of the style.

style :

a style.

parent :

the new parent.

goo_canvas_style_get_property ()

GValue*             goo_canvas_style_get_property       (GooCanvasStyle *style,
                                                         GQuark property_id);

Gets the value of a property.

This searches though all the GooCanvasStyle's own list of property settings and also all ancestor GooCanvasStyle objects.

Note that it returns a pointer to the internal GValue setting, which should not be changed.

style :

a style.

property_id :

the property identifier.

Returns :

the property value, or NULL if it isn't set.

goo_canvas_style_set_property ()

void                goo_canvas_style_set_property       (GooCanvasStyle *style,
                                                         GQuark property_id,
                                                         const GValue *value);

Sets a property in the style, replacing any current setting.

Note that this will override the property setting in ancestor GooCanvasStyle objects.

style :

a style.

property_id :

the property identifier.

value :

the value of the property.

goo_canvas_style_set_fill_options ()

gboolean            goo_canvas_style_set_fill_options   (GooCanvasStyle *style,
                                                         cairo_t *cr);

Sets the standard cairo fill options using the given style.

style :

a style.

cr :

a cairo context.

Returns :

TRUE if a paint source is set, or FALSE if the fill should be skipped.

goo_canvas_style_set_stroke_options ()

gboolean            goo_canvas_style_set_stroke_options (GooCanvasStyle *style,
                                                         cairo_t *cr);

Sets the standard cairo stroke options using the given style.

style :

a style.

cr :

a cairo context.

Returns :

TRUE if a paint source is set, or FALSE if the stroke should be skipped.

goo_canvas_style_antialias_id

extern GQuark goo_canvas_style_antialias_id;

Unique GQuark identifier used for the standard antialias property.


goo_canvas_style_fill_pattern_id

extern GQuark goo_canvas_style_fill_pattern_id;

Unique GQuark identifier used for the standard fill pattern property.


goo_canvas_style_fill_rule_id

extern GQuark goo_canvas_style_fill_rule_id;

Unique GQuark identifier used for the standard fill rule property.


goo_canvas_style_font_desc_id

extern GQuark goo_canvas_style_font_desc_id;

Unique GQuark identifier used for the standard font description property.


goo_canvas_style_hint_metrics_id

extern GQuark goo_canvas_style_hint_metrics_id;

Unique GQuark identifier used for the standard hint metrics property.


goo_canvas_style_line_cap_id

extern GQuark goo_canvas_style_line_cap_id;

Unique GQuark identifier used for the standard line cap property.


goo_canvas_style_line_dash_id

extern GQuark goo_canvas_style_line_dash_id;

Unique GQuark identifier used for the standard line dash property.


goo_canvas_style_line_join_id

extern GQuark goo_canvas_style_line_join_id;

Unique GQuark identifier used for the standard line join property.


goo_canvas_style_line_join_miter_limit_id

extern GQuark goo_canvas_style_line_join_miter_limit_id;

Unique GQuark identifier used for the standard miter limit property.


goo_canvas_style_line_width_id

extern GQuark goo_canvas_style_line_width_id;

Unique GQuark identifier used for the standard line width property.


goo_canvas_style_operator_id

extern GQuark goo_canvas_style_operator_id;

Unique GQuark identifier used for the standard operator property.


goo_canvas_style_stroke_pattern_id

extern GQuark goo_canvas_style_stroke_pattern_id;

Unique GQuark identifier used for the standard stroke pattern property.

goocanvas-1.0.0/docs/html/GooCanvasWidget.html0000644000076400007640000003566311512612762016247 00000000000000 GooCanvasWidget

GooCanvasWidget

GooCanvasWidget — an embedded widget item.

Synopsis

                    GooCanvasWidget;
GooCanvasItem*      goo_canvas_widget_new               (GooCanvasItem *parent,
                                                         GtkWidget *widget,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasWidget

Implemented Interfaces

GooCanvasWidget implements GooCanvasItem.

Properties

  "anchor"                   GtkAnchorType         : Read / Write
  "height"                   gdouble               : Read / Write
  "widget"                   GtkWidget*            : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasWidget provides support for placing any GtkWidget in the canvas.

The "width" and "height" properties specify the widget's size. If either of them is -1, then the requested size of the widget is used instead, which is the default for both width and height.

Note that there are a number of limitations in the use of GooCanvasWidget:

  • It doesn't support any transformation besides simple translation. This means you can't scale a canvas with a GooCanvasWidget in it.

  • It doesn't support layering, so you can't place other items beneath or above the GooCanvasWidget.

  • It doesn't support rendering of widgets to a given cairo_t, which means you can't output the widget to a pdf or postscript file.

  • It doesn't have a model/view variant like the other standard items, so it can only be used in a simple canvas without a model.

  • It can't be made a static item.

Details

GooCanvasWidget

typedef struct _GooCanvasWidget GooCanvasWidget;

The GooCanvasWidget struct contains private data only.


goo_canvas_widget_new ()

GooCanvasItem*      goo_canvas_widget_new               (GooCanvasItem *parent,
                                                         GtkWidget *widget,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Creates a new widget item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

widget :

the widget.

x :

the x coordinate of the item.

y :

the y coordinate of the item.

width :

the width of the item, or -1 to use the widget's requested width.

height :

the height of the item, or -1 to use the widget's requested height.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new widget item.

Here's an example showing how to create an entry widget centered at (100.0, 100.0):

1
2
3
4
5
GtkWidget *entry = gtk_entry_new ();
GooCanvasItem *witem = goo_canvas_widget_new (mygroup, entry,
                                              100, 100, -1, -1,
                                              "anchor", GTK_ANCHOR_CENTER,
                                              NULL);

Property Details

The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

How to position the widget relative to the item's x and y coordinate settings.

Default value: GTK_ANCHOR_NORTH_WEST


The "height" property

  "height"                   gdouble               : Read / Write

The height of the widget, or -1 to use its requested height.

Default value: -1


The "widget" property

  "widget"                   GtkWidget*            : Read / Write

The widget to place in the canvas.


The "width" property

  "width"                    gdouble               : Read / Write

The width of the widget, or -1 to use its requested width.

Default value: -1


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the widget.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the widget.

Default value: 0

goocanvas-1.0.0/docs/html/GooCanvasItem.html0000644000076400007640000052476711512612762015732 00000000000000 GooCanvasItem

GooCanvasItem

GooCanvasItem — the interface for canvas items.

Synopsis

                    GooCanvasItem;
                    GooCanvasItemIface;

void                goo_canvas_item_translate           (GooCanvasItem *item,
                                                         gdouble tx,
                                                         gdouble ty);
void                goo_canvas_item_scale               (GooCanvasItem *item,
                                                         gdouble sx,
                                                         gdouble sy);
void                goo_canvas_item_rotate              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_skew_x              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_skew_y              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
gboolean            goo_canvas_item_get_transform       (GooCanvasItem *item,
                                                         cairo_matrix_t *transform);
void                goo_canvas_item_set_transform       (GooCanvasItem *item,
                                                         const cairo_matrix_t *transform);
gboolean            goo_canvas_item_get_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);
void                goo_canvas_item_set_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);
void                goo_canvas_item_get_bounds          (GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);
gboolean            goo_canvas_item_is_visible          (GooCanvasItem *item);
gboolean            goo_canvas_item_get_is_static       (GooCanvasItem *item);
void                goo_canvas_item_set_is_static       (GooCanvasItem *item,
                                                         gboolean is_static);

void                goo_canvas_item_animate             (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);
void                goo_canvas_item_stop_animation      (GooCanvasItem *item);

void                goo_canvas_item_raise               (GooCanvasItem *item,
                                                         GooCanvasItem *above);
void                goo_canvas_item_lower               (GooCanvasItem *item,
                                                         GooCanvasItem *below);

void                goo_canvas_item_remove              (GooCanvasItem *item);

GooCanvas*          goo_canvas_item_get_canvas          (GooCanvasItem *item);
void                goo_canvas_item_set_canvas          (GooCanvasItem *item,
                                                         GooCanvas *canvas);

GooCanvasItem*      goo_canvas_item_get_parent          (GooCanvasItem *item);
void                goo_canvas_item_set_parent          (GooCanvasItem *item,
                                                         GooCanvasItem *parent);

GooCanvasItemModel* goo_canvas_item_get_model           (GooCanvasItem *item);
void                goo_canvas_item_set_model           (GooCanvasItem *item,
                                                         GooCanvasItemModel *model);

gboolean            goo_canvas_item_is_container        (GooCanvasItem *item);
gint                goo_canvas_item_get_n_children      (GooCanvasItem *item);
GooCanvasItem*      goo_canvas_item_get_child           (GooCanvasItem *item,
                                                         gint child_num);
gint                goo_canvas_item_find_child          (GooCanvasItem *item,
                                                         GooCanvasItem *child);
void                goo_canvas_item_add_child           (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         gint position);
void                goo_canvas_item_move_child          (GooCanvasItem *item,
                                                         gint old_position,
                                                         gint new_position);
void                goo_canvas_item_remove_child        (GooCanvasItem *item,
                                                         gint child_num);
gboolean            goo_canvas_item_get_transform_for_child
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         cairo_matrix_t *transform);

GooCanvasStyle*     goo_canvas_item_get_style           (GooCanvasItem *item);
void                goo_canvas_item_set_style           (GooCanvasItem *item,
                                                         GooCanvasStyle *style);

void                goo_canvas_item_request_update      (GooCanvasItem *item);
void                goo_canvas_item_ensure_updated      (GooCanvasItem *item);
void                goo_canvas_item_update              (GooCanvasItem *item,
                                                         gboolean entire_tree,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);
gboolean            goo_canvas_item_get_requested_area  (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *requested_area);
gdouble             goo_canvas_item_get_requested_height
                                                        (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         gdouble width);
void                goo_canvas_item_allocate_area       (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *requested_area,
                                                         const GooCanvasBounds *allocated_area,
                                                         gdouble x_offset,
                                                         gdouble y_offset);
GList*              goo_canvas_item_get_items_at        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         cairo_t *cr,
                                                         gboolean is_pointer_event,
                                                         gboolean parent_is_visible,
                                                         GList *found_items);
void                goo_canvas_item_paint               (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

void                goo_canvas_item_class_install_child_property
                                                        (GObjectClass *iclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);
GParamSpec**        goo_canvas_item_class_list_child_properties
                                                        (GObjectClass *iclass,
                                                         guint *n_properties);
GParamSpec*         goo_canvas_item_class_find_child_property
                                                        (GObjectClass *iclass,
                                                         const gchar *property_name);
void                goo_canvas_item_get_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         GValue *value);
void                goo_canvas_item_set_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         const GValue *value);
void                goo_canvas_item_get_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);
void                goo_canvas_item_get_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);
void                goo_canvas_item_set_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);
void                goo_canvas_item_set_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);

Object Hierarchy

  GInterface
   +----GooCanvasItem

Prerequisites

GooCanvasItem requires GObject.

Properties

  "can-focus"                gboolean              : Read / Write
  "description"              gchar*                : Read / Write
  "parent"                   GooCanvasItem*        : Read / Write
  "pointer-events"           GooCanvasPointerEvents  : Read / Write
  "title"                    gchar*                : Read / Write
  "tooltip"                  gchar*                : Read / Write
  "transform"                GooCairoMatrix*       : Read / Write
  "visibility"               GooCanvasItemVisibility  : Read / Write
  "visibility-threshold"     gdouble               : Read / Write

Signals

  "animation-finished"                             : Run Last
  "button-press-event"                             : Run Last
  "button-release-event"                           : Run Last
  "child-notify"                                   : Run First / No Recursion / Has Details / No Hooks
  "enter-notify-event"                             : Run Last
  "focus-in-event"                                 : Run Last
  "focus-out-event"                                : Run Last
  "grab-broken-event"                              : Run Last
  "key-press-event"                                : Run Last
  "key-release-event"                              : Run Last
  "leave-notify-event"                             : Run Last
  "motion-notify-event"                            : Run Last
  "query-tooltip"                                  : Run Last
  "scroll-event"                                   : Run Last

Description

GooCanvasItem defines the interface that canvas items must implement, and contains methods for operating on canvas items.

Details

GooCanvasItem

typedef struct _GooCanvasItem GooCanvasItem;

GooCanvasItem is a typedef used for objects that implement the GooCanvasItem interface.

(There is no actual GooCanvasItem struct, since it is only an interface. But using 'GooCanvasItem' is more helpful than using 'GObject'.)


GooCanvasItemIface

typedef struct {
  /* Virtual methods that group items must implement. */
  GooCanvas*		(* get_canvas)			(GooCanvasItem		*item);
  void			(* set_canvas)			(GooCanvasItem		*item,
							 GooCanvas		*canvas);
  gint			(* get_n_children)		(GooCanvasItem		*item);
  GooCanvasItem* (* get_child)			(GooCanvasItem		*item,
							 gint			 child_num);
  void			(* request_update)		(GooCanvasItem		*item);

  /* Virtual methods that group items may implement. */
  void			(* add_child)			(GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 gint			 position);
  void			(* move_child)			(GooCanvasItem		*item,
							 gint			 old_position,
							 gint			 new_position);
  void			(* remove_child)		(GooCanvasItem		*item,
							 gint			 child_num);
  void			(* get_child_property)		(GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 guint			 property_id,
							 GValue			*value,
							 GParamSpec		*pspec);
  void			(* set_child_property)		(GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 guint			 property_id,
							 const GValue		*value,
							 GParamSpec		*pspec);
  gboolean		(* get_transform_for_child) (GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 cairo_matrix_t		*transform);

  /* Virtual methods that all canvas items must implement. */
  GooCanvasItem* (* get_parent)			(GooCanvasItem		*item);
  void			(* set_parent)			(GooCanvasItem		*item,
							 GooCanvasItem		*parent);
  void			(* get_bounds)			(GooCanvasItem		*item,
							 GooCanvasBounds *bounds);
  GList*		(* get_items_at)		(GooCanvasItem		*item,
							 gdouble		 x,
							 gdouble		 y,
							 cairo_t		*cr,
							 gboolean		 is_pointer_event,
							 gboolean		 parent_is_visible,
							 GList                  *found_items);
  void			(* update)			(GooCanvasItem		*item,
							 gboolean		 entire_tree,
							 cairo_t		*cr,
							 GooCanvasBounds *bounds);
  void			(* paint)			(GooCanvasItem		*item,
							 cairo_t		*cr,
							 const GooCanvasBounds *bounds,
							 gdouble		 scale);

  gboolean		(* get_requested_area)		(GooCanvasItem		*item,
							 cairo_t		*cr,
							 GooCanvasBounds *requested_area);
  void			(* allocate_area)		(GooCanvasItem		*item,
							 cairo_t		*cr,
							 const GooCanvasBounds *requested_area,
							 const GooCanvasBounds *allocated_area,
							 gdouble		 x_offset,
							 gdouble		 y_offset);

  /* Virtual methods that canvas items may implement. */
  gboolean		(* get_transform)		(GooCanvasItem		*item,
							 cairo_matrix_t		*transform);
  void			(* set_transform)		(GooCanvasItem		*item,
							 const cairo_matrix_t *transform);
  GooCanvasStyle* (* get_style)			(GooCanvasItem		*item);
  void			(* set_style)			(GooCanvasItem		*item,
							 GooCanvasStyle		*style);
  gboolean		(* is_visible)			(GooCanvasItem		*item);
  gdouble               (* get_requested_height) (GooCanvasItem		*item,
							 cairo_t		*cr,
							 gdouble		 width);

  /* Virtual methods that model/view items must implement. */
  GooCanvasItemModel* (* get_model)			(GooCanvasItem		*item);
  void			(* set_model)			(GooCanvasItem		*item,
							 GooCanvasItemModel *model);


  /* Signals. */
  gboolean		(* enter_notify_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventCrossing *event);
  gboolean		(* leave_notify_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventCrossing *event);
  gboolean		(* motion_notify_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventMotion		*event);
  gboolean		(* button_press_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventButton		*event);
  gboolean		(* button_release_event) (GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventButton		*event);
  gboolean		(* focus_in_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventFocus		*event);
  gboolean		(* focus_out_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventFocus		*event);
  gboolean		(* key_press_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventKey		*event);
  gboolean		(* key_release_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventKey		*event);
  gboolean		(* grab_broken_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventGrabBroken *event);
  void			(* child_notify)		(GooCanvasItem		*item,
							 GParamSpec		*pspec);
  gboolean		(* query_tooltip)		(GooCanvasItem		*item,
							 gdouble		 x,
							 gdouble		 y,
							 gboolean		 keyboard_tooltip,
							 GtkTooltip		*tooltip);

  gboolean		(* get_is_static)		(GooCanvasItem		*item);
  void			(* set_is_static)		(GooCanvasItem		*item,
							 gboolean		 is_static);

  void			(* animation_finished)		(GooCanvasItem           *item,
							 gboolean                 stopped);

  gboolean		(* scroll_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventScroll		*event);
} GooCanvasItemIface;

GooCanvasItemIFace holds the virtual methods that make up the GooCanvasItem interface.

Simple canvas items only need to implement the get_parent(), set_parent(), get_bounds(), get_items_at(), update() and paint() methods (and also get_requested_area() and allocate_area() if they are going to be used inside a layout container like GooCanvasTable).

Items that support transforms should also implement get_transform() and set_transform(). Items that support styles should implement get_style() and set_style().

Container items must implement get_canvas(), set_canvas(), get_n_children(), get_child() and request_update(). Containers that support dynamic changes to their children should implement add_child(), move_child() and remove_child(). Layout containers like GooCanvasTable may implement get_child_property(), set_child_property() and get_transform_for_child().

get_canvas ()

returns the canvas the item is in.

set_canvas ()

sets the canvas the item is in.

get_n_children ()

returns the number of children of the item.

get_child ()

returns the child at the given index.

request_update ()

requests that an update is scheduled.

add_child ()

adds a child.

move_child ()

moves a child up or down the stacking order.

remove_child ()

removes a child.

get_child_property ()

gets a child property of a given child item, e.g. the "row" or "column" property of an item in a GooCanvasTable.

set_child_property ()

sets a child property for a given child item.

get_transform_for_child ()

gets the transform used to lay out a given child.

get_parent ()

gets the item's parent.

set_parent ()

sets the item's parent.

get_bounds ()

gets the bounds of the item.

get_items_at ()

gets all the items at the given point.

update ()

updates the item, if needed. It recalculates the bounds of the item and requests redraws of parts of the canvas if necessary.

paint ()

renders the item to the given cairo context.

get_requested_area ()

returns the requested area of the item, in its parent's coordinate space. This is only used for items in layout containers such as GooCanvasTable.

allocate_area ()

allocates the item's area, in its parent's coordinate space. The item must recalculate its bounds and request redraws of parts of the canvas if necessary. This is only used for items in layout containers such as GooCanvasTable.

get_transform ()

gets the item's transformation matrix.

set_transform ()

sets the item's transformation matrix.

get_style ()

gets the item's style.

set_style ()

sets the item's style.

is_visible ()

returns TRUE if the item is currently visible.

get_requested_height ()

returns the requested height of the item, given a particular allocated width, using the parent's coordinate space.

get_model ()

gets the model that the canvas item is viewing.

set_model ()

sets the model that the canvas item will view.

enter_notify_event ()

signal emitted when the mouse enters the item.

leave_notify_event ()

signal emitted when the mouse leaves the item.

motion_notify_event ()

signal emitted when the mouse moves within the item.

button_press_event ()

signal emitted when a mouse button is pressed within the item.

button_release_event ()

signal emitted when a mouse button is released.

focus_in_event ()

signal emitted when the item receices the keyboard focus.

focus_out_event ()

signal emitted when the item loses the keyboard focus.

key_press_event ()

signal emitted when a key is pressed.

key_release_event ()

signal emitted when a key is released.

grab_broken_event ()

signal emitted when a grab that the item has is lost.

child_notify ()

signal emitted when a child property is changed.

query_tooltip ()

signal emitted to query the tooltip of an item.

get_is_static ()

returns TRUE if the item is static.

set_is_static ()

notifies the item whether it is static or not.

animation_finished ()

signal emitted when the item's animation has finished.

scroll_event ()

signal emitted when the mouse wheel is activated within the item.

goo_canvas_item_translate ()

void                goo_canvas_item_translate           (GooCanvasItem *item,
                                                         gdouble tx,
                                                         gdouble ty);

Translates the origin of the item's coordinate system by the given amounts.

item :

an item.

tx :

the amount to move the origin in the horizontal direction.

ty :

the amount to move the origin in the vertical direction.

goo_canvas_item_scale ()

void                goo_canvas_item_scale               (GooCanvasItem *item,
                                                         gdouble sx,
                                                         gdouble sy);

Scales the item's coordinate system by the given amounts.

item :

an item.

sx :

the amount to scale the horizontal axis.

sy :

the amount to scale the vertical axis.

goo_canvas_item_rotate ()

void                goo_canvas_item_rotate              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Rotates the item's coordinate system by the given amount, about the given origin.

item :

an item.

degrees :

the clockwise angle of rotation.

cx :

the x coordinate of the origin of the rotation.

cy :

the y coordinate of the origin of the rotation.

goo_canvas_item_skew_x ()

void                goo_canvas_item_skew_x              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the item's coordinate system along the x axis by the given amount, about the given origin.

item :

an item.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_skew_y ()

void                goo_canvas_item_skew_y              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the item's coordinate system along the y axis by the given amount, about the given origin.

item :

an item.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_get_transform ()

gboolean            goo_canvas_item_get_transform       (GooCanvasItem *item,
                                                         cairo_matrix_t *transform);

Gets the transformation matrix of an item.

item :

an item.

transform :

the place to store the transform.

Returns :

TRUE if a transform is set.

goo_canvas_item_set_transform ()

void                goo_canvas_item_set_transform       (GooCanvasItem *item,
                                                         const cairo_matrix_t *transform);

Sets the transformation matrix of an item.

item :

an item.

transform :

the new transformation matrix, or NULL to reset the transformation to the identity matrix.

goo_canvas_item_get_simple_transform ()

gboolean            goo_canvas_item_get_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);

This function can be used to get the position, scale and rotation of an item, providing that the item has a simple transformation matrix (e.g. set with goo_canvas_item_set_simple_transform(), or using a combination of simple translate, scale and rotate operations). If the item has a complex transformation matrix the results will be incorrect.

item :

an item.

x :

returns the x coordinate of the origin of the item's coordinate space.

y :

returns the y coordinate of the origin of the item's coordinate space.

scale :

returns the scale of the item.

rotation :

returns the clockwise rotation of the item, in degrees (0-360).

Returns :

TRUE if a transform is set.

goo_canvas_item_set_simple_transform ()

void                goo_canvas_item_set_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);

A convenience function to set the item's transformation matrix.

item :

an item.

x :

the x coordinate of the origin of the item's coordinate space.

y :

the y coordinate of the origin of the item's coordinate space.

scale :

the scale of the item.

rotation :

the clockwise rotation of the item, in degrees.

goo_canvas_item_get_bounds ()

void                goo_canvas_item_get_bounds          (GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);

Gets the bounds of the item.

Note that the bounds includes the entire fill and stroke extents of the item, whether they are painted or not.

item :

a GooCanvasItem.

bounds :

a GooCanvasBounds to return the bounds in.

goo_canvas_item_is_visible ()

gboolean            goo_canvas_item_is_visible          (GooCanvasItem *item);

Checks if the item is visible.

This entails checking the item's own visibility setting, as well as those of its ancestors.

Note that the item may be scrolled off the screen and so may not be actually visible to the user.

item :

a GooCanvasItem.

Returns :

TRUE if the item is visible.

goo_canvas_item_get_is_static ()

gboolean            goo_canvas_item_get_is_static       (GooCanvasItem *item);

Returns TRUE if the item is static. Static items do not move or change size when the canvas is scrolled or the scale changes.

item :

an item.

Returns :

TRUE if the item is static.

goo_canvas_item_set_is_static ()

void                goo_canvas_item_set_is_static       (GooCanvasItem *item,
                                                         gboolean is_static);

Notifies the item that it is static. Static items do not move or change size when the canvas is scrolled or the scale changes.

Container items such as GooCanvasGroup should call this function when children are added, to notify children whether they are static or not. Containers should also pass on any changes in their own status to children.

item :

an item.

is_static :

if the item is static.

goo_canvas_item_animate ()

void                goo_canvas_item_animate             (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);

Animates an item from its current position to the given offsets, scale and rotation.

item :

an item.

x :

the final x coordinate.

y :

the final y coordinate.

scale :

the final scale.

degrees :

the final rotation. This can be negative to rotate anticlockwise, and can also be greater than 360 to rotate a number of times.

absolute :

if the x, y, scale and degrees values are absolute, or relative to the current transform. Note that absolute animations only work if the item currently has a simple transform. If the item has a shear or some other complicated transform it may result in strange animations.

duration :

the duration of the animation, in milliseconds (1/1000ths of a second).

step_time :

the time between each animation step, in milliseconds.

type :

specifies what happens when the animation finishes.

goo_canvas_item_stop_animation ()

void                goo_canvas_item_stop_animation      (GooCanvasItem *item);

Stops any current animation for the given item, leaving it at its current position.

item :

an item.

goo_canvas_item_raise ()

void                goo_canvas_item_raise               (GooCanvasItem *item,
                                                         GooCanvasItem *above);

Raises an item in the stacking order.

item :

an item.

above :

the item to raise item above, or NULL to raise item to the top of the stack.

goo_canvas_item_lower ()

void                goo_canvas_item_lower               (GooCanvasItem *item,
                                                         GooCanvasItem *below);

Lowers an item in the stacking order.

item :

an item.

below :

the item to lower item below, or NULL to lower item to the bottom of the stack.

goo_canvas_item_remove ()

void                goo_canvas_item_remove              (GooCanvasItem *item);

Removes an item from its parent. If the item is in a canvas it will be removed.

This would normally also result in the item being freed.

item :

an item.

goo_canvas_item_get_canvas ()

GooCanvas*          goo_canvas_item_get_canvas          (GooCanvasItem *item);

Returns the GooCanvas containing the given GooCanvasItem.

item :

a GooCanvasItem.

Returns :

the GooCanvas.

goo_canvas_item_set_canvas ()

void                goo_canvas_item_set_canvas          (GooCanvasItem *item,
                                                         GooCanvas *canvas);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

It sets the canvas of the item.

item :

a GooCanvasItem.

canvas :

a GooCanvas

goo_canvas_item_get_parent ()

GooCanvasItem*      goo_canvas_item_get_parent          (GooCanvasItem *item);

Gets the parent of the given item.

item :

an item.

Returns :

the parent item, or NULL if the item has no parent.

goo_canvas_item_set_parent ()

void                goo_canvas_item_set_parent          (GooCanvasItem *item,
                                                         GooCanvasItem *parent);

This function is only intended to be used when implementing new canvas items (specifically container items such as GooCanvasGroup). It sets the parent of the child item.

item :

an item.

parent :

the new parent item.

Note

This function cannot be used to add an item to a group or to change the parent of an item. To do that use the "parent" property.


goo_canvas_item_get_model ()

GooCanvasItemModel* goo_canvas_item_get_model           (GooCanvasItem *item);

Gets the model of the given canvas item.

item :

a GooCanvasItem.

Returns :

the item's model, or NULL if it has no model.

goo_canvas_item_set_model ()

void                goo_canvas_item_set_model           (GooCanvasItem *item,
                                                         GooCanvasItemModel *model);

Sets the model of the given canvas item.

item :

a GooCanvasItem.

model :

a GooCanvasItemModel.

goo_canvas_item_is_container ()

gboolean            goo_canvas_item_is_container        (GooCanvasItem *item);

Tests to see if the given item is a container.

item :

an item.

Returns :

TRUE if the item is a container.

goo_canvas_item_get_n_children ()

gint                goo_canvas_item_get_n_children      (GooCanvasItem *item);

Gets the number of children of the container.

item :

a container item.

Returns :

the number of children.

goo_canvas_item_get_child ()

GooCanvasItem*      goo_canvas_item_get_child           (GooCanvasItem *item,
                                                         gint child_num);

Gets the child item at the given stack position.

item :

a container item.

child_num :

the position of a child in the container's stack.

Returns :

the child item at the given stack position, or NULL if child_num is out of range.

goo_canvas_item_find_child ()

gint                goo_canvas_item_find_child          (GooCanvasItem *item,
                                                         GooCanvasItem *child);

Attempts to find the given child item with the container's stack.

item :

a container item.

child :

the child item to find.

Returns :

the position of the given child item, or -1 if it isn't found.

goo_canvas_item_add_child ()

void                goo_canvas_item_add_child           (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         gint position);

Adds a child item to a container item at the given stack position.

item :

the container to add the item to.

child :

the item to add.

position :

the position of the item, or -1 to place it last (at the top of the stacking order).

goo_canvas_item_move_child ()

void                goo_canvas_item_move_child          (GooCanvasItem *item,
                                                         gint old_position,
                                                         gint new_position);

Moves a child item to a new stack position within the container.

item :

a container item.

old_position :

the current position of the child item.

new_position :

the new position of the child item.

goo_canvas_item_remove_child ()

void                goo_canvas_item_remove_child        (GooCanvasItem *item,
                                                         gint child_num);

Removes the child item at the given position.

item :

a container item.

child_num :

the position of the child item to remove.

goo_canvas_item_get_transform_for_child ()

gboolean            goo_canvas_item_get_transform_for_child
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         cairo_matrix_t *transform);

Gets the transformation matrix of an item combined with any special transform needed for the given child. These special transforms are used by layout items such as GooCanvasTable.

item :

an item.

child :

a child of item.

transform :

the place to store the transform.

Returns :

TRUE if a transform is set.

goo_canvas_item_get_style ()

GooCanvasStyle*     goo_canvas_item_get_style           (GooCanvasItem *item);

Gets the item's style. If the item doesn't have its own style it will return its parent's style.

item :

an item.

Returns :

the item's style.

goo_canvas_item_set_style ()

void                goo_canvas_item_set_style           (GooCanvasItem *item,
                                                         GooCanvasStyle *style);

Sets the item's style, by copying the properties from the given style.

item :

an item.

style :

a style.

goo_canvas_item_request_update ()

void                goo_canvas_item_request_update      (GooCanvasItem *item);

This function is only intended to be used when implementing new canvas items.

It requests that an update of the item is scheduled. It will be performed as soon as the application is idle, and before the canvas is redrawn.

item :

a GooCanvasItem.

goo_canvas_item_ensure_updated ()

void                goo_canvas_item_ensure_updated      (GooCanvasItem *item);

This function is only intended to be used when implementing new canvas items.

It updates the canvas immediately, if an update is scheduled. This ensures that all item bounds are up-to-date.

item :

a GooCanvasItem.

goo_canvas_item_update ()

void                goo_canvas_item_update              (GooCanvasItem *item,
                                                         gboolean entire_tree,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

Updates the item, if needed, and any children.

item :

a GooCanvasItem.

entire_tree :

if the entire subtree should be updated.

cr :

a cairo context.

bounds :

a GooCanvasBounds to return the new bounds in.

goo_canvas_item_get_requested_area ()

gboolean            goo_canvas_item_get_requested_area  (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *requested_area);

This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable.

It gets the requested area of a child item.

item :

a GooCanvasItem.

cr :

a cairo context.

requested_area :

a GooCanvasBounds to return the requested area in, in the parent's coordinate space.

Returns :

TRUE if the item should be allocated space.

goo_canvas_item_get_requested_height ()

gdouble             goo_canvas_item_get_requested_height
                                                        (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         gdouble width);

This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable.

It gets the requested height of a child item, assuming it is allocated the given width. This is useful for text items whose requested height may change depending on the allocated width.

item :

a GooCanvasItem.

cr :

a cairo context.

width :

the width that the item may be allocated.

Returns :

the requested height of the item, given the allocated width, or -1 if the item doesn't support this method or its height doesn't change when allocated different widths.

goo_canvas_item_allocate_area ()

void                goo_canvas_item_allocate_area       (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *requested_area,
                                                         const GooCanvasBounds *allocated_area,
                                                         gdouble x_offset,
                                                         gdouble y_offset);

This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable.

It allocates an area to a child GooCanvasItem.

Note that the parent layout item will use a transform to move each of its children for the layout, so there is no need for the child item to reposition itself. It only needs to recalculate its device bounds.

To help recalculate the item's device bounds, the x_offset and y_offset of the child item's allocated position from its requested position are provided. Simple items can just add these to their bounds.

item :

a GooCanvasItem.

cr :

a cairo context.

requested_area :

the area that the item originally requested, in the parent's coordinate space.

allocated_area :

the area that the item has been allocated, in the parent's coordinate space.

x_offset :

the x offset of the allocated area from the requested area in the device coordinate space.

y_offset :

the y offset of the allocated area from the requested area in the device coordinate space.

goo_canvas_item_get_items_at ()

GList*              goo_canvas_item_get_items_at        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         cairo_t *cr,
                                                         gboolean is_pointer_event,
                                                         gboolean parent_is_visible,
                                                         GList *found_items);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

It gets the items at the given point.

item :

a GooCanvasItem.

x :

the x coordinate of the point.

y :

the y coordinate of the point.

cr :

a cairo contect.

is_pointer_event :

TRUE if the "pointer-events" properties of items should be used to determine which parts of the item are tested.

parent_is_visible :

TRUE if the parent item is visible (which implies that all ancestors are also visible).

found_items :

the list of items found so far.

Returns :

the found_items list, with any more found items added onto the start of the list, leaving the top item first.

goo_canvas_item_paint ()

void                goo_canvas_item_paint               (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

It paints the item and all children if they intersect the given bounds.

Note that the scale argument may be different to the current scale in the GooCanvasItem, e.g. when the canvas is being printed.

item :

a GooCanvasItem.

cr :

a cairo context.

bounds :

the bounds that need to be repainted, in device space.

scale :

the scale to use to determine whether an item should be painted. See "visibility-threshold".

goo_canvas_item_class_install_child_property ()

void                goo_canvas_item_class_install_child_property
                                                        (GObjectClass *iclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);

This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable.

It installs a child property on a canvas item class.

iclass :

a GObjectClass

property_id :

the id for the property

pspec :

the GParamSpec for the property

goo_canvas_item_class_list_child_properties ()

GParamSpec**        goo_canvas_item_class_list_child_properties
                                                        (GObjectClass *iclass,
                                                         guint *n_properties);

This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable.

It returns all child properties of a canvas item class.

iclass :

a GObjectClass

n_properties :

location to return the number of child properties found

Returns :

a newly allocated array of GParamSpec*. The array must be freed with g_free().

goo_canvas_item_class_find_child_property ()

GParamSpec*         goo_canvas_item_class_find_child_property
                                                        (GObjectClass *iclass,
                                                         const gchar *property_name);

This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable.

It finds a child property of a canvas item class by name.

iclass :

a GObjectClass

property_name :

the name of the child property to find

Returns :

the GParamSpec of the child property or NULL if class has no child property with that name.

goo_canvas_item_get_child_property ()

void                goo_canvas_item_get_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         GValue *value);

Gets a child property of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

property_name :

the name of the child property to get.

value :

a location to return the value.

goo_canvas_item_set_child_property ()

void                goo_canvas_item_set_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         const GValue *value);

Sets a child property of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

property_name :

the name of the child property to set.

value :

the value to set the property to.

goo_canvas_item_get_child_properties ()

void                goo_canvas_item_get_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);

Gets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

... :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_get_child_properties_valist ()

void                goo_canvas_item_get_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);

Gets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

var_args :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_set_child_properties ()

void                goo_canvas_item_set_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);

Sets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

... :

pairs of property names and values, and a terminating NULL.

goo_canvas_item_set_child_properties_valist ()

void                goo_canvas_item_set_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);

Sets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

var_args :

pairs of property names and values, and a terminating NULL.

Property Details

The "can-focus" property

  "can-focus"                gboolean              : Read / Write

If the item can take the keyboard focus.

Default value: FALSE


The "description" property

  "description"              gchar*                : Read / Write

A description of the item for use by assistive technologies.

Default value: NULL


The "parent" property

  "parent"                   GooCanvasItem*        : Read / Write

The parent item.


The "pointer-events" property

  "pointer-events"           GooCanvasPointerEvents  : Read / Write

Specifies when the item receives pointer events.

Default value: GOO_CANVAS_EVENTS_VISIBLE_MASK|GOO_CANVAS_EVENTS_PAINTED_MASK|GOO_CANVAS_EVENTS_FILL_MASK|GOO_CANVAS_EVENTS_STROKE_MASK


The "title" property

  "title"                    gchar*                : Read / Write

A short context-rich description of the item for use by assistive technologies.

Default value: NULL


The "tooltip" property

  "tooltip"                  gchar*                : Read / Write

The tooltip to display for the item.

Default value: NULL


The "transform" property

  "transform"                GooCairoMatrix*       : Read / Write

The transformation matrix of the item.


The "visibility" property

  "visibility"               GooCanvasItemVisibility  : Read / Write

When the canvas item is visible.

Default value: GOO_CANVAS_ITEM_VISIBLE


The "visibility-threshold" property

  "visibility-threshold"     gdouble               : Read / Write

The scale threshold at which the item becomes visible.

Allowed values: >= 0

Default value: 0

Signal Details

The "animation-finished" signal

void                user_function                      (GooCanvasItem *item,
                                                        gboolean       stopped,
                                                        gpointer       user_data)      : Run Last

Emitted when the item animation has finished.

item :

the item that received the signal.

stopped :

if the animation was explicitly stopped.

user_data :

user data set when the signal handler was connected.

The "button-press-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventButton *event,
                                                        gpointer        user_data)        : Run Last

Emitted when a mouse button is pressed in an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "button-release-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventButton *event,
                                                        gpointer        user_data)        : Run Last

Emitted when a mouse button is released in an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "child-notify" signal

void                user_function                      (GooCanvasItem *item,
                                                        GParamSpec    *pspec,
                                                        gpointer       user_data)      : Run First / No Recursion / Has Details / No Hooks

Emitted for each child property that has changed. The signal's detail holds the property name.

item :

the item that received the signal.

pspec :

the GParamSpec of the changed child property.

user_data :

user data set when the signal handler was connected.

The "enter-notify-event" signal

gboolean            user_function                      (GooCanvasItem    *item,
                                                        GooCanvasItem    *target_item,
                                                        GdkEventCrossing *event,
                                                        gpointer          user_data)        : Run Last

Emitted when the mouse enters an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "focus-in-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventFocus *event,
                                                        gpointer       user_data)        : Run Last

Emitted when the item receives the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "focus-out-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventFocus *event,
                                                        gpointer       user_data)        : Run Last

Emitted when the item loses the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "grab-broken-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEvent      *event,
                                                        gpointer       user_data)        : Run Last

Emitted when the item's keyboard or pointer grab was lost unexpectedly.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "key-press-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventKey   *event,
                                                        gpointer       user_data)        : Run Last

Emitted when a key is pressed and the item has the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "key-release-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventKey   *event,
                                                        gpointer       user_data)        : Run Last

Emitted when a key is released and the item has the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "leave-notify-event" signal

gboolean            user_function                      (GooCanvasItem    *item,
                                                        GooCanvasItem    *target_item,
                                                        GdkEventCrossing *event,
                                                        gpointer          user_data)        : Run Last

Emitted when the mouse leaves an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "motion-notify-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventMotion *event,
                                                        gpointer        user_data)        : Run Last

Emitted when the mouse moves within an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "query-tooltip" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        gdouble        x,
                                                        gdouble        y,
                                                        gboolean       keyboard_mode,
                                                        GtkTooltip    *tooltip,
                                                        gpointer       user_data)          : Run Last

Emitted when the mouse has paused over the item for a certain amount of time, or the tooltip was requested via the keyboard.

Note that if keyboard_mode is TRUE, the values of x and y are undefined and should not be used.

If the item wants to display a tooltip it should update tooltip and return TRUE.

item :

the item which received the signal.

x :

the x coordinate of the mouse.

y :

the y coordinate of the mouse.

keyboard_mode :

TRUE if the tooltip was triggered using the keyboard.

tooltip :

a GtkTooltip.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE if the item has set a tooltip to show.

The "scroll-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventScroll *event,
                                                        gpointer        user_data)        : Run Last

Emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned in an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.
goocanvas-1.0.0/docs/html/ch04.html0000644000076400007640000000625511512612762013754 00000000000000 Standard Canvas Item Models

Standard Canvas Item Models

GooCanvasGroupModel — a model for a group of items.
GooCanvasEllipseModel — a model for ellipse items.
GooCanvasGridModel — a model for grid items.
GooCanvasImageModel — a model for image items.
GooCanvasPathModel — a model for path items (a series of lines and curves).
GooCanvasPolylineModel — a model for polyline items (a series of lines with optional arrows).
GooCanvasRectModel — a model for rectangle items.
GooCanvasTextModel — a model for text items.
GooCanvasTableModel — a model for a table container to layout items.
goocanvas-1.0.0/COPYING0000644000076400007640000006131411412723611011457 00000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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! goocanvas-1.0.0/README0000644000076400007640000000427411512611666011315 00000000000000 Welcome to GooCanvas ==================== (a cairo-based canvas widget for GTK+) GooCanvas Home Page : http://live.gnome.org/GooCanvas GooCanvas is similar in many ways to GnomeCanvas and FooCanvas, but it uses cairo for rendering. NOTE: I am no longer actively developing GooCanvas, so no major new features will be added (unless a new maintainer takes over). I'll still try to fix any bugs that appear though, and may accept minor patches. To build it run './configure' and 'make'. To run the demo cd into 'demo' and run './demo'. (Or run ./simple-demo for the very simple demo, or ./mv-demo for the model-view demo.) Features: o Basic items - rect/ellipse/polyline/text/image/grid/group. o Path item, using SVG path specification strings. o Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.) o Embedded GTK+ widgets. o Layers/stacking order with raise/lower functions. o Affine transformations for all items - rotations/scales/skews. o Clip paths to support clipping items. o Event handling - button/motion events, "pointer-events" property like SVG. o Grabs - support for pointer & keyboard grabs. o Keyboard focus traversal. o Accessibility (item title & description properties and hierarchy stuff). o Printing (output to a given cairo_t). o Scrolling. o Zooming. o Static items that don't move as the canvas is scrolled or zoomed. o Tooltips. o Item visibility setting - on/off/above zoom threshold. o Simple animation. o Scalable - support for thousands of items over a large canvas area. o Support for different units - pixels/points/inches/millimeters. o API docs. Features that may be removed in future to simplify the code: o Optional model/view split. o Uses interfaces for items & views. o Cascading styles - line width/style/dashes, colors, fill patterns. (The style properties will remain, but will not cascade.) Damon Chaplin (damon@gnome.org) (FooCanvas can be found in GNOME svn in the 'foocanvas' module. FooCanvas was based on GnomeCanvas, which is in the 'libgnomecanvas' module.) goocanvas-1.0.0/gtk-doc.make0000644000076400007640000001534111354003646012616 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) EXTRA_DIST = \ $(content_files) \ $(HTML_IMAGES) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ pdf-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ $(srcdir)/pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/html @mkdir $(srcdir)/html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options=--path="$(srcdir)"; \ fi; \ cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building PDF' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/$(DOC_MODULE).pdf @mkpdf_imgdirs=""; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \ fi; \ done; \ fi; \ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: @installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo '-- Installing '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ mv -f $${installdir}/$(DOC_MODULE).devhelp \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl cp $(srcdir)/html/* $(distdir)/html -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ cd $(distdir) && rm -f $(DISTCLEANFILES) $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs goocanvas-1.0.0/missing0000755000076400007640000002623311310245766012033 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 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 tar try tar, gnutar, gtar, then tar without non-portable flags 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. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) 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 ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) 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: goocanvas-1.0.0/config.sub0000755000076400007640000010316711310245766012421 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 # Free Software Foundation, Inc. timestamp='2009-11-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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 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-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/'` ;; *) 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 \ | 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 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | 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 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | 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 | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-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-* \ | 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-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | 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-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | 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-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | 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-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | 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 ;; 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) 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'm not sure what "Sysv32" means. Should this be sysv3.2? 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-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; 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) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; 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 ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-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 ;; 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* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -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 ;; -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 ;; # 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 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; 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: goocanvas-1.0.0/configure0000755000076400007640000152651011512612656012347 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65 for goocanvas 1.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. 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" 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. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$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 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 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=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&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'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # 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 if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # 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='goocanvas' PACKAGE_TARNAME='goocanvas' PACKAGE_VERSION='1.0.0' PACKAGE_STRING='goocanvas 1.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/goocanvas.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 GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK PLATFORM_WIN32_FALSE PLATFORM_WIN32_TRUE REBUILD PERL GLIB_MKENUMS GLIB_GENMARSHAL MKINSTALLDIRS POSUB POFILES PO_IN_DATADIR_FALSE PO_IN_DATADIR_TRUE INTLLIBS INSTOBJEXT GMOFILES DATADIRNAME CATOBJEXT CATALOGS XGETTEXT GMSGFMT MSGFMT_OPTS MSGFMT USE_NLS GETTEXT_PACKAGE PACKAGE_LIBS PACKAGE_CFLAGS PKG_CONFIG OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE LT_VERSION_INFO 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 VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM 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_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock enable_rebuilds with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PACKAGE_CFLAGS PACKAGE_LIBS' # 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=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 goocanvas 1.0.0 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/goocanvas] --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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of goocanvas 1.0.0:";; 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 --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --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-rebuilds disable all source autogeneration rules --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-html-dir=PATH path to installed docs 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 PKG_CONFIG path to pkg-config utility PACKAGE_CFLAGS C compiler flags for PACKAGE, overriding pkg-config PACKAGE_LIBS linker flags for PACKAGE, overriding pkg-config 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 the package provider. _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 goocanvas configure 1.0.0 generated by GNU Autoconf 2.65 Copyright (C) 2009 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # 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; } >/dev/null && { 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # 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; test "x$as_lineno_stack" = x && { as_lineno=; 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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.$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;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel 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 goocanvas $as_me 1.0.0, which was generated by GNU Autoconf 2.65. 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX 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 cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX 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 cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX 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 ac_site_file1=$CONFIG_SITE 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" 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_config_headers="$ac_config_headers config.h" am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do for ac_t in install-sh install.sh shtool; do if test -f "$ac_dir/$ac_t"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/$ac_t -c" break 2 fi done done if test -z "$ac_aux_dir"; then as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$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. # 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 test "${ac_cv_path_install+set}" = set; 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 test "${ac_cv_prog_STRIP+set}" = set; 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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 test "${ac_cv_path_mkdir+set}" = set; 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 test "${ac_cv_prog_AWK+set}" = set; 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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; 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='goocanvas' VERSION='1.0.0' 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. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Libtool versioning - only update before a public release. # If the code has changed at all: REVISION++. # If any interfaces have changed at all: CURRENT++, REVISION=0. # If interfaces changed but it is backwards compatible: AGE++, else AGE=0. # i.e. the library supports interfaces CURRENT - AGE up to CURRENT. # if two libraries have identical CURRENT and AGE, then newest REVISION used. CURRENT=8 AGE=5 REVISION=0 LT_VERSION_INFO="$CURRENT:$REVISION:$AGE" { $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 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='\' 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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_set_status 77 as_fn_error "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 test "${ac_cv_objext+set}" = set; 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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; 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 test "${ac_cv_prog_cc_c89+set}" = set; 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 test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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'. 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 ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if test "${ac_cv_search_strerror+set}" = set; 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 test "${ac_cv_search_strerror+set}" = set; then : break fi done if test "${ac_cv_search_strerror+set}" = set; 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 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { $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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; 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 test "${ac_cv_prog_cc_c89+set}" = set; 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 test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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'. 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 ;; 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 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 test "${ac_cv_prog_CPP+set}" = set; 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.$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.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $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.$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.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $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 for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; 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 test "${ac_cv_path_EGREP+set}" = set; 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 test "${ac_cv_header_stdc+set}" = set; 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 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.2.6b' macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" # 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 test "${ac_cv_build+set}" = set; 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 test "${ac_cv_host+set}" = set; 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 for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; 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 test "${ac_cv_path_FGREP+set}" = set; 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 test "${lt_cv_path_LD+set}" = set; 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 test "${lt_cv_prog_gnu_ld+set}" = set; 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 test "${lt_cv_path_NM+set}" = set; 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 "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" 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 test "${ac_cv_prog_DUMPBIN+set}" = set; 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 -symbols" "link -dump -symbols" 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 test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; 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 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 test "${lt_cv_nm_interface+set}" = set; 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:5536: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:5539: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:5542: 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 test "${lt_cv_sys_max_cmd_len+set}" = set; 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; ;; 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 ;; 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"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$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"}, \ = c,a/b,, \ && 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 for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; 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 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 test "${ac_cv_prog_OBJDUMP+set}" = set; 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 test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; 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 test "${lt_cv_deplibs_check_method+set}" = set; 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. if ( 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 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 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 ;; 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]) 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 Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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_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}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; 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}ar" $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 fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; 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="ar" $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 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 else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru 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 test "${ac_cv_prog_STRIP+set}" = set; 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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 test "${ac_cv_prog_RANLIB+set}" = set; 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 test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; 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 \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # 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 test "${lt_cv_sys_global_symbol_pipe+set}" = set; 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};"\ " /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 # 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 #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. */ 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_save_LIBS="$LIBS" lt_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_save_LIBS" CFLAGS="$lt_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 # 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 6747 "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 test "${lt_cv_cc_needs_belf+set}" = set; 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 ;; sparc*-*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*) LD="${LD-ld} -m elf64_sparc" ;; *) 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" 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 test "${ac_cv_prog_DSYMUTIL+set}" = set; 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 test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; 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 test "${ac_cv_prog_NMEDIT+set}" = set; 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 test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; 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 test "${ac_cv_prog_LIPO+set}" = set; 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 test "${ac_cv_prog_ac_ct_LIPO+set}" = set; 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 test "${ac_cv_prog_OTOOL+set}" = set; 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 test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; 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 test "${ac_cv_prog_OTOOL64+set}" = set; 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 test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; 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 test "${lt_cv_apple_cc_single_mod+set}" = set; 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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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 test "${lt_cv_ld_exported_symbols_list+set}" = set; 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; } 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" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # 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 " eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done 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" = x""yes; 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; pic_mode="$withval" 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 test "${lt_cv_objdir+set}" = set; 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 # Sed substitution that helps us do robust quoting. It backslashifies # 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' # 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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 test "${lt_cv_path_MAGIC_CMD+set}" = set; 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 test "${lt_cv_path_MAGIC_CMD+set}" = set; 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* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $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 test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; 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:8023: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8027: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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= { $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 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' ;; 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 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) 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' ;; pgcc* | pgf77* | pgf90* | pgf95*) # 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*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # 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='' ;; 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*) 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}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # 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 test "${lt_cv_prog_compiler_pic_works+set}" = set; 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:8362: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8366: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_static_works+set}" = set; 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:8467: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8471: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:8522: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8526: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_flag_spec_ld= 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 ;; esac ld_shlibs=yes if test "$with_gnu_ld" = 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 *\ [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.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _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' 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/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' 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 ;; 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) 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= 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$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]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; 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; $ECHO \"$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*) # 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= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) 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 $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' 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 $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 ;; 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 $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 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 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")) && (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 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. 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 } }' 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 "$aix_libpath"; then 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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. 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 } }' 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 "$aix_libpath"; then 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' 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. 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 `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' 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=echo 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 ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${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_flag_spec_ld='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${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' ;; *) archive_cmds='$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 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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. 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) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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*) 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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; } $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 archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; 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 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # 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 -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # 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; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` 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 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 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=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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 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 ;; freebsd1*) dynamic_linker=no ;; 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[123]*) 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 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 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' ;; interix[3-9]*) 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' 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 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 Linux ELF. linux* | k*bsd*-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' 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 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 : 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 # 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 # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # 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;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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' ;; 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 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 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 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 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 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 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 test "${ac_cv_lib_dl_dlopen+set}" = set; 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" = x""yes; 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" = x""yes; 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 test "${ac_cv_lib_dld_shl_load+set}" = set; 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" = x""yes; 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" = x""yes; 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 test "${ac_cv_lib_dl_dlopen+set}" = set; 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" = x""yes; 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 test "${ac_cv_lib_svld_dlopen+set}" = set; 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" = x""yes; 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 test "${ac_cv_lib_dld_dld_link+set}" = set; 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" = x""yes; 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 test "${lt_cv_dlopen_self+set}" = set; 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 10892 "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 void fnord() { int i=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; /* 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 test "${lt_cv_dlopen_self_static+set}" = set; 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 10988 "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 void fnord() { int i=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; /* 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: pkg_modules="gtk+-2.0 >= 2.12.0 glib-2.0 >= 2.10.0 cairo >= 1.4.0" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) 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_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) 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_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; 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" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PACKAGE" >&5 $as_echo_n "checking for PACKAGE... " >&6; } if test -n "$PACKAGE_CFLAGS"; then pkg_cv_PACKAGE_CFLAGS="$PACKAGE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\""; } >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PACKAGE_CFLAGS=`$PKG_CONFIG --cflags "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PACKAGE_LIBS"; then pkg_cv_PACKAGE_LIBS="$PACKAGE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\""; } >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PACKAGE_LIBS=`$PKG_CONFIG --libs "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PACKAGE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$pkg_modules" 2>&1` else PACKAGE_PKG_ERRORS=`$PKG_CONFIG --print-errors "$pkg_modules" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PACKAGE_PKG_ERRORS" >&5 as_fn_error "Package requirements ($pkg_modules) were not met: $PACKAGE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " "$LINENO" 5 elif test $pkg_failed = untried; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." "$LINENO" 5; } else PACKAGE_CFLAGS=$pkg_cv_PACKAGE_CFLAGS PACKAGE_LIBS=$pkg_cv_PACKAGE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : fi GETTEXT_PACKAGE=goocanvas cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" _ACEOF ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" for ac_header in locale.h do : ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOCALE_H 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_val_LC_MESSAGES=yes else am_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 $as_echo "$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = x""yes; then : gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 $as_echo_n "checking for ngettext in libc... " >&6; } if test "${gt_cv_func_ngettext_libc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_ngettext_libc=yes else gt_cv_func_ngettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 $as_echo "$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 $as_echo_n "checking for dgettext in libc... " >&6; } if test "${gt_cv_func_dgettext_libc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_dgettext_libc=yes else gt_cv_func_dgettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 $as_echo "$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; } if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_bindtextdomain=yes else ac_cv_lib_intl_bindtextdomain=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_intl_bindtextdomain" >&5 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } if test "x$ac_cv_lib_intl_bindtextdomain" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=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_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_dgettext+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dgettext=yes else ac_cv_lib_intl_dgettext=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_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = x""yes; then : gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $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 ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=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_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 $as_echo_n "checking for dcgettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_dcgettext+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $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 dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dcgettext=yes else ac_cv_lib_intl_dcgettext=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_intl_dcgettext" >&5 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; } if test "x$ac_cv_lib_intl_dcgettext" = x""yes; then : gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv else : fi else : fi fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do : ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" if test "x$ac_cv_func_dcgettext" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi done MSGFMT_OPTS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 $as_echo_n "checking if msgfmt accepts -c... " >&6; } cat >conftest.foo <<_ACEOF msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" _ACEOF if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then MSGFMT_OPTS=-c; { $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; } echo "$as_me: failed input was:" >&5 sed 's/^/| /' conftest.foo >&5 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) 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_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $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 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : CATOBJEXT=.gmo DATADIRNAME=share else case $host in *-*-solaris*) ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi fi if test "$gt_cv_have_gettext" = "yes" ; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po ac_config_commands="$ac_config_commands default-1" for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 $as_echo_n "checking for catalogs to be installed... " >&6; } NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 $as_echo "$LINGUAS" >&6; } fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` # Check whether --enable-rebuilds was given. if test "${enable_rebuilds+set}" = set; then : enableval=$enable_rebuilds; else enable_rebuilds=yes fi # define a MAINT-like variable REBUILD which is set if Perl # and awk are found, so autogenerated sources can be rebuilt for ac_prog in perl5 perl 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 test "${ac_cv_path_PERL+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) 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_path_PERL="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PERL" && break done REBUILD=\# if test "x$enable_rebuilds" = "xyes" && \ test -n "$PERL" && \ $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then REBUILD= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for some Win32 platform" >&5 $as_echo_n "checking for some Win32 platform... " >&6; } case "$host" in *-*-mingw*|*-*-cygwin*) platform_win32=yes ;; *) platform_win32=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $platform_win32" >&5 $as_echo "$platform_win32" >&6; } if test "$platform_win32" = "yes"; then PLATFORM_WIN32_TRUE= PLATFORM_WIN32_FALSE='#' else PLATFORM_WIN32_TRUE='#' PLATFORM_WIN32_FALSE= fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GTKDOC_CHECK+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) 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_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase 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 test "${ac_cv_path_GTKDOC_REBASE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) 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_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GTKDOC_MKPDF+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) 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_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi if test x$enable_gtk_doc = xyes; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : else as_fn_error "You need to have gtk-doc >= 1.8 installed to build $PACKAGE_NAME" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi ac_config_files="$ac_config_files Makefile src/Makefile demo/Makefile docs/Makefile po/Makefile.in goocanvas.pc" 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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file 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= 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 "${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 "${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 "${PLATFORM_WIN32_TRUE}" && test -z "${PLATFORM_WIN32_FALSE}"; then as_fn_error "conditional \"PLATFORM_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error "conditional \"GTK_DOC_USE_REBASE\" 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. 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 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=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&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 goocanvas $as_me 1.0.0, which was generated by GNU Autoconf 2.65. 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ goocanvas config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" Copyright (C) 2009 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=$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"` ;; 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 "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ 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 \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ 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_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac 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 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "demo/Makefile") CONFIG_FILES="$CONFIG_FILES demo/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "goocanvas.pc") CONFIG_FILES="$CONFIG_FILES goocanvas.pc" ;; *) 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= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # 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 {' >"$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 >>"\$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 >>"\$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 < "$tmp/subs1.awk" > "$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 $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi 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 >"$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_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; 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="$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 "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 >"$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 "$tmp/subs.awk" >$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' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$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 "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$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 "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$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 "$tmp/config.h" "$ac_file" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$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 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 # 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 # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # 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 # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # 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 # 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 # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # 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 # 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 # 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 # 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 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # 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 # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$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 # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # 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_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}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # 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 () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # 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 "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; 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 $? 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 goocanvas-1.0.0/config.h.in0000644000076400007640000000421211512612676012452 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS /* Gettext package. */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* 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_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 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 to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION goocanvas-1.0.0/INSTALL0000644000076400007640000003633211310245766011466 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. 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 need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. 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. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. 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=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, 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 can use 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 `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer 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. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' 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. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= 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'. 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. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, 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 option `--target=TYPE' 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 causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--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. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. goocanvas-1.0.0/Makefile.in0000644000076400007640000006164211512612655012503 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/goocanvas.pc.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ depcomp install-sh ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in 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 = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = goocanvas.pc 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 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__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) 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 = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } 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 distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src demo docs po # require automake 1.7 AUTOMAKE_OPTIONS = 1.7 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = goocanvas.pc EXTRA_DIST = goocanvas.pc.in autogen.sh all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu 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_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): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(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 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 goocanvas.pc: $(top_builddir)/config.status $(srcdir)/goocanvas.pc.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 install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || 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)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files # 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) $(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 -9 -c >$(distdir).tar.bz2 $(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 -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.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" \ $(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: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { 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 $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA 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: uninstall-pkgconfigDATA .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 am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ 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-pkgconfigDATA 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 uninstall-pkgconfigDATA # 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: goocanvas-1.0.0/mkinstalldirs0000755000076400007640000000370411512612651013233 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here goocanvas-1.0.0/po/0000755000076400007640000000000011512612762011122 500000000000000goocanvas-1.0.0/po/POTFILES.in0000644000076400007640000000064111412723611012613 00000000000000# List of source files containing translatable strings. src/goocanvasatk.c src/goocanvas.c src/goocanvasellipse.c src/goocanvasgrid.c src/goocanvasgroup.c src/goocanvasimage.c src/goocanvasitem.c src/goocanvasitemmodel.c src/goocanvasitemsimple.c src/goocanvaspath.c src/goocanvaspolyline.c src/goocanvasrect.c src/goocanvasstyle.c src/goocanvastable.c src/goocanvastext.c src/goocanvasutils.c src/goocanvaswidget.c goocanvas-1.0.0/po/LINGUAS0000644000076400007640000000001411512612372012057 00000000000000en_GB es ja goocanvas-1.0.0/po/en_GB.gmo0000644000076400007640000000053711512612753012525 00000000000000Þ•$,8%9Project-Id-Version: GooCanvas CVS Report-Msgid-Bugs-To: POT-Creation-Date: 2011-01-10 14:15+0000 PO-Revision-Date: 2006-04-24 16:26+0100 Last-Translator: Damon Chaplin Language-Team: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit goocanvas-1.0.0/po/ChangeLog0000644000076400007640000000065611412723611012616 000000000000002008-12-29 Damon Chaplin * POTFILES.in: added goocanvasgrid.c. 2008-05-04 Damon Chaplin * ja.po: update from Kouhei Sutou. 2007-03-06 Damon Chaplin * es.po: update from Rafael Villar Burke. 2007-02-15 Damon Chaplin * ja.po: update from Kouhei Sutou. 2007-02-12 Damon Chaplin * ja.po: * es.po: added new po files. goocanvas-1.0.0/po/goocanvas.pot0000644000076400007640000005677311512612234013562 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-01-10 14:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "" #: src/goocanvas.c:291 msgid "Scale X" msgstr "" #: src/goocanvas.c:292 msgid "The horizontal magnification factor of the canvas" msgstr "" #: src/goocanvas.c:298 msgid "Scale Y" msgstr "" #: src/goocanvas.c:299 msgid "The vertical magnification factor of the canvas" msgstr "" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:597 msgid "Anchor" msgstr "" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "" #: src/goocanvas.c:313 msgid "X1" msgstr "" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:321 msgid "Y1" msgstr "" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:329 msgid "X2" msgstr "" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:338 msgid "Y2" msgstr "" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "" #: src/goocanvas.c:362 msgid "Bounds Padding" msgstr "" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "" #: src/goocanvas.c:369 msgid "Units" msgstr "" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:394 msgid "Background Color" msgstr "" #: src/goocanvas.c:395 msgid "The color to use for the canvas background" msgstr "" #: src/goocanvas.c:401 msgid "Background Color RGB" msgstr "" #: src/goocanvas.c:402 msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:108 msgid "The x coordinate of the left side of the ellipse" msgstr "" #: src/goocanvasellipse.c:116 msgid "The y coordinate of the top of the ellipse" msgstr "" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:109 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:580 msgid "Width" msgstr "" #: src/goocanvasellipse.c:124 msgid "The width of the ellipse" msgstr "" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:116 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:588 msgid "Height" msgstr "" #: src/goocanvasellipse.c:131 msgid "The height of the ellipse" msgstr "" #: src/goocanvasgrid.c:109 msgid "The x coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:117 msgid "The y coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:125 msgid "The width of the grid" msgstr "" #: src/goocanvasgrid.c:132 msgid "The height of the grid" msgstr "" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "" #: src/goocanvasgrid.c:167 msgid "The width of the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "" #: src/goocanvasgrid.c:175 msgid "The width of the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:182 msgid "Horizontal Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:183 msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "" #: src/goocanvasgrid.c:189 msgid "Vertical Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:190 msgid "The cairo pattern to paint the vertical grid lines with" msgstr "" #: src/goocanvasgrid.c:196 msgid "Border Width" msgstr "" #: src/goocanvasgrid.c:197 msgid "The width of the border around the grid" msgstr "" #: src/goocanvasgrid.c:204 msgid "Border Pattern" msgstr "" #: src/goocanvasgrid.c:205 msgid "The cairo pattern to paint the border with" msgstr "" #: src/goocanvasgrid.c:211 msgid "Show Horizontal Grid Lines" msgstr "" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 msgid "Show Vertical Grid Lines" msgstr "" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 msgid "Vertical Grid Lines On Top" msgstr "" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 msgid "Horizontal Grid Line Color" msgstr "" #: src/goocanvasgrid.c:235 msgid "The color to use for the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:241 msgid "Horizontal Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:242 msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "" #: src/goocanvasgrid.c:248 msgid "Horizontal Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:249 msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:255 msgid "Vertical Grid Line Color" msgstr "" #: src/goocanvasgrid.c:256 msgid "The color to use for the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:262 msgid "Vertical Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:263 msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "" #: src/goocanvasgrid.c:269 msgid "Vertical Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:270 msgid "The pixbuf to use to draw the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:276 msgid "Border Color" msgstr "" #: src/goocanvasgrid.c:277 msgid "The color to use for the border" msgstr "" #: src/goocanvasgrid.c:283 msgid "Border Color RGBA" msgstr "" #: src/goocanvasgrid.c:284 msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "" #: src/goocanvasgrid.c:290 msgid "Border Pixbuf" msgstr "" #: src/goocanvasgrid.c:291 msgid "The pixbuf to use to draw the border" msgstr "" #: src/goocanvasgroup.c:91 msgid "The x coordinate of the group" msgstr "" #: src/goocanvasgroup.c:99 msgid "The y coordinate of the group" msgstr "" #: src/goocanvasgroup.c:107 msgid "The width of the group, or -1 to use the default width" msgstr "" #: src/goocanvasgroup.c:115 msgid "The height of the group, or -1 to use the default height" msgstr "" #: src/goocanvasimage.c:86 msgid "Pattern" msgstr "" #: src/goocanvasimage.c:87 msgid "The cairo pattern to paint" msgstr "" #: src/goocanvasimage.c:94 msgid "The x coordinate of the image" msgstr "" #: src/goocanvasimage.c:102 msgid "The y coordinate of the image" msgstr "" #: src/goocanvasimage.c:110 msgid "The width of the image" msgstr "" #: src/goocanvasimage.c:117 msgid "The height of the image" msgstr "" #: src/goocanvasimage.c:123 msgid "Scale To Fit" msgstr "" #: src/goocanvasimage.c:124 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:130 msgid "Alpha" msgstr "" #: src/goocanvasimage.c:131 msgid "The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque." msgstr "" #: src/goocanvasimage.c:137 msgid "Pixbuf" msgstr "" #: src/goocanvasimage.c:138 msgid "The GdkPixbuf to display" msgstr "" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 msgid "The tooltip to display for the item" msgstr "" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "" #: src/goocanvasitemsimple.c:127 msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "" #: src/goocanvasitemsimple.c:134 msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "" #: src/goocanvasitemsimple.c:227 msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:234 msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "" #: src/goocanvasitemsimple.c:248 msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:255 msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:262 msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "" #: src/goocanvaspath.c:78 msgid "The x coordinate of the path" msgstr "" #: src/goocanvaspath.c:86 msgid "The y coordinate of the path" msgstr "" #: src/goocanvaspath.c:94 msgid "The width of the path" msgstr "" #: src/goocanvaspath.c:101 msgid "The height of the path" msgstr "" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:192 msgid "The x coordinate of the left-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:200 msgid "The y coordinate of the top-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:208 msgid "The width of the polyline" msgstr "" #: src/goocanvaspolyline.c:215 msgid "The height of the polyline" msgstr "" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "" #: src/goocanvastable.c:237 msgid "Row Spacing" msgstr "" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "" #: src/goocanvastable.c:244 msgid "Column Spacing" msgstr "" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "" #: src/goocanvastable.c:277 msgid "The width of the grid line to draw between rows" msgstr "" #: src/goocanvastable.c:284 msgid "The width of the grid line to draw between columns" msgstr "" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "" #: src/goocanvastable.c:318 msgid "X Align" msgstr "" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "" #: src/goocanvastable.c:331 msgid "Row" msgstr "" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "" #: src/goocanvastable.c:337 msgid "Column" msgstr "" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "" #: src/goocanvastable.c:343 msgid "Rows" msgstr "" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "" #: src/goocanvastable.c:349 msgid "Columns" msgstr "" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "" #: src/goocanvastext.c:94 msgid "Text" msgstr "" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "" #: src/goocanvastext.c:142 msgid "" "The width to use to layout the text, or -1 to let the text use as much " "horizontal space as needed" msgstr "" #: src/goocanvastext.c:150 msgid "" "The height to use to layout the text, or -1 to let the text use as much " "vertical space as needed" msgstr "" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "" #: src/goocanvaswidget.c:557 msgid "Widget" msgstr "" #: src/goocanvaswidget.c:558 msgid "The widget to place in the canvas" msgstr "" #: src/goocanvaswidget.c:565 msgid "The x coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:573 msgid "The y coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:581 msgid "The width of the widget, or -1 to use its requested width" msgstr "" #: src/goocanvaswidget.c:589 msgid "The height of the widget, or -1 to use its requested height" msgstr "" #: src/goocanvaswidget.c:598 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "" goocanvas-1.0.0/po/ja.gmo0000644000076400007640000004567311512612754012160 00000000000000Þ•Ì|Ü 0;1Nm ¼Æ Í ×ä õ#8GZ is|…– ¥ ¯ºÁÐ Ø ä î!ø!*<+g “ž ® » ÇÑÖç îû9BOM’!à14:T<6Ì9]=C›Aß'!5I30³.ä2F Ub k u  Š–Ÿ ¦°¸¿ÎÕÞ ç ô  $*2/: j vƒ• ¤²·VÐW'œ+°!Üþ*YDžh,”•o*šºÚ!òC3BwºÒ;î'*1Ri„$î0 :D < 9¼ ö !.+!&Z!)!&«!)Ò!ü! "Q""Ot"mÄ"p2#C£#pç#X$5u$«$6É$a%b%%v%œ%/¼%gì%"T&.w&8¦&!ß&8'2:'/m''´'9Ï'- (7(GU(!(H¿()%)ID)-Ž)¼)!Ú)ü)F*`** …* ‘*›* ¡*¬* Å*Ð*å*M+ES+™+ +¦+«+³+Ä+Í+Ô+Ý+à+ã+ë+ü+, ,,,L,h---¯- ¶-Ã-Ü-ì- .. %./.E.[.w.“.©.¼. Ï.$Ü.//*/./>/E/L/ S/0`/0‘/0Â/0ó/$0%:0`00˜0 ®0»0Î0Õ0 î0 û01-'1SU1a©1- 2B920|26­26ä233EO3o•3Z4Z`4K»4K5KS59Ÿ59Ù596 M6Z6 p6}6 ”6¡6¨6¾6Å6É6 Ù6æ6í67 7707E7Z7p7t7„7 ‹7˜7¯7NÆ7 8"8%;8a8€8 œ8©8B¿8B9-E9 s9-€9'®9+Ö9:K:”j:nÿ:­n;‡<¤<½<,Ö<$=$(=`M=]®= >>g/>-—>*Å>Sð>D?c?4?*´?!ß?'@')@'Q@y@•@±@3Í@AAa*AjŒA†÷AŠ~BQ CZ[C¶C<ÏC DB+DunDäDýDE*8EYcE½EÜE4ùE3.FbFFšF ³FÀFaÐF2GNGEaG§GE»GHHE9HH›H®HÂHEÛH!I @IMIcIjIqII ¬I¶I0ÏIcJbdJÇJÚJ ÞJëJýJK)K;KMKPKSKeKK‘K£KµK¸K“8k¼„žÌ-œ¬¸t\u›ÁH(ŠŽ`iKw¢³¨4Xƒ± 2+Ș!o” €Z¥¿caLsÃlRV=}qN)·Ÿ‘À { /™@O>²U.‰—Y­r$&mJˆCb3 ¯6©ÉE£‚–j5%¤WÅ«gpšz7¡‡S®‹9…†AĹ~Ëx^µÂdºDvT];<F ÇŒ|[_ª§Æh1 •¾¦e0’f,*GB"nP'Ê´I»#:My°?¶½QA description of the item for use by assistive technologiesA short context-rich description of the item for use by assistive technologiesAlignmentAnchorAntialiasArrow LengthArrow Tip LengthArrow WidthAutomatic BoundsBackground ColorBackground Color RGBBottom PaddingBounds From OriginBounds PaddingCan FocusCenter XCenter YClear BackgroundClip Fill RuleClip PathClose PathColumnColumn SpacingColumnsDescriptionEllipsizeEnd ArrowExtra space to add above the itemExtra space to add below the itemExtra space to add to the left of the itemExtra space to add to the right of the itemFill ColorFill Color RGBAFill PatternFill PixbufFill RuleFontFont DescriptionHeightHint MetricsHomogenous ColumnsHomogenous RowsHorizontal Grid Line WidthHow to align the textHow to position the text relative to the given x and y coordinatesHow to position the widget relative to the item's x and y coordinate settingsIf all columns are the same widthIf all item layout is done to the nearest integerIf all rows are the same heightIf an arrow should be displayed at the end of the polylineIf an arrow should be displayed at the start of the polylineIf the automatic bounds are calculated from the originIf the background is cleared before the canvas is paintedIf the bounds are automatically calculated based on the bounds of all the items in the canvasIf the item can shrink smaller than its requested size horizontallyIf the item can shrink smaller than its requested size verticallyIf the item can take the keyboard focusIf the item expands horizontally as the table expandsIf the item expands vertically as the table expandsIf the item fills all horizontal allocated spaceIf the item fills all vertical allocated spaceIf the last point should be connected to the firstInteger LayoutLeft PaddingLine CapLine DashLine JoinLine WidthMiter LimitOperatorParentPath DataPatternPixbufPointer EventsPointsRadius XRadius YResolution XResolution YRight PaddingRowRow SpacingRowsScaleScale XScale YSpecifies when the item receives pointer eventsStart ArrowStroke ColorStroke Color RGBAStroke PatternStroke PixbufTextThe GdkPixbuf to displayThe amount of spacing between the lefmost and rightmost cells and the border grid lineThe amount of spacing between the topmost and bottommost cells and the border grid lineThe antialiasing mode to useThe array of pointsThe attributes specifying which font to useThe base font to use for the textThe cairo pattern to paintThe color to use for the canvas backgroundThe color to use for the canvas background, specified as a 24-bit integer value, 0xRRGGBBThe color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULLThe color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULLThe color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULLThe color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULLThe column to place the item inThe compositing operator to useThe dash pattern to useThe default space between columnsThe default space between rowsThe fill rule used to determine which parts of the item are clippedThe fill rule used to determine which parts of the item are filledThe height of the imageThe height of the rectangleThe height of the widget, or -1 to use its requested heightThe hinting to be used for font metricsThe horizontal magnification factor of the canvasThe horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-alignedThe horizontal radius of the ellipseThe horizontal radius to use for rounded cornersThe horizontal resolution of the display, in dots per inchThe length of the arrow tip, as a multiple of the line widthThe length of the arrows, as a multiple of the line widthThe line cap style to useThe line join style to useThe line width to use for the item's perimeterThe magnification factor of the canvasThe number of columns that the item spansThe number of rows that the item spansThe padding added to the automatic boundsThe parent itemThe parent item modelThe pattern to use to paint the interior of the item, or NULL to disable paintingThe pattern to use to paint the perimeter of the item, or NULL disable paintingThe pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULLThe pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULLThe preferred method of wrapping the string if a width has been setThe preferred place to ellipsize the string, if the label does not have enough room to display the entire stringThe row to place the item inThe scale threshold at which the item becomes visibleThe sequence of path commandsThe sequence of path commands specifying the clip pathThe smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limitThe text to displayThe transformation matrix of the itemThe units to use for the canvasThe vertical magnification factor of the canvasThe vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-alignedThe vertical radius of the ellipseThe vertical radius to use for rounded cornersThe vertical resolution of the display, in dots per inchThe widget to place in the canvasThe width of the arrows, as a multiple of the line widthThe width of the grid line to draw between columnsThe width of the grid line to draw between rowsThe width of the imageThe width of the rectangleThe width of the widget, or -1 to use its requested widthThe x coordinate of the center of the ellipseThe x coordinate of the imageThe x coordinate of the left edge of the canvas bounds, in canvas unitsThe x coordinate of the rectangleThe x coordinate of the right edge of the canvas bounds, in canvas unitsThe x coordinate of the textThe x coordinate of the widgetThe y coordinate of the bottom edge of the canvas bounds, in canvas unitsThe y coordinate of the center of the ellipseThe y coordinate of the imageThe y coordinate of the rectangleThe y coordinate of the textThe y coordinate of the top edge of the canvas bounds, in canvas unitsThe y coordinate of the widgetTitleTop PaddingTransformUnitsUse MarkupVertical Grid Line WidthVisibilityVisibility ThresholdWhen the canvas item is visibleWhere to place the canvas when it is smaller than the widget's allocated areaWhether to parse PangoMarkup in the text, to support different stylesWidgetWidthWrapX AlignX Border SpacingX ExpandX FillX ShrinkX1X2Y AlignY Border SpacingY ExpandY FillY ShrinkY1Y2Project-Id-Version: GooCanvas CVS Report-Msgid-Bugs-To: POT-Creation-Date: 2011-01-10 14:15+0000 PO-Revision-Date: 2008-04-28 20:42+0900 Last-Translator: kou@cozmixng.org Language-Team: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; æ”¯æ´æŠ€è¡“ç”¨ã®èª¬æ˜Žæ”¯æ´æŠ€è¡“用ã®çŸ­ã„文脈豊富ãªèª¬æ˜Žé…置アンカーアンãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹çŸ¢å°ã®é•·ã•矢å°ã®å…ˆç«¯ã®é•·ã•矢å°ã®å¹…自動境界計算背景色背景色ã®RGB表ç¾ä¸‹éƒ¨ãƒ‘ディング原点ã‹ã‚‰ã®å¢ƒç•Œè¨ˆç®—境界部ã®ãƒ‘ディングフォーカスå¯å¦ä¸­å¿ƒã® X 座標中心㮠Y 座標背景消去切り抜ã用塗りã¤ã¶ã—基準切り抜ã用パスパスを閉ã˜ã‚‹åˆ—列間ã®ç©ºç™½åˆ—数説明çœç•¥çµ‚点矢å°ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸Šéƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸‹éƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®å·¦å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®å³å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½å¡—りã¤ã¶ã—ã®è‰²å¡—りã¤ã¶ã—用ã®RGBA表ç¾ã®è‰²å¡—りã¤ã¶ã—用パターン塗りã¤ã¶ã—用Pixbuf塗りã¤ã¶ã—基準フォントフォント記述高ã•ヒントメトリクスå‡ä¸€ã®åˆ—å‡ä¸€ã®è¡Œæ°´å¹³æ–¹å‘ã®æ ¼å­ç·šã®å¹…ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹ä¸Žãˆã‚‰ã‚ŒãŸ X/Y 座標ã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹ã‚¢ã‚¤ãƒ†ãƒ ã® X/Y座標ã®è¨­å®šã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã‚’é…ç½®ã™ã‚‹ã‹å…¨ã¦ã®åˆ—ã‚’åŒã˜å¹…ã«ã™ã‚‹ã‹ã©ã†ã‹ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’近似整数ã§é…ç½®ã™ã‚‹ã‹ã©ã†ã‹å…¨ã¦ã®è¡Œã‚’åŒã˜é«˜ã•ã«ã™ã‚‹ã‹ã©ã†ã‹å¤šç·šå½¢ã®çµ‚点ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹å¤šç·šå½¢ã®å§‹ç‚¹ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹è‡ªå‹•境界計算を原点ã‹ã‚‰è¡Œã†ã‹ã©ã†ã‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚’æç”»ã™ã‚‹å‰ã«èƒŒæ™¯ã‚’消去ã™ã‚‹ã‹ã©ã†ã‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œã‚’å…ƒã«ã—ã¦è‡ªå‹•çš„ã«å¢ƒç•Œã‚’計算ã™ã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦æ±‚ã•ã‚ŒãŸæ°´å¹³æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦æ±‚ã•れãŸåž‚ç›´æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ãƒ•ォーカスをå—ã‘付ã‘ã‚‹ã‹ã©ã†ã‹è¡¨ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’水平方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹è¡¨ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’垂直方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒæ°´å¹³é ˜åŸŸã„ã£ã±ã„使ã†ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒåž‚直領域ã„ã£ã±ã„使ã†ã‹ã©ã†ã‹æœ€å¾Œã®ç‚¹ãŒæœ€åˆã®ç‚¹ã«çµã³ä»˜ã‘ã‚‹ã‹ã©ã†ã‹æ•´æ•°é…置左å´ãƒ‘ディング線ã®é ‚点線ã®ãƒ€ãƒƒã‚·ãƒ¥ (-)ç·šã®çµåˆç·šå¹…ç•™ã‚ç¶™ãŽã®å¢ƒç•Œæ¼”算親パスデータパターンPixbufãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆç‚¹åŠå¾„ã® X 座標åŠå¾„ã® Y 座標X æ–¹å‘ã®è§£åƒåº¦Y æ–¹å‘ã®è§£åƒåº¦å³å´ãƒ‘ディング行行間ã®ç©ºç™½è¡Œæ•°ã‚¹ã‚±ãƒ¼ãƒ«Xæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«Yæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«ã„ã¤ã‚¢ã‚¤ãƒ†ãƒ ãŒãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆã‚’å—ã‘å–ã‚‹ã‹æŒ‡å®šã—ã¾ã™å§‹ç‚¹çŸ¢å°ã‚¹ãƒˆãƒ­ãƒ¼ã‚¯ç”¨ã®è‰²ã‚¹ãƒˆãƒ­ãƒ¼ã‚¯ç”¨ã®RGBA表ç¾ã®è‰²ã‚¹ãƒˆãƒ­ãƒ¼ã‚¯ç”¨ãƒ‘ターンストローク用ã®Pixbufテキスト表示ã™ã‚‹GdkPixbuf最左・最å³ã‚»ãƒ«ã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡æœ€ä¸Šãƒ»æœ€ä¸‹ã‚»ãƒ«ã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡ä½¿ç”¨ã™ã‚‹ã‚¢ãƒ³ãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹ãƒ¢ãƒ¼ãƒ‰ç‚¹ã®é…列使用ã™ã‚‹ãƒ•ォントを特定ã™ã‚‹å±žæ€§ãƒ†ã‚­ã‚¹ãƒˆã«ä½¿ã†åŸºåº•フォント塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターンキャンãƒã‚¹ã®èƒŒæ™¯è‰²24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«ã™ã‚‹32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã‚’ç½®ã列使用ã™ã‚‹åˆæˆæ¼”算使用ã™ã‚‹ãƒ€ãƒƒã‚·ãƒ¥ (-) ã®ãƒ‘ターン列ã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½è¡Œã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸€éƒ¨ãŒåˆ‡ã‚ŠæŠœã‹ã‚Œã¦ã„ã‚‹ã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準アイテムã®ä¸€éƒ¨ãŒå¡—りã¤ã¶ã•れãŸã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準画åƒã®é«˜ã•長方形ã®é«˜ã•ウィジェットã®é«˜ã•。ウィジェットãŒè¦æ±‚ã•れã¦ã„る高ã•を使ã†ãªã‚‰ -1 ã§ã™ãƒ•ォントメトリクスã§ä½¿ã†ãƒ’ントキャンãƒã‚¹ã®æ°´å¹³æ–¹å‘ã®æ‹¡å¤§çŽ‡é ˜åŸŸä¸­ã®ã‚¢ã‚¤ãƒ†ãƒ ã®æ°´å¹³ä½ç½®ã€‚0.0 ã¯å·¦è©°ã‚ã€1.0 ã¯å³è©°ã‚ã§ã™æ¥•å††ã®æ°´å¹³æ–¹å‘ã®åŠå¾„丸角ã§ä½¿ã†æ°´å¹³åŠå¾„ç”»é¢ã®æ°´å¹³è§£åƒåº¦ (ドット/インãƒã€DPI)矢å°ã®å…ˆç«¯ã®é•·ã• (ç·šå¹…ã®å€æ•°)矢å°ã®é•·ã• (ç·šå¹…ã®å€æ•°)使用ã™ã‚‹ç·šã®é ‚点ã®ã‚¹ã‚¿ã‚¤ãƒ«ä½¿ç”¨ã™ã‚‹ç·šã®çµåˆã®ã‚¹ã‚¿ã‚¤ãƒ«ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã«ä½¿ã†ç·šå¹…キャンãƒã‚¹ã®æ‹¡å¤§çŽ‡ã‚¢ã‚¤ãƒ†ãƒ ãŒä½¿ã†åˆ—数アイテムãŒä½¿ã†è¡Œæ•°è‡ªå‹•境界計算ã§è¿½åŠ ã•れãŸãƒ‘ディング親アイテム親アイテムモデルアイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã®ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULLアイテムã®å¢ƒç•Œç·šã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULLアイテムã®å¢ƒç•Œç·šã‚’æç”»ã™ã‚‹ãŸã‚ã«ä½¿ã†Pixbuf。æç”»ã—ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†Pixbuf。塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹å¹…ãŒè¨­å®šã•れã¦ã„ã‚‹ã¨ãã«æ–‡å­—åˆ—ã®æŠ˜ã‚Šè¿”ã—ã«ä½¿ã†ã¹ã方法文字列全体を表示ã™ã‚‹å ´æ‰€ãŒç„¡ã„ã¨ãã«æ–‡å­—列をçœç•¥ã™ã‚‹ã¹ã場所アイテムを置ã行アイテムãŒè¦‹ãˆã‚‹ã‚ˆã†ã«ãªã‚‹å€çއã®ã—ãã„値パスコマンドã®ãªã‚‰ã³åˆ‡ã‚ŠæŠœã用パスを指定ã™ã‚‹ãƒ‘スコマンドã®ãªã‚‰ã³ä½¿ç”¨ã™ã‚‹ç•™ã‚ç¶™ãŽã®æœ€å°è§’度 (度数)。ã“ã®å¢ƒç•Œå€¤ã‚ˆã‚Šä½Žã„å ´åˆã¯ããŽç¶™ãŽãŒä½¿ã‚れã¾ã™è¡¨ç¤ºã™ã‚‹ãƒ†ã‚­ã‚¹ãƒˆã‚¢ã‚¤ãƒ†ãƒ ã®å¤‰æ›è¡Œåˆ—キャンãƒã‚¹ã§ä½¿ã†å˜ä½ã‚­ãƒ£ãƒ³ãƒã‚¹ã®åž‚ç›´æ–¹å‘ã®æ‹¡å¤§çŽ‡é ˜åŸŸä¸­å†…ã§ã®ã‚¢ã‚¤ãƒ†ãƒ ã®åž‚ç›´ä½ç½®ã€‚0.0 ã¯ä¸Šè©°ã‚ã€1.0 ã¯ä¸‹è©°ã‚ã§ã™æ¥•円ã®åž‚ç›´æ–¹å‘ã®åŠå¾„丸角ã§ä½¿ã†åž‚ç›´åŠå¾„<ç”»é¢ã®åž‚ç›´è§£åƒåº¦ (ドット/インãƒã€DPI)キャンãƒã‚¹å†…ã«é…ç½®ã™ã‚‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆçŸ¢å°ã®å¹… (ç·šå¹…ã®å€æ•°)åˆ—é–“ã®æ ¼å­ç·šã®å¹…è¡Œé–“ã®æ ¼å­ç·šã®å¹…ç”»åƒã®å¹…長方形ã®å¹…ウィジェットã®å¹…。ウィジェットãŒè¦æ±‚ã•れã¦ã„る幅を使ã†ãªã‚‰ -1 ã§ã™æ¥•円ã®ä¸­å¿ƒã® X 座標画åƒã® X 座標キャンãƒã‚¹å·¦ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)長方形ã®x座標キャンãƒã‚¹å³ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)テキスト㮠X 座標ウィジェット㮠X 座標キャンãƒã‚¹ä¸‹ç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)楕円ã®ä¸­å¿ƒã® Y 座標画åƒã® Y 座標長方形ã®y座標テキスト㮠Y 座標キャンãƒã‚¹ä¸Šç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)ウィジェット㮠Y 座標タイトル上部パディング変æ›å˜ä½ãƒžãƒ¼ã‚¯ã‚¢ãƒƒãƒ—を使ã†åž‚ç›´æ–¹å‘ã®æ ¼å­ç·šã®å¹…å¯è¦–性å¯è¦–性ã®ã—ãã„値ã„ã¤ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦‹ãˆã‚‹ã‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã®é ˜åŸŸã‚ˆã‚Šã‚‚å°ã•ããªã£ãŸã¨ãã«ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚’ã©ã“ã«ãŠãã‹ç•°ãªã‚‹ã‚¹ã‚¿ã‚¤ãƒ«ã‚’使ã†ãŸã‚ã«ãƒ†ã‚­ã‚¹ãƒˆä¸­ã®PangoMarkupをパースã™ã‚‹ã‹ã©ã†ã‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆå¹…折り返ã—X æ–¹å‘ã®é…ç½®Xæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½X æ–¹å‘ã®ä¼¸é•·X æ–¹å‘ã®å……å¡«X æ–¹å‘ã®ç¸®å°X1X2Y æ–¹å‘ã®é…ç½®Yæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½Y æ–¹å‘ã®ä¼¸é•·Y æ–¹å‘ã®å……å¡«Y æ–¹å‘ã®ç¸®å°Y1Y2goocanvas-1.0.0/po/ja.po0000644000076400007640000010247011512612234011772 00000000000000# Japanese translation for GooCanvas # Copyright (C) 2007 Kouhei Sutou # This file is distributed under the same license as the GooCanvas package. # Kouhei Sutou , 2007. # msgid "" msgstr "" "Project-Id-Version: GooCanvas CVS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-01-10 14:15+0000\n" "PO-Revision-Date: 2008-04-28 20:42+0900\n" "Last-Translator: kou@cozmixng.org \n" "Language-Team:\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "スケール" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "キャンãƒã‚¹ã®æ‹¡å¤§çއ" #: src/goocanvas.c:291 msgid "Scale X" msgstr "Xæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«" #: src/goocanvas.c:292 msgid "The horizontal magnification factor of the canvas" msgstr "キャンãƒã‚¹ã®æ°´å¹³æ–¹å‘ã®æ‹¡å¤§çއ" #: src/goocanvas.c:298 msgid "Scale Y" msgstr "Yæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«" #: src/goocanvas.c:299 msgid "The vertical magnification factor of the canvas" msgstr "キャンãƒã‚¹ã®åž‚ç›´æ–¹å‘ã®æ‹¡å¤§çއ" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:597 msgid "Anchor" msgstr "アンカー" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "ウィジェットã®é ˜åŸŸã‚ˆã‚Šã‚‚å°ã•ããªã£ãŸã¨ãã«ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚’ã©ã“ã«ãŠãã‹" #: src/goocanvas.c:313 msgid "X1" msgstr "X1" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹å·¦ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:321 msgid "Y1" msgstr "Y1" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹ä¸Šç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:329 msgid "X2" msgstr "X2" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹å³ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:338 msgid "Y2" msgstr "Y2" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹ä¸‹ç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "自動境界計算" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" "キャンãƒã‚¹ã®ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œã‚’å…ƒã«ã—ã¦è‡ªå‹•çš„ã«å¢ƒç•Œã‚’計算ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "原点ã‹ã‚‰ã®å¢ƒç•Œè¨ˆç®—" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "自動境界計算を原点ã‹ã‚‰è¡Œã†ã‹ã©ã†ã‹" #: src/goocanvas.c:362 msgid "Bounds Padding" msgstr "境界部ã®ãƒ‘ディング" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "自動境界計算ã§è¿½åŠ ã•れãŸãƒ‘ディング" #: src/goocanvas.c:369 msgid "Units" msgstr "å˜ä½" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "キャンãƒã‚¹ã§ä½¿ã†å˜ä½" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "X æ–¹å‘ã®è§£åƒåº¦" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "ç”»é¢ã®æ°´å¹³è§£åƒåº¦ (ドット/インãƒã€DPI)" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "Y æ–¹å‘ã®è§£åƒåº¦" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "ç”»é¢ã®åž‚ç›´è§£åƒåº¦ (ドット/インãƒã€DPI)" #: src/goocanvas.c:394 msgid "Background Color" msgstr "背景色" #: src/goocanvas.c:395 msgid "The color to use for the canvas background" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvas.c:401 msgid "Background Color RGB" msgstr "背景色ã®RGB表ç¾" #: src/goocanvas.c:402 msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "æ•´æ•°é…ç½®" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’近似整数ã§é…ç½®ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "背景消去" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "キャンãƒã‚¹ã‚’æç”»ã™ã‚‹å‰ã«èƒŒæ™¯ã‚’消去ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "中心㮠X 座標" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® X 座標" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "中心㮠Y 座標" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® Y 座標" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "åŠå¾„ã® X 座標" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "æ¥•å††ã®æ°´å¹³æ–¹å‘ã®åŠå¾„" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "åŠå¾„ã® Y 座標" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "楕円ã®åž‚ç›´æ–¹å‘ã®åŠå¾„" #: src/goocanvasellipse.c:108 #, fuzzy msgid "The x coordinate of the left side of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® X 座標" #: src/goocanvasellipse.c:116 #, fuzzy msgid "The y coordinate of the top of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® Y 座標" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:109 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:580 msgid "Width" msgstr "å¹…" #: src/goocanvasellipse.c:124 #, fuzzy msgid "The width of the ellipse" msgstr "ç”»åƒã®å¹…" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:116 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:588 msgid "Height" msgstr "高ã•" #: src/goocanvasellipse.c:131 #, fuzzy msgid "The height of the ellipse" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasgrid.c:109 #, fuzzy msgid "The x coordinate of the grid" msgstr "ウィジェット㮠X 座標" #: src/goocanvasgrid.c:117 #, fuzzy msgid "The y coordinate of the grid" msgstr "ウィジェット㮠Y 座標" #: src/goocanvasgrid.c:125 #, fuzzy msgid "The width of the grid" msgstr "ç”»åƒã®å¹…" #: src/goocanvasgrid.c:132 #, fuzzy msgid "The height of the grid" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:167 #, fuzzy msgid "The width of the horizontal grid lines" msgstr "長方形ã®å¹…" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:175 #, fuzzy msgid "The width of the vertical grid lines" msgstr "長方形ã®å¹…" #: src/goocanvasgrid.c:182 #, fuzzy msgid "Horizontal Grid Line Pattern" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:183 #, fuzzy msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasgrid.c:189 #, fuzzy msgid "Vertical Grid Line Pattern" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:190 #, fuzzy msgid "The cairo pattern to paint the vertical grid lines with" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasgrid.c:196 #, fuzzy msgid "Border Width" msgstr "矢å°ã®å¹…" #: src/goocanvasgrid.c:197 #, fuzzy msgid "The width of the border around the grid" msgstr "長方形ã®å¹…" #: src/goocanvasgrid.c:204 #, fuzzy msgid "Border Pattern" msgstr "ストローク用パターン" #: src/goocanvasgrid.c:205 #, fuzzy msgid "The cairo pattern to paint the border with" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasgrid.c:211 #, fuzzy msgid "Show Horizontal Grid Lines" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 #, fuzzy msgid "Show Vertical Grid Lines" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 #, fuzzy msgid "Vertical Grid Lines On Top" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 #, fuzzy msgid "Horizontal Grid Line Color" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:235 #, fuzzy msgid "The color to use for the horizontal grid lines" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:241 #, fuzzy msgid "Horizontal Grid Line Color RGBA" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:242 #, fuzzy msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:248 #, fuzzy msgid "Horizontal Grid Line Pixbuf" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:249 msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:255 #, fuzzy msgid "Vertical Grid Line Color" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:256 #, fuzzy msgid "The color to use for the vertical grid lines" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:262 #, fuzzy msgid "Vertical Grid Line Color RGBA" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:263 #, fuzzy msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:269 #, fuzzy msgid "Vertical Grid Line Pixbuf" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:270 #, fuzzy msgid "The pixbuf to use to draw the vertical grid lines" msgstr "キャンãƒã‚¹ã§ä½¿ã†å˜ä½" #: src/goocanvasgrid.c:276 #, fuzzy msgid "Border Color" msgstr "ストローク用ã®è‰²" #: src/goocanvasgrid.c:277 #, fuzzy msgid "The color to use for the border" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:283 #, fuzzy msgid "Border Color RGBA" msgstr "ストローク用ã®RGBA表ç¾ã®è‰²" #: src/goocanvasgrid.c:284 #, fuzzy msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:290 #, fuzzy msgid "Border Pixbuf" msgstr "ストローク用ã®Pixbuf" #: src/goocanvasgrid.c:291 #, fuzzy msgid "The pixbuf to use to draw the border" msgstr "テキストをé…ç½®ã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã™ã‚‹å¹…" #: src/goocanvasgroup.c:91 #, fuzzy msgid "The x coordinate of the group" msgstr "ç”»åƒã® X 座標" #: src/goocanvasgroup.c:99 #, fuzzy msgid "The y coordinate of the group" msgstr "ç”»åƒã® Y 座標" #: src/goocanvasgroup.c:107 #, fuzzy msgid "The width of the group, or -1 to use the default width" msgstr "è¦æ±‚ã™ã‚‹è¡¨ã®å¹…。デフォルトã®å¹…を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvasgroup.c:115 #, fuzzy msgid "The height of the group, or -1 to use the default height" msgstr "è¦æ±‚ã™ã‚‹è¡¨ã®é«˜ã•。デフォルトã®é«˜ã•を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvasimage.c:86 msgid "Pattern" msgstr "パターン" #: src/goocanvasimage.c:87 msgid "The cairo pattern to paint" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasimage.c:94 msgid "The x coordinate of the image" msgstr "ç”»åƒã® X 座標" #: src/goocanvasimage.c:102 msgid "The y coordinate of the image" msgstr "ç”»åƒã® Y 座標" #: src/goocanvasimage.c:110 msgid "The width of the image" msgstr "ç”»åƒã®å¹…" #: src/goocanvasimage.c:117 msgid "The height of the image" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasimage.c:123 #, fuzzy msgid "Scale To Fit" msgstr "Xæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«" #: src/goocanvasimage.c:124 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:130 msgid "Alpha" msgstr "" #: src/goocanvasimage.c:131 msgid "The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque." msgstr "" #: src/goocanvasimage.c:137 msgid "Pixbuf" msgstr "Pixbuf" #: src/goocanvasimage.c:138 msgid "The GdkPixbuf to display" msgstr "表示ã™ã‚‹GdkPixbuf" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "親" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "親アイテム" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "å¯è¦–性" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "ã„ã¤ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦‹ãˆã‚‹ã‹" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "å¯è¦–性ã®ã—ãã„値" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "アイテムãŒè¦‹ãˆã‚‹ã‚ˆã†ã«ãªã‚‹å€çއã®ã—ãã„値" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "変æ›" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "アイテムã®å¤‰æ›è¡Œåˆ—" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "ãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆ" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "ã„ã¤ã‚¢ã‚¤ãƒ†ãƒ ãŒãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆã‚’å—ã‘å–ã‚‹ã‹æŒ‡å®šã—ã¾ã™" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "タイトル" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "æ”¯æ´æŠ€è¡“ç”¨ã®çŸ­ã„文脈豊富ãªèª¬æ˜Ž" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "説明" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "æ”¯æ´æŠ€è¡“ç”¨ã®èª¬æ˜Ž" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "フォーカスå¯å¦" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "アイテムã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ãƒ•ォーカスをå—ã‘付ã‘ã‚‹ã‹ã©ã†ã‹" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 #, fuzzy msgid "The tooltip to display for the item" msgstr "アイテムを置ã行" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "親アイテムモデル" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "ストローク用パターン" #: src/goocanvasitemsimple.c:127 msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "" "アイテムã®å¢ƒç•Œç·šã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULL" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "塗りã¤ã¶ã—用パターン" #: src/goocanvasitemsimple.c:134 msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "アイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã®ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULL" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "塗りã¤ã¶ã—基準" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "アイテムã®ä¸€éƒ¨ãŒå¡—りã¤ã¶ã•れãŸã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "演算" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "使用ã™ã‚‹åˆæˆæ¼”ç®—" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "アンãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "使用ã™ã‚‹ã‚¢ãƒ³ãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹ãƒ¢ãƒ¼ãƒ‰" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "ç·šå¹…" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "アイテムã®å¢ƒç•Œç·šã«ä½¿ã†ç·šå¹…" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "ç·šã®é ‚点" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "使用ã™ã‚‹ç·šã®é ‚点ã®ã‚¹ã‚¿ã‚¤ãƒ«" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "ç·šã®çµåˆ" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "使用ã™ã‚‹ç·šã®çµåˆã®ã‚¹ã‚¿ã‚¤ãƒ«" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "ç•™ã‚ç¶™ãŽã®å¢ƒç•Œ" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" "使用ã™ã‚‹ç•™ã‚ç¶™ãŽã®æœ€å°è§’度 (度数)。ã“ã®å¢ƒç•Œå€¤ã‚ˆã‚Šä½Žã„å ´åˆã¯ããŽç¶™ãŽãŒä½¿ã‚れã¾" "ã™" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "ç·šã®ãƒ€ãƒƒã‚·ãƒ¥ (-)" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "使用ã™ã‚‹ãƒ€ãƒƒã‚·ãƒ¥ (-) ã®ãƒ‘ターン" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "フォント" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "テキストã«ä½¿ã†åŸºåº•フォント" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "フォント記述" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "使用ã™ã‚‹ãƒ•ォントを特定ã™ã‚‹å±žæ€§" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "ヒントメトリクス" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "フォントメトリクスã§ä½¿ã†ãƒ’ント" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "ストローク用ã®è‰²" #: src/goocanvasitemsimple.c:227 msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" "アイテムã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«" "ã™ã‚‹" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "ストローク用ã®RGBA表ç¾ã®è‰²" #: src/goocanvasitemsimple.c:234 msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" "32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-" "pattern'プロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "ストローク用ã®Pixbuf" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" "アイテムã®å¢ƒç•Œç·šã‚’æç”»ã™ã‚‹ãŸã‚ã«ä½¿ã†Pixbuf。æç”»ã—ãªã„å ´åˆã¯'stroke-" "pattern'プロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "塗りã¤ã¶ã—ã®è‰²" #: src/goocanvasitemsimple.c:248 msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" "アイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プ" "ロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "塗りã¤ã¶ã—用ã®RGBA表ç¾ã®è‰²" #: src/goocanvasitemsimple.c:255 msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" "32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•" "ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "塗りã¤ã¶ã—用Pixbuf" #: src/goocanvasitemsimple.c:262 msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" "アイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†Pixbuf。塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-" "pattern'プロパティをNULLã«ã™ã‚‹" # 「切り抜ã用ã€ã˜ã‚ƒãªãã¦ã€Œã‚¯ãƒªãƒƒãƒ”ングã€ã®æ–¹ãŒã„ã„? #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "切り抜ã用パス" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "切り抜ã用パスを指定ã™ã‚‹ãƒ‘スコマンドã®ãªã‚‰ã³" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "切り抜ã用塗りã¤ã¶ã—基準" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "アイテムã®ä¸€éƒ¨ãŒåˆ‡ã‚ŠæŠœã‹ã‚Œã¦ã„ã‚‹ã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "パスデータ" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "パスコマンドã®ãªã‚‰ã³" #: src/goocanvaspath.c:78 #, fuzzy msgid "The x coordinate of the path" msgstr "テキスト㮠X 座標" #: src/goocanvaspath.c:86 #, fuzzy msgid "The y coordinate of the path" msgstr "テキスト㮠Y 座標" #: src/goocanvaspath.c:94 #, fuzzy msgid "The width of the path" msgstr "ç”»åƒã®å¹…" #: src/goocanvaspath.c:101 #, fuzzy msgid "The height of the path" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "点" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "点ã®é…列" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "パスを閉ã˜ã‚‹" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "最後ã®ç‚¹ãŒæœ€åˆã®ç‚¹ã«çµã³ä»˜ã‘ã‚‹ã‹ã©ã†ã‹" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "始点矢å°" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "多線形ã®å§‹ç‚¹ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "終点矢å°" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "多線形ã®çµ‚点ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "矢å°ã®é•·ã•" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "矢å°ã®é•·ã• (ç·šå¹…ã®å€æ•°)" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "矢å°ã®å¹…" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "矢å°ã®å¹… (ç·šå¹…ã®å€æ•°)" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "矢å°ã®å…ˆç«¯ã®é•·ã•" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "矢å°ã®å…ˆç«¯ã®é•·ã• (ç·šå¹…ã®å€æ•°)" #: src/goocanvaspolyline.c:192 #, fuzzy msgid "The x coordinate of the left-most point of the polyline" msgstr "楕円ã®ä¸­å¿ƒã® X 座標" #: src/goocanvaspolyline.c:200 #, fuzzy msgid "The y coordinate of the top-most point of the polyline" msgstr "楕円ã®ä¸­å¿ƒã® Y 座標" #: src/goocanvaspolyline.c:208 #, fuzzy msgid "The width of the polyline" msgstr "ç”»åƒã®å¹…" #: src/goocanvaspolyline.c:215 #, fuzzy msgid "The height of the polyline" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "長方形ã®x座標" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "長方形ã®y座標" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "長方形ã®å¹…" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "長方形ã®é«˜ã•" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "丸角ã§ä½¿ã†æ°´å¹³åŠå¾„" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "丸角ã§ä½¿ã†åž‚ç›´åŠå¾„<" #: src/goocanvastable.c:237 msgid "Row Spacing" msgstr "行間ã®ç©ºç™½" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "行ã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½" #: src/goocanvastable.c:244 msgid "Column Spacing" msgstr "列間ã®ç©ºç™½" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "列ã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "å‡ä¸€ã®è¡Œ" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "å…¨ã¦ã®è¡Œã‚’åŒã˜é«˜ã•ã«ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "å‡ä¸€ã®åˆ—" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "å…¨ã¦ã®åˆ—ã‚’åŒã˜å¹…ã«ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "Xæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "最左・最å³ã‚»ãƒ«ã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "Yæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "最上・最下セルã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡" #: src/goocanvastable.c:277 msgid "The width of the grid line to draw between rows" msgstr "è¡Œé–“ã®æ ¼å­ç·šã®å¹…" #: src/goocanvastable.c:284 msgid "The width of the grid line to draw between columns" msgstr "åˆ—é–“ã®æ ¼å­ç·šã®å¹…" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "å·¦å´ãƒ‘ディング" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "アイテムã®å·¦å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "å³å´ãƒ‘ディング" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "アイテムã®å³å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "上部パディング" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "アイテムã®ä¸Šéƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "下部パディング" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "アイテムã®ä¸‹éƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:318 msgid "X Align" msgstr "X æ–¹å‘ã®é…ç½®" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "領域中ã®ã‚¢ã‚¤ãƒ†ãƒ ã®æ°´å¹³ä½ç½®ã€‚0.0 ã¯å·¦è©°ã‚ã€1.0 ã¯å³è©°ã‚ã§ã™" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "Y æ–¹å‘ã®é…ç½®" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "領域中内ã§ã®ã‚¢ã‚¤ãƒ†ãƒ ã®åž‚ç›´ä½ç½®ã€‚0.0 ã¯ä¸Šè©°ã‚ã€1.0 ã¯ä¸‹è©°ã‚ã§ã™" #: src/goocanvastable.c:331 msgid "Row" msgstr "行" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "アイテムを置ã行" #: src/goocanvastable.c:337 msgid "Column" msgstr "列" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "アイテムを置ã列" #: src/goocanvastable.c:343 msgid "Rows" msgstr "行数" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "アイテムãŒä½¿ã†è¡Œæ•°" #: src/goocanvastable.c:349 msgid "Columns" msgstr "列数" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "アイテムãŒä½¿ã†åˆ—æ•°" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "X æ–¹å‘ã®ä¼¸é•·" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "表ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’水平方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "X æ–¹å‘ã®å……å¡«" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "ã‚¢ã‚¤ãƒ†ãƒ ãŒæ°´å¹³é ˜åŸŸã„ã£ã±ã„使ã†ã‹ã©ã†ã‹" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "X æ–¹å‘ã®ç¸®å°" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "アイテムãŒè¦æ±‚ã•ã‚ŒãŸæ°´å¹³æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "Y æ–¹å‘ã®ä¼¸é•·" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "表ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’垂直方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "Y æ–¹å‘ã®å……å¡«" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "アイテムãŒåž‚直領域ã„ã£ã±ã„使ã†ã‹ã©ã†ã‹" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "Y æ–¹å‘ã®ç¸®å°" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "アイテムãŒè¦æ±‚ã•れãŸåž‚ç›´æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹" #: src/goocanvastext.c:94 msgid "Text" msgstr "テキスト" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "表示ã™ã‚‹ãƒ†ã‚­ã‚¹ãƒˆ" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "マークアップを使ã†" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "ç•°ãªã‚‹ã‚¹ã‚¿ã‚¤ãƒ«ã‚’使ã†ãŸã‚ã«ãƒ†ã‚­ã‚¹ãƒˆä¸­ã®PangoMarkupをパースã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "çœç•¥" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "文字列全体を表示ã™ã‚‹å ´æ‰€ãŒç„¡ã„ã¨ãã«æ–‡å­—列をçœç•¥ã™ã‚‹ã¹ã場所" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "折り返ã—" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "å¹…ãŒè¨­å®šã•れã¦ã„ã‚‹ã¨ãã«æ–‡å­—åˆ—ã®æŠ˜ã‚Šè¿”ã—ã«ä½¿ã†ã¹ã方法" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "テキスト㮠X 座標" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "テキスト㮠Y 座標" #: src/goocanvastext.c:142 #, fuzzy msgid "" "The width to use to layout the text, or -1 to let the text use as much " "horizontal space as needed" msgstr "è¦æ±‚ã™ã‚‹è¡¨ã®é«˜ã•。デフォルトã®é«˜ã•を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvastext.c:150 #, fuzzy msgid "" "The height to use to layout the text, or -1 to let the text use as much " "vertical space as needed" msgstr "è¦æ±‚ã™ã‚‹è¡¨ã®é«˜ã•。デフォルトã®é«˜ã•を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "与ãˆã‚‰ã‚ŒãŸ X/Y 座標ã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "é…ç½®" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹" #: src/goocanvaswidget.c:557 msgid "Widget" msgstr "ウィジェット" #: src/goocanvaswidget.c:558 msgid "The widget to place in the canvas" msgstr "キャンãƒã‚¹å†…ã«é…ç½®ã™ã‚‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆ" #: src/goocanvaswidget.c:565 msgid "The x coordinate of the widget" msgstr "ウィジェット㮠X 座標" #: src/goocanvaswidget.c:573 msgid "The y coordinate of the widget" msgstr "ウィジェット㮠Y 座標" #: src/goocanvaswidget.c:581 msgid "The width of the widget, or -1 to use its requested width" msgstr "ウィジェットã®å¹…。ウィジェットãŒè¦æ±‚ã•れã¦ã„る幅を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvaswidget.c:589 msgid "The height of the widget, or -1 to use its requested height" msgstr "ウィジェットã®é«˜ã•。ウィジェットãŒè¦æ±‚ã•れã¦ã„る高ã•を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvaswidget.c:598 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "アイテム㮠X/Y座標ã®è¨­å®šã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã‚’é…ç½®ã™ã‚‹ã‹" #~ msgid "The width to use to layout the text" #~ msgstr "テキストをé…ç½®ã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã™ã‚‹å¹…" goocanvas-1.0.0/po/Makefile.in.in0000644000076400007640000002020111512612651013504 00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # # This file file be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = @SHELL@ @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ libdir = @libdir@ localedir = $(libdir)/locale gnulocaledir = $(datadir)/locale gettextsrcdir = $(datadir)/glib-2.0/gettext/po subdir = po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ CC = @CC@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge DEFS = @DEFS@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ INCLUDES = -I.. -I$(top_srcdir)/intl COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) SOURCES = POFILES = @POFILES@ GMOFILES = @GMOFILES@ DISTFILES = LINGUAS ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ $(POFILES) $(GMOFILES) $(SOURCES) POTFILES = \ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ INSTOBJEXT = @INSTOBJEXT@ .SUFFIXES: .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat .c.o: $(COMPILE) $< .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && $(GENCAT) $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \ --add-comments --keyword=_ --keyword=N_ \ --keyword=C_:1c,2 \ --keyword=NC_:1c,2 \ --keyword=g_dngettext:2,3 \ --flag=N_:1:pass-c-format \ --flag=C_:2:pass-c-format \ --flag=NC_:2:pass-c-format \ --flag=g_dngettext:2:pass-c-format \ --flag=g_strdup_printf:1:c-format \ --flag=g_string_printf:2:c-format \ --flag=g_string_append_printf:2:c-format \ --flag=g_error_new:3:c-format \ --flag=g_set_error:4:c-format \ --flag=g_markup_printf_escaped:1:c-format \ --flag=g_log:3:c-format \ --flag=g_print:1:c-format \ --flag=g_printerr:1:c-format \ --flag=g_printf:1:c-format \ --flag=g_fprintf:2:c-format \ --flag=g_sprintf:2:c-format \ --flag=g_snprintf:3:c-format \ --flag=g_scanner_error:2:c-format \ --flag=g_scanner_warn:2:c-format \ --files-from=$(srcdir)/POTFILES.in \ && test ! -f $(GETTEXT_PACKAGE).po \ || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \ && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot ) install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ case "$$cat" in \ *.gmo) destdir=$(gnulocaledir);; \ *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $$dir; \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ fi; \ if test -r $$cat; then \ $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ else \ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ fi; \ if test -r $$cat.m; then \ $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ if test -r $(srcdir)/$$cat.m ; then \ $(INSTALL_DATA) $(srcdir)/$$cat.m \ $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ true; \ fi; \ fi; \ done if test "$(PACKAGE)" = "glib"; then \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ done if test "$(PACKAGE)" = "glib"; then \ rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ fi check: all dvi info tags TAGS ID: mostlyclean: rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(GMOFILES) distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) dist distdir: update-po $(DISTFILES) dists="$(DISTFILES)"; \ for file in $$dists; do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ cd $(srcdir); \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ echo "$$lang:"; \ if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$cat failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done # POTFILES is created from POTFILES.in by stripping comments, empty lines # and Intltool tags (enclosed in square brackets), and appending a full # relative path to them POTFILES: POTFILES.in ( if test 'x$(srcdir)' != 'x.'; then \ posrcprefix='$(top_srcdir)/'; \ else \ posrcprefix="../"; \ fi; \ rm -f $@-t $@ \ && (sed -e '/^#/d' \ -e "s/^\[.*\] +//" \ -e '/^[ ]*$$/d' \ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ | sed -e '$$s/\\$$//') > $@-t \ && chmod a-w $@-t \ && mv $@-t $@ ) Makefile: Makefile.in.in ../config.status POTFILES cd .. \ && $(SHELL) ./config.status $(subdir)/$@.in # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: goocanvas-1.0.0/po/en_GB.po0000644000076400007640000005675111512612234012364 00000000000000# English (British) translation for GooCanvas # Copyright (C) 2006 Damon Chaplin. # This file is distributed under the same license as the GooCanvas package. # Damon Chaplin , 2006. # msgid "" msgstr "" "Project-Id-Version: GooCanvas CVS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-01-10 14:15+0000\n" "PO-Revision-Date: 2006-04-24 16:26+0100\n" "Last-Translator: Damon Chaplin \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "" #: src/goocanvas.c:291 msgid "Scale X" msgstr "" #: src/goocanvas.c:292 msgid "The horizontal magnification factor of the canvas" msgstr "" #: src/goocanvas.c:298 msgid "Scale Y" msgstr "" #: src/goocanvas.c:299 msgid "The vertical magnification factor of the canvas" msgstr "" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:597 msgid "Anchor" msgstr "" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "" #: src/goocanvas.c:313 msgid "X1" msgstr "" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:321 msgid "Y1" msgstr "" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:329 msgid "X2" msgstr "" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:338 msgid "Y2" msgstr "" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "" #: src/goocanvas.c:362 msgid "Bounds Padding" msgstr "" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "" #: src/goocanvas.c:369 msgid "Units" msgstr "" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:394 msgid "Background Color" msgstr "" #: src/goocanvas.c:395 msgid "The color to use for the canvas background" msgstr "" #: src/goocanvas.c:401 msgid "Background Color RGB" msgstr "" #: src/goocanvas.c:402 msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:108 msgid "The x coordinate of the left side of the ellipse" msgstr "" #: src/goocanvasellipse.c:116 msgid "The y coordinate of the top of the ellipse" msgstr "" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:109 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:580 msgid "Width" msgstr "" #: src/goocanvasellipse.c:124 msgid "The width of the ellipse" msgstr "" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:116 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:588 msgid "Height" msgstr "" #: src/goocanvasellipse.c:131 msgid "The height of the ellipse" msgstr "" #: src/goocanvasgrid.c:109 msgid "The x coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:117 msgid "The y coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:125 msgid "The width of the grid" msgstr "" #: src/goocanvasgrid.c:132 msgid "The height of the grid" msgstr "" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "" #: src/goocanvasgrid.c:167 msgid "The width of the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "" #: src/goocanvasgrid.c:175 msgid "The width of the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:182 msgid "Horizontal Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:183 msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "" #: src/goocanvasgrid.c:189 msgid "Vertical Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:190 msgid "The cairo pattern to paint the vertical grid lines with" msgstr "" #: src/goocanvasgrid.c:196 msgid "Border Width" msgstr "" #: src/goocanvasgrid.c:197 msgid "The width of the border around the grid" msgstr "" #: src/goocanvasgrid.c:204 msgid "Border Pattern" msgstr "" #: src/goocanvasgrid.c:205 msgid "The cairo pattern to paint the border with" msgstr "" #: src/goocanvasgrid.c:211 msgid "Show Horizontal Grid Lines" msgstr "" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 msgid "Show Vertical Grid Lines" msgstr "" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 msgid "Vertical Grid Lines On Top" msgstr "" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 msgid "Horizontal Grid Line Color" msgstr "" #: src/goocanvasgrid.c:235 msgid "The color to use for the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:241 msgid "Horizontal Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:242 msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "" #: src/goocanvasgrid.c:248 msgid "Horizontal Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:249 msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:255 msgid "Vertical Grid Line Color" msgstr "" #: src/goocanvasgrid.c:256 msgid "The color to use for the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:262 msgid "Vertical Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:263 msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "" #: src/goocanvasgrid.c:269 msgid "Vertical Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:270 msgid "The pixbuf to use to draw the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:276 msgid "Border Color" msgstr "" #: src/goocanvasgrid.c:277 msgid "The color to use for the border" msgstr "" #: src/goocanvasgrid.c:283 msgid "Border Color RGBA" msgstr "" #: src/goocanvasgrid.c:284 msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "" #: src/goocanvasgrid.c:290 msgid "Border Pixbuf" msgstr "" #: src/goocanvasgrid.c:291 msgid "The pixbuf to use to draw the border" msgstr "" #: src/goocanvasgroup.c:91 msgid "The x coordinate of the group" msgstr "" #: src/goocanvasgroup.c:99 msgid "The y coordinate of the group" msgstr "" #: src/goocanvasgroup.c:107 msgid "The width of the group, or -1 to use the default width" msgstr "" #: src/goocanvasgroup.c:115 msgid "The height of the group, or -1 to use the default height" msgstr "" #: src/goocanvasimage.c:86 msgid "Pattern" msgstr "" #: src/goocanvasimage.c:87 msgid "The cairo pattern to paint" msgstr "" #: src/goocanvasimage.c:94 msgid "The x coordinate of the image" msgstr "" #: src/goocanvasimage.c:102 msgid "The y coordinate of the image" msgstr "" #: src/goocanvasimage.c:110 msgid "The width of the image" msgstr "" #: src/goocanvasimage.c:117 msgid "The height of the image" msgstr "" #: src/goocanvasimage.c:123 msgid "Scale To Fit" msgstr "" #: src/goocanvasimage.c:124 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:130 msgid "Alpha" msgstr "" #: src/goocanvasimage.c:131 msgid "The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque." msgstr "" #: src/goocanvasimage.c:137 msgid "Pixbuf" msgstr "" #: src/goocanvasimage.c:138 msgid "The GdkPixbuf to display" msgstr "" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 msgid "The tooltip to display for the item" msgstr "" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "" #: src/goocanvasitemsimple.c:127 msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "" #: src/goocanvasitemsimple.c:134 msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "" #: src/goocanvasitemsimple.c:227 msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:234 msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "" #: src/goocanvasitemsimple.c:248 msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:255 msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:262 msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "" #: src/goocanvaspath.c:78 msgid "The x coordinate of the path" msgstr "" #: src/goocanvaspath.c:86 msgid "The y coordinate of the path" msgstr "" #: src/goocanvaspath.c:94 msgid "The width of the path" msgstr "" #: src/goocanvaspath.c:101 msgid "The height of the path" msgstr "" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:192 msgid "The x coordinate of the left-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:200 msgid "The y coordinate of the top-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:208 msgid "The width of the polyline" msgstr "" #: src/goocanvaspolyline.c:215 msgid "The height of the polyline" msgstr "" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "" #: src/goocanvastable.c:237 msgid "Row Spacing" msgstr "" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "" #: src/goocanvastable.c:244 msgid "Column Spacing" msgstr "" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "" #: src/goocanvastable.c:277 msgid "The width of the grid line to draw between rows" msgstr "" #: src/goocanvastable.c:284 msgid "The width of the grid line to draw between columns" msgstr "" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "" #: src/goocanvastable.c:318 msgid "X Align" msgstr "" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "" #: src/goocanvastable.c:331 msgid "Row" msgstr "" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "" #: src/goocanvastable.c:337 msgid "Column" msgstr "" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "" #: src/goocanvastable.c:343 msgid "Rows" msgstr "" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "" #: src/goocanvastable.c:349 msgid "Columns" msgstr "" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "" #: src/goocanvastext.c:94 msgid "Text" msgstr "" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "" #: src/goocanvastext.c:142 msgid "" "The width to use to layout the text, or -1 to let the text use as much " "horizontal space as needed" msgstr "" #: src/goocanvastext.c:150 msgid "" "The height to use to layout the text, or -1 to let the text use as much " "vertical space as needed" msgstr "" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "" #: src/goocanvaswidget.c:557 msgid "Widget" msgstr "" #: src/goocanvaswidget.c:558 msgid "The widget to place in the canvas" msgstr "" #: src/goocanvaswidget.c:565 msgid "The x coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:573 msgid "The y coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:581 msgid "The width of the widget, or -1 to use its requested width" msgstr "" #: src/goocanvaswidget.c:589 msgid "The height of the widget, or -1 to use its requested height" msgstr "" #: src/goocanvaswidget.c:598 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "" goocanvas-1.0.0/po/es.gmo0000644000076400007640000003333511512612754012165 00000000000000Þ•¤<ß\ Ø ;Ù N dn u Œ © ¸ÂËÔ ã íøÿ  !!?*a+Œ ¸Ã Ó à ìöû   3CBYMœ!ê :,<gC¤Aè'*5R3ˆ0¼.í2 O\ e o y „™  ª²¹ÈÏØ á î û  / H Tas ‚•®Ë+ß! -Hhˆ! ÂCáB%h€;œ'Øi$j0:À<û98rŒ.§&Ö)ý&'N^t5‘Ç6åa~%’¸gØ"@.c8’!Ë8í&=9X-’ÀGÞ!&HH‘®IÍ-E!c…F¢é  $ * 5@UMuEà    ' . 7 : = E N U ^ a -d G’!lÚ! G"S" Y"c"!v"˜"¨"¸"Î"×"à"ý" ##$# -# :#,G#+t#6 #4×# $$7$J$\$o$v$$•$©$¾$Ð$@ç$I(%+r%)ž%7È%;&R<&P&.à&@'>P':'8Ê'4(8(I(Z(k(|((«(´( º(È(Ð(×(ê(ñ(ù( ) )),)1)7)3>)r)))¨)»)Í)Ó)&ê)*5!*W*m*$ˆ*.­*,Ü*% +"/+GR+Gš+â+ù+:,7K,‹ƒ,-2--<`-I-<ç-,$.,Q.@~. ¿.*à.' /3/B/!\/A~/À/>ß/r0‘0&¯0*Ö0•1—10³1:ä1)2<I2†2™29¯2$é23S(3|3Q™3ë34R4$n4“4­4Ê4Rá445M5U5e5u5 ~5 ‹5—5$­5HÒ5H6d6l6r6 ƒ6Ž6 —6£6¦6 ©6 ·6Â6 Ë6×6Ú6œNDe˜‡j}v*\‰_[$žŠ ;4f…#I6d| —z‘‹SlG0) yZg% T!'PC8mO¡šw&ŒRsXaWV.Ku?={p3^“£€+bFEQ Ž•"2L(’‚t”r™: i/c–ox„qŸ†]›-hƒJ`<7k~@59M1AˆU¤n¢B>Y,HA description of the item for use by assistive technologiesA short context-rich description of the item for use by assistive technologiesAlignmentAnchorAntialiasArrow LengthArrow Tip LengthArrow WidthBottom PaddingCan FocusCenter XCenter YClip Fill RuleClip PathClose PathColumnColumnsDescriptionEnd ArrowExtra space to add above the itemExtra space to add below the itemExtra space to add to the left of the itemExtra space to add to the right of the itemFill ColorFill Color RGBAFill PatternFill PixbufFill RuleFontFont DescriptionHeightHint MetricsHomogenous ColumnsHomogenous RowsHow to align the textHow to position the text relative to the given x and y coordinatesHow to position the widget relative to the item's x and y coordinate settingsIf all columns are the same widthIf all rows are the same heightIf an arrow should be displayed at the end of the polylineIf an arrow should be displayed at the start of the polylineIf the item can shrink smaller than its requested size horizontallyIf the item can shrink smaller than its requested size verticallyIf the item can take the keyboard focusIf the item expands horizontally as the table expandsIf the item expands vertically as the table expandsIf the item fills all horizontal allocated spaceIf the item fills all vertical allocated spaceIf the last point should be connected to the firstLeft PaddingLine CapLine DashLine JoinLine WidthMiter LimitOperatorParentPath DataPatternPixbufPointer EventsPointsRadius XRadius YResolution XResolution YRight PaddingRowRowsScaleSpecifies when the item receives pointer eventsStart ArrowStroke ColorStroke Color RGBAStroke PatternStroke PixbufTextThe GdkPixbuf to displayThe antialiasing mode to useThe array of pointsThe attributes specifying which font to useThe base font to use for the textThe cairo pattern to paintThe column to place the item inThe compositing operator to useThe dash pattern to useThe default space between columnsThe default space between rowsThe fill rule used to determine which parts of the item are clippedThe fill rule used to determine which parts of the item are filledThe height of the imageThe height of the rectangleThe height of the widget, or -1 to use its requested heightThe hinting to be used for font metricsThe horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-alignedThe horizontal radius of the ellipseThe horizontal radius to use for rounded cornersThe horizontal resolution of the display, in dots per inchThe length of the arrow tip, as a multiple of the line widthThe length of the arrows, as a multiple of the line widthThe line cap style to useThe line join style to useThe line width to use for the item's perimeterThe magnification factor of the canvasThe number of columns that the item spansThe number of rows that the item spansThe parent itemThe parent item modelThe row to place the item inThe scale threshold at which the item becomes visibleThe sequence of path commandsThe sequence of path commands specifying the clip pathThe smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limitThe text to displayThe transformation matrix of the itemThe units to use for the canvasThe vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-alignedThe vertical radius of the ellipseThe vertical radius to use for rounded cornersThe vertical resolution of the display, in dots per inchThe widget to place in the canvasThe width of the arrows, as a multiple of the line widthThe width of the imageThe width of the rectangleThe width of the widget, or -1 to use its requested widthThe x coordinate of the center of the ellipseThe x coordinate of the imageThe x coordinate of the left edge of the canvas bounds, in canvas unitsThe x coordinate of the rectangleThe x coordinate of the right edge of the canvas bounds, in canvas unitsThe x coordinate of the textThe x coordinate of the widgetThe y coordinate of the bottom edge of the canvas bounds, in canvas unitsThe y coordinate of the center of the ellipseThe y coordinate of the imageThe y coordinate of the rectangleThe y coordinate of the textThe y coordinate of the top edge of the canvas bounds, in canvas unitsThe y coordinate of the widgetTitleTop PaddingTransformUnitsUse MarkupVisibilityVisibility ThresholdWhen the canvas item is visibleWhere to place the canvas when it is smaller than the widget's allocated areaWhether to parse PangoMarkup in the text, to support different stylesWidgetWidthX AlignX ExpandX FillX ShrinkX1X2Y AlignY ExpandY FillY ShrinkY1Y2Project-Id-Version: GooCanvas CVS Report-Msgid-Bugs-To: POT-Creation-Date: 2011-01-10 14:15+0000 PO-Revision-Date: 2006-04-24 16:26+0100 Last-Translator: Rafael Villar Burke Language-Team: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Descripción del elemento para su uso por tecnologías de accesibilidadDescripción del elemento, breve pero indicativa del contexto, para su uso por tecnologías de accesibilidadAlineaciónAnclaAntialiasLongitud de flechaLongitud de la punta de la flechaAncho de flechaMargen inferiorPuede recibir el focoCentro XCentro YRegla de recorte con rellenoFigura de recorteCerrar TrazoColumnaColumnasDescripciónFlecha finalEspacio adicional añadido sobre el elementoEspacio adicional añadido bajo el elementoEspacio adicional añadido a la izquierda del elementoEspacio adicional añadido a la derecha del elementoColor de rellenoRGBA del color de rellenoPatrón de rellenoPixbuf de rellenoRegla de rellenadoFuenteDescripción de la fuenteAltoMétrica de hintingColumnas homogéneasFilas homogéneasCómo alinear el textoCómo situar el texto en relación a las coordenadas x e y dadasCómo situar el control en relación a las coordenadas x e y del elementoSi todas las columnas poseen el mismo anchoSi todas las filas poseen la misma alturaSi se debe mostrar una flecha al final de la polilíneaSi se debe mostrar una flecha al principio de la polilíneaSi el elemento puede reducirse horizontalmente por debajo de su tamaño solicitadoSi el elemento puede reducirse verticalmente por debajo de su tamaño solicitadoSi el elemento puede tomar el foco del tecladoSi el elemento se expande horizontalmente al expandirse la tablaSi el elemento se expande verticalmente al expandirse la tablaSi el elemento rellena todo el espacio horizontal asignadoSi el elemento rellena todo el espacio vertical asignadoSi el último punto se ha de conectar con el primeroMargen izquierdoRemate de líneaRayado de líneaUnión de líneaGrosor de líneaLímite para unión a ingleteOperadorPadreDato de trazoPatrónPixbufEventos de punteroPuntosRadio XRadio YResolución XResolución YMargen derechoFilaFilasEscalaEspecifica si el elemento recibe eventos de punteroFlecha inicialColor de trazoRGBA del color de trazoPatrón de trazadoPixbuf de trazadoTextoGdkPixbuf para mostrarModo de antialiasing que se ha de usarLista de puntosAtributos que especifican la fuente que se ha de usarFuente base del textoPatrón cairo para dibujarColumna en la que situar el elementoOperador de composición que se ha de utilizarPatrón de rayas de línea que se ha de usarEspacio predeterminado entre columnasEspacio predeterminado entre filasRegla de rellenado para determinar qué partes del elemento se recortanRegla de rellenado para determinar qué partes del elemento se rellenanAltura de la la imagenAltura del rectánguloAltura del control, o -1 para usar el tamaño que soliciteHinting que se han de usar para la medición de fuentesPosición horizontal del elemento dentro del espacio que le ha sido asignado. 0.0 es alineado a la izquierda y 1.0 es alineado a la derechaRadio horizontal de la elipseRadio horizontal para usar en esquinas redondeadasResolución horizontal de la pantalla, en puntos por pulgadaLa longitud de la punta de la flecha, como múltiplo del grosor de líneaLongitud de las flechas, como múltiplo del grosor de líneaEstilo de remate de línea que se ha de usarEstilo de unión de línea que se ha de usarGrosor de línea que se ha de usar en el perímetro del elementoFactor de ampliación del lienzoNúmero de columnas que abarca el elementoNúmero de filas que abarca el elementoElemento padreModelo del elemento padreFila en la que situar el elementoEl umbral de escala a partir del cual el elemento se hace visibleSecuencia de órdenes de trazoSecuencia de órdenes de para especificar la figura de recorteEl ángulo mínimo para usar uniones a inglete, en grados. Se usarán uniones biseladas por debajo de este límiteEl texto que se ha de mostrarMatriz de transformación del elementoUnidades que se han de usar para el lienzoPosición vertical del elemento dentro del espacio que le ha sido asignado. 0.0 es alineado a la parte superior y 1.0 es alineado a la parte inferiorRadio vertical de la elipseRadio vertical para usar en esquinas redondeadasResolución vertical de la pantalla, en puntos por pulgadaControl que se ha de colocar en el lienzoEl ancho de las flechas, como múltiplo del grosor de líneaAncho de la imagenAncho del rectánguloAncho del control, o -1 para usar el tamaño que soliciteCoordenada x del centro de la elipseCoordenada x de la imagenCoordenada x del borde izquierdo de los límites del lienzo, en unidades del lienzoCoordenada x del rectánguloCoordenada x del borde derecho de los límites del lienzo, en unidades del lienzoCoordenada x del textoCoordenada x del controlCoordenada y del borde inferior de los límites del lienzo, en unidades del lienzoCoordenada y del centro de la elipseCoordenada y de la imagenCoordenada y del rectánguloCoordenada y del textoCoordenada y del borde superior de los límites del lienzo, en unidades del lienzoCoordenada y del controlTítuloMargen superiorTransformaciónUnidadesUsar marcadoVisibilidadUmbral de visibilidadSi el elemento del lienzo es visibleDónde situar el lienzo cuando es menor que el área asignada al controlSi se ha de usar PangoMarkup en el texto, para admitir distintos estilosControlAnchoAlineación en XExpandir XLlenar XDisminuir XX1X2Alineación YExpandir YLlenar YDisminuir YY1Y2goocanvas-1.0.0/po/es.po0000644000076400007640000007767011512612234012024 00000000000000# Spanish translation for GooCanvas # This file is distributed under the same license as the GooCanvas package. # msgid "" msgstr "" "Project-Id-Version: GooCanvas CVS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-01-10 14:15+0000\n" "PO-Revision-Date: 2006-04-24 16:26+0100\n" "Last-Translator: Rafael Villar Burke \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "Escala" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "Factor de ampliación del lienzo" #: src/goocanvas.c:291 #, fuzzy msgid "Scale X" msgstr "Escala" #: src/goocanvas.c:292 #, fuzzy msgid "The horizontal magnification factor of the canvas" msgstr "Factor de ampliación del lienzo" #: src/goocanvas.c:298 #, fuzzy msgid "Scale Y" msgstr "Escala" #: src/goocanvas.c:299 #, fuzzy msgid "The vertical magnification factor of the canvas" msgstr "Factor de ampliación del lienzo" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:597 msgid "Anchor" msgstr "Ancla" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "Dónde situar el lienzo cuando es menor que el área asignada al control" #: src/goocanvas.c:313 msgid "X1" msgstr "X1" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "" "Coordenada x del borde izquierdo de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:321 msgid "Y1" msgstr "Y1" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "" "Coordenada y del borde superior de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:329 msgid "X2" msgstr "X2" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "" "Coordenada x del borde derecho de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:338 msgid "Y2" msgstr "Y2" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "" "Coordenada y del borde inferior de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "" #: src/goocanvas.c:362 #, fuzzy msgid "Bounds Padding" msgstr "Margen superior" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "" #: src/goocanvas.c:369 msgid "Units" msgstr "Unidades" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "Unidades que se han de usar para el lienzo" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "Resolución X" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "Resolución horizontal de la pantalla, en puntos por pulgada" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "Resolución Y" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "Resolución vertical de la pantalla, en puntos por pulgada" #: src/goocanvas.c:394 msgid "Background Color" msgstr "" #: src/goocanvas.c:395 #, fuzzy msgid "The color to use for the canvas background" msgstr "Unidades que se han de usar para el lienzo" #: src/goocanvas.c:401 #, fuzzy msgid "Background Color RGB" msgstr "RGBA del color de trazo" #: src/goocanvas.c:402 #, fuzzy msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "Centro X" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "Coordenada x del centro de la elipse" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "Centro Y" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "Coordenada y del centro de la elipse" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "Radio X" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "Radio horizontal de la elipse" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "Radio Y" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "Radio vertical de la elipse" #: src/goocanvasellipse.c:108 #, fuzzy msgid "The x coordinate of the left side of the ellipse" msgstr "Coordenada x del centro de la elipse" #: src/goocanvasellipse.c:116 #, fuzzy msgid "The y coordinate of the top of the ellipse" msgstr "Coordenada y del centro de la elipse" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:109 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:580 msgid "Width" msgstr "Ancho" #: src/goocanvasellipse.c:124 #, fuzzy msgid "The width of the ellipse" msgstr "Ancho de la imagen" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:116 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:588 msgid "Height" msgstr "Alto" #: src/goocanvasellipse.c:131 #, fuzzy msgid "The height of the ellipse" msgstr "Altura de la la imagen" #: src/goocanvasgrid.c:109 #, fuzzy msgid "The x coordinate of the grid" msgstr "Coordenada x del control" #: src/goocanvasgrid.c:117 #, fuzzy msgid "The y coordinate of the grid" msgstr "Coordenada y del control" #: src/goocanvasgrid.c:125 #, fuzzy msgid "The width of the grid" msgstr "Ancho de la imagen" #: src/goocanvasgrid.c:132 #, fuzzy msgid "The height of the grid" msgstr "Altura de la la imagen" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "" #: src/goocanvasgrid.c:167 #, fuzzy msgid "The width of the horizontal grid lines" msgstr "Ancho del rectángulo" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "" #: src/goocanvasgrid.c:175 #, fuzzy msgid "The width of the vertical grid lines" msgstr "Ancho del rectángulo" #: src/goocanvasgrid.c:182 msgid "Horizontal Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:183 #, fuzzy msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "Patrón cairo para dibujar" #: src/goocanvasgrid.c:189 msgid "Vertical Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:190 #, fuzzy msgid "The cairo pattern to paint the vertical grid lines with" msgstr "Patrón cairo para dibujar" #: src/goocanvasgrid.c:196 #, fuzzy msgid "Border Width" msgstr "Ancho de flecha" #: src/goocanvasgrid.c:197 #, fuzzy msgid "The width of the border around the grid" msgstr "Ancho del rectángulo" #: src/goocanvasgrid.c:204 #, fuzzy msgid "Border Pattern" msgstr "Patrón de trazado" #: src/goocanvasgrid.c:205 #, fuzzy msgid "The cairo pattern to paint the border with" msgstr "Patrón cairo para dibujar" #: src/goocanvasgrid.c:211 msgid "Show Horizontal Grid Lines" msgstr "" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 msgid "Show Vertical Grid Lines" msgstr "" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 msgid "Vertical Grid Lines On Top" msgstr "" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 msgid "Horizontal Grid Line Color" msgstr "" #: src/goocanvasgrid.c:235 #, fuzzy msgid "The color to use for the horizontal grid lines" msgstr "Color para usar en el perímetro del elemento" #: src/goocanvasgrid.c:241 msgid "Horizontal Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:242 #, fuzzy msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasgrid.c:248 msgid "Horizontal Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:249 #, fuzzy msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "Pixbuf que se ha de usar para dibujar el perímetro del elemento" #: src/goocanvasgrid.c:255 msgid "Vertical Grid Line Color" msgstr "" #: src/goocanvasgrid.c:256 #, fuzzy msgid "The color to use for the vertical grid lines" msgstr "Unidades que se han de usar para el lienzo" #: src/goocanvasgrid.c:262 #, fuzzy msgid "Vertical Grid Line Color RGBA" msgstr "RGBA del color de trazo" #: src/goocanvasgrid.c:263 #, fuzzy msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasgrid.c:269 msgid "Vertical Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:270 #, fuzzy msgid "The pixbuf to use to draw the vertical grid lines" msgstr "Pixbuf que se ha de usar para dibujar el perímetro del elemento" #: src/goocanvasgrid.c:276 #, fuzzy msgid "Border Color" msgstr "Color de trazo" #: src/goocanvasgrid.c:277 #, fuzzy msgid "The color to use for the border" msgstr "Color para usar en el perímetro del elemento" #: src/goocanvasgrid.c:283 #, fuzzy msgid "Border Color RGBA" msgstr "RGBA del color de trazo" #: src/goocanvasgrid.c:284 #, fuzzy msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasgrid.c:290 #, fuzzy msgid "Border Pixbuf" msgstr "Pixbuf de trazado" #: src/goocanvasgrid.c:291 #, fuzzy msgid "The pixbuf to use to draw the border" msgstr "Pixbuf que se ha de usar para dibujar el perímetro del elemento" #: src/goocanvasgroup.c:91 #, fuzzy msgid "The x coordinate of the group" msgstr "Coordenada x de la imagen" #: src/goocanvasgroup.c:99 #, fuzzy msgid "The y coordinate of the group" msgstr "Coordenada y de la imagen" #: src/goocanvasgroup.c:107 #, fuzzy msgid "The width of the group, or -1 to use the default width" msgstr "Ancho solicitado de la tabla, o -1 para usar el ancho predeterminado" #: src/goocanvasgroup.c:115 #, fuzzy msgid "The height of the group, or -1 to use the default height" msgstr "Altura solicitada de la tabla, o -1 para usar la altura predefinida" #: src/goocanvasimage.c:86 msgid "Pattern" msgstr "Patrón" #: src/goocanvasimage.c:87 msgid "The cairo pattern to paint" msgstr "Patrón cairo para dibujar" #: src/goocanvasimage.c:94 msgid "The x coordinate of the image" msgstr "Coordenada x de la imagen" #: src/goocanvasimage.c:102 msgid "The y coordinate of the image" msgstr "Coordenada y de la imagen" #: src/goocanvasimage.c:110 msgid "The width of the image" msgstr "Ancho de la imagen" #: src/goocanvasimage.c:117 msgid "The height of the image" msgstr "Altura de la la imagen" #: src/goocanvasimage.c:123 #, fuzzy msgid "Scale To Fit" msgstr "Escala" #: src/goocanvasimage.c:124 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:130 msgid "Alpha" msgstr "" #: src/goocanvasimage.c:131 msgid "The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque." msgstr "" #: src/goocanvasimage.c:137 msgid "Pixbuf" msgstr "Pixbuf" #: src/goocanvasimage.c:138 msgid "The GdkPixbuf to display" msgstr "GdkPixbuf para mostrar" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "Padre" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "Elemento padre" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "Visibilidad" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "Si el elemento del lienzo es visible" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "Umbral de visibilidad" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "El umbral de escala a partir del cual el elemento se hace visible" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "Transformación" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "Matriz de transformación del elemento" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "Eventos de puntero" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "Especifica si el elemento recibe eventos de puntero" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "Título" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "" "Descripción del elemento, breve pero indicativa del contexto, para su uso " "por tecnologías de accesibilidad" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "Descripción" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "Descripción del elemento para su uso por tecnologías de accesibilidad" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "Puede recibir el foco" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "Si el elemento puede tomar el foco del teclado" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 #, fuzzy msgid "The tooltip to display for the item" msgstr "Fila en la que situar el elemento" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "Modelo del elemento padre" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "Patrón de trazado" #: src/goocanvasitemsimple.c:127 #, fuzzy msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "El patrón utilizado para dibujar el perímetro del elemento" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "Patrón de relleno" #: src/goocanvasitemsimple.c:134 #, fuzzy msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "Patrón usado para pintar el interior del elemento" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "Regla de rellenado" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "Regla de rellenado para determinar qué partes del elemento se rellenan" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "Operador" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "Operador de composición que se ha de utilizar" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "Antialias" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "Modo de antialiasing que se ha de usar" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "Grosor de línea" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "Grosor de línea que se ha de usar en el perímetro del elemento" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "Remate de línea" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "Estilo de remate de línea que se ha de usar" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "Unión de línea" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "Estilo de unión de línea que se ha de usar" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "Límite para unión a inglete" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" "El ángulo mínimo para usar uniones a inglete, en grados. Se usarán uniones " "biseladas por debajo de este límite" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "Rayado de línea" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "Patrón de rayas de línea que se ha de usar" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "Fuente" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "Fuente base del texto" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "Descripción de la fuente" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "Atributos que especifican la fuente que se ha de usar" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "Métrica de hinting" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "Hinting que se han de usar para la medición de fuentes" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "Color de trazo" #: src/goocanvasitemsimple.c:227 #, fuzzy msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "RGBA del color de trazo" #: src/goocanvasitemsimple.c:234 #, fuzzy msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "Pixbuf de trazado" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "Color de relleno" #: src/goocanvasitemsimple.c:248 #, fuzzy msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" "Color que se ha de usar para pintar el interior del elemento, especificado " "como un valor entero de 32-bits" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "RGBA del color de relleno" #: src/goocanvasitemsimple.c:255 #, fuzzy msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" "Color que se ha de usar para pintar el interior del elemento, especificado " "como un valor entero de 32-bits" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "Pixbuf de relleno" #: src/goocanvasitemsimple.c:262 #, fuzzy msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "El pixbuf que se ha de usar para pintar el interior del elemento" #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "Figura de recorte" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "Secuencia de órdenes de para especificar la figura de recorte" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "Regla de recorte con relleno" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "Regla de rellenado para determinar qué partes del elemento se recortan" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "Dato de trazo" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "Secuencia de órdenes de trazo" #: src/goocanvaspath.c:78 #, fuzzy msgid "The x coordinate of the path" msgstr "Coordenada x del texto" #: src/goocanvaspath.c:86 #, fuzzy msgid "The y coordinate of the path" msgstr "Coordenada y del texto" #: src/goocanvaspath.c:94 #, fuzzy msgid "The width of the path" msgstr "Ancho de la imagen" #: src/goocanvaspath.c:101 #, fuzzy msgid "The height of the path" msgstr "Altura de la la imagen" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "Puntos" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "Lista de puntos" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "Cerrar Trazo" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "Si el último punto se ha de conectar con el primero" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "Flecha inicial" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "Si se debe mostrar una flecha al principio de la polilínea" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "Flecha final" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "Si se debe mostrar una flecha al final de la polilínea" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "Longitud de flecha" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "Longitud de las flechas, como múltiplo del grosor de línea" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "Ancho de flecha" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "El ancho de las flechas, como múltiplo del grosor de línea" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "Longitud de la punta de la flecha" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "" "La longitud de la punta de la flecha, como múltiplo del grosor de línea" #: src/goocanvaspolyline.c:192 #, fuzzy msgid "The x coordinate of the left-most point of the polyline" msgstr "Coordenada x del centro de la elipse" #: src/goocanvaspolyline.c:200 #, fuzzy msgid "The y coordinate of the top-most point of the polyline" msgstr "Coordenada y del centro de la elipse" #: src/goocanvaspolyline.c:208 #, fuzzy msgid "The width of the polyline" msgstr "Ancho de la imagen" #: src/goocanvaspolyline.c:215 #, fuzzy msgid "The height of the polyline" msgstr "Altura de la la imagen" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "Coordenada x del rectángulo" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "Coordenada y del rectángulo" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "Ancho del rectángulo" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "Altura del rectángulo" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "Radio horizontal para usar en esquinas redondeadas" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "Radio vertical para usar en esquinas redondeadas" #: src/goocanvastable.c:237 #, fuzzy msgid "Row Spacing" msgstr "Espacio entre filas" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "Espacio predeterminado entre filas" #: src/goocanvastable.c:244 #, fuzzy msgid "Column Spacing" msgstr "Espacio entre columnas" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "Espacio predeterminado entre columnas" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "Filas homogéneas" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "Si todas las filas poseen la misma altura" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "Columnas homogéneas" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "Si todas las columnas poseen el mismo ancho" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "" #: src/goocanvastable.c:277 #, fuzzy msgid "The width of the grid line to draw between rows" msgstr "Ancho del rectángulo" #: src/goocanvastable.c:284 #, fuzzy msgid "The width of the grid line to draw between columns" msgstr "Espacio predeterminado entre columnas" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "Margen izquierdo" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "Espacio adicional añadido a la izquierda del elemento" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "Margen derecho" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "Espacio adicional añadido a la derecha del elemento" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "Margen superior" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "Espacio adicional añadido sobre el elemento" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "Margen inferior" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "Espacio adicional añadido bajo el elemento" #: src/goocanvastable.c:318 msgid "X Align" msgstr "Alineación en X" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "" "Posición horizontal del elemento dentro del espacio que le ha sido asignado. " "0.0 es alineado a la izquierda y 1.0 es alineado a la derecha" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "Alineación Y" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "" "Posición vertical del elemento dentro del espacio que le ha sido asignado. " "0.0 es alineado a la parte superior y 1.0 es alineado a la parte inferior" #: src/goocanvastable.c:331 msgid "Row" msgstr "Fila" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "Fila en la que situar el elemento" #: src/goocanvastable.c:337 msgid "Column" msgstr "Columna" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "Columna en la que situar el elemento" #: src/goocanvastable.c:343 msgid "Rows" msgstr "Filas" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "Número de filas que abarca el elemento" #: src/goocanvastable.c:349 msgid "Columns" msgstr "Columnas" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "Número de columnas que abarca el elemento" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "Expandir X" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "Si el elemento se expande horizontalmente al expandirse la tabla" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "Llenar X" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "Si el elemento rellena todo el espacio horizontal asignado" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "Disminuir X" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "" "Si el elemento puede reducirse horizontalmente por debajo de su tamaño " "solicitado" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "Expandir Y" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "Si el elemento se expande verticalmente al expandirse la tabla" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "Llenar Y" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "Si el elemento rellena todo el espacio vertical asignado" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "Disminuir Y" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "" "Si el elemento puede reducirse verticalmente por debajo de su tamaño " "solicitado" #: src/goocanvastext.c:94 msgid "Text" msgstr "Texto" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "El texto que se ha de mostrar" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "Usar marcado" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "" "Si se ha de usar PangoMarkup en el texto, para admitir distintos estilos" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "Coordenada x del texto" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "Coordenada y del texto" #: src/goocanvastext.c:142 #, fuzzy msgid "" "The width to use to layout the text, or -1 to let the text use as much " "horizontal space as needed" msgstr "Altura solicitada de la tabla, o -1 para usar la altura predefinida" #: src/goocanvastext.c:150 #, fuzzy msgid "" "The height to use to layout the text, or -1 to let the text use as much " "vertical space as needed" msgstr "Altura solicitada de la tabla, o -1 para usar la altura predefinida" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "Cómo situar el texto en relación a las coordenadas x e y dadas" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "Alineación" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "Cómo alinear el texto" #: src/goocanvaswidget.c:557 msgid "Widget" msgstr "Control" #: src/goocanvaswidget.c:558 msgid "The widget to place in the canvas" msgstr "Control que se ha de colocar en el lienzo" #: src/goocanvaswidget.c:565 msgid "The x coordinate of the widget" msgstr "Coordenada x del control" #: src/goocanvaswidget.c:573 msgid "The y coordinate of the widget" msgstr "Coordenada y del control" #: src/goocanvaswidget.c:581 msgid "The width of the widget, or -1 to use its requested width" msgstr "Ancho del control, o -1 para usar el tamaño que solicite" #: src/goocanvaswidget.c:589 msgid "The height of the widget, or -1 to use its requested height" msgstr "Altura del control, o -1 para usar el tamaño que solicite" #: src/goocanvaswidget.c:598 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "" "Cómo situar el control en relación a las coordenadas x e y del elemento" #~ msgid "The width to use to layout the text" #~ msgstr "Ancho para disponer el texto" #~ msgid "The color to use to paint the interior of the item" #~ msgstr "Color usado para pintar el interior del elemento" goocanvas-1.0.0/aclocal.m40000644000076400007640000122613111512612654012272 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 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. # 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.65],, [m4_warning([this file was generated for autoconf 2.65. 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'.])]) # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # # Modified to never use included libintl. # Owen Taylor , 12/15/1998 # # Major rework to remove unused code # Owen Taylor , 12/11/2002 # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 # # Modified to require ngettext # Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT AC_PREREQ(2.53) dnl dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl m4_copy([AC_DEFUN],[glib_DEFUN]) m4_copy([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. dnl # GLIB_LC_MESSAGES #-------------------- glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) # GLIB_PATH_PROG_WITH_TEST #---------------------------- dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], dnl NLS is obligatory [USE_NLS=yes AC_SUBST(USE_NLS) gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], [return !ngettext ("","", 1)], gt_cv_func_ngettext_libc=yes, gt_cv_func_ngettext_libc=no) ]) if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, [AC_TRY_LINK([ #include ], [return !dgettext ("","")], gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no) ]) fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dgettext, gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset AC_CHECK_FUNCS(bind_textdomain_codeset) LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then AC_DEFINE(HAVE_GETTEXT,1, [Define if the GNU gettext() function is already present or preinstalled.]) GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_SUBST(MSGFMT_OPTS) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share and dnl and CATOBJEXT=.gmo in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac]) LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi ]) if test "$gt_cv_have_gettext" = "yes" ; then AC_DEFINE(ENABLE_NLS, 1, [always defined to indicate that i18n is enabled]) fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(PO_IN_DATADIR_TRUE) AC_SUBST(PO_IN_DATADIR_FALSE) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) # AM_GLIB_GNU_GETTEXT # ------------------- # Do checks necessary for use of gettext. If a suitable implementation # of gettext is found in either in libintl or in the C library, # it will set INTLLIBS to the libraries needed for use of gettext # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl glib_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_HEADER_STDC])dnl GLIB_LC_MESSAGES GLIB_WITH_NLS if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" AC_DEFINE_UNQUOTED($1, "$localedir", [Define the location where the catalogs will be installed]) ]) dnl dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_in,[],[ AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) # # Create a temporary file with TEST-FILE as its contents and pass the # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with # 0 and perform ACTION-IF-FAIL for any other exit status. AC_DEFUN([GLIB_RUN_PROG], [cat >conftest.foo <<_ACEOF $2 _ACEOF if AC_RUN_LOG([$1 conftest.foo]); then m4_ifval([$3], [$3], [:]) m4_ifvaln([$4], [else $4])dnl echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first dnl check for tools we added during development AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 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 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 56 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_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 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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 _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_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])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 _LT_PROG_ECHO_BACKSLASH 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 # Sed substitution that helps us do robust quoting. It backslashifies # 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' # 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_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 # 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], [[!?.]$], [], [.]) )]) # _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 "X$][$1" | $Xsed -e "$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 "X$" | $Xsed -e "$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' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_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]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 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) 2008 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. if test "$no_create" != yes; then 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) fi ])# 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) 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)], [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 # _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([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)]) 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], []) # _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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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" ]) 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" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # 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 _LT_TAGVAR(whole_archive_flag_spec, $1)='' _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=echo _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 # ----------------------- # 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. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # 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 if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _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 __oline__ "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 ;; sparc*-*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*) LD="${LD-ld} -m elf64_sparc" ;; *) 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_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) 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 \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _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_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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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; ;; 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 ;; 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"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$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 __oline__ "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 void fnord() { int i=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; /* 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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 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 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # 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 -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # 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; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` 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 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 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=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux 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,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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 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 ;; freebsd1*) dynamic_linker=no ;; 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[[123]]*) 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 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 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' ;; interix[[3-9]]*) 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' 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 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 Linux ELF. linux* | k*bsd*-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' 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 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], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # 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 # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # 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;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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' ;; 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 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 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 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 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 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 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([], [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 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 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 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 ;; 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]) 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 Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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_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_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. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) 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:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $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:__oline__: 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_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-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 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _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([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};"\ " /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 # 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 #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. */ 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_save_LIBS="$LIBS" lt_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_save_LIBS" CFLAGS="$lt_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 _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_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)= AC_MSG_CHECKING([for $compiler option to produce PIC]) 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)= ;; 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 ;; 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) 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*) # IBM XL 8.0 on PPC _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*) ;; *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*) # 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' ;; 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 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) 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' ;; pgcc* | pgf77* | pgf90* | pgf95*) # 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*) # IBM XL C 8.0/Fortran 10.1 on PPC _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)='-Wl,' ;; *Sun\ F*) # 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)='' ;; 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*) _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_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # 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]) # # 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_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' 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 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")) && ([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*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ 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_flag_spec_ld, $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 ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = 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 *\ [[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.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _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(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/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' 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 ;; 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) 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= 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$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]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; 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; $ECHO \"$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*) # 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)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) 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 $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' 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 $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 ;; 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 $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 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 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")) && ([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 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 _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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 _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' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _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. _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 `$ECHO "X$deplibs" | $Xsed -e '\''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(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; 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 ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${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_flag_spec_ld, $1)='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${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' ;; *) _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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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*) 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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_MSG_CHECKING([whether -lc should be explicitly linked in]) $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_TAGVAR(archive_cmds_need_lc, $1)=no else _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* AC_MSG_RESULT([$_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_flag_spec_ld], [1], [[If ld is used when linking, 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([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _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([], [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 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_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX 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 popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _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], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl 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_flag_spec_ld, $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(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_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++"} 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 -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -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 "\-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 _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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 _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' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _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*) # _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(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 ;; 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 ;; freebsd[[12]]*) # 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*) ;; 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; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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; $ECHO "X$list" | $Xsed' ;; *) 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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -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) 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; $ECHO "X$list" | $Xsed' _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 | $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 | $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 | $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will 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; $ECHO \"$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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # 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; $ECHO \"$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='echo' # 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=echo 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${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 "\-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*) # 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='echo' # 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 -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 -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 "\-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 "\-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(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 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_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 # 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 ]) 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 $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 else prev= fi if test "$pre_test_object_deps_done" = no; then case $p 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 ;; *.$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 # 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*) # 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_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _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_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _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_flag_spec_ld, $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(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 CC=${F77-"f77"} 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" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _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_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _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_flag_spec_ld, $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(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 CC=${FC-"f95"} 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" 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_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} 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 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" ])# _LT_LANG_GCJ_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_GCC=$GCC GCC= CC=${RC-"windres"} 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" ])# _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_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_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"}, \ = c,a/b,, \ && 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_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # 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_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}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # 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 () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # 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 "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) # Helper functions for option handling. -*- 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 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], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [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], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [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. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _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 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 4 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_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) 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])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 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. # 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.1], [], [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.1])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 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. # 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 # 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 10 # 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'. 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 ;; 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='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])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 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. # 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 # 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 am_maintainer_other 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 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. # 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 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_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 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. # 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 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_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 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. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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 goocanvas-1.0.0/Makefile.am0000644000076400007640000000036011412723611012452 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = src demo docs po # require automake 1.7 AUTOMAKE_OPTIONS = 1.7 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = goocanvas.pc EXTRA_DIST = goocanvas.pc.in autogen.sh goocanvas-1.0.0/TODO0000644000076400007640000000627111412723611011115 00000000000000 NOTE: I am no longer actively developing GooCanvas, so no major new features will be added (unless a new maintainer takes over). I'll still try to fix any bugs that appear though, and may accept minor patches. Bugs: o I need to check the bounds are being calculated correctly so that they are correct for all zoom settings. Since cairo uses fixed point maths and I think only calculates up to a certain tolerance there might be slight errors in our gdouble results. So as the canvas is scaled this could eventually lead to the bounds being a pixel out, leading to painting errors. Maybe we should extend any bounds returned from cairo slightly to cover the maximum possible errors. Features definitely needed: o API for modifying GooCanvasPath data. o Editable text item - a port of GtkTextView. o Need a function to setup a given cairo context with the defaults settings of a GooCanvas, e.g. default line width. o Check canvas and all items can be completely configured with properties so that GtkBuilder can be used to load hierarchies of items/models. Add "root-item" and "root-item-model" properties? Will GtkBuilder be able to handle the tree of items/models like that? What about GUI builders? How can gradients be specified by object properties? Possible additional features: o Need a way to efficiently notify items about changes in canvas scale, if they request it. Could use something similar to the update flags. o Change GooCanvasStyle so it doesn't expose GValues in the API. Use get/set_boolean/int/double/boxed() instead. o Drag-and-Drop - probably copy all the GTK+ widget signals so items can implement their own behavior. o Caching of rendered items to improve performance. Items would have a cache option with choices like Never, Always and WhenVisible. But don't use caches when printing. o Filters like in SVG, to add graphical effects. o Support using the same item in different places, like SVG 'use'. o Support using system color names, like SVG, e.g. "ActiveBorder". This helps you write widget-like items that fit in with the rest of GTK+. o "scale-line-width" boolean property to specify if the line width scales with the canvas? The item bounds will change at different scale settings. o Arrows on path items, just like on polyline. Requests from GTK+ people: o Use separate GooCanvasContainer[Model] interfaces? May help bindings. o GooCanvasWidget width & height are redundant - use widget's requested size. o Make PathCommand and LineDash structs opaque. o Use floating flag and sink() for objects. o Use 1-byte integer percentage for xalign/yalign instead of doubles? o Make it easy to add a border and background to items. "border-width", "border-color" and "background-color" properties? Might also need "x-pad", "y-pad", "x-radius", "y-radius" etc. Maybe have a related border item. Note that we only have the bounds in device coords, so drawing a border of a rotated item would be awkward. (Maybe we store the user bounds somewhere.) o Link/URL item, or enable URLs in the markup of text items. o A button item, with different children displayed for different states, maybe with optional automatic prelighting. goocanvas-1.0.0/src/0000755000076400007640000000000011512612761011272 500000000000000goocanvas-1.0.0/src/goocanvasrect.h0000644000076400007640000000720511412723611014221 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasrect.h - rectangle item. */ #ifndef __GOO_CANVAS_RECT_H__ #define __GOO_CANVAS_RECT_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasRectData GooCanvasRectData; struct _GooCanvasRectData { gdouble x, y, width, height, radius_x, radius_y; }; #define GOO_TYPE_CANVAS_RECT (goo_canvas_rect_get_type ()) #define GOO_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_RECT, GooCanvasRect)) #define GOO_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_RECT, GooCanvasRectClass)) #define GOO_IS_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_RECT)) #define GOO_IS_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_RECT)) #define GOO_CANVAS_RECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_RECT, GooCanvasRectClass)) typedef struct _GooCanvasRect GooCanvasRect; typedef struct _GooCanvasRectClass GooCanvasRectClass; /** * GooCanvasRect * * The #GooCanvasRect-struct struct contains private data only. */ struct _GooCanvasRect { GooCanvasItemSimple parent; GooCanvasRectData *rect_data; }; struct _GooCanvasRectClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_rect_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); #define GOO_TYPE_CANVAS_RECT_MODEL (goo_canvas_rect_model_get_type ()) #define GOO_CANVAS_RECT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_RECT_MODEL, GooCanvasRectModel)) #define GOO_CANVAS_RECT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_RECT_MODEL, GooCanvasRectModelClass)) #define GOO_IS_CANVAS_RECT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_RECT_MODEL)) #define GOO_IS_CANVAS_RECT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_RECT_MODEL)) #define GOO_CANVAS_RECT_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_RECT_MODEL, GooCanvasRectModelClass)) typedef struct _GooCanvasRectModel GooCanvasRectModel; typedef struct _GooCanvasRectModelClass GooCanvasRectModelClass; /** * GooCanvasRectModel * * The #GooCanvasRectModel-struct struct contains private data only. */ struct _GooCanvasRectModel { GooCanvasItemModelSimple parent_object; GooCanvasRectData rect_data; }; struct _GooCanvasRectModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_rect_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_rect_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_CANVAS_RECT_H__ */ goocanvas-1.0.0/src/goocanvasmarshal.list0000644000076400007640000000021011412723611015424 00000000000000VOID:VOID VOID:INT VOID:INT,INT VOID:BOOLEAN VOID:OBJECT,OBJECT BOOLEAN:BOXED BOOLEAN:OBJECT,BOXED BOOLEAN:DOUBLE,DOUBLE,BOOLEAN,OBJECT goocanvas-1.0.0/src/goocanvaspath.c0000644000076400007640000006257611412723611014227 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspath.c - a path item, very similar to the SVG path element. */ /** * SECTION:goocanvaspath * @Title: GooCanvasPath * @Short_Description: a path item (a series of lines and curves). * * GooCanvasPath represents a path item, which is a series of one or more * lines, bezier curves, or elliptical arcs. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * #GooCanvasPath uses the same path specification strings as the Scalable * Vector Graphics (SVG) path element. For details see the * SVG specification. * * To create a #GooCanvasPath use goo_canvas_path_new(). * * To get or set the properties of an existing #GooCanvasPath, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvaspath.h" #include "goocanvas.h" enum { PROP_0, PROP_DATA, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasPath, goo_canvas_path, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_path_install_common_properties (GObjectClass *gobject_class) { /** * GooCanvasPath:data * * The sequence of path commands, specified as a string using the same syntax * as in the Scalable Vector * Graphics (SVG) path element. */ g_object_class_install_property (gobject_class, PROP_DATA, g_param_spec_string ("data", _("Path Data"), _("The sequence of path commands"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the path"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the path"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the path"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the path"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_path_init (GooCanvasPath *path) { path->path_data = g_slice_new0 (GooCanvasPathData); } /** * goo_canvas_path_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @path_data: the sequence of path commands, specified as a string using the * same syntax as in the Scalable * Vector Graphics (SVG) path element. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new path item. * * * * Here's an example showing how to create a red line from (20,20) to (40,40): * * * GooCanvasItem *path = goo_canvas_path_new (mygroup, * "M 20 20 L 40 40", * "stroke-color", "red", * NULL); * * * This example creates a cubic bezier curve from (20,100) to (100,100) with * the control points at (20,50) and (100,50): * * * GooCanvasItem *path = goo_canvas_path_new (mygroup, * "M20,100 C20,50 100,50 100,100", * "stroke-color", "blue", * NULL); * * * This example uses an elliptical arc to create a filled circle with one * quarter missing: * * * GooCanvasItem *path = goo_canvas_path_new (mygroup, * "M200,500 h-150 a150,150 0 1,0 150,-150 z", * "fill-color", "red", * "stroke-color", "blue", * "line-width", 5.0, * NULL); * * * Returns: a new path item. **/ GooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent, const gchar *path_data, ...) { GooCanvasItem *item; GooCanvasPath *path; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_PATH, NULL); path = (GooCanvasPath*) item; path->path_data->path_commands = goo_canvas_parse_path_data (path_data); va_start (var_args, path_data); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_path_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPath *path = (GooCanvasPath*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { if (path->path_data->path_commands) g_array_free (path->path_data->path_commands, TRUE); g_slice_free (GooCanvasPathData, path->path_data); } path->path_data = NULL; G_OBJECT_CLASS (goo_canvas_path_parent_class)->finalize (object); } static void goo_canvas_path_common_get_extent (GooCanvas *canvas, GooCanvasPathData *path_data, GooCanvasBounds *bounds) { cairo_t *cr; cr = goo_canvas_create_cairo_context (canvas); goo_canvas_create_path (path_data->path_commands, cr); cairo_fill_extents (cr, &bounds->x1, &bounds->y1, &bounds->x2, &bounds->y2); cairo_destroy (cr); } /* Moves all the absolute points in the command by the given amounts. Relative points don't need to be moved. */ static void goo_canvas_path_move_command (GooCanvasPathCommand *cmd, gdouble x_offset, gdouble y_offset) { switch (cmd->simple.type) { case GOO_CANVAS_PATH_MOVE_TO: case GOO_CANVAS_PATH_CLOSE_PATH: case GOO_CANVAS_PATH_LINE_TO: case GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: case GOO_CANVAS_PATH_VERTICAL_LINE_TO: if (!cmd->simple.relative) { cmd->simple.x += x_offset; cmd->simple.y += y_offset; } break; case GOO_CANVAS_PATH_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_CURVE_TO: case GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: if (!cmd->curve.relative) { cmd->curve.x += x_offset; cmd->curve.y += y_offset; cmd->curve.x1 += x_offset; cmd->curve.y1 += y_offset; cmd->curve.x2 += x_offset; cmd->curve.y2 += y_offset; } break; case GOO_CANVAS_PATH_ELLIPTICAL_ARC: if (!cmd->arc.relative) { cmd->arc.x += x_offset; cmd->arc.y += y_offset; } break; default: g_assert_not_reached(); break; } } /* Scales all the points in the command by the given amounts. Absolute points are scaled about the given origin. */ static void goo_canvas_path_scale_command (GooCanvasPathCommand *cmd, gdouble x_origin, gdouble y_origin, gdouble x_scale, gdouble y_scale) { switch (cmd->simple.type) { case GOO_CANVAS_PATH_MOVE_TO: case GOO_CANVAS_PATH_CLOSE_PATH: case GOO_CANVAS_PATH_LINE_TO: case GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: case GOO_CANVAS_PATH_VERTICAL_LINE_TO: if (cmd->simple.relative) { cmd->simple.x *= x_scale; cmd->simple.y *= y_scale; } else { cmd->simple.x = x_origin + (cmd->simple.x - x_origin) * x_scale; cmd->simple.y = y_origin + (cmd->simple.y - y_origin) * y_scale; } break; case GOO_CANVAS_PATH_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_CURVE_TO: case GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: if (cmd->curve.relative) { cmd->curve.x *= x_scale; cmd->curve.y *= y_scale; cmd->curve.x1 *= x_scale; cmd->curve.y1 *= y_scale; cmd->curve.x2 *= x_scale; cmd->curve.y2 *= y_scale; } else { cmd->curve.x = x_origin + (cmd->curve.x - x_origin) * x_scale; cmd->curve.y = y_origin + (cmd->curve.y - y_origin) * y_scale; cmd->curve.x1 = x_origin + (cmd->curve.x1 - x_origin) * x_scale; cmd->curve.y1 = y_origin + (cmd->curve.y1 - y_origin) * y_scale; cmd->curve.x2 = x_origin + (cmd->curve.x2 - x_origin) * x_scale; cmd->curve.y2 = y_origin + (cmd->curve.y2 - y_origin) * y_scale; } break; case GOO_CANVAS_PATH_ELLIPTICAL_ARC: if (cmd->arc.relative) { cmd->arc.x *= x_scale; cmd->arc.y *= y_scale; } else { cmd->arc.x = x_origin + (cmd->arc.x - x_origin) * x_scale; cmd->arc.y = y_origin + (cmd->arc.y - y_origin) * y_scale; } break; default: g_assert_not_reached(); break; } } static void goo_canvas_path_get_common_property (GObject *object, GooCanvas *canvas, GooCanvasPathData *path_data, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasBounds extent; switch (prop_id) { case PROP_X: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.x1); break; case PROP_Y: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.y1); break; case PROP_WIDTH: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.x2 - extent.x1); break; case PROP_HEIGHT: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.y2 - extent.y1); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_path_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPath *path = (GooCanvasPath*) object; goo_canvas_path_get_common_property (object, simple->canvas, path->path_data, prop_id, value, pspec); } static void goo_canvas_path_set_common_property (GObject *object, GooCanvas *canvas, GooCanvasPathData *path_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasBounds extent; GooCanvasPathCommand *cmd; gdouble x_offset, y_offset, x_scale, y_scale; guint i; switch (prop_id) { case PROP_DATA: if (path_data->path_commands) g_array_free (path_data->path_commands, TRUE); path_data->path_commands = goo_canvas_parse_path_data (g_value_get_string (value)); g_object_notify (object, "x"); g_object_notify (object, "y"); g_object_notify (object, "width"); g_object_notify (object, "height"); break; case PROP_X: if (path_data->path_commands->len > 0) { /* Calculate the x offset from the current position. */ goo_canvas_path_common_get_extent (canvas, path_data, &extent); x_offset = g_value_get_double (value) - extent.x1; /* Add the offset to all the absolute x coordinates. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_move_command (cmd, x_offset, 0.0); } g_object_notify (object, "data"); } break; case PROP_Y: if (path_data->path_commands->len > 0) { /* Calculate the y offset from the current position. */ goo_canvas_path_common_get_extent (canvas, path_data, &extent); y_offset = g_value_get_double (value) - extent.y1; /* Add the offset to all the absolute y coordinates. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_move_command (cmd, 0.0, y_offset); } g_object_notify (object, "data"); } break; case PROP_WIDTH: if (path_data->path_commands->len >= 2) { goo_canvas_path_common_get_extent (canvas, path_data, &extent); if (extent.x2 - extent.x1 != 0.0) { /* Calculate the amount to scale the path. */ x_scale = g_value_get_double (value) / (extent.x2 - extent.x1); /* Scale the x coordinates, relative to the left-most point. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_scale_command (cmd, extent.x1, 0.0, x_scale, 1.0); } g_object_notify (object, "data"); } } break; case PROP_HEIGHT: if (path_data->path_commands->len >= 2) { goo_canvas_path_common_get_extent (canvas, path_data, &extent); if (extent.y2 - extent.y1 != 0.0) { /* Calculate the amount to scale the polyline. */ y_scale = g_value_get_double (value) / (extent.y2 - extent.y1); /* Scale the y coordinates, relative to the top-most point. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_scale_command (cmd, 0.0, extent.y1, 1.0, y_scale); } g_object_notify (object, "data"); } } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_path_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPath *path = (GooCanvasPath*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_path_set_common_property (object, simple->canvas, path->path_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_path_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasPath *path = (GooCanvasPath*) simple; goo_canvas_create_path (path->path_data->path_commands, cr); } static gboolean goo_canvas_path_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPointerEvents pointer_events = GOO_CANVAS_EVENTS_ALL; gboolean do_fill; /* By default only check the fill if a fill color/pattern is specified. */ do_fill = goo_canvas_style_set_fill_options (simple_data->style, cr); if (!do_fill) pointer_events &= ~GOO_CANVAS_EVENTS_FILL_MASK; /* If is_pointer_event is set use the pointer_events property instead. */ if (is_pointer_event) pointer_events = simple_data->pointer_events; goo_canvas_path_create_path (simple, cr); if (goo_canvas_item_simple_check_in_path (simple, x, y, cr, pointer_events)) return TRUE; return FALSE; } static void goo_canvas_path_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasPath *path = (GooCanvasPath*) item; GooCanvasPathModel *emodel = (GooCanvasPathModel*) model; /* If our data was allocated, free it. */ if (!simple->model) { if (path->path_data->path_commands) g_array_free (path->path_data->path_commands, TRUE); g_slice_free (GooCanvasPathData, path->path_data); } /* Now use the new model's data instead. */ path->path_data = &emodel->path_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_path_set_model; } static void goo_canvas_path_class_init (GooCanvasPathClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_path_finalize; gobject_class->get_property = goo_canvas_path_get_property; gobject_class->set_property = goo_canvas_path_set_property; simple_class->simple_create_path = goo_canvas_path_create_path; simple_class->simple_is_item_at = goo_canvas_path_is_item_at; goo_canvas_path_install_common_properties (gobject_class); } /** * SECTION:goocanvaspathmodel * @Title: GooCanvasPathModel * @Short_Description: a model for path items (a series of lines and curves). * * GooCanvasPathModel represents a model for path items, which are a series of * one or more lines, bezier curves, or elliptical arcs. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * #GooCanvasPathModel uses the same path specification strings as the Scalable * Vector Graphics (SVG) path element. For details see the * SVG specification. * * To create a #GooCanvasPathModel use goo_canvas_path_model_new(). * * To get or set the properties of an existing #GooCanvasPathModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the path you must connect * to the signal handlers of the corresponding #GooCanvasPath objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_path_model_finalize (GObject *object); static void goo_canvas_path_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_path_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasPathModel, goo_canvas_path_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_path_model_class_init (GooCanvasPathModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->finalize = goo_canvas_path_model_finalize; gobject_class->get_property = goo_canvas_path_model_get_property; gobject_class->set_property = goo_canvas_path_model_set_property; goo_canvas_path_install_common_properties (gobject_class); } static void goo_canvas_path_model_init (GooCanvasPathModel *pmodel) { } /** * goo_canvas_path_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @path_data: the sequence of path commands, specified as a string using the * same syntax as in the Scalable * Vector Graphics (SVG) path element. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new path model. * * * * Here's an example showing how to create a red line from (20,20) to (40,40): * * * GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, * "M 20 20 L 40 40", * "stroke-color", "red", * NULL); * * * This example creates a cubic bezier curve from (20,100) to (100,100) with * the control points at (20,50) and (100,50): * * * GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, * "M20,100 C20,50 100,50 100,100", * "stroke-color", "blue", * NULL); * * * This example uses an elliptical arc to create a filled circle with one * quarter missing: * * * GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, * "M200,500 h-150 a150,150 0 1,0 150,-150 z", * "fill-color", "red", * "stroke-color", "blue", * "line-width", 5.0, * NULL); * * * Returns: a new path model. **/ GooCanvasItemModel* goo_canvas_path_model_new (GooCanvasItemModel *parent, const gchar *path_data, ...) { GooCanvasItemModel *model; GooCanvasPathModel *pmodel; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_PATH_MODEL, NULL); pmodel = (GooCanvasPathModel*) model; pmodel->path_data.path_commands = goo_canvas_parse_path_data (path_data); va_start (var_args, path_data); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_path_model_finalize (GObject *object) { GooCanvasPathModel *pmodel = (GooCanvasPathModel*) object; if (pmodel->path_data.path_commands) g_array_free (pmodel->path_data.path_commands, TRUE); G_OBJECT_CLASS (goo_canvas_path_model_parent_class)->finalize (object); } static void goo_canvas_path_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPathModel *pmodel = (GooCanvasPathModel*) object; goo_canvas_path_get_common_property (object, NULL, &pmodel->path_data, prop_id, value, pspec); } static void goo_canvas_path_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasPathModel *pmodel = (GooCanvasPathModel*) object; goo_canvas_path_set_common_property (object, NULL, &pmodel->path_data, prop_id, value, pspec); g_signal_emit_by_name (pmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_path_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_PATH, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_path_model_create_item; } goocanvas-1.0.0/src/goocanvaswidget.c0000644000076400007640000004173011412723611014543 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaswidget.c - wrapper item for an embedded GtkWidget. */ /** * SECTION:goocanvaswidget * @Title: GooCanvasWidget * @Short_Description: an embedded widget item. * * GooCanvasWidget provides support for placing any GtkWidget in the canvas. * * The #GooCanvasWidget:width and #GooCanvasWidget:height properties specify * the widget's size. If either of them is -1, then the requested size of the * widget is used instead, which is the default for both width and height. * * Note that there are a number of limitations in the use of #GooCanvasWidget: * * * It doesn't support any transformation besides simple translation. * This means you can't scale a canvas with a #GooCanvasWidget in it. * * It doesn't support layering, so you can't place other items beneath * or above the #GooCanvasWidget. * * It doesn't support rendering of widgets to a given cairo_t, which * means you can't output the widget to a pdf or postscript file. * * It doesn't have a model/view variant like the other standard items, * so it can only be used in a simple canvas without a model. * * It can't be made a static item. * */ #include #include #include #include "goocanvas.h" #include "goocanvasatk.h" enum { PROP_0, PROP_WIDGET, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_ANCHOR, PROP_VISIBILITY }; static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_widget_dispose (GObject *object); static void goo_canvas_widget_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_widget_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasWidget, goo_canvas_widget, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_widget_init (GooCanvasWidget *witem) { /* By default we place the widget at the top-left of the canvas at its requested size. */ witem->x = 0.0; witem->y = 0.0; witem->width = -1.0; witem->height = -1.0; witem->anchor = GTK_ANCHOR_NW; } /** * goo_canvas_widget_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @widget: the widget. * @x: the x coordinate of the item. * @y: the y coordinate of the item. * @width: the width of the item, or -1 to use the widget's requested width. * @height: the height of the item, or -1 to use the widget's requested height. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new widget item. * * * * Here's an example showing how to create an entry widget centered at (100.0, * 100.0): * * * GtkWidget *entry = gtk_entry_new (); * GooCanvasItem *witem = goo_canvas_widget_new (mygroup, entry, * 100, 100, -1, -1, * "anchor", GTK_ANCHOR_CENTER, * NULL); * * * Returns: a new widget item. **/ GooCanvasItem* goo_canvas_widget_new (GooCanvasItem *parent, GtkWidget *widget, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooCanvasWidget *witem; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_WIDGET, NULL); witem = (GooCanvasWidget*) item; witem->widget = widget; g_object_ref (witem->widget); g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", witem); witem->x = x; witem->y = y; witem->width = width; witem->height = height; /* The widget defaults to being visible, like the canvas item, but this can be overridden by the object property below. */ if (widget) gtk_widget_show (widget); va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* Returns the anchor position, within the given width. */ static gdouble goo_canvas_widget_anchor_horizontal_pos (GtkAnchorType anchor, gdouble width) { switch(anchor) { case GTK_ANCHOR_N: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_S: return width / 2.0; case GTK_ANCHOR_NE: case GTK_ANCHOR_E: case GTK_ANCHOR_SE: return width; default: return 0.0; } } /* Returns the anchor position, within the given height. */ static gdouble goo_canvas_widget_anchor_vertical_pos (GtkAnchorType anchor, gdouble height) { switch (anchor) { case GTK_ANCHOR_W: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_E: return height / 2.0; case GTK_ANCHOR_SW: case GTK_ANCHOR_S: case GTK_ANCHOR_SE: return height; default: return 0.0; } } /* Returns the size to use for the widget, either the item's width & height properties or the widget's own requested width & height. */ static void goo_canvas_widget_get_widget_size (GooCanvasWidget *witem, gdouble *width, gdouble *height) { GtkRequisition requisition; if (witem->widget) { /* Get the widget's requested size, if we need it. */ if (witem->width < 0 || witem->height < 0) gtk_widget_size_request (witem->widget, &requisition); *width = witem->width < 0 ? requisition.width : witem->width; *height = witem->height < 0 ? requisition.height : witem->height; } else { *width = *height = 0.0; } } static void goo_canvas_widget_set_widget (GooCanvasWidget *witem, GtkWidget *widget) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) witem; if (witem->widget) { g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", NULL); gtk_widget_unparent (witem->widget); g_object_unref (witem->widget); witem->widget = NULL; } if (widget) { witem->widget = widget; g_object_ref (witem->widget); g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", witem); if (simple->simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE) gtk_widget_hide (widget); else gtk_widget_show (widget); if (simple->canvas) { #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_get_realized (GTK_WIDGET (simple->canvas))) #else if (GTK_WIDGET_REALIZED (simple->canvas)) #endif gtk_widget_set_parent_window (widget, simple->canvas->canvas_window); gtk_widget_set_parent (widget, GTK_WIDGET (simple->canvas)); } } } static void goo_canvas_widget_dispose (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasWidget *witem = (GooCanvasWidget*) object; if (simple->canvas) goo_canvas_unregister_widget_item (simple->canvas, witem); goo_canvas_widget_set_widget (witem, NULL); G_OBJECT_CLASS (goo_canvas_widget_parent_class)->dispose (object); } static void goo_canvas_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasWidget *witem = (GooCanvasWidget*) object; switch (prop_id) { case PROP_WIDGET: g_value_set_object (value, witem->widget); break; case PROP_X: g_value_set_double (value, witem->x); break; case PROP_Y: g_value_set_double (value, witem->y); break; case PROP_WIDTH: g_value_set_double (value, witem->width); break; case PROP_HEIGHT: g_value_set_double (value, witem->height); break; case PROP_ANCHOR: g_value_set_enum (value, witem->anchor); break; case PROP_VISIBILITY: g_value_set_enum (value, simple->simple_data->visibility); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasWidget *witem = (GooCanvasWidget*) object; switch (prop_id) { case PROP_WIDGET: goo_canvas_widget_set_widget (witem, g_value_get_object (value)); break; case PROP_X: witem->x = g_value_get_double (value); break; case PROP_Y: witem->y = g_value_get_double (value); break; case PROP_WIDTH: witem->width = g_value_get_double (value); break; case PROP_HEIGHT: witem->height = g_value_get_double (value); break; case PROP_ANCHOR: witem->anchor = g_value_get_enum (value); break; case PROP_VISIBILITY: simple->simple_data->visibility = g_value_get_enum (value); if (simple->simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE) gtk_widget_hide (witem->widget); else gtk_widget_show (witem->widget); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_widget_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasWidget *witem = (GooCanvasWidget*) item; if (simple->canvas != canvas) { if (simple->canvas) goo_canvas_unregister_widget_item (simple->canvas, witem); simple->canvas = canvas; if (simple->canvas) { goo_canvas_register_widget_item (simple->canvas, witem); if (witem->widget) { #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_get_realized (GTK_WIDGET (simple->canvas))) #else if (GTK_WIDGET_REALIZED (simple->canvas)) #endif gtk_widget_set_parent_window (witem->widget, simple->canvas->canvas_window); gtk_widget_set_parent (witem->widget, GTK_WIDGET (simple->canvas)); } } else { if (witem->widget) gtk_widget_unparent (witem->widget); } } } static void goo_canvas_widget_set_parent (GooCanvasItem *item, GooCanvasItem *parent) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvas *canvas; simple->parent = parent; simple->need_update = TRUE; simple->need_entire_subtree_update = TRUE; canvas = parent ? goo_canvas_item_get_canvas (parent) : NULL; goo_canvas_widget_set_canvas (item, canvas); } static void goo_canvas_widget_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasWidget *witem = (GooCanvasWidget*) simple; gdouble width, height; if (witem->widget) { goo_canvas_widget_get_widget_size (witem, &width, &height); simple->bounds.x1 = witem->x; simple->bounds.y1 = witem->y; simple->bounds.x1 -= goo_canvas_widget_anchor_horizontal_pos (witem->anchor, width); simple->bounds.y1 -= goo_canvas_widget_anchor_vertical_pos (witem->anchor, height); simple->bounds.x2 = simple->bounds.x1 + width; simple->bounds.y2 = simple->bounds.y1 + height; /* Queue a resize of the widget so it gets moved. Note that the widget is moved by goo_canvas_size_allocate(). */ gtk_widget_queue_resize (witem->widget); } else { simple->bounds.x1 = simple->bounds.y1 = 0.0; simple->bounds.x2 = simple->bounds.y2 = 0.0; } } static void goo_canvas_widget_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasWidget *witem = (GooCanvasWidget*) item; gdouble requested_width, requested_height, allocated_width, allocated_height; gdouble width_proportion, height_proportion; gdouble width, height; width = simple->bounds.x2 - simple->bounds.x1; height = simple->bounds.y2 - simple->bounds.y1; simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; requested_width = requested_area->x2 - requested_area->x1; requested_height = requested_area->y2 - requested_area->y1; allocated_width = allocated_area->x2 - allocated_area->x1; allocated_height = allocated_area->y2 - allocated_area->y1; width_proportion = allocated_width / requested_width; height_proportion = allocated_height / requested_height; width *= width_proportion; height *= height_proportion; simple->bounds.x2 = simple->bounds.x1 + width; simple->bounds.y2 = simple->bounds.y1 + height; /* Queue a resize of the widget so it gets moved. Note that the widget is moved by goo_canvas_size_allocate(). */ gtk_widget_queue_resize (witem->widget); } static void goo_canvas_widget_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { /* Do nothing for now. Maybe render for printing in future. */ } static gboolean goo_canvas_widget_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { /* For now we just assume that the widget covers its entire bounds so we just return TRUE. In future if widget items support transforms we'll need to modify this. */ return TRUE; } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_canvas = goo_canvas_widget_set_canvas; iface->set_parent = goo_canvas_widget_set_parent; iface->allocate_area = goo_canvas_widget_allocate_area; } static void goo_canvas_widget_class_init (GooCanvasWidgetClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->dispose = goo_canvas_widget_dispose; gobject_class->get_property = goo_canvas_widget_get_property; gobject_class->set_property = goo_canvas_widget_set_property; simple_class->simple_update = goo_canvas_widget_update; simple_class->simple_paint = goo_canvas_widget_paint; simple_class->simple_is_item_at = goo_canvas_widget_is_item_at; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS_WIDGET, goo_canvas_widget_accessible_factory_get_type ()); } g_object_class_install_property (gobject_class, PROP_WIDGET, g_param_spec_object ("widget", _("Widget"), _("The widget to place in the canvas"), GTK_TYPE_WIDGET, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the widget"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the widget"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the widget, or -1 to use its requested width"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the widget, or -1 to use its requested height"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANCHOR, g_param_spec_enum ("anchor", _("Anchor"), _("How to position the widget relative to the item's x and y coordinate settings"), GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_NW, G_PARAM_READWRITE)); g_object_class_override_property (gobject_class, PROP_VISIBILITY, "visibility"); } goocanvas-1.0.0/src/goocanvasitemsimple.c0000644000076400007640000020524611461232754015443 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitemsimple.c - abstract base class for canvas items. */ /** * SECTION:goocanvasitemsimple * @Title: GooCanvasItemSimple * @Short_Description: the base class for the standard canvas items. * @Stability_Level: * @See_Also: * * #GooCanvasItemSimple is used as a base class for all of the standard canvas * items. It can also be used as the base class for new custom canvas items. * * It provides default implementations for many of the #GooCanvasItem * methods. * * For very simple items, all that is needed is to implement the create_path() * method. (#GooCanvasEllipse, #GooCanvasRect and #GooCanvasPath do this.) * * More complicated items need to implement the update(), paint() and * is_item_at() methods instead. (#GooCanvasImage, #GooCanvasPolyline, * #GooCanvasText and #GooCanvasWidget do this.) They may also need to * override some of the other GooCanvasItem methods such as set_canvas(), * set_parent() or allocate_area() if special code is needed. (#GooCanvasWidget * does this to make sure the #GtkWidget is embedded in the #GooCanvas widget * correctly.) */ #include #include #include #include "goocanvasprivate.h" #include "goocanvasitemsimple.h" #include "goocanvas.h" #include "goocanvasatk.h" enum { PROP_0, /* Basic drawing properties. */ PROP_STROKE_PATTERN, PROP_FILL_PATTERN, PROP_FILL_RULE, PROP_OPERATOR, PROP_ANTIALIAS, /* Line style & width properties. */ PROP_LINE_WIDTH, PROP_LINE_CAP, PROP_LINE_JOIN, PROP_LINE_JOIN_MITER_LIMIT, PROP_LINE_DASH, /* Font properties. */ PROP_FONT, PROP_FONT_DESC, PROP_HINT_METRICS, /* Convenience properties. */ PROP_STROKE_COLOR, PROP_STROKE_COLOR_RGBA, PROP_STROKE_PIXBUF, PROP_FILL_COLOR, PROP_FILL_COLOR_RGBA, PROP_FILL_PIXBUF, /* Other properties. Note that the order here is important PROP_TRANSFORM must be the first non-style property. see set_property(). */ PROP_TRANSFORM, PROP_PARENT, PROP_VISIBILITY, PROP_VISIBILITY_THRESHOLD, PROP_POINTER_EVENTS, PROP_TITLE, PROP_DESCRIPTION, PROP_CAN_FOCUS, PROP_CLIP_PATH, PROP_CLIP_FILL_RULE, PROP_TOOLTIP }; static gboolean accessibility_enabled = FALSE; static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_item_simple_dispose (GObject *object); static void goo_canvas_item_simple_finalize (GObject *object); static void goo_canvas_item_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_item_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_item_simple_default_create_path (GooCanvasItemSimple *simple, cairo_t *cr); static void goo_canvas_item_simple_default_update (GooCanvasItemSimple *simple, cairo_t *cr); static void goo_canvas_item_simple_default_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds); static gboolean goo_canvas_item_simple_default_is_item_at (GooCanvasItemSimple *simple, double x, double y, cairo_t *cr, gboolean is_pointer_event); G_DEFINE_TYPE_WITH_CODE (GooCanvasItemSimple, goo_canvas_item_simple, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_item_simple_install_common_properties (GObjectClass *gobject_class) { /* Basic drawing properties. */ g_object_class_install_property (gobject_class, PROP_STROKE_PATTERN, g_param_spec_boxed ("stroke-pattern", _("Stroke Pattern"), _("The pattern to use to paint the perimeter of the item, or NULL disable painting"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FILL_PATTERN, g_param_spec_boxed ("fill-pattern", _("Fill Pattern"), _("The pattern to use to paint the interior of the item, or NULL to disable painting"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FILL_RULE, g_param_spec_enum ("fill-rule", _("Fill Rule"), _("The fill rule used to determine which parts of the item are filled"), GOO_TYPE_CAIRO_FILL_RULE, CAIRO_FILL_RULE_WINDING, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_OPERATOR, g_param_spec_enum ("operator", _("Operator"), _("The compositing operator to use"), GOO_TYPE_CAIRO_OPERATOR, CAIRO_OPERATOR_OVER, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANTIALIAS, g_param_spec_enum ("antialias", _("Antialias"), _("The antialiasing mode to use"), GOO_TYPE_CAIRO_ANTIALIAS, CAIRO_ANTIALIAS_GRAY, G_PARAM_READWRITE)); /* Line style & width properties. */ g_object_class_install_property (gobject_class, PROP_LINE_WIDTH, g_param_spec_double ("line-width", _("Line Width"), _("The line width to use for the item's perimeter"), 0.0, G_MAXDOUBLE, 2.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_CAP, g_param_spec_enum ("line-cap", _("Line Cap"), _("The line cap style to use"), GOO_TYPE_CAIRO_LINE_CAP, CAIRO_LINE_CAP_BUTT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_JOIN, g_param_spec_enum ("line-join", _("Line Join"), _("The line join style to use"), GOO_TYPE_CAIRO_LINE_JOIN, CAIRO_LINE_JOIN_MITER, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_JOIN_MITER_LIMIT, g_param_spec_double ("line-join-miter-limit", _("Miter Limit"), _("The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit"), 0.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_DASH, g_param_spec_boxed ("line-dash", _("Line Dash"), _("The dash pattern to use"), GOO_TYPE_CANVAS_LINE_DASH, G_PARAM_READWRITE)); /* Font properties. */ g_object_class_install_property (gobject_class, PROP_FONT, g_param_spec_string ("font", _("Font"), _("The base font to use for the text"), NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FONT_DESC, g_param_spec_boxed ("font-desc", _("Font Description"), _("The attributes specifying which font to use"), PANGO_TYPE_FONT_DESCRIPTION, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HINT_METRICS, g_param_spec_enum ("hint-metrics", _("Hint Metrics"), _("The hinting to be used for font metrics"), GOO_TYPE_CAIRO_HINT_METRICS, CAIRO_HINT_METRICS_OFF, G_PARAM_READWRITE)); /* Convenience properties - writable only. */ g_object_class_install_property (gobject_class, PROP_STROKE_COLOR, g_param_spec_string ("stroke-color", _("Stroke Color"), _("The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_STROKE_COLOR_RGBA, g_param_spec_uint ("stroke-color-rgba", _("Stroke Color RGBA"), _("The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_STROKE_PIXBUF, g_param_spec_object ("stroke-pixbuf", _("Stroke Pixbuf"), _("The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_FILL_COLOR, g_param_spec_string ("fill-color", _("Fill Color"), _("The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_FILL_COLOR_RGBA, g_param_spec_uint ("fill-color-rgba", _("Fill Color RGBA"), _("The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FILL_PIXBUF, g_param_spec_object ("fill-pixbuf", _("Fill Pixbuf"), _("The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); /* Other properties. */ g_object_class_override_property (gobject_class, PROP_PARENT, "parent"); g_object_class_override_property (gobject_class, PROP_VISIBILITY, "visibility"); g_object_class_override_property (gobject_class, PROP_VISIBILITY_THRESHOLD, "visibility-threshold"); g_object_class_override_property (gobject_class, PROP_TRANSFORM, "transform"); g_object_class_override_property (gobject_class, PROP_POINTER_EVENTS, "pointer-events"); g_object_class_override_property (gobject_class, PROP_TITLE, "title"); g_object_class_override_property (gobject_class, PROP_DESCRIPTION, "description"); g_object_class_override_property (gobject_class, PROP_CAN_FOCUS, "can-focus"); g_object_class_override_property (gobject_class, PROP_TOOLTIP, "tooltip"); /** * GooCanvasItemSimple:clip-path * * The sequence of commands describing the clip path of the item, specified * as a string using the same syntax * as in the Scalable Vector * Graphics (SVG) path element. */ /** * GooCanvasItemModelSimple:clip-path * * The sequence of commands describing the clip path of the item, specified * as a string using the same syntax * as in the Scalable Vector * Graphics (SVG) path element. */ g_object_class_install_property (gobject_class, PROP_CLIP_PATH, g_param_spec_string ("clip-path", _("Clip Path"), _("The sequence of path commands specifying the clip path"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_CLIP_FILL_RULE, g_param_spec_enum ("clip-fill-rule", _("Clip Fill Rule"), _("The fill rule used to determine which parts of the item are clipped"), GOO_TYPE_CAIRO_FILL_RULE, CAIRO_FILL_RULE_WINDING, G_PARAM_READWRITE)); } static void goo_canvas_item_simple_class_init (GooCanvasItemSimpleClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->dispose = goo_canvas_item_simple_dispose; gobject_class->finalize = goo_canvas_item_simple_finalize; gobject_class->get_property = goo_canvas_item_simple_get_property; gobject_class->set_property = goo_canvas_item_simple_set_property; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { accessibility_enabled = TRUE; atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS_ITEM_SIMPLE, goo_canvas_item_accessible_factory_get_type ()); } goo_canvas_item_simple_install_common_properties (gobject_class); klass->simple_create_path = goo_canvas_item_simple_default_create_path; klass->simple_update = goo_canvas_item_simple_default_update; klass->simple_paint = goo_canvas_item_simple_default_paint; klass->simple_is_item_at = goo_canvas_item_simple_default_is_item_at; } static void goo_canvas_item_simple_init (GooCanvasItemSimple *item) { GooCanvasBounds *bounds = &item->bounds; bounds->x1 = bounds->y1 = bounds->x2 = bounds->y2 = 0.0; item->simple_data = g_slice_new0 (GooCanvasItemSimpleData); item->simple_data->visibility = GOO_CANVAS_ITEM_VISIBLE; item->simple_data->pointer_events = GOO_CANVAS_EVENTS_VISIBLE_PAINTED; item->simple_data->clip_fill_rule = CAIRO_FILL_RULE_WINDING; item->need_update = TRUE; item->need_entire_subtree_update = TRUE; } static void goo_canvas_item_simple_reset_model (GooCanvasItemSimple *simple) { if (simple->model) { g_signal_handlers_disconnect_matched (simple->model, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, simple); g_object_unref (simple->model); simple->model = NULL; simple->simple_data = NULL; } } /* Frees the contents of the GooCanvasItemSimpleData, but not the struct. */ static void goo_canvas_item_simple_free_data (GooCanvasItemSimpleData *simple_data) { if (simple_data) { if (simple_data->style) { g_object_unref (simple_data->style); simple_data->style = NULL; } if (simple_data->clip_path_commands) { g_array_free (simple_data->clip_path_commands, TRUE); simple_data->clip_path_commands = NULL; } g_slice_free (cairo_matrix_t, simple_data->transform); simple_data->transform = NULL; } } static void goo_canvas_item_simple_dispose (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; /* Remove the view from the GooCanvas hash table. */ if (simple->canvas && simple->model) goo_canvas_unregister_item (simple->canvas, (GooCanvasItemModel*) simple->model); goo_canvas_item_simple_reset_model (simple); goo_canvas_item_simple_free_data (simple->simple_data); G_OBJECT_CLASS (goo_canvas_item_simple_parent_class)->dispose (object); } static void goo_canvas_item_simple_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; g_slice_free (GooCanvasItemSimpleData, simple->simple_data); simple->simple_data = NULL; G_OBJECT_CLASS (goo_canvas_item_simple_parent_class)->finalize (object); } static void goo_canvas_item_simple_get_common_property (GObject *object, GooCanvasItemSimpleData *simple_data, GooCanvas *canvas, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasStyle *style = simple_data->style; GValue *svalue; gdouble line_width = 2.0; gchar *font = NULL; switch (prop_id) { /* Basic drawing properties. */ case PROP_STROKE_PATTERN: svalue = goo_canvas_style_get_property (style, goo_canvas_style_stroke_pattern_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; case PROP_FILL_PATTERN: svalue = goo_canvas_style_get_property (style, goo_canvas_style_fill_pattern_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; case PROP_FILL_RULE: svalue = goo_canvas_style_get_property (style, goo_canvas_style_fill_rule_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_FILL_RULE_WINDING); break; case PROP_OPERATOR: svalue = goo_canvas_style_get_property (style, goo_canvas_style_operator_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_OPERATOR_OVER); break; case PROP_ANTIALIAS: svalue = goo_canvas_style_get_property (style, goo_canvas_style_antialias_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_ANTIALIAS_GRAY); break; /* Line style & width properties. */ case PROP_LINE_WIDTH: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_width_id); if (svalue) line_width = svalue->data[0].v_double; else if (canvas) line_width = goo_canvas_get_default_line_width (canvas); g_value_set_double (value, line_width); break; case PROP_LINE_CAP: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_cap_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_LINE_CAP_BUTT); break; case PROP_LINE_JOIN: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_join_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_LINE_JOIN_MITER); break; case PROP_LINE_JOIN_MITER_LIMIT: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_join_miter_limit_id); g_value_set_double (value, svalue ? svalue->data[0].v_double : 10.0); break; case PROP_LINE_DASH: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_dash_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; /* Font properties. */ case PROP_FONT: svalue = goo_canvas_style_get_property (style, goo_canvas_style_font_desc_id); if (svalue) font = pango_font_description_to_string (svalue->data[0].v_pointer); g_value_set_string (value, font); g_free (font); break; case PROP_FONT_DESC: svalue = goo_canvas_style_get_property (style, goo_canvas_style_font_desc_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; case PROP_HINT_METRICS: svalue = goo_canvas_style_get_property (style, goo_canvas_style_hint_metrics_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_HINT_METRICS_OFF); break; /* Convenience properties. */ case PROP_STROKE_COLOR_RGBA: svalue = goo_canvas_style_get_property (style, goo_canvas_style_stroke_pattern_id); if (svalue) goo_canvas_get_rgba_value_from_pattern (svalue->data[0].v_pointer, value); break; case PROP_FILL_COLOR_RGBA: svalue = goo_canvas_style_get_property (style, goo_canvas_style_fill_pattern_id); if (svalue) goo_canvas_get_rgba_value_from_pattern (svalue->data[0].v_pointer, value); break; /* Other properties. */ case PROP_TRANSFORM: g_value_set_boxed (value, simple_data->transform); break; case PROP_VISIBILITY: g_value_set_enum (value, simple_data->visibility); break; case PROP_VISIBILITY_THRESHOLD: g_value_set_double (value, simple_data->visibility_threshold); break; case PROP_POINTER_EVENTS: g_value_set_flags (value, simple_data->pointer_events); break; case PROP_CAN_FOCUS: g_value_set_boolean (value, simple_data->can_focus); break; case PROP_CLIP_FILL_RULE: g_value_set_enum (value, simple_data->clip_fill_rule); break; case PROP_TOOLTIP: g_value_set_string (value, simple_data->tooltip); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_item_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasItemSimpleData *simple_data = simple->simple_data; AtkObject *accessible; switch (prop_id) { case PROP_PARENT: g_value_set_object (value, simple->parent); break; case PROP_TITLE: accessible = atk_gobject_accessible_for_object (object); g_value_set_string (value, atk_object_get_name (accessible)); break; case PROP_DESCRIPTION: accessible = atk_gobject_accessible_for_object (object); g_value_set_string (value, atk_object_get_description (accessible)); break; default: goo_canvas_item_simple_get_common_property (object, simple_data, simple->canvas, prop_id, value, pspec); break; } } static gboolean goo_canvas_item_simple_set_common_property (GObject *object, GooCanvasItemSimpleData *simple_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasStyle *style; cairo_pattern_t *pattern; gboolean recompute_bounds = FALSE; cairo_matrix_t *transform; GValue tmpval = { 0 }; const char *font_name, *path_data; PangoFontDescription *font_desc = NULL; /* See if we need to create our own style. */ if (prop_id < PROP_TRANSFORM) { if (!simple_data->style) { simple_data->style = goo_canvas_style_new (); } else if (!simple_data->own_style) { g_object_unref (simple_data->style); simple_data->style = goo_canvas_style_new (); } simple_data->own_style = TRUE; } style = simple_data->style; switch (prop_id) { /* Basic drawing properties. */ case PROP_STROKE_PATTERN: goo_canvas_style_set_property (style, goo_canvas_style_stroke_pattern_id, value); break; case PROP_FILL_PATTERN: goo_canvas_style_set_property (style, goo_canvas_style_fill_pattern_id, value); break; case PROP_FILL_RULE: goo_canvas_style_set_property (style, goo_canvas_style_fill_rule_id, value); break; case PROP_OPERATOR: goo_canvas_style_set_property (style, goo_canvas_style_operator_id, value); break; case PROP_ANTIALIAS: goo_canvas_style_set_property (style, goo_canvas_style_antialias_id, value); break; /* Line style & width properties. */ case PROP_LINE_WIDTH: goo_canvas_style_set_property (style, goo_canvas_style_line_width_id, value); recompute_bounds = TRUE; break; case PROP_LINE_CAP: goo_canvas_style_set_property (style, goo_canvas_style_line_cap_id, value); recompute_bounds = TRUE; break; case PROP_LINE_JOIN: goo_canvas_style_set_property (style, goo_canvas_style_line_join_id, value); recompute_bounds = TRUE; break; case PROP_LINE_JOIN_MITER_LIMIT: goo_canvas_style_set_property (style, goo_canvas_style_line_join_miter_limit_id, value); recompute_bounds = TRUE; break; case PROP_LINE_DASH: goo_canvas_style_set_property (style, goo_canvas_style_line_dash_id, value); recompute_bounds = TRUE; break; /* Font properties. */ case PROP_FONT: font_name = g_value_get_string (value); if (font_name) font_desc = pango_font_description_from_string (font_name); g_value_init (&tmpval, PANGO_TYPE_FONT_DESCRIPTION); g_value_take_boxed (&tmpval, font_desc); goo_canvas_style_set_property (style, goo_canvas_style_font_desc_id, &tmpval); g_value_unset (&tmpval); recompute_bounds = TRUE; break; case PROP_FONT_DESC: goo_canvas_style_set_property (style, goo_canvas_style_font_desc_id, value); recompute_bounds = TRUE; break; case PROP_HINT_METRICS: goo_canvas_style_set_property (style, goo_canvas_style_hint_metrics_id, value); recompute_bounds = TRUE; break; /* Convenience properties. */ case PROP_STROKE_COLOR: pattern = goo_canvas_create_pattern_from_color_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_stroke_pattern_id, pattern); break; case PROP_STROKE_COLOR_RGBA: pattern = goo_canvas_create_pattern_from_rgba_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_stroke_pattern_id, pattern); break; case PROP_STROKE_PIXBUF: pattern = goo_canvas_create_pattern_from_pixbuf_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_stroke_pattern_id, pattern); break; case PROP_FILL_COLOR: pattern = goo_canvas_create_pattern_from_color_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_fill_pattern_id, pattern); break; case PROP_FILL_COLOR_RGBA: pattern = goo_canvas_create_pattern_from_rgba_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_fill_pattern_id, pattern); break; case PROP_FILL_PIXBUF: pattern = goo_canvas_create_pattern_from_pixbuf_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_fill_pattern_id, pattern); break; /* Other properties. */ case PROP_TRANSFORM: g_slice_free (cairo_matrix_t, simple_data->transform); transform = g_value_get_boxed (value); simple_data->transform = goo_cairo_matrix_copy (transform); recompute_bounds = TRUE; break; case PROP_VISIBILITY: simple_data->visibility = g_value_get_enum (value); break; case PROP_VISIBILITY_THRESHOLD: simple_data->visibility_threshold = g_value_get_double (value); break; case PROP_POINTER_EVENTS: simple_data->pointer_events = g_value_get_flags (value); break; case PROP_CAN_FOCUS: simple_data->can_focus = g_value_get_boolean (value); break; case PROP_CLIP_PATH: if (simple_data->clip_path_commands) g_array_free (simple_data->clip_path_commands, TRUE); path_data = g_value_get_string (value); if (path_data) simple_data->clip_path_commands = goo_canvas_parse_path_data (path_data); else simple_data->clip_path_commands = NULL; recompute_bounds = TRUE; break; case PROP_CLIP_FILL_RULE: simple_data->clip_fill_rule = g_value_get_enum (value); recompute_bounds = TRUE; break; case PROP_TOOLTIP: simple_data->tooltip = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } return recompute_bounds; } static void goo_canvas_item_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItem *item = (GooCanvasItem*) object; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasItem *parent; AtkObject *accessible; gboolean recompute_bounds; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } switch (prop_id) { case PROP_PARENT: parent = g_value_get_object (value); goo_canvas_item_remove (item); goo_canvas_item_add_child (parent, item, -1); break; case PROP_TITLE: accessible = atk_gobject_accessible_for_object (object); atk_object_set_name (accessible, g_value_get_string (value)); break; case PROP_DESCRIPTION: accessible = atk_gobject_accessible_for_object (object); atk_object_set_description (accessible, g_value_get_string (value)); break; default: recompute_bounds = goo_canvas_item_simple_set_common_property (object, simple_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, recompute_bounds); break; } } static GooCanvas* goo_canvas_item_simple_get_canvas (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return simple->canvas; } static void goo_canvas_item_simple_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; simple->canvas = canvas; } static GooCanvasItem* goo_canvas_item_simple_get_parent (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return simple->parent; } static void goo_canvas_item_simple_set_parent (GooCanvasItem *item, GooCanvasItem *parent) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvas *canvas; simple->parent = parent; canvas = parent ? goo_canvas_item_get_canvas (parent) : NULL; goo_canvas_item_set_canvas (item, canvas); simple->need_update = TRUE; simple->need_entire_subtree_update = TRUE; } /** * goo_canvas_item_simple_changed: * @item: a #GooCanvasItemSimple. * @recompute_bounds: if the item's bounds need to be recomputed. * * This function is intended to be used by subclasses of #GooCanvasItemSimple. * * It is used as a callback for the "changed" signal of the item models. * It requests an update or redraw of the item as appropriate. **/ void goo_canvas_item_simple_changed (GooCanvasItemSimple *item, gboolean recompute_bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (recompute_bounds) { item->need_entire_subtree_update = TRUE; if (!item->need_update) { goo_canvas_item_request_update ((GooCanvasItem*) item); /* Do this after requesting an update, since GooCanvasGroup will ignore the update request if we do this first. */ item->need_update = TRUE; } } else { if (item->canvas) goo_canvas_request_item_redraw (item->canvas, &item->bounds, simple_data->is_static); } } static gboolean goo_canvas_item_simple_get_transform (GooCanvasItem *item, cairo_matrix_t *matrix) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (!simple_data->transform) return FALSE; *matrix = *simple_data->transform; return TRUE; } static void goo_canvas_item_simple_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (transform) { if (!simple_data->transform) simple_data->transform = g_slice_new (cairo_matrix_t); *simple_data->transform = *transform; } else { g_slice_free (cairo_matrix_t, simple_data->transform); simple_data->transform = NULL; } goo_canvas_item_simple_changed (simple, TRUE); } static GooCanvasStyle* goo_canvas_item_simple_get_style (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return simple->simple_data->style; } static void goo_canvas_item_simple_set_style (GooCanvasItem *item, GooCanvasStyle *style) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (simple_data->style) g_object_unref (simple_data->style); if (style) { simple_data->style = goo_canvas_style_copy (style); simple_data->own_style = TRUE; } else { simple_data->style = NULL; simple_data->own_style = FALSE; } goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_item_simple_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; if (simple->need_update) goo_canvas_item_ensure_updated (item); *bounds = simple->bounds; } static GList* goo_canvas_item_simple_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_visible, GList *found_items) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (item); GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; double user_x = x, user_y = y; cairo_matrix_t matrix; gboolean add_item = FALSE; if (simple->need_update) goo_canvas_item_ensure_updated (item); /* Skip the item if the point isn't in the item's bounds. */ if (simple->bounds.x1 > x || simple->bounds.x2 < x || simple->bounds.y1 > y || simple->bounds.y2 < y) return found_items; /* Check if the item should receive events. */ if (is_pointer_event) { if (simple_data->pointer_events == GOO_CANVAS_EVENTS_NONE) return found_items; if (simple_data->pointer_events & GOO_CANVAS_EVENTS_VISIBLE_MASK && (!parent_visible || simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold))) return found_items; } cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_device_to_user (cr, &user_x, &user_y); /* Remove any current translation, to avoid the 16-bit cairo limit. */ cairo_get_matrix (cr, &matrix); matrix.x0 = matrix.y0 = 0.0; cairo_set_matrix (cr, &matrix); /* If the item has a clip path, check if the point is inside it. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); if (!cairo_in_fill (cr, user_x, user_y)) { cairo_restore (cr); return found_items; } } add_item = class->simple_is_item_at (simple, user_x, user_y, cr, is_pointer_event); cairo_restore (cr); if (add_item) return g_list_prepend (found_items, item); else return found_items; } static gboolean goo_canvas_item_simple_default_is_item_at (GooCanvasItemSimple *simple, double x, double y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPointerEvents pointer_events = GOO_CANVAS_EVENTS_ALL; if (is_pointer_event) pointer_events = simple_data->pointer_events; /* Use the virtual method subclasses define to create the path. */ class->simple_create_path (simple, cr); if (goo_canvas_item_simple_check_in_path (simple, x, y, cr, pointer_events)) return TRUE; return FALSE; } static gboolean goo_canvas_item_simple_is_visible (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) return FALSE; if (simple->parent) return goo_canvas_item_is_visible (simple->parent); return TRUE; } static gboolean goo_canvas_item_simple_get_is_static (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; return simple_data->is_static; } static void goo_canvas_item_simple_set_is_static (GooCanvasItem *item, gboolean is_static) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; simple_data->is_static = is_static; } /** * goo_canvas_item_simple_check_style: * @item: a #GooCanvasItemSimple. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their update() or get_requested_area() methods. * * It ensures that the item's style is setup correctly. If the item has its * own #GooCanvasStyle it makes sure the parent is set correctly. If it * doesn't have its own style it uses the parent item's style. **/ void goo_canvas_item_simple_check_style (GooCanvasItemSimple *item) { GooCanvasItemSimpleData *simple_data = item->simple_data; GooCanvasStyle *parent_style = NULL; if (item->parent) parent_style = goo_canvas_item_get_style (item->parent); if (simple_data->own_style) { goo_canvas_style_set_parent (simple_data->style, parent_style); } else if (simple_data->style != parent_style) { /* The item doesn't have its own style so we use the parent's (though that may also be NULL). */ if (simple_data->style) g_object_unref (simple_data->style); simple_data->style = parent_style; if (parent_style) g_object_ref (parent_style); } } static void goo_canvas_item_simple_update_internal (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasBounds tmp_bounds; cairo_matrix_t transform; simple->need_update = FALSE; goo_canvas_item_simple_check_style (simple); cairo_get_matrix (cr, &transform); class->simple_update (simple, cr); /* Modify the extents by the item's clip path. */ if (simple_data->clip_path_commands) { cairo_identity_matrix (cr); goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_fill_extents (cr, &tmp_bounds.x1, &tmp_bounds.y1, &tmp_bounds.x2, &tmp_bounds.y2); simple->bounds.x1 = MAX (simple->bounds.x1, tmp_bounds.x1); simple->bounds.y1 = MAX (simple->bounds.y1, tmp_bounds.y1); simple->bounds.x2 = MIN (simple->bounds.x2, tmp_bounds.x2); simple->bounds.y2 = MIN (simple->bounds.y2, tmp_bounds.y2); if (simple->bounds.x1 > simple->bounds.x2) simple->bounds.x2 = simple->bounds.x1; if (simple->bounds.y1 > simple->bounds.y2) simple->bounds.y2 = simple->bounds.y1; } cairo_set_matrix (cr, &transform); } static void goo_canvas_item_simple_default_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); /* Use the identity matrix to get the bounds completely in user space. */ cairo_identity_matrix (cr); class->simple_create_path (simple, cr); goo_canvas_item_simple_get_path_bounds (simple, cr, &simple->bounds); } static void goo_canvas_item_simple_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; cairo_matrix_t matrix; double x_offset, y_offset; if (entire_tree || simple->need_update) { /* Request a redraw of the existing bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Remove any current translation, to avoid the 16-bit cairo limit. */ cairo_get_matrix (cr, &matrix); x_offset = matrix.x0; y_offset = matrix.y0; matrix.x0 = matrix.y0 = 0.0; cairo_set_matrix (cr, &matrix); goo_canvas_item_simple_update_internal (simple, cr); goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); /* Add the translation back to the bounds. */ simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; simple->bounds.x2 += x_offset; simple->bounds.y2 += y_offset; cairo_restore (cr); /* Request a redraw of the new bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); } *bounds = simple->bounds; } static gboolean goo_canvas_item_simple_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; cairo_matrix_t matrix; double x_offset, y_offset; /* Request a redraw of the existing bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Remove any current translation, to avoid the 16-bit cairo limit. */ cairo_get_matrix (cr, &matrix); x_offset = matrix.x0; y_offset = matrix.y0; matrix.x0 = matrix.y0 = 0.0; cairo_set_matrix (cr, &matrix); goo_canvas_item_simple_update_internal (simple, cr); if (simple->simple_data->visibility == GOO_CANVAS_ITEM_HIDDEN) { simple->bounds.x1 = simple->bounds.x2 = 0.0; simple->bounds.y1 = simple->bounds.y2 = 0.0; cairo_restore (cr); return FALSE; } /* FIXME: Maybe optimize by just converting the offsets to user space and adding them? */ /* Convert to device space. */ cairo_user_to_device (cr, &simple->bounds.x1, &simple->bounds.y1); cairo_user_to_device (cr, &simple->bounds.x2, &simple->bounds.y2); /* Add the translation back to the bounds. */ simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; simple->bounds.x2 += x_offset; simple->bounds.y2 += y_offset; /* Restore the item's proper transformation matrix. */ matrix.x0 = x_offset; matrix.y0 = y_offset; cairo_set_matrix (cr, &matrix); /* Convert back to user space. */ cairo_device_to_user (cr, &simple->bounds.x1, &simple->bounds.y1); cairo_device_to_user (cr, &simple->bounds.x2, &simple->bounds.y2); /* Copy the user bounds to the requested area. */ *requested_area = simple->bounds; /* Convert to the parent's coordinate space. */ goo_canvas_item_simple_user_bounds_to_parent (simple, cr, requested_area); /* Convert the item's bounds to device space. */ goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); cairo_restore (cr); return TRUE; } static void goo_canvas_item_simple_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; /* Simple items can't resize at all, so we just adjust the bounds x & y positions here, and let the item be clipped if necessary. */ simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; simple->bounds.x2 += x_offset; simple->bounds.y2 += y_offset; /* Request a redraw of the new bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); } static void goo_canvas_item_simple_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (item); GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; /* Skip the item if the bounds don't intersect the expose rectangle. */ if (simple->bounds.x1 > bounds->x2 || simple->bounds.x2 < bounds->x1 || simple->bounds.y1 > bounds->y2 || simple->bounds.y2 < bounds->y1) return; /* Check if the item should be visible. */ if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && scale < simple_data->visibility_threshold)) return; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Clip with the item's clip path, if it is set. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_clip (cr); } class->simple_paint (simple, cr, bounds); cairo_restore (cr); } static void goo_canvas_item_simple_default_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); class->simple_create_path (simple, cr); goo_canvas_item_simple_paint_path (simple, cr); } static void goo_canvas_item_simple_default_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { /* Do nothing. */ } static void goo_canvas_item_simple_title_changed (GooCanvasItemModelSimple *smodel, GParamSpec *pspec, GooCanvasItemSimple *item) { AtkObject *accessible; accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); atk_object_set_name (accessible, smodel->title); } static void goo_canvas_item_simple_description_changed (GooCanvasItemModelSimple *smodel, GParamSpec *pspec, GooCanvasItemSimple *item) { AtkObject *accessible; accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); atk_object_set_description (accessible, smodel->description); } static void goo_canvas_item_simple_setup_accessibility (GooCanvasItemSimple *item) { GooCanvasItemModelSimple *smodel = item->model; AtkObject *accessible; accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); if (!ATK_IS_NO_OP_OBJECT (accessible)) { if (smodel->title) atk_object_set_name (accessible, smodel->title); if (smodel->description) atk_object_set_description (accessible, smodel->description); g_signal_connect (smodel, "notify::title", G_CALLBACK (goo_canvas_item_simple_title_changed), item); g_signal_connect (smodel, "notify::description", G_CALLBACK (goo_canvas_item_simple_description_changed), item); } } static void goo_canvas_item_model_simple_changed (GooCanvasItemModelSimple *smodel, gboolean recompute_bounds, GooCanvasItemSimple *simple) { goo_canvas_item_simple_changed (simple, recompute_bounds); } static GooCanvasItemModel* goo_canvas_item_simple_get_model (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return (GooCanvasItemModel*) simple->model; } /** * goo_canvas_item_simple_set_model: * @item: a #GooCanvasItemSimple. * @model: the model that @item will view. * * This function should be called by subclasses of #GooCanvasItemSimple * in their set_model() method. **/ void goo_canvas_item_simple_set_model (GooCanvasItemSimple *item, GooCanvasItemModel *model) { g_return_if_fail (model != NULL); goo_canvas_item_simple_reset_model (item); goo_canvas_item_simple_free_data (item->simple_data); g_slice_free (GooCanvasItemSimpleData, item->simple_data); item->model = g_object_ref (model); item->simple_data = &item->model->simple_data; if (accessibility_enabled) goo_canvas_item_simple_setup_accessibility (item); g_signal_connect (model, "changed", G_CALLBACK (goo_canvas_item_model_simple_changed), item); } static void goo_canvas_item_simple_set_model_internal (GooCanvasItem *item, GooCanvasItemModel *model) { goo_canvas_item_simple_set_model ((GooCanvasItemSimple*) item, model); } static gboolean goo_canvas_item_simple_query_tooltip (GooCanvasItem *item, gdouble x, gdouble y, gboolean keyboard_tip, GtkTooltip *tooltip) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (simple_data->tooltip) { gtk_tooltip_set_markup (tooltip, simple_data->tooltip); return TRUE; } return FALSE; } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->get_canvas = goo_canvas_item_simple_get_canvas; iface->set_canvas = goo_canvas_item_simple_set_canvas; iface->get_parent = goo_canvas_item_simple_get_parent; iface->set_parent = goo_canvas_item_simple_set_parent; iface->get_bounds = goo_canvas_item_simple_get_bounds; iface->get_items_at = goo_canvas_item_simple_get_items_at; iface->update = goo_canvas_item_simple_update; iface->get_requested_area = goo_canvas_item_simple_get_requested_area; iface->allocate_area = goo_canvas_item_simple_allocate_area; iface->paint = goo_canvas_item_simple_paint; iface->get_transform = goo_canvas_item_simple_get_transform; iface->set_transform = goo_canvas_item_simple_set_transform; iface->get_style = goo_canvas_item_simple_get_style; iface->set_style = goo_canvas_item_simple_set_style; iface->is_visible = goo_canvas_item_simple_is_visible; iface->get_is_static = goo_canvas_item_simple_get_is_static; iface->set_is_static = goo_canvas_item_simple_set_is_static; iface->get_model = goo_canvas_item_simple_get_model; iface->set_model = goo_canvas_item_simple_set_model_internal; iface->query_tooltip = goo_canvas_item_simple_query_tooltip; } /** * goo_canvas_item_simple_paint_path: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * * This function is intended to be used by subclasses of #GooCanvasItemSimple. * * It paints the current path, using the item's style settings. **/ void goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr) { GooCanvasStyle *style = item->simple_data->style; if (goo_canvas_style_set_fill_options (style, cr)) cairo_fill_preserve (cr); if (goo_canvas_style_set_stroke_options (style, cr)) cairo_stroke (cr); cairo_new_path (cr); } /* Returns the bounds of the path, using the item's stroke and fill options, in device coords. Note that the bounds include both the stroke and the fill extents, even if they will not be painted. (We need this to handle the "pointer-events" property.) */ /** * goo_canvas_item_simple_get_path_bounds: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * @bounds: the #GooCanvasBounds struct to store the resulting bounding box. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their update() or get_requested_area() methods. * * It calculates the bounds of the current path, using the item's style * settings, and stores the results in the given #GooCanvasBounds struct. * * The returned bounds contains the bounding box of the path in device space, * converted to user space coordinates. To calculate the bounds completely in * user space, use cairo_identity_matrix() to temporarily reset the current * transformation matrix to the identity matrix. **/ void goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasStyle *style = item->simple_data->style; GooCanvasBounds fill_bounds, stroke_bounds; /* Calculate the filled extents. */ goo_canvas_style_set_fill_options (style, cr); cairo_fill_extents (cr, &fill_bounds.x1, &fill_bounds.y1, &fill_bounds.x2, &fill_bounds.y2); /* Check the stroke. */ goo_canvas_style_set_stroke_options (style, cr); cairo_stroke_extents (cr, &stroke_bounds.x1, &stroke_bounds.y1, &stroke_bounds.x2, &stroke_bounds.y2); /* Workaround for cairo < 1.4.0. It used to just return odd values if the path had empty bounds. This fix will work, but only if there is no transform currently set, since cairo will convert to user space. */ if (cairo_version () < CAIRO_VERSION_ENCODE (1, 4, 0)) { if (fill_bounds.x1 == 32767.0 && fill_bounds.x2 == -32768.0) fill_bounds.x1 = fill_bounds.x2 = 0.0; if (stroke_bounds.x1 == 32767.0 && stroke_bounds.x2 == -32768.0) stroke_bounds.x1 = stroke_bounds.x2 = 0.0; } if (fill_bounds.x1 == 0.0 && fill_bounds.x2 == 0.0) { /* The fill bounds are empty so just use the stroke bounds. If the stroke bounds are also empty the bounds will be all 0.0. */ bounds->x1 = MIN (stroke_bounds.x1, stroke_bounds.x2); bounds->x2 = MAX (stroke_bounds.x1, stroke_bounds.x2); bounds->y1 = MIN (stroke_bounds.y1, stroke_bounds.y2); bounds->y2 = MAX (stroke_bounds.y1, stroke_bounds.y2); } else if (stroke_bounds.x1 == 0.0 && stroke_bounds.x2 == 0.0) { /* The stroke bounds are empty so just use the fill bounds. */ bounds->x1 = MIN (fill_bounds.x1, fill_bounds.x2); bounds->x2 = MAX (fill_bounds.x1, fill_bounds.x2); bounds->y1 = MIN (fill_bounds.y1, fill_bounds.y2); bounds->y2 = MAX (fill_bounds.y1, fill_bounds.y2); } else { /* Both fill & stoke bounds are non-empty so combine them. */ bounds->x1 = MIN (fill_bounds.x1, fill_bounds.x2); bounds->x2 = MAX (fill_bounds.x1, fill_bounds.x2); bounds->y1 = MIN (fill_bounds.y1, fill_bounds.y2); bounds->y2 = MAX (fill_bounds.y1, fill_bounds.y2); bounds->x1 = MIN (bounds->x1, stroke_bounds.x1); bounds->x1 = MIN (bounds->x1, stroke_bounds.x2); bounds->x2 = MAX (bounds->x2, stroke_bounds.x1); bounds->x2 = MAX (bounds->x2, stroke_bounds.x2); bounds->y1 = MIN (bounds->y1, stroke_bounds.y1); bounds->y1 = MIN (bounds->y1, stroke_bounds.y2); bounds->y2 = MAX (bounds->y2, stroke_bounds.y1); bounds->y2 = MAX (bounds->y2, stroke_bounds.y2); } } /** * goo_canvas_item_simple_user_bounds_to_device: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * @bounds: the bounds of the item, in the item's coordinate space. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their update() or get_requested_area() methods. * * It converts the item's bounds to a bounding box in the canvas (device) * coordinate space. **/ void goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasBounds tmp_bounds = *bounds, tmp_bounds2 = *bounds; /* Convert the top-left and bottom-right corners to device coords. */ cairo_user_to_device (cr, &tmp_bounds.x1, &tmp_bounds.y1); cairo_user_to_device (cr, &tmp_bounds.x2, &tmp_bounds.y2); /* Now convert the top-right and bottom-left corners. */ cairo_user_to_device (cr, &tmp_bounds2.x1, &tmp_bounds2.y2); cairo_user_to_device (cr, &tmp_bounds2.x2, &tmp_bounds2.y1); /* Calculate the minimum x coordinate seen and put in x1. */ bounds->x1 = MIN (tmp_bounds.x1, tmp_bounds.x2); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x1); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x2); /* Calculate the maximum x coordinate seen and put in x2. */ bounds->x2 = MAX (tmp_bounds.x1, tmp_bounds.x2); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x1); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x2); /* Calculate the minimum y coordinate seen and put in y1. */ bounds->y1 = MIN (tmp_bounds.y1, tmp_bounds.y2); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y1); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y2); /* Calculate the maximum y coordinate seen and put in y2. */ bounds->y2 = MAX (tmp_bounds.y1, tmp_bounds.y2); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y1); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y2); } /** * goo_canvas_item_simple_user_bounds_to_parent: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * @bounds: the bounds of the item, in the item's coordinate space. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their get_requested_area() method. * * It converts the item's bounds to a bounding box in its parent's coordinate * space. If the item has no transformation matrix set then no conversion is * needed. **/ void goo_canvas_item_simple_user_bounds_to_parent (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = item->simple_data; cairo_matrix_t *transform = simple_data->transform; GooCanvasBounds tmp_bounds, tmp_bounds2; if (!transform) return; tmp_bounds = tmp_bounds2 = *bounds; /* Convert the top-left and bottom-right corners to parent coords. */ cairo_matrix_transform_point (transform, &tmp_bounds.x1, &tmp_bounds.y1); cairo_matrix_transform_point (transform, &tmp_bounds.x2, &tmp_bounds.y2); /* Now convert the top-right and bottom-left corners. */ cairo_matrix_transform_point (transform, &tmp_bounds2.x1, &tmp_bounds2.y2); cairo_matrix_transform_point (transform, &tmp_bounds2.x2, &tmp_bounds2.y1); /* Calculate the minimum x coordinate seen and put in x1. */ bounds->x1 = MIN (tmp_bounds.x1, tmp_bounds.x2); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x1); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x2); /* Calculate the maximum x coordinate seen and put in x2. */ bounds->x2 = MAX (tmp_bounds.x1, tmp_bounds.x2); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x1); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x2); /* Calculate the minimum y coordinate seen and put in y1. */ bounds->y1 = MIN (tmp_bounds.y1, tmp_bounds.y2); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y1); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y2); /* Calculate the maximum y coordinate seen and put in y2. */ bounds->y2 = MAX (tmp_bounds.y1, tmp_bounds.y2); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y1); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y2); } /** * goo_canvas_item_simple_check_in_path: * @item: a #GooCanvasItemSimple. * @x: the x coordinate of the point. * @y: the y coordinate of the point. * @cr: a cairo context. * @pointer_events: specifies which parts of the path to check. * * This function is intended to be used by subclasses of #GooCanvasItemSimple. * * It checks if the given point is in the current path, using the item's * style settings. * * Returns: %TRUE if the given point is in the current path. **/ gboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events) { GooCanvasStyle *style = item->simple_data->style; gboolean do_fill, do_stroke; /* Check the filled path, if required. */ if (pointer_events & GOO_CANVAS_EVENTS_FILL_MASK) { do_fill = goo_canvas_style_set_fill_options (style, cr); if (!(pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK) || do_fill) { if (cairo_in_fill (cr, x, y)) return TRUE; } } /* Check the stroke, if required. */ if (pointer_events & GOO_CANVAS_EVENTS_STROKE_MASK) { do_stroke = goo_canvas_style_set_stroke_options (style, cr); if (!(pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK) || do_stroke) { if (cairo_in_stroke (cr, x, y)) return TRUE; } } return FALSE; } /** * goo_canvas_item_simple_get_line_width: * @item: a #GooCanvasItemSimple. * * Gets the item's line width. * * Returns: the item's line width. **/ gdouble goo_canvas_item_simple_get_line_width (GooCanvasItemSimple *item) { GValue *value; value = goo_canvas_style_get_property (item->simple_data->style, goo_canvas_style_line_width_id); if (value) return value->data[0].v_double; else if (item->canvas) return goo_canvas_get_default_line_width (item->canvas); else return 2.0; } /** * SECTION:goocanvasitemmodelsimple * @Title: GooCanvasItemModelSimple * @Short_Description: the base class for the standard canvas item models. * @Stability_Level: * @See_Also: * * #GooCanvasItemModelSimple is used as a base class for the standard canvas * item models. It can also be used as the base class for new custom canvas * item models. * * It provides default implementations for many of the #GooCanvasItemModel * methods. * * Subclasses of #GooCanvasItemModelSimple only need to implement the * create_item() method of the #GooCanvasItemModel interface, to create * the default canvas item to view the item model. */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_item_model_simple_dispose (GObject *object); static void goo_canvas_item_model_simple_finalize (GObject *object); static void goo_canvas_item_model_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_item_model_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasItemModelSimple, goo_canvas_item_model_simple, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_item_model_simple_class_init (GooCanvasItemModelSimpleClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->dispose = goo_canvas_item_model_simple_dispose; gobject_class->finalize = goo_canvas_item_model_simple_finalize; gobject_class->get_property = goo_canvas_item_model_simple_get_property; gobject_class->set_property = goo_canvas_item_model_simple_set_property; goo_canvas_item_simple_install_common_properties (gobject_class); } static void goo_canvas_item_model_simple_init (GooCanvasItemModelSimple *smodel) { smodel->simple_data.visibility = GOO_CANVAS_ITEM_VISIBLE; smodel->simple_data.pointer_events = GOO_CANVAS_EVENTS_VISIBLE_PAINTED; smodel->simple_data.clip_fill_rule = CAIRO_FILL_RULE_WINDING; } static void goo_canvas_item_model_simple_dispose (GObject *object) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object; goo_canvas_item_simple_free_data (&smodel->simple_data); G_OBJECT_CLASS (goo_canvas_item_model_simple_parent_class)->dispose (object); } static void goo_canvas_item_model_simple_finalize (GObject *object) { /*GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object;*/ G_OBJECT_CLASS (goo_canvas_item_model_simple_parent_class)->finalize (object); } static void goo_canvas_item_model_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; switch (prop_id) { case PROP_PARENT: g_value_set_object (value, smodel->parent); break; case PROP_TITLE: g_value_set_string (value, smodel->title); break; case PROP_DESCRIPTION: g_value_set_string (value, smodel->description); break; default: goo_canvas_item_simple_get_common_property (object, simple_data, NULL, prop_id, value, pspec); break; } } extern void _goo_canvas_item_model_emit_changed (GooCanvasItemModel *model, gboolean recompute_bounds); static void goo_canvas_item_model_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemModel *model = (GooCanvasItemModel*) object; GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; GooCanvasItemModel *parent; gboolean recompute_bounds; switch (prop_id) { case PROP_PARENT: parent = g_value_get_object (value); goo_canvas_item_model_remove (model); goo_canvas_item_model_add_child (parent, model, -1); break; case PROP_TITLE: g_free (smodel->title); smodel->title = g_value_dup_string (value); break; case PROP_DESCRIPTION: g_free (smodel->description); smodel->description = g_value_dup_string (value); break; default: recompute_bounds = goo_canvas_item_simple_set_common_property (object, simple_data, prop_id, value, pspec); _goo_canvas_item_model_emit_changed (model, recompute_bounds); break; } } static GooCanvasItemModel* goo_canvas_item_model_simple_get_parent (GooCanvasItemModel *model) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; return smodel->parent; } static void goo_canvas_item_model_simple_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; smodel->parent = parent; } static gboolean goo_canvas_item_model_simple_get_transform (GooCanvasItemModel *model, cairo_matrix_t *matrix) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; if (!simple_data->transform) return FALSE; *matrix = *simple_data->transform; return TRUE; } static void goo_canvas_item_model_simple_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; if (transform) { if (!simple_data->transform) simple_data->transform = g_slice_new (cairo_matrix_t); *simple_data->transform = *transform; } else { g_slice_free (cairo_matrix_t, simple_data->transform); simple_data->transform = NULL; } _goo_canvas_item_model_emit_changed (model, TRUE); } static GooCanvasStyle* goo_canvas_item_model_simple_get_style (GooCanvasItemModel *model) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; return smodel->simple_data.style; } static void goo_canvas_item_model_simple_set_style (GooCanvasItemModel *model, GooCanvasStyle *style) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; if (simple_data->style) g_object_unref (simple_data->style); if (style) { simple_data->style = goo_canvas_style_copy (style); simple_data->own_style = TRUE; } else { simple_data->style = NULL; simple_data->own_style = FALSE; } _goo_canvas_item_model_emit_changed (model, TRUE); } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->get_parent = goo_canvas_item_model_simple_get_parent; iface->set_parent = goo_canvas_item_model_simple_set_parent; iface->get_transform = goo_canvas_item_model_simple_get_transform; iface->set_transform = goo_canvas_item_model_simple_set_transform; iface->get_style = goo_canvas_item_model_simple_get_style; iface->set_style = goo_canvas_item_model_simple_set_style; } goocanvas-1.0.0/src/goocanvasrect.c0000644000076400007640000004246611461236123014225 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasrect.c - rectangle item. */ /** * SECTION:goocanvasrect * @Title: GooCanvasRect * @Short_Description: a rectangle item. * * GooCanvasRect represents a rectangle item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasRect use goo_canvas_rect_new(). * * To get or set the properties of an existing #GooCanvasRect, use * g_object_get() and g_object_set(). */ #include #include #include #include #include "goocanvasrect.h" #include "goocanvas.h" enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_RADIUS_X, PROP_RADIUS_Y }; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasRect, goo_canvas_rect, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_rect_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the rectangle"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the rectangle"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the rectangle"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the rectangle"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_X, g_param_spec_double ("radius_x", _("Radius X"), _("The horizontal radius to use for rounded corners"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_Y, g_param_spec_double ("radius_y", _("Radius Y"), _("The vertical radius to use for rounded corners"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_rect_init (GooCanvasRect *rect) { rect->rect_data = g_slice_new0 (GooCanvasRectData); } /** * goo_canvas_rect_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the rectangle. * @y: the y coordinate of the top of the rectangle. * @width: the width of the rectangle. * @height: the height of the rectangle. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new rectangle item. * * * * Here's an example showing how to create a rectangle at (100,100) with a * width of 200 and a height of 100. * * * GooCanvasItem *rect = goo_canvas_rect_new (mygroup, 100.0, 100.0, 200.0, 100.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new rectangle item. **/ GooCanvasItem* goo_canvas_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooCanvasRect *rect; GooCanvasRectData *rect_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_RECT, NULL); rect = (GooCanvasRect*) item; rect_data = rect->rect_data; rect_data->x = x; rect_data->y = y; rect_data->width = width; rect_data->height = height; rect_data->radius_x = 0; rect_data->radius_y = 0; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_rect_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasRect *rect = (GooCanvasRect*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) g_slice_free (GooCanvasRectData, rect->rect_data); rect->rect_data = NULL; G_OBJECT_CLASS (goo_canvas_rect_parent_class)->finalize (object); } static void goo_canvas_rect_get_common_property (GObject *object, GooCanvasRectData *rect_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, rect_data->x); break; case PROP_Y: g_value_set_double (value, rect_data->y); break; case PROP_WIDTH: g_value_set_double (value, rect_data->width); break; case PROP_HEIGHT: g_value_set_double (value, rect_data->height); break; case PROP_RADIUS_X: g_value_set_double (value, rect_data->radius_x); break; case PROP_RADIUS_Y: g_value_set_double (value, rect_data->radius_y); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_rect_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasRect *rect = (GooCanvasRect*) object; goo_canvas_rect_get_common_property (object, rect->rect_data, prop_id, value, pspec); } static void goo_canvas_rect_set_common_property (GObject *object, GooCanvasRectData *rect_data, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: rect_data->x = g_value_get_double (value); break; case PROP_Y: rect_data->y = g_value_get_double (value); break; case PROP_WIDTH: rect_data->width = g_value_get_double (value); break; case PROP_HEIGHT: rect_data->height = g_value_get_double (value); break; case PROP_RADIUS_X: rect_data->radius_x = g_value_get_double (value); break; case PROP_RADIUS_Y: rect_data->radius_y = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_rect_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasRect *rect = (GooCanvasRect*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_rect_set_common_property (object, rect->rect_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_rect_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasRect *rect = (GooCanvasRect*) simple; GooCanvasRectData *rect_data = rect->rect_data; cairo_new_path (cr); /* Check if we need to draw rounded corners. */ if (rect_data->radius_x > 0 && rect_data->radius_y > 0) { /* The radii can't be more than half the size of the rect. */ double rx = MIN (rect_data->radius_x, rect_data->width / 2); double ry = MIN (rect_data->radius_y, rect_data->height / 2); /* Draw the top-right arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rect_data->width - rx, rect_data->y + ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, 1.5 * M_PI, 2.0 * M_PI); cairo_restore (cr); /* Draw the line down the right side. */ cairo_line_to (cr, rect_data->x + rect_data->width, rect_data->y + rect_data->height - ry); /* Draw the bottom-right arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rect_data->width - rx, rect_data->y + rect_data->height - ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, 0.0, 0.5 * M_PI); cairo_restore (cr); /* Draw the line left across the bottom. */ cairo_line_to (cr, rect_data->x + rx, rect_data->y + rect_data->height); /* Draw the bottom-left arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rx, rect_data->y + rect_data->height - ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, 0.5 * M_PI, M_PI); cairo_restore (cr); /* Draw the line up the left side. */ cairo_line_to (cr, rect_data->x, rect_data->y + ry); /* Draw the top-left arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rx, rect_data->y + ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, M_PI, 1.5 * M_PI); cairo_restore (cr); /* Close the path across the top. */ cairo_close_path (cr); } else { /* Draw the plain rectangle. */ cairo_rectangle (cr, rect_data->x, rect_data->y, rect_data->width, rect_data->height); } } static void goo_canvas_rect_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasRect *rect = (GooCanvasRect*) simple; GooCanvasRectData *rect_data = rect->rect_data; gdouble half_line_width; /* We can quickly compute the bounds as being just the rectangle's size plus half the line width around each edge. */ half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; simple->bounds.x1 = rect_data->x - half_line_width; simple->bounds.y1 = rect_data->y - half_line_width; simple->bounds.x2 = rect_data->x + rect_data->width + half_line_width; simple->bounds.y2 = rect_data->y + rect_data->height + half_line_width; } static void goo_canvas_rect_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasRect *rect = (GooCanvasRect*) item; GooCanvasRectModel *rmodel = (GooCanvasRectModel*) model; /* If our rect_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasRectData, rect->rect_data); /* Now use the new model's rect_data instead. */ rect->rect_data = &rmodel->rect_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_rect_set_model; } static void goo_canvas_rect_class_init (GooCanvasRectClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_rect_finalize; gobject_class->get_property = goo_canvas_rect_get_property; gobject_class->set_property = goo_canvas_rect_set_property; simple_class->simple_create_path = goo_canvas_rect_create_path; simple_class->simple_update = goo_canvas_rect_update; goo_canvas_rect_install_common_properties (gobject_class); } /** * SECTION:goocanvasrectmodel * @Title: GooCanvasRectModel * @Short_Description: a model for rectangle items. * * GooCanvasRectModel represents a model for rectangle items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasRectModel use goo_canvas_rect_model_new(). * * To get or set the properties of an existing #GooCanvasRectModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the rectangle you must connect * to the signal handlers of the corresponding #GooCanvasRect objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_rect_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_rect_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasRectModel, goo_canvas_rect_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_rect_model_class_init (GooCanvasRectModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->get_property = goo_canvas_rect_model_get_property; gobject_class->set_property = goo_canvas_rect_model_set_property; goo_canvas_rect_install_common_properties (gobject_class); } static void goo_canvas_rect_model_init (GooCanvasRectModel *rmodel) { } /** * goo_canvas_rect_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the rectangle. * @y: the y coordinate of the top of the rectangle. * @width: the width of the rectangle. * @height: the height of the rectangle. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new rectangle item. * * * * Here's an example showing how to create a rectangle at (100,100) with a * width of 200 and a height of 100. * * * GooCanvasItemModel *rect = goo_canvas_rect_model_new (mygroup, 100.0, 100.0, 200.0, 100.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new rectangle model. **/ GooCanvasItemModel* goo_canvas_rect_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItemModel *model; GooCanvasRectModel *rmodel; GooCanvasRectData *rect_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_RECT_MODEL, NULL); rmodel = (GooCanvasRectModel*) model; rect_data = &rmodel->rect_data; rect_data->x = x; rect_data->y = y; rect_data->width = width; rect_data->height = height; rect_data->radius_x = 0; rect_data->radius_y = 0; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_rect_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasRectModel *rmodel = (GooCanvasRectModel*) object; goo_canvas_rect_get_common_property (object, &rmodel->rect_data, prop_id, value, pspec); } static void goo_canvas_rect_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasRectModel *rmodel = (GooCanvasRectModel*) object; goo_canvas_rect_set_common_property (object, &rmodel->rect_data, prop_id, value, pspec); g_signal_emit_by_name (rmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_rect_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_RECT, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_rect_model_create_item; } goocanvas-1.0.0/src/goocanvasenumtypes.h0000644000076400007640000000152011412724107015310 00000000000000 /* Generated data (by glib-mkenums) */ #ifndef __GOO_CANVAS_ENUM_TYPES_H__ #define __GOO_CANVAS_ENUM_TYPES_H__ #include G_BEGIN_DECLS /* Enumerations from "goocanvasitem.h" */ GType goo_canvas_animate_type_get_type (void); #define GOO_TYPE_CANVAS_ANIMATE_TYPE (goo_canvas_animate_type_get_type()) /* Enumerations from "goocanvasutils.h" */ GType goo_canvas_pointer_events_get_type (void); #define GOO_TYPE_CANVAS_POINTER_EVENTS (goo_canvas_pointer_events_get_type()) GType goo_canvas_item_visibility_get_type (void); #define GOO_TYPE_CANVAS_ITEM_VISIBILITY (goo_canvas_item_visibility_get_type()) GType goo_canvas_path_command_type_get_type (void); #define GOO_TYPE_CANVAS_PATH_COMMAND_TYPE (goo_canvas_path_command_type_get_type()) G_END_DECLS #endif /* __GOO_CANVAS_ENUM_TYPES_H__ */ /* Generated data ends here */ goocanvas-1.0.0/src/goocanvaspath.h0000644000076400007640000000674611412723611014231 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspath.h - a path item, very similar to the SVG path element. */ #ifndef __GOO_CANVAS_PATH_H__ #define __GOO_CANVAS_PATH_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasPathData GooCanvasPathData; struct _GooCanvasPathData { /* An array of GooCanvasPathCommand. */ GArray *path_commands; }; #define GOO_TYPE_CANVAS_PATH (goo_canvas_path_get_type ()) #define GOO_CANVAS_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_PATH, GooCanvasPath)) #define GOO_CANVAS_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_PATH, GooCanvasPathClass)) #define GOO_IS_CANVAS_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_PATH)) #define GOO_IS_CANVAS_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_PATH)) #define GOO_CANVAS_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_PATH, GooCanvasPathClass)) typedef struct _GooCanvasPath GooCanvasPath; typedef struct _GooCanvasPathClass GooCanvasPathClass; /** * GooCanvasPath * * The #GooCanvasPath-struct struct contains private data only. */ struct _GooCanvasPath { GooCanvasItemSimple parent; GooCanvasPathData *path_data; }; struct _GooCanvasPathClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_path_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent, const gchar *path_data, ...); #define GOO_TYPE_CANVAS_PATH_MODEL (goo_canvas_path_model_get_type ()) #define GOO_CANVAS_PATH_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModel)) #define GOO_CANVAS_PATH_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModelClass)) #define GOO_IS_CANVAS_PATH_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_PATH_MODEL)) #define GOO_IS_CANVAS_PATH_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_PATH_MODEL)) #define GOO_CANVAS_PATH_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModelClass)) typedef struct _GooCanvasPathModel GooCanvasPathModel; typedef struct _GooCanvasPathModelClass GooCanvasPathModelClass; /** * GooCanvasPathModel * * The #GooCanvasPathModel-struct struct contains private data only. */ struct _GooCanvasPathModel { GooCanvasItemModelSimple parent_object; GooCanvasPathData path_data; }; struct _GooCanvasPathModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_path_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_path_model_new (GooCanvasItemModel *parent, const gchar *path_data, ...); G_END_DECLS #endif /* __GOO_CANVAS_PATH_H__ */ goocanvas-1.0.0/src/goocanvasatk.h0000644000076400007640000000102711412723611014037 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasatk.h - the accessibility code. */ #ifndef __GOO_CANVAS_ATK_H__ #define __GOO_CANVAS_ATK_H__ #include G_BEGIN_DECLS GType goo_canvas_accessible_factory_get_type (void) G_GNUC_CONST; GType goo_canvas_item_accessible_factory_get_type (void) G_GNUC_CONST; GType goo_canvas_widget_accessible_factory_get_type (void) G_GNUC_CONST; G_END_DECLS #endif /* __GOO_CANVAS_ATK_H__ */ goocanvas-1.0.0/src/goocanvasstyle.h0000644000076400007640000000700611412723611014423 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasstyle.h - cascading styles. */ #ifndef __GOO_CANVAS_STYLE_H__ #define __GOO_CANVAS_STYLE_H__ #include G_BEGIN_DECLS /* GQuarks for the basic properties. */ extern GQuark goo_canvas_style_stroke_pattern_id; extern GQuark goo_canvas_style_fill_pattern_id; extern GQuark goo_canvas_style_fill_rule_id; extern GQuark goo_canvas_style_operator_id; extern GQuark goo_canvas_style_antialias_id; extern GQuark goo_canvas_style_line_width_id; extern GQuark goo_canvas_style_line_cap_id; extern GQuark goo_canvas_style_line_join_id; extern GQuark goo_canvas_style_line_join_miter_limit_id; extern GQuark goo_canvas_style_line_dash_id; extern GQuark goo_canvas_style_font_desc_id; extern GQuark goo_canvas_style_hint_metrics_id; /** * GooCanvasStyleProperty * @id: the unique property identifier. * @value: the value of the property. * * #GooCanvasStyleProperty represents a property setting. */ typedef struct _GooCanvasStyleProperty GooCanvasStyleProperty; struct _GooCanvasStyleProperty { GQuark id; GValue value; }; #define GOO_TYPE_CANVAS_STYLE (goo_canvas_style_get_type ()) #define GOO_CANVAS_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_STYLE, GooCanvasStyle)) #define GOO_CANVAS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_STYLE, GooCanvasStyleClass)) #define GOO_IS_CANVAS_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_STYLE)) #define GOO_IS_CANVAS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_STYLE)) #define GOO_CANVAS_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_STYLE, GooCanvasStyleClass)) typedef struct _GooCanvasStyle GooCanvasStyle; typedef struct _GooCanvasStyleClass GooCanvasStyleClass; /** * GooCanvasStyle * @parent: the parent style. * @properties: an array of #GooCanvasStyleProperty property settings. * * #GooCanvasStyle holds the style properties of a canvas item, as well as a * pointer to the parent style. */ struct _GooCanvasStyle { /* */ GObject parent_object; /* */ GooCanvasStyle *parent; GArray *properties; }; struct _GooCanvasStyleClass { GObjectClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_style_get_type (void) G_GNUC_CONST; GooCanvasStyle* goo_canvas_style_new (void); GooCanvasStyle* goo_canvas_style_copy (GooCanvasStyle *style); GooCanvasStyle* goo_canvas_style_get_parent (GooCanvasStyle *style); void goo_canvas_style_set_parent (GooCanvasStyle *style, GooCanvasStyle *parent); GValue* goo_canvas_style_get_property (GooCanvasStyle *style, GQuark property_id); void goo_canvas_style_set_property (GooCanvasStyle *style, GQuark property_id, const GValue *value); /* Convenience functions to set the standard cairo stroke and fill options. */ gboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style, cairo_t *cr); gboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style, cairo_t *cr); G_END_DECLS #endif /* __GOO_CANVAS_STYLE_H__ */ goocanvas-1.0.0/src/goocanvasatk.c0000644000076400007640000004744611412723611014051 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Copyright 2001 Sun Microsystems Inc. * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation * Released under the GNU LGPL license. See COPYING for details. * * goocanvasatk.c - the accessibility code. Most of this has been ported from * the gail/libgnomecanvas & foocanvas code. */ #include #include #include #include "goocanvas.h" /* * GooCanvasItemAccessible. */ typedef AtkGObjectAccessible GooCanvasItemAccessible; typedef AtkGObjectAccessibleClass GooCanvasItemAccessibleClass; #define GOO_TYPE_CANVAS_ITEM_ACCESSIBLE (goo_canvas_item_accessible_get_type ()) #define GOO_IS_CANVAS_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), goo_canvas_item_accessible_get_type ())) static void goo_canvas_item_accessible_component_interface_init (AtkComponentIface *iface); static gint goo_canvas_item_accessible_get_index_in_parent (AtkObject *accessible); G_DEFINE_TYPE_WITH_CODE (GooCanvasItemAccessible, goo_canvas_item_accessible, ATK_TYPE_GOBJECT_ACCESSIBLE, G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, goo_canvas_item_accessible_component_interface_init)) /* Returns the extents of the item, in pixels relative to the main canvas window. */ static void goo_canvas_item_accessible_get_item_extents (GooCanvasItem *item, GdkRectangle *rect) { GooCanvas *canvas; GooCanvasBounds bounds; canvas = goo_canvas_item_get_canvas (item); if (!canvas) { rect->x = rect->y = rect->width = rect->height = 0; return; } /* Get the bounds in device units. */ goo_canvas_item_get_bounds (item, &bounds); /* Static items are in pixels so don't need converting. */ if (!goo_canvas_item_get_is_static (item)) { /* Convert to pixels within the entire canvas. */ goo_canvas_convert_to_pixels (canvas, &bounds.x1, &bounds.y1); goo_canvas_convert_to_pixels (canvas, &bounds.x2, &bounds.y2); /* Convert to pixels within the visible window. */ bounds.x1 -= canvas->hadjustment->value; bounds.y1 -= canvas->vadjustment->value; bounds.x2 -= canvas->hadjustment->value; bounds.y2 -= canvas->vadjustment->value; } /* Round up or down to integers. */ rect->x = floor (bounds.x1); rect->y = floor (bounds.y1); rect->width = ceil (bounds.x1) - rect->x; rect->height = ceil (bounds.y1) - rect->y; } /* This returns TRUE if the given rectangle intersects the canvas window. The rectangle should be in pixels relative to the main canvas window. */ static gboolean goo_canvas_item_accessible_is_item_in_window (GooCanvasItem *item, GdkRectangle *rect) { GtkWidget *widget; widget = (GtkWidget*) goo_canvas_item_get_canvas (item); if (!widget) return FALSE; if (rect->x + rect->width < 0 || rect->x > widget->allocation.width || rect->y + rect->height < 0 || rect->y > widget->allocation.height) return FALSE; return TRUE; } static gboolean goo_canvas_item_accessible_is_item_on_screen (GooCanvasItem *item) { GdkRectangle rect; goo_canvas_item_accessible_get_item_extents (item, &rect); return goo_canvas_item_accessible_is_item_in_window (item, &rect); } static void goo_canvas_item_accessible_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type) { GooCanvasItem *item; GooCanvas *canvas; GObject *object; gint window_x, window_y; gint toplevel_x, toplevel_y; GdkRectangle rect; GdkWindow *window; g_return_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component)); *x = *y = G_MININT; object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component)); if (!object) return; item = GOO_CANVAS_ITEM (object); canvas = goo_canvas_item_get_canvas (item); if (!canvas || !GTK_WIDGET (canvas)->window) return; goo_canvas_item_accessible_get_item_extents (item, &rect); *width = rect.width; *height = rect.height; if (!goo_canvas_item_accessible_is_item_in_window (item, &rect)) return; gdk_window_get_origin (GTK_WIDGET (canvas)->window, &window_x, &window_y); *x = rect.x + window_x; *y = rect.y + window_y; if (coord_type == ATK_XY_WINDOW) { window = gdk_window_get_toplevel (GTK_WIDGET (canvas)->window); gdk_window_get_origin (window, &toplevel_x, &toplevel_y); *x -= toplevel_x; *y -= toplevel_y; } } static gint goo_canvas_item_accessible_get_mdi_zorder (AtkComponent *component) { g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), -1); return goo_canvas_item_accessible_get_index_in_parent (ATK_OBJECT (component)); } static guint goo_canvas_item_accessible_add_focus_handler (AtkComponent *component, AtkFocusHandler handler) { GSignalMatchType match_type; GClosure *closure; guint signal_id; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), 0); match_type = G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC; signal_id = g_signal_lookup ("focus-event", ATK_TYPE_OBJECT); /* If the handler has already been added just return. */ if (g_signal_handler_find (component, match_type, signal_id, 0, NULL, (gpointer) handler, NULL)) return 0; closure = g_cclosure_new (G_CALLBACK (handler), NULL, (GClosureNotify) NULL); return g_signal_connect_closure_by_id (component, signal_id, 0, closure, FALSE); } static void goo_canvas_item_accessible_remove_focus_handler (AtkComponent *component, guint handler_id) { g_return_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component)); g_signal_handler_disconnect (ATK_OBJECT (component), handler_id); } static gboolean goo_canvas_item_accessible_grab_focus (AtkComponent *component) { GooCanvasItem *item; GooCanvas *canvas; GtkWidget *toplevel; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), FALSE); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component)); if (!object) return FALSE; item = GOO_CANVAS_ITEM (object); canvas = goo_canvas_item_get_canvas (item); if (!canvas) return FALSE; goo_canvas_grab_focus (canvas, item); toplevel = gtk_widget_get_toplevel (GTK_WIDGET (canvas)); if (GTK_WIDGET_TOPLEVEL (toplevel)) gtk_window_present (GTK_WINDOW (toplevel)); return TRUE; } static void goo_canvas_item_accessible_component_interface_init (AtkComponentIface *iface) { iface->get_extents = goo_canvas_item_accessible_get_extents; iface->get_mdi_zorder = goo_canvas_item_accessible_get_mdi_zorder; iface->add_focus_handler = goo_canvas_item_accessible_add_focus_handler; iface->remove_focus_handler = goo_canvas_item_accessible_remove_focus_handler; iface->grab_focus = goo_canvas_item_accessible_grab_focus; } static void goo_canvas_item_accessible_initialize (AtkObject *object, gpointer data) { if (ATK_OBJECT_CLASS (goo_canvas_item_accessible_parent_class)->initialize) ATK_OBJECT_CLASS (goo_canvas_item_accessible_parent_class)->initialize (object, data); object->role = ATK_ROLE_UNKNOWN; /* FIXME: Maybe this should be ATK_LAYER_CANVAS. */ g_object_set_data (G_OBJECT (object), "atk-component-layer", GINT_TO_POINTER (ATK_LAYER_MDI)); } static AtkObject* goo_canvas_item_accessible_get_parent (AtkObject *accessible) { GooCanvasItem *item, *parent; GooCanvas *canvas; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL); if (accessible->accessible_parent) return accessible->accessible_parent; object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return NULL; item = GOO_CANVAS_ITEM (object); parent = goo_canvas_item_get_parent (item); if (parent) return atk_gobject_accessible_for_object (G_OBJECT (parent)); canvas = goo_canvas_item_get_canvas (item); if (canvas) return gtk_widget_get_accessible (GTK_WIDGET (canvas)); return NULL; } static gint goo_canvas_item_accessible_get_index_in_parent (AtkObject *accessible) { GooCanvasItem *item, *parent; GooCanvas *canvas; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), -1); if (accessible->accessible_parent) { gint n_children, i; gboolean found = FALSE; n_children = atk_object_get_n_accessible_children (accessible->accessible_parent); for (i = 0; i < n_children; i++) { AtkObject *child; child = atk_object_ref_accessible_child (accessible->accessible_parent, i); if (child == accessible) found = TRUE; g_object_unref (child); if (found) return i; } return -1; } object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return -1; item = GOO_CANVAS_ITEM (object); parent = goo_canvas_item_get_parent (item); if (parent) return goo_canvas_item_find_child (parent, item); canvas = goo_canvas_item_get_canvas (item); if (canvas) return 0; return -1; } static gint goo_canvas_item_accessible_get_n_children (AtkObject *accessible) { GooCanvasItem *item; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), 0); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return 0; item = GOO_CANVAS_ITEM (object); return goo_canvas_item_get_n_children (item); } static AtkObject* goo_canvas_item_accessible_ref_child (AtkObject *accessible, gint child_num) { GooCanvasItem *item, *child; AtkObject *atk_object; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return NULL; item = GOO_CANVAS_ITEM (object); child = goo_canvas_item_get_child (item, child_num); if (!child) return NULL; atk_object = atk_gobject_accessible_for_object (G_OBJECT (child)); g_object_ref (atk_object); return atk_object; } static AtkStateSet* goo_canvas_item_accessible_ref_state_set (AtkObject *accessible) { GooCanvasItem *item; GooCanvas *canvas; AtkStateSet *state_set; GObject *object; gboolean can_focus = FALSE; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL); state_set = ATK_OBJECT_CLASS (goo_canvas_item_accessible_parent_class)->ref_state_set (accessible); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (!object) { atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT); return state_set; } item = GOO_CANVAS_ITEM (object); canvas = goo_canvas_item_get_canvas (item); if (!canvas) return state_set; if (goo_canvas_item_is_visible (item)) { atk_state_set_add_state (state_set, ATK_STATE_VISIBLE); if (goo_canvas_item_accessible_is_item_on_screen (item)) atk_state_set_add_state (state_set, ATK_STATE_SHOWING); } g_object_get (item, "can-focus", &can_focus, NULL); if (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (canvas)) && can_focus) { atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE); #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_has_focus (GTK_WIDGET (canvas)) && canvas->focused_item == item) #else if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item == item) #endif atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); } return state_set; } static void goo_canvas_item_accessible_class_init (GooCanvasItemAccessibleClass *klass) { AtkObjectClass *aklass = (AtkObjectClass*) klass; aklass->initialize = goo_canvas_item_accessible_initialize; aklass->get_parent = goo_canvas_item_accessible_get_parent; aklass->get_index_in_parent = goo_canvas_item_accessible_get_index_in_parent; aklass->get_n_children = goo_canvas_item_accessible_get_n_children; aklass->ref_child = goo_canvas_item_accessible_ref_child; aklass->ref_state_set = goo_canvas_item_accessible_ref_state_set; } static void goo_canvas_item_accessible_init (GooCanvasItemAccessible *accessible) { } static AtkObject * goo_canvas_item_accessible_new (GObject *object) { AtkObject *accessible; g_return_val_if_fail (GOO_IS_CANVAS_ITEM (object), NULL); accessible = g_object_new (goo_canvas_item_accessible_get_type (), NULL); atk_object_initialize (accessible, object); return accessible; } /* * GooCanvasItemAccessibleFactory. */ typedef AtkObjectFactory GooCanvasItemAccessibleFactory; typedef AtkObjectFactoryClass GooCanvasItemAccessibleFactoryClass; G_DEFINE_TYPE (GooCanvasItemAccessibleFactory, goo_canvas_item_accessible_factory, ATK_TYPE_OBJECT_FACTORY) static void goo_canvas_item_accessible_factory_class_init (GooCanvasItemAccessibleFactoryClass *klass) { klass->create_accessible = goo_canvas_item_accessible_new; klass->get_accessible_type = goo_canvas_item_accessible_get_type; } static void goo_canvas_item_accessible_factory_init (GooCanvasItemAccessibleFactory *factory) { } /* * GooCanvasWidgetAccessible. */ typedef AtkGObjectAccessible GooCanvasWidgetAccessible; typedef AtkGObjectAccessibleClass GooCanvasWidgetAccessibleClass; #define GOO_IS_CANVAS_WIDGET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), goo_canvas_widget_accessible_get_type ())) G_DEFINE_TYPE (GooCanvasWidgetAccessible, goo_canvas_widget_accessible, GOO_TYPE_CANVAS_ITEM_ACCESSIBLE) static void goo_canvas_widget_accessible_initialize (AtkObject *object, gpointer data) { if (ATK_OBJECT_CLASS (goo_canvas_widget_accessible_parent_class)->initialize) ATK_OBJECT_CLASS (goo_canvas_widget_accessible_parent_class)->initialize (object, data); object->role = ATK_ROLE_PANEL; } static gint goo_canvas_widget_accessible_get_n_children (AtkObject *accessible) { GooCanvasWidget *witem; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET_ACCESSIBLE (accessible), 0); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return 0; witem = GOO_CANVAS_WIDGET (object); return witem->widget ? 1 : 0; } static AtkObject * goo_canvas_widget_accessible_ref_child (AtkObject *accessible, gint child_num) { GooCanvasWidget *witem; AtkObject *atk_object; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET_ACCESSIBLE (accessible), NULL); if (child_num != 0) return NULL; object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return NULL; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET (object), NULL); witem = GOO_CANVAS_WIDGET (object); if (!witem->widget) return NULL; atk_object = gtk_widget_get_accessible (witem->widget); g_object_ref (atk_object); return atk_object; } static void goo_canvas_widget_accessible_class_init (GooCanvasWidgetAccessibleClass *klass) { AtkObjectClass *aklass = (AtkObjectClass*) klass; aklass->initialize = goo_canvas_widget_accessible_initialize; aklass->get_n_children = goo_canvas_widget_accessible_get_n_children; aklass->ref_child = goo_canvas_widget_accessible_ref_child; } static void goo_canvas_widget_accessible_init (GooCanvasWidgetAccessible *accessible) { } static AtkObject* goo_canvas_widget_accessible_new (GObject *object) { AtkObject *accessible; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET (object), NULL); accessible = g_object_new (goo_canvas_widget_accessible_get_type (), NULL); atk_object_initialize (accessible, object); return accessible; } /* * GooCanvasWidgetAccessibleFactory. */ typedef AtkObjectFactory GooCanvasWidgetAccessibleFactory; typedef AtkObjectFactoryClass GooCanvasWidgetAccessibleFactoryClass; G_DEFINE_TYPE (GooCanvasWidgetAccessibleFactory, goo_canvas_widget_accessible_factory, ATK_TYPE_OBJECT_FACTORY) static void goo_canvas_widget_accessible_factory_class_init (GooCanvasWidgetAccessibleFactoryClass *klass) { klass->create_accessible = goo_canvas_widget_accessible_new; klass->get_accessible_type = goo_canvas_widget_accessible_get_type; } static void goo_canvas_widget_accessible_factory_init (GooCanvasWidgetAccessibleFactory *factory) { } /* * GooCanvasAccessible. */ static gpointer accessible_parent_class = NULL; static void goo_canvas_accessible_initialize (AtkObject *object, gpointer data) { if (ATK_OBJECT_CLASS (accessible_parent_class)->initialize) ATK_OBJECT_CLASS (accessible_parent_class)->initialize (object, data); /* FIXME: Maybe this should be ATK_ROLE_CANVAS. */ object->role = ATK_ROLE_LAYERED_PANE; } static gint goo_canvas_accessible_get_n_children (AtkObject *object) { GtkAccessible *accessible; GtkWidget *widget; accessible = GTK_ACCESSIBLE (object); widget = accessible->widget; /* Check if widget still exists. */ if (widget == NULL) return 0; g_return_val_if_fail (GOO_IS_CANVAS (widget), 0); if (goo_canvas_get_root_item (GOO_CANVAS (widget))) return 1; return 0; } static AtkObject* goo_canvas_accessible_ref_child (AtkObject *object, gint child_num) { GtkAccessible *accessible; GtkWidget *widget; GooCanvasItem *root; AtkObject *atk_object; /* Canvas only has one child, so return NULL if index is non zero */ if (child_num != 0) return NULL; accessible = GTK_ACCESSIBLE (object); widget = accessible->widget; /* Check if widget still exists. */ if (widget == NULL) return NULL; root = goo_canvas_get_root_item (GOO_CANVAS (widget)); if (!root) return NULL; atk_object = atk_gobject_accessible_for_object (G_OBJECT (root)); g_object_ref (atk_object); return atk_object; } static void goo_canvas_accessible_class_init (AtkObjectClass *klass) { accessible_parent_class = g_type_class_peek_parent (klass); klass->initialize = goo_canvas_accessible_initialize; klass->get_n_children = goo_canvas_accessible_get_n_children; klass->ref_child = goo_canvas_accessible_ref_child; } static GType goo_canvas_accessible_get_type (void) { static GType g_define_type_id = 0; if (G_UNLIKELY (g_define_type_id == 0)) { AtkObjectFactory *factory; GType parent_atk_type; GTypeQuery query; GTypeInfo tinfo = { 0 }; /* Gail doesn't declare its classes publicly, so we have to do a query to find the size of the class and instances. */ factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET); if (!factory) return G_TYPE_INVALID; parent_atk_type = atk_object_factory_get_accessible_type (factory); if (!parent_atk_type) return G_TYPE_INVALID; g_type_query (parent_atk_type, &query); tinfo.class_init = (GClassInitFunc) goo_canvas_accessible_class_init; tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; g_define_type_id = g_type_register_static (parent_atk_type, "GooCanvasAccessible", &tinfo, 0); } return g_define_type_id; } static AtkObject * goo_canvas_accessible_new (GObject *object) { AtkObject *accessible; g_return_val_if_fail (GOO_IS_CANVAS (object), NULL); accessible = g_object_new (goo_canvas_accessible_get_type (), NULL); atk_object_initialize (accessible, object); return accessible; } /* * GooCanvasAccessibleFactory. */ typedef AtkObjectFactory GooCanvasAccessibleFactory; typedef AtkObjectFactoryClass GooCanvasAccessibleFactoryClass; G_DEFINE_TYPE (GooCanvasAccessibleFactory, goo_canvas_accessible_factory, ATK_TYPE_OBJECT_FACTORY) static void goo_canvas_accessible_factory_class_init (GooCanvasAccessibleFactoryClass *klass) { klass->create_accessible = goo_canvas_accessible_new; klass->get_accessible_type = goo_canvas_accessible_get_type; } static void goo_canvas_accessible_factory_init (GooCanvasAccessibleFactory *factory) { } goocanvas-1.0.0/src/goocanvasimage.h0000644000076400007640000000712011412723611014342 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasimage.h - image item. */ #ifndef __GOO_CANVAS_IMAGE_H__ #define __GOO_CANVAS_IMAGE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasImageData GooCanvasImageData; struct _GooCanvasImageData { cairo_pattern_t *pattern; gdouble x, y, width, height; }; #define GOO_TYPE_CANVAS_IMAGE (goo_canvas_image_get_type ()) #define GOO_CANVAS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_IMAGE, GooCanvasImage)) #define GOO_CANVAS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_IMAGE, GooCanvasImageClass)) #define GOO_IS_CANVAS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_IMAGE)) #define GOO_IS_CANVAS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_IMAGE)) #define GOO_CANVAS_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_IMAGE, GooCanvasImageClass)) typedef struct _GooCanvasImage GooCanvasImage; typedef struct _GooCanvasImageClass GooCanvasImageClass; /** * GooCanvasImage * * The #GooCanvasImage-struct struct contains private data only. */ struct _GooCanvasImage { GooCanvasItemSimple parent_object; GooCanvasImageData *image_data; }; struct _GooCanvasImageClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_image_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); #define GOO_TYPE_CANVAS_IMAGE_MODEL (goo_canvas_image_model_get_type ()) #define GOO_CANVAS_IMAGE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImageModel)) #define GOO_CANVAS_IMAGE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImageModelClass)) #define GOO_IS_CANVAS_IMAGE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_IMAGE_MODEL)) #define GOO_IS_CANVAS_IMAGE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_IMAGE_MODEL)) #define GOO_CANVAS_IMAGE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImageModelClass)) typedef struct _GooCanvasImageModel GooCanvasImageModel; typedef struct _GooCanvasImageModelClass GooCanvasImageModelClass; /** * GooCanvasImageModel * * The #GooCanvasImageModel-struct struct contains private data only. */ struct _GooCanvasImageModel { GooCanvasItemModelSimple parent_object; GooCanvasImageData image_data; }; struct _GooCanvasImageModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_image_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_image_model_new (GooCanvasItemModel *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); G_END_DECLS #endif /* __GOO_CANVAS_IMAGE_H__ */ goocanvas-1.0.0/src/goocanvaspolyline.h0000644000076400007640000001307011412723611015114 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspolyline.h - polyline item, with optional arrows. */ #ifndef __GOO_CANVAS_POLYLINE_H__ #define __GOO_CANVAS_POLYLINE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /** * GooCanvasPoints * @coords: the coordinates of the points, in pairs. * @num_points: the number of points. * @ref_count: the reference count of the struct. * * #GooCairoPoints represents an array of points. */ typedef struct _GooCanvasPoints GooCanvasPoints; struct _GooCanvasPoints { double *coords; int num_points; int ref_count; }; #define GOO_TYPE_CANVAS_POINTS goo_canvas_points_get_type() GType goo_canvas_points_get_type (void); GooCanvasPoints* goo_canvas_points_new (int num_points); GooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points); void goo_canvas_points_unref (GooCanvasPoints *points); #define NUM_ARROW_POINTS 5 /* number of points in an arrowhead */ typedef struct _GooCanvasPolylineArrowData GooCanvasPolylineArrowData; struct _GooCanvasPolylineArrowData { /* These are specified in multiples of the line width, e.g. if arrow_width is 2 the width of the arrow will be twice the width of the line. */ gdouble arrow_width, arrow_length, arrow_tip_length; gdouble line_start[2], line_end[2]; gdouble start_arrow_coords[NUM_ARROW_POINTS * 2]; gdouble end_arrow_coords[NUM_ARROW_POINTS * 2]; }; /* This is the data used by both model and view classes. */ typedef struct _GooCanvasPolylineData GooCanvasPolylineData; struct _GooCanvasPolylineData { gdouble *coords; GooCanvasPolylineArrowData *arrow_data; guint num_points : 16; guint close_path : 1; guint start_arrow : 1; guint end_arrow : 1; guint reconfigure_arrows : 1; /* Not used any more. */ }; #define GOO_TYPE_CANVAS_POLYLINE (goo_canvas_polyline_get_type ()) #define GOO_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolyline)) #define GOO_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass)) #define GOO_IS_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE)) #define GOO_IS_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE)) #define GOO_CANVAS_POLYLINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass)) typedef struct _GooCanvasPolyline GooCanvasPolyline; typedef struct _GooCanvasPolylineClass GooCanvasPolylineClass; /** * GooCanvasPolyline * * The #GooCanvasPolyline-struct struct contains private data only. */ struct _GooCanvasPolyline { GooCanvasItemSimple parent; GooCanvasPolylineData *polyline_data; }; struct _GooCanvasPolylineClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_polyline_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent, gboolean close_path, gint num_points, ...); GooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); #define GOO_TYPE_CANVAS_POLYLINE_MODEL (goo_canvas_polyline_model_get_type ()) #define GOO_CANVAS_POLYLINE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModel)) #define GOO_CANVAS_POLYLINE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass)) #define GOO_IS_CANVAS_POLYLINE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL)) #define GOO_IS_CANVAS_POLYLINE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL)) #define GOO_CANVAS_POLYLINE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass)) typedef struct _GooCanvasPolylineModel GooCanvasPolylineModel; typedef struct _GooCanvasPolylineModelClass GooCanvasPolylineModelClass; /** * GooCanvasPolylineModel * * The #GooCanvasPolylineModel-struct struct contains private data only. */ struct _GooCanvasPolylineModel { GooCanvasItemModelSimple parent_object; GooCanvasPolylineData polyline_data; }; struct _GooCanvasPolylineModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_polyline_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_polyline_model_new (GooCanvasItemModel *parent, gboolean close_path, gint num_points, ...); GooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); G_END_DECLS #endif /* __GOO_CANVAS_POLYLINE_H__ */ goocanvas-1.0.0/src/goocanvasitem.h0000644000076400007640000004500711412723611014224 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitem.h - interface for canvas items & groups. */ #ifndef __GOO_CANVAS_ITEM_H__ #define __GOO_CANVAS_ITEM_H__ #include #include "goocanvasstyle.h" G_BEGIN_DECLS /** * GooCanvasAnimateType * @GOO_CANVAS_ANIMATE_FREEZE: the item remains in the final position. * @GOO_CANVAS_ANIMATE_RESET: the item is moved back to the initial position. * @GOO_CANVAS_ANIMATE_RESTART: the animation is restarted from the initial * position. * @GOO_CANVAS_ANIMATE_BOUNCE: the animation bounces back and forth between the * start and end positions. * * #GooCanvasAnimateType is used to specify what happens when the end of an * animation is reached. */ typedef enum { GOO_CANVAS_ANIMATE_FREEZE, GOO_CANVAS_ANIMATE_RESET, GOO_CANVAS_ANIMATE_RESTART, GOO_CANVAS_ANIMATE_BOUNCE } GooCanvasAnimateType; /** * GooCanvasBounds * @x1: the left edge. * @y1: the top edge. * @x2: the right edge. * @y2: the bottom edge. * * #GooCanvasBounds represents the bounding box of an item in the canvas. */ typedef struct _GooCanvasBounds GooCanvasBounds; struct _GooCanvasBounds { gdouble x1, y1, x2, y2; }; GType goo_canvas_bounds_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CANVAS_BOUNDS (goo_canvas_bounds_get_type ()) #define GOO_TYPE_CANVAS_ITEM (goo_canvas_item_get_type ()) #define GOO_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM, GooCanvasItem)) #define GOO_IS_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM)) #define GOO_CANVAS_ITEM_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GOO_TYPE_CANVAS_ITEM, GooCanvasItemIface)) /* Workaround for circular dependencies. Include this file first. */ typedef struct _GooCanvas GooCanvas; typedef struct _GooCanvasItemModel GooCanvasItemModel; /** * GooCanvasItem * * #GooCanvasItem is a typedef used for objects that implement the * #GooCanvasItem interface. * * (There is no actual #GooCanvasItem struct, since it is only an interface. * But using '#GooCanvasItem' is more helpful than using '#GObject'.) */ typedef struct _GooCanvasItem GooCanvasItem; /** * GooCanvasItemIface * @get_canvas: returns the canvas the item is in. * @set_canvas: sets the canvas the item is in. * @get_n_children: returns the number of children of the item. * @get_child: returns the child at the given index. * @request_update: requests that an update is scheduled. * @add_child: adds a child. * @move_child: moves a child up or down the stacking order. * @remove_child: removes a child. * @get_child_property: gets a child property of a given child item, * e.g. the "row" or "column" property of an item in a #GooCanvasTable. * @set_child_property: sets a child property for a given child item. * @get_transform_for_child: gets the transform used to lay out a given child. * @get_parent: gets the item's parent. * @set_parent: sets the item's parent. * @get_bounds: gets the bounds of the item. * @get_items_at: gets all the items at the given point. * @update: updates the item, if needed. It recalculates the bounds of the item * and requests redraws of parts of the canvas if necessary. * @paint: renders the item to the given cairo context. * @get_requested_area: returns the requested area of the item, in its parent's * coordinate space. This is only used for items in layout containers such as * #GooCanvasTable. * @allocate_area: allocates the item's area, in its parent's coordinate space. * The item must recalculate its bounds and request redraws of parts of the * canvas if necessary. This is only used for items in layout containers such * as #GooCanvasTable. * @get_transform: gets the item's transformation matrix. * @set_transform: sets the item's transformation matrix. * @get_style: gets the item's style. * @set_style: sets the item's style. * @is_visible: returns %TRUE if the item is currently visible. * @get_is_static: returns %TRUE if the item is static. * @set_is_static: notifies the item whether it is static or not. * @get_requested_height: returns the requested height of the item, * given a particular allocated width, using the parent's coordinate space. * @get_model: gets the model that the canvas item is viewing. * @set_model: sets the model that the canvas item will view. * @enter_notify_event: signal emitted when the mouse enters the item. * @leave_notify_event: signal emitted when the mouse leaves the item. * @motion_notify_event: signal emitted when the mouse moves within the item. * @button_press_event: signal emitted when a mouse button is pressed within * the item. * @button_release_event: signal emitted when a mouse button is released. * @focus_in_event: signal emitted when the item receices the keyboard focus. * @focus_out_event: signal emitted when the item loses the keyboard focus. * @key_press_event: signal emitted when a key is pressed. * @key_release_event: signal emitted when a key is released. * @grab_broken_event: signal emitted when a grab that the item has is lost. * @child_notify: signal emitted when a child property is changed. * @query_tooltip: signal emitted to query the tooltip of an item. * @animation_finished: signal emitted when the item's animation has finished. * @scroll_event: signal emitted when the mouse wheel is activated within * the item. * * #GooCanvasItemIFace holds the virtual methods that make up the * #GooCanvasItem interface. * * Simple canvas items only need to implement the get_parent(), set_parent(), * get_bounds(), get_items_at(), update() and paint() methods (and also * get_requested_area() and allocate_area() if they are going to be used * inside a layout container like #GooCanvasTable). * * Items that support transforms should also implement get_transform() and * set_transform(). Items that support styles should implement get_style() * and set_style(). * * Container items must implement get_canvas(), set_canvas(), * get_n_children(), get_child() and request_update(). Containers that support * dynamic changes to their children should implement add_child(), * move_child() and remove_child(). Layout containers like #GooCanvasTable * may implement get_child_property(), set_child_property() and * get_transform_for_child(). */ typedef struct _GooCanvasItemIface GooCanvasItemIface; struct _GooCanvasItemIface { /*< private >*/ GTypeInterface base_iface; /*< public >*/ /* Virtual methods that group items must implement. */ GooCanvas* (* get_canvas) (GooCanvasItem *item); void (* set_canvas) (GooCanvasItem *item, GooCanvas *canvas); gint (* get_n_children) (GooCanvasItem *item); GooCanvasItem* (* get_child) (GooCanvasItem *item, gint child_num); void (* request_update) (GooCanvasItem *item); /* Virtual methods that group items may implement. */ void (* add_child) (GooCanvasItem *item, GooCanvasItem *child, gint position); void (* move_child) (GooCanvasItem *item, gint old_position, gint new_position); void (* remove_child) (GooCanvasItem *item, gint child_num); void (* get_child_property) (GooCanvasItem *item, GooCanvasItem *child, guint property_id, GValue *value, GParamSpec *pspec); void (* set_child_property) (GooCanvasItem *item, GooCanvasItem *child, guint property_id, const GValue *value, GParamSpec *pspec); gboolean (* get_transform_for_child) (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform); /* Virtual methods that all canvas items must implement. */ GooCanvasItem* (* get_parent) (GooCanvasItem *item); void (* set_parent) (GooCanvasItem *item, GooCanvasItem *parent); void (* get_bounds) (GooCanvasItem *item, GooCanvasBounds *bounds); GList* (* get_items_at) (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items); void (* update) (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds); void (* paint) (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); gboolean (* get_requested_area) (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area); void (* allocate_area) (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset); /* Virtual methods that canvas items may implement. */ gboolean (* get_transform) (GooCanvasItem *item, cairo_matrix_t *transform); void (* set_transform) (GooCanvasItem *item, const cairo_matrix_t *transform); GooCanvasStyle* (* get_style) (GooCanvasItem *item); void (* set_style) (GooCanvasItem *item, GooCanvasStyle *style); gboolean (* is_visible) (GooCanvasItem *item); gdouble (* get_requested_height) (GooCanvasItem *item, cairo_t *cr, gdouble width); /* Virtual methods that model/view items must implement. */ GooCanvasItemModel* (* get_model) (GooCanvasItem *item); void (* set_model) (GooCanvasItem *item, GooCanvasItemModel *model); /* Signals. */ gboolean (* enter_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event); gboolean (* leave_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event); gboolean (* motion_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event); gboolean (* button_press_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event); gboolean (* button_release_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event); gboolean (* focus_in_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event); gboolean (* focus_out_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event); gboolean (* key_press_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event); gboolean (* key_release_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event); gboolean (* grab_broken_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventGrabBroken *event); void (* child_notify) (GooCanvasItem *item, GParamSpec *pspec); gboolean (* query_tooltip) (GooCanvasItem *item, gdouble x, gdouble y, gboolean keyboard_tooltip, GtkTooltip *tooltip); gboolean (* get_is_static) (GooCanvasItem *item); void (* set_is_static) (GooCanvasItem *item, gboolean is_static); void (* animation_finished) (GooCanvasItem *item, gboolean stopped); gboolean (* scroll_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventScroll *event); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_item_get_type (void) G_GNUC_CONST; /* * Group functions - these should only be called on container items. */ gint goo_canvas_item_get_n_children (GooCanvasItem *item); GooCanvasItem* goo_canvas_item_get_child (GooCanvasItem *item, gint child_num); gint goo_canvas_item_find_child (GooCanvasItem *item, GooCanvasItem *child); void goo_canvas_item_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position); void goo_canvas_item_move_child (GooCanvasItem *item, gint old_position, gint new_position); void goo_canvas_item_remove_child (GooCanvasItem *item, gint child_num); void goo_canvas_item_get_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, GValue *value); void goo_canvas_item_set_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, const GValue *value); void goo_canvas_item_get_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_set_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_get_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); void goo_canvas_item_set_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); gboolean goo_canvas_item_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform); /* * Item functions - these are safe to call on all items. */ GooCanvas* goo_canvas_item_get_canvas (GooCanvasItem *item); void goo_canvas_item_set_canvas (GooCanvasItem *item, GooCanvas *canvas); GooCanvasItem* goo_canvas_item_get_parent (GooCanvasItem *item); void goo_canvas_item_set_parent (GooCanvasItem *item, GooCanvasItem *parent); void goo_canvas_item_remove (GooCanvasItem *item); gboolean goo_canvas_item_is_container (GooCanvasItem *item); void goo_canvas_item_raise (GooCanvasItem *item, GooCanvasItem *above); void goo_canvas_item_lower (GooCanvasItem *item, GooCanvasItem *below); gboolean goo_canvas_item_get_transform (GooCanvasItem *item, cairo_matrix_t *transform); void goo_canvas_item_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform); gboolean goo_canvas_item_get_simple_transform (GooCanvasItem *item, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); void goo_canvas_item_set_simple_transform (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble rotation); void goo_canvas_item_translate (GooCanvasItem *item, gdouble tx, gdouble ty); void goo_canvas_item_scale (GooCanvasItem *item, gdouble sx, gdouble sy); void goo_canvas_item_rotate (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_skew_x (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_skew_y (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); GooCanvasStyle* goo_canvas_item_get_style (GooCanvasItem *item); void goo_canvas_item_set_style (GooCanvasItem *item, GooCanvasStyle *style); void goo_canvas_item_animate (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); void goo_canvas_item_stop_animation (GooCanvasItem *item); void goo_canvas_item_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds); GList* goo_canvas_item_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items); gboolean goo_canvas_item_is_visible (GooCanvasItem *item); GooCanvasItemModel* goo_canvas_item_get_model (GooCanvasItem *item); void goo_canvas_item_set_model (GooCanvasItem *item, GooCanvasItemModel *model); void goo_canvas_item_request_update (GooCanvasItem *item); void goo_canvas_item_ensure_updated (GooCanvasItem *item); void goo_canvas_item_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); gboolean goo_canvas_item_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area); gdouble goo_canvas_item_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width); void goo_canvas_item_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset); gboolean goo_canvas_item_get_is_static (GooCanvasItem *item); void goo_canvas_item_set_is_static (GooCanvasItem *item, gboolean is_static); /* * Functions to support child properties when implementing new canvas items. */ void goo_canvas_item_class_install_child_property (GObjectClass *iclass, guint property_id, GParamSpec *pspec); GParamSpec* goo_canvas_item_class_find_child_property (GObjectClass *iclass, const gchar *property_name); GParamSpec** goo_canvas_item_class_list_child_properties (GObjectClass *iclass, guint *n_properties); G_END_DECLS #endif /* __GOO_CANVAS_ITEM_H__ */ goocanvas-1.0.0/src/goocanvaspolyline.c0000644000076400007640000012336511412723611015120 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspolyline.c - polyline item, with optional arrows. */ /** * SECTION:goocanvaspolyline * @Title: GooCanvasPolyline * @Short_Description: a polyline item (a series of lines with optional arrows). * * GooCanvasPolyline represents a polyline item, which is a series of one or * more lines, with optional arrows at either end. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasPolyline use goo_canvas_polyline_new(), or * goo_canvas_polyline_new_line() for a simple line between two points. * * To get or set the properties of an existing #GooCanvasPolyline, use * g_object_get() and g_object_set(). */ #include #include #include #include #include #include #include "goocanvaspolyline.h" #include "goocanvas.h" /** * goo_canvas_points_new: * @num_points: the number of points to create space for. * * Creates a new #GooCanvasPoints struct with space for the given number of * points. It should be freed with goo_canvas_points_unref(). * * Returns: a new #GooCanvasPoints struct. **/ GooCanvasPoints* goo_canvas_points_new (int num_points) { GooCanvasPoints *points; points = g_slice_new (GooCanvasPoints); points->num_points = num_points; points->coords = g_slice_alloc (num_points * 2 * sizeof (double)); points->ref_count = 1; return points; } /** * goo_canvas_points_ref: * @points: a #GooCanvasPoints struct. * * Increments the reference count of the given #GooCanvasPoints struct. * * Returns: the #GooCanvasPoints struct. **/ GooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points) { points->ref_count++; return points; } /** * goo_canvas_points_unref: * @points: a #GooCanvasPoints struct. * * Decrements the reference count of the given #GooCanvasPoints struct, * freeing it if the reference count falls to zero. **/ void goo_canvas_points_unref (GooCanvasPoints *points) { if (--points->ref_count == 0) { g_slice_free1 (points->num_points * 2 * sizeof (double), points->coords); g_slice_free (GooCanvasPoints, points); } } GType goo_canvas_points_get_type (void) { static GType type_canvas_points = 0; if (!type_canvas_points) type_canvas_points = g_boxed_type_register_static ("GooCanvasPoints", (GBoxedCopyFunc) goo_canvas_points_ref, (GBoxedFreeFunc) goo_canvas_points_unref); return type_canvas_points; } enum { PROP_0, PROP_POINTS, PROP_CLOSE_PATH, PROP_START_ARROW, PROP_END_ARROW, PROP_ARROW_LENGTH, PROP_ARROW_WIDTH, PROP_ARROW_TIP_LENGTH, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasPolyline, goo_canvas_polyline, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_polyline_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_POINTS, g_param_spec_boxed ("points", _("Points"), _("The array of points"), GOO_TYPE_CANVAS_POINTS, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CLOSE_PATH, g_param_spec_boolean ("close-path", _("Close Path"), _("If the last point should be connected to the first"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_START_ARROW, g_param_spec_boolean ("start-arrow", _("Start Arrow"), _("If an arrow should be displayed at the start of the polyline"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_END_ARROW, g_param_spec_boolean ("end-arrow", _("End Arrow"), _("If an arrow should be displayed at the end of the polyline"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ARROW_LENGTH, g_param_spec_double ("arrow-length", _("Arrow Length"), _("The length of the arrows, as a multiple of the line width"), 0.0, G_MAXDOUBLE, 5.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ARROW_WIDTH, g_param_spec_double ("arrow-width", _("Arrow Width"), _("The width of the arrows, as a multiple of the line width"), 0.0, G_MAXDOUBLE, 4.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ARROW_TIP_LENGTH, g_param_spec_double ("arrow-tip-length", _("Arrow Tip Length"), _("The length of the arrow tip, as a multiple of the line width"), 0.0, G_MAXDOUBLE, 4.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the left-most point of the polyline"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the top-most point of the polyline"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the polyline"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the polyline"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_polyline_init (GooCanvasPolyline *polyline) { polyline->polyline_data = g_slice_new0 (GooCanvasPolylineData); } static void goo_canvas_polyline_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPolyline *polyline = (GooCanvasPolyline*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { g_slice_free1 (polyline->polyline_data->num_points * 2 * sizeof (gdouble), polyline->polyline_data->coords); g_slice_free (GooCanvasPolylineArrowData, polyline->polyline_data->arrow_data); g_slice_free (GooCanvasPolylineData, polyline->polyline_data); } polyline->polyline_data = NULL; G_OBJECT_CLASS (goo_canvas_polyline_parent_class)->finalize (object); } static void goo_canvas_polyline_get_extent (GooCanvasPolylineData *polyline_data, GooCanvasBounds *bounds) { guint i; if (polyline_data->num_points == 0) { bounds->x1 = bounds->y1 = bounds->x2 = bounds->y2 = 0.0; } else { bounds->x1 = bounds->x2 = polyline_data->coords[0]; bounds->y1 = bounds->y2 = polyline_data->coords[1]; for (i = 1; i < polyline_data->num_points; i++) { bounds->x1 = MIN (bounds->x1, polyline_data->coords[2 * i]); bounds->y1 = MIN (bounds->y1, polyline_data->coords[2 * i + 1]); bounds->x2 = MAX (bounds->x2, polyline_data->coords[2 * i]); bounds->y2 = MAX (bounds->y2, polyline_data->coords[2 * i + 1]); } } } static void goo_canvas_polyline_get_common_property (GObject *object, GooCanvasPolylineData *polyline_data, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPoints *points; GooCanvasBounds extent; switch (prop_id) { case PROP_POINTS: if (polyline_data->num_points == 0) { g_value_set_boxed (value, NULL); } else { points = goo_canvas_points_new (polyline_data->num_points); memcpy (points->coords, polyline_data->coords, polyline_data->num_points * 2 * sizeof (double)); g_value_set_boxed (value, points); goo_canvas_points_unref (points); } break; case PROP_CLOSE_PATH: g_value_set_boolean (value, polyline_data->close_path); break; case PROP_START_ARROW: g_value_set_boolean (value, polyline_data->start_arrow); break; case PROP_END_ARROW: g_value_set_boolean (value, polyline_data->end_arrow); break; case PROP_ARROW_LENGTH: g_value_set_double (value, polyline_data->arrow_data ? polyline_data->arrow_data->arrow_length : 5.0); break; case PROP_ARROW_WIDTH: g_value_set_double (value, polyline_data->arrow_data ? polyline_data->arrow_data->arrow_width : 4.0); break; case PROP_ARROW_TIP_LENGTH: g_value_set_double (value, polyline_data->arrow_data ? polyline_data->arrow_data->arrow_tip_length : 4.0); break; case PROP_X: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.x1); break; case PROP_Y: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.y1); break; case PROP_WIDTH: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.x2 - extent.x1); break; case PROP_HEIGHT: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.y2 - extent.y1); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_polyline_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPolyline *polyline = (GooCanvasPolyline*) object; goo_canvas_polyline_get_common_property (object, polyline->polyline_data, prop_id, value, pspec); } static void ensure_arrow_data (GooCanvasPolylineData *polyline_data) { if (!polyline_data->arrow_data) { polyline_data->arrow_data = g_slice_new (GooCanvasPolylineArrowData); /* These seem like reasonable defaults for the arrow dimensions. They are specified in multiples of the line width so they scale OK. */ polyline_data->arrow_data->arrow_width = 4.0; polyline_data->arrow_data->arrow_length = 5.0; polyline_data->arrow_data->arrow_tip_length = 4.0; } } #define GOO_CANVAS_EPSILON 1e-10 static void reconfigure_arrow (GooCanvasPolylineData *polyline_data, gint end_point, gint prev_point, gdouble line_width, gdouble *line_coords, gdouble *arrow_coords) { GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; double dx, dy, length, sin_theta, cos_theta; double half_arrow_width, arrow_length, arrow_tip_length; double arrow_end_center_x, arrow_end_center_y; double arrow_tip_center_x, arrow_tip_center_y; double x_offset, y_offset, half_line_width, line_trim; dx = polyline_data->coords[prev_point] - polyline_data->coords[end_point]; dy = polyline_data->coords[prev_point + 1] - polyline_data->coords[end_point + 1]; length = sqrt (dx * dx + dy * dy); if (length < GOO_CANVAS_EPSILON) { /* The length is too short to reliably get the angle so just guess. */ sin_theta = 1.0; cos_theta = 0.0; } else { /* Calculate a unit vector moving from the arrow point along the line. */ sin_theta = dy / length; cos_theta = dx / length; } /* These are all specified in multiples of the line width, so convert. */ half_arrow_width = arrow->arrow_width * line_width / 2; arrow_length = arrow->arrow_length * line_width; arrow_tip_length = arrow->arrow_tip_length * line_width; /* The arrow tip is at the end point of the line. */ arrow_coords[0] = polyline_data->coords[end_point]; arrow_coords[1] = polyline_data->coords[end_point + 1]; /* Calculate the end of the arrow, along the center line. */ arrow_end_center_x = arrow_coords[0] + (arrow_length * cos_theta); arrow_end_center_y = arrow_coords[1] + (arrow_length * sin_theta); /* Now calculate the 2 end points of the arrow either side of the line. */ x_offset = half_arrow_width * sin_theta; y_offset = half_arrow_width * cos_theta; arrow_coords[2] = arrow_end_center_x + x_offset; arrow_coords[3] = arrow_end_center_y - y_offset; arrow_coords[8] = arrow_end_center_x - x_offset; arrow_coords[9] = arrow_end_center_y + y_offset; /* Calculate the end of the arrow tip, along the center line. */ arrow_tip_center_x = arrow_coords[0] + (arrow_tip_length * cos_theta); arrow_tip_center_y = arrow_coords[1] + (arrow_tip_length * sin_theta); /* Now calculate the 2 arrow points on either edge of the line. */ half_line_width = line_width / 2.0; x_offset = half_line_width * sin_theta; y_offset = half_line_width * cos_theta; arrow_coords[4] = arrow_tip_center_x + x_offset; arrow_coords[5] = arrow_tip_center_y - y_offset; arrow_coords[6] = arrow_tip_center_x - x_offset; arrow_coords[7] = arrow_tip_center_y + y_offset; /* Calculate the new end of the line. We have to move it back slightly so it doesn't draw over the arrow tip. But we overlap the arrow by a small fraction of the line width to avoid a tiny gap. */ line_trim = arrow_tip_length - (line_width / 10.0); line_coords[0] = arrow_coords[0] + (line_trim * cos_theta); line_coords[1] = arrow_coords[1] + (line_trim * sin_theta); } /* Recalculates the arrow polygons for the line */ static void goo_canvas_polyline_reconfigure_arrows (GooCanvasPolyline *polyline) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) polyline; GooCanvasPolylineData *polyline_data = polyline->polyline_data; double line_width; if (polyline_data->num_points < 2 || (!polyline_data->start_arrow && !polyline_data->end_arrow)) return; line_width = goo_canvas_item_simple_get_line_width (simple); ensure_arrow_data (polyline_data); if (polyline_data->start_arrow) reconfigure_arrow (polyline_data, 0, 2, line_width, polyline_data->arrow_data->line_start, polyline_data->arrow_data->start_arrow_coords); if (polyline_data->end_arrow) { int end_point, prev_point; if (polyline_data->close_path) { end_point = 0; prev_point = polyline_data->num_points - 1; } else { end_point = polyline_data->num_points - 1; prev_point = polyline_data->num_points - 2; } reconfigure_arrow (polyline_data, end_point * 2, prev_point * 2, line_width, polyline_data->arrow_data->line_end, polyline_data->arrow_data->end_arrow_coords); } } static void goo_canvas_polyline_set_common_property (GObject *object, GooCanvasPolylineData *polyline_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasPoints *points; GooCanvasBounds extent; gdouble x_offset, y_offset, x_scale, y_scale; guint i; switch (prop_id) { case PROP_POINTS: points = g_value_get_boxed (value); if (polyline_data->coords) { g_slice_free1 (polyline_data->num_points * 2 * sizeof (double), polyline_data->coords); polyline_data->coords = NULL; } if (!points) { polyline_data->num_points = 0; } else { polyline_data->num_points = points->num_points; polyline_data->coords = g_slice_alloc (polyline_data->num_points * 2 * sizeof (double)); memcpy (polyline_data->coords, points->coords, polyline_data->num_points * 2 * sizeof (double)); } g_object_notify (object, "x"); g_object_notify (object, "y"); g_object_notify (object, "width"); g_object_notify (object, "height"); break; case PROP_CLOSE_PATH: polyline_data->close_path = g_value_get_boolean (value); break; case PROP_START_ARROW: polyline_data->start_arrow = g_value_get_boolean (value); break; case PROP_END_ARROW: polyline_data->end_arrow = g_value_get_boolean (value); break; case PROP_ARROW_LENGTH: ensure_arrow_data (polyline_data); polyline_data->arrow_data->arrow_length = g_value_get_double (value); break; case PROP_ARROW_WIDTH: ensure_arrow_data (polyline_data); polyline_data->arrow_data->arrow_width = g_value_get_double (value); break; case PROP_ARROW_TIP_LENGTH: ensure_arrow_data (polyline_data); polyline_data->arrow_data->arrow_tip_length = g_value_get_double (value); break; case PROP_X: if (polyline_data->num_points > 0) { /* Calculate the x offset from the current position. */ goo_canvas_polyline_get_extent (polyline_data, &extent); x_offset = g_value_get_double (value) - extent.x1; /* Add the offset to all the x coordinates. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i] += x_offset; g_object_notify (object, "points"); } break; case PROP_Y: if (polyline_data->num_points > 0) { /* Calculate the y offset from the current position. */ goo_canvas_polyline_get_extent (polyline_data, &extent); y_offset = g_value_get_double (value) - extent.y1; /* Add the offset to all the y coordinates. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i + 1] += y_offset; g_object_notify (object, "points"); } break; case PROP_WIDTH: if (polyline_data->num_points >= 2) { goo_canvas_polyline_get_extent (polyline_data, &extent); if (extent.x2 - extent.x1 != 0.0) { /* Calculate the amount to scale the polyline. */ x_scale = g_value_get_double (value) / (extent.x2 - extent.x1); /* Scale the x coordinates, relative to the left-most point. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i] = extent.x1 + (polyline_data->coords[2 * i] - extent.x1) * x_scale; g_object_notify (object, "points"); } } break; case PROP_HEIGHT: if (polyline_data->num_points >= 2) { goo_canvas_polyline_get_extent (polyline_data, &extent); if (extent.y2 - extent.y1 != 0.0) { /* Calculate the amount to scale the polyline. */ y_scale = g_value_get_double (value) / (extent.y2 - extent.y1); /* Scale the y coordinates, relative to the top-most point. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i + 1] = extent.y1 + (polyline_data->coords[2 * i + 1] - extent.y1) * y_scale; g_object_notify (object, "points"); } } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_polyline_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPolyline *polyline = (GooCanvasPolyline*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_polyline_set_common_property (object, polyline->polyline_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } /** * goo_canvas_polyline_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @close_path: if the last point should be connected to the first. * @num_points: the number of points in the polyline. * @...: the pairs of coordinates for each point in the line, followed by * optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline item. * * * * Here's an example showing how to create a filled triangle with vertices * at (100,100), (300,100), and (200,300). * * * GooCanvasItem *polyline = goo_canvas_polyline_new (mygroup, TRUE, 3, * 100.0, 100.0, * 300.0, 100.0, * 200.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new polyline item. **/ GooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent, gboolean close_path, gint num_points, ...) { GooCanvasItem *item; GooCanvasPolyline *polyline; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; gint i; item = g_object_new (GOO_TYPE_CANVAS_POLYLINE, NULL); polyline = (GooCanvasPolyline*) item; polyline_data = polyline->polyline_data; polyline_data->close_path = close_path; polyline_data->num_points = num_points; if (num_points) polyline_data->coords = g_slice_alloc (num_points * 2 * sizeof (gdouble)); va_start (var_args, num_points); for (i = 0; i < num_points * 2; i++) polyline_data->coords[i] = va_arg (var_args, gdouble); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /** * goo_canvas_polyline_new_line: * @parent: the parent item, or %NULL. * @x1: the x coordinate of the start of the line. * @y1: the y coordinate of the start of the line. * @x2: the x coordinate of the end of the line. * @y2: the y coordinate of the end of the line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline item with a single line. * * * * Here's an example showing how to create a line from (100,100) to (300,300). * * * GooCanvasItem *polyline = goo_canvas_polyline_new_line (mygroup, * 100.0, 100.0, * 300.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * NULL); * * * Returns: a new polyline item. **/ GooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...) { GooCanvasItem *item; GooCanvasPolyline *polyline; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_POLYLINE, NULL); polyline = (GooCanvasPolyline*) item; polyline_data = polyline->polyline_data; polyline_data->close_path = FALSE; polyline_data->num_points = 2; polyline_data->coords = g_slice_alloc (4 * sizeof (gdouble)); polyline_data->coords[0] = x1; polyline_data->coords[1] = y1; polyline_data->coords[2] = x2; polyline_data->coords[3] = y2; va_start (var_args, y2); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_polyline_create_path (GooCanvasPolyline *polyline, cairo_t *cr) { GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; gint i; cairo_new_path (cr); if (polyline_data->num_points == 0) return; /* If there is an arrow at the start of the polyline, we need to move the start of the line slightly to avoid drawing over the arrow tip. */ if (polyline_data->start_arrow && polyline_data->num_points >= 2) cairo_move_to (cr, arrow->line_start[0], arrow->line_start[1]); else cairo_move_to (cr, polyline_data->coords[0], polyline_data->coords[1]); if (polyline_data->end_arrow && polyline_data->num_points >= 2) { gint last_point = polyline_data->num_points - 1; if (!polyline_data->close_path) last_point--; for (i = 1; i <= last_point; i++) cairo_line_to (cr, polyline_data->coords[i * 2], polyline_data->coords[i * 2 + 1]); cairo_line_to (cr, arrow->line_end[0], arrow->line_end[1]); } else { for (i = 1; i < polyline_data->num_points; i++) cairo_line_to (cr, polyline_data->coords[i * 2], polyline_data->coords[i * 2 + 1]); if (polyline_data->close_path) cairo_close_path (cr); } } static void goo_canvas_polyline_create_start_arrow_path (GooCanvasPolyline *polyline, cairo_t *cr) { GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; gint i; cairo_new_path (cr); if (polyline_data->num_points < 2) return; cairo_move_to (cr, arrow->start_arrow_coords[0], arrow->start_arrow_coords[1]); for (i = 1; i < NUM_ARROW_POINTS; i++) { cairo_line_to (cr, arrow->start_arrow_coords[i * 2], arrow->start_arrow_coords[i * 2 + 1]); } cairo_close_path (cr); } static void goo_canvas_polyline_create_end_arrow_path (GooCanvasPolyline *polyline, cairo_t *cr) { GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; gint i; cairo_new_path (cr); if (polyline_data->num_points < 2) return; cairo_move_to (cr, arrow->end_arrow_coords[0], arrow->end_arrow_coords[1]); for (i = 1; i < NUM_ARROW_POINTS; i++) { cairo_line_to (cr, arrow->end_arrow_coords[i * 2], arrow->end_arrow_coords[i * 2 + 1]); } cairo_close_path (cr); } static gboolean goo_canvas_polyline_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple; GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPointerEvents pointer_events = GOO_CANVAS_EVENTS_ALL; gboolean do_stroke; if (polyline_data->num_points == 0) return FALSE; /* Check if the item should receive events. */ if (is_pointer_event) pointer_events = simple_data->pointer_events; /* If the path isn't closed, we never check the fill. */ if (!(polyline_data->close_path && polyline_data->num_points > 2)) pointer_events &= ~GOO_CANVAS_EVENTS_FILL_MASK; goo_canvas_polyline_create_path (polyline, cr); if (goo_canvas_item_simple_check_in_path (simple, x, y, cr, pointer_events)) return TRUE; /* Check the arrows, if the polyline has them. */ if ((polyline_data->start_arrow || polyline_data->end_arrow) && polyline_data->num_points >= 2 && (pointer_events & GOO_CANVAS_EVENTS_STROKE_MASK)) { /* We use the stroke pattern to match the style of the line. */ do_stroke = goo_canvas_style_set_stroke_options (simple_data->style, cr); if (!(pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK) || do_stroke) { if (polyline_data->start_arrow) { goo_canvas_polyline_create_start_arrow_path (polyline, cr); if (cairo_in_fill (cr, x, y)) return TRUE; } if (polyline_data->end_arrow) { goo_canvas_polyline_create_end_arrow_path (polyline, cr); if (cairo_in_fill (cr, x, y)) return TRUE; } } } return FALSE; } static void goo_canvas_polyline_compute_bounds (GooCanvasPolyline *polyline, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) polyline; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasBounds tmp_bounds; cairo_matrix_t transform; if (polyline_data->num_points == 0) { bounds->x1 = bounds->x2 = bounds->y1 = bounds->y2 = 0.0; return; } /* Use the identity matrix to get the bounds completely in user space. */ cairo_get_matrix (cr, &transform); cairo_identity_matrix (cr); goo_canvas_polyline_create_path (polyline, cr); goo_canvas_item_simple_get_path_bounds (simple, cr, bounds); /* Add on the arrows, if required. */ if ((polyline_data->start_arrow || polyline_data->end_arrow) && polyline_data->num_points >= 2) { /* We use the stroke pattern to match the style of the line. */ goo_canvas_style_set_stroke_options (simple_data->style, cr); if (polyline_data->start_arrow) { goo_canvas_polyline_create_start_arrow_path (polyline, cr); cairo_fill_extents (cr, &tmp_bounds.x1, &tmp_bounds.y1, &tmp_bounds.x2, &tmp_bounds.y2); bounds->x1 = MIN (bounds->x1, tmp_bounds.x1); bounds->y1 = MIN (bounds->y1, tmp_bounds.y1); bounds->x2 = MAX (bounds->x2, tmp_bounds.x2); bounds->y2 = MAX (bounds->y2, tmp_bounds.y2); } if (polyline_data->end_arrow) { goo_canvas_polyline_create_end_arrow_path (polyline, cr); cairo_fill_extents (cr, &tmp_bounds.x1, &tmp_bounds.y1, &tmp_bounds.x2, &tmp_bounds.y2); bounds->x1 = MIN (bounds->x1, tmp_bounds.x1); bounds->y1 = MIN (bounds->y1, tmp_bounds.y1); bounds->x2 = MAX (bounds->x2, tmp_bounds.x2); bounds->y2 = MAX (bounds->y2, tmp_bounds.y2); } } cairo_set_matrix (cr, &transform); } static void goo_canvas_polyline_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple; GooCanvasPolylineData *polyline_data = polyline->polyline_data; goo_canvas_polyline_reconfigure_arrows (polyline); /* Compute the new bounds. */ goo_canvas_polyline_compute_bounds (polyline, cr, &simple->bounds); } static void goo_canvas_polyline_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple; GooCanvasPolylineData *polyline_data = polyline->polyline_data; if (polyline_data->num_points == 0) return; goo_canvas_polyline_create_path (polyline, cr); goo_canvas_item_simple_paint_path (simple, cr); /* Paint the arrows, if required. */ if ((polyline_data->start_arrow || polyline_data->end_arrow) && polyline_data->num_points >= 2) { /* We use the stroke pattern to match the style of the line. */ goo_canvas_style_set_stroke_options (simple_data->style, cr); if (polyline_data->start_arrow) { goo_canvas_polyline_create_start_arrow_path (polyline, cr); cairo_fill (cr); } if (polyline_data->end_arrow) { goo_canvas_polyline_create_end_arrow_path (polyline, cr); cairo_fill (cr); } } } static void goo_canvas_polyline_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasPolyline *polyline = (GooCanvasPolyline*) item; GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) model; /* If our polyline_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasPolylineData, polyline->polyline_data); /* Now use the new model's polyline_data instead. */ polyline->polyline_data = &pmodel->polyline_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_polyline_set_model; } static void goo_canvas_polyline_class_init (GooCanvasPolylineClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_polyline_finalize; gobject_class->get_property = goo_canvas_polyline_get_property; gobject_class->set_property = goo_canvas_polyline_set_property; simple_class->simple_update = goo_canvas_polyline_update; simple_class->simple_paint = goo_canvas_polyline_paint; simple_class->simple_is_item_at = goo_canvas_polyline_is_item_at; goo_canvas_polyline_install_common_properties (gobject_class); } /** * SECTION:goocanvaspolylinemodel * @Title: GooCanvasPolylineModel * @Short_Description: a model for polyline items (a series of lines with * optional arrows). * * GooCanvasPolylineModel represents a model for polyline items, which are a * series of one or more lines, with optional arrows at either end. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasPolylineModel use goo_canvas_polyline_model_new(), or * goo_canvas_polyline_model_new_line() for a simple line between two points. * * To get or set the properties of an existing #GooCanvasPolylineModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the polyline you must connect * to the signal handlers of the corresponding #GooCanvasPolyline objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_polyline_model_finalize (GObject *object); static void goo_canvas_polyline_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_polyline_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasPolylineModel, goo_canvas_polyline_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_polyline_model_class_init (GooCanvasPolylineModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->finalize = goo_canvas_polyline_model_finalize; gobject_class->get_property = goo_canvas_polyline_model_get_property; gobject_class->set_property = goo_canvas_polyline_model_set_property; goo_canvas_polyline_install_common_properties (gobject_class); } static void goo_canvas_polyline_model_init (GooCanvasPolylineModel *pmodel) { } /** * goo_canvas_polyline_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @close_path: if the last point should be connected to the first. * @num_points: the number of points in the polyline. * @...: the pairs of coordinates for each point in the line, followed by * optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline model. * * * * Here's an example showing how to create a filled triangle with vertices * at (100,100), (300,100), and (200,300). * * * GooCanvasItemModel *polyline = goo_canvas_polyline_model_new (mygroup, TRUE, 3, * 100.0, 100.0, * 300.0, 100.0, * 200.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new polyline model. **/ GooCanvasItemModel* goo_canvas_polyline_model_new (GooCanvasItemModel *parent, gboolean close_path, gint num_points, ...) { GooCanvasItemModel *model; GooCanvasPolylineModel *pmodel; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; gint i; model = g_object_new (GOO_TYPE_CANVAS_POLYLINE_MODEL, NULL); pmodel = (GooCanvasPolylineModel*) model; polyline_data = &pmodel->polyline_data; polyline_data->close_path = close_path; polyline_data->num_points = num_points; if (num_points) polyline_data->coords = g_slice_alloc (num_points * 2 * sizeof (gdouble)); va_start (var_args, num_points); for (i = 0; i < num_points * 2; i++) polyline_data->coords[i] = va_arg (var_args, gdouble); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } /** * goo_canvas_polyline_model_new_line: * @parent: the parent model, or %NULL. * @x1: the x coordinate of the start of the line. * @y1: the y coordinate of the start of the line. * @x2: the x coordinate of the end of the line. * @y2: the y coordinate of the end of the line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline model with a single line. * * * * Here's an example showing how to create a line from (100,100) to (300,300). * * * GooCanvasItemModel *polyline = goo_canvas_polyline_model_new_line (mygroup, * 100.0, 100.0, * 300.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * NULL); * * * Returns: a new polyline model. **/ GooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...) { GooCanvasItemModel *model; GooCanvasPolylineModel *pmodel; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_POLYLINE_MODEL, NULL); pmodel = (GooCanvasPolylineModel*) model; polyline_data = &pmodel->polyline_data; polyline_data->close_path = FALSE; polyline_data->num_points = 2; polyline_data->coords = g_slice_alloc (4 * sizeof (gdouble)); polyline_data->coords[0] = x1; polyline_data->coords[1] = y1; polyline_data->coords[2] = x2; polyline_data->coords[3] = y2; va_start (var_args, y2); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_polyline_model_finalize (GObject *object) { GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) object; g_slice_free1 (pmodel->polyline_data.num_points * 2 * sizeof (gdouble), pmodel->polyline_data.coords); g_slice_free (GooCanvasPolylineArrowData, pmodel->polyline_data.arrow_data); G_OBJECT_CLASS (goo_canvas_polyline_model_parent_class)->finalize (object); } static void goo_canvas_polyline_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) object; goo_canvas_polyline_get_common_property (object, &pmodel->polyline_data, prop_id, value, pspec); } static void goo_canvas_polyline_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) object; goo_canvas_polyline_set_common_property (object, &pmodel->polyline_data, prop_id, value, pspec); g_signal_emit_by_name (pmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_polyline_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_POLYLINE, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_polyline_model_create_item; } goocanvas-1.0.0/src/goocanvasstyle.c0000644000076400007640000003437711412723611014431 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasstyle.c - cascading styles. */ /** * SECTION:goocanvasstyle * @Title: GooCanvasStyle * @Short_Description: support for cascading style properties for canvas items. * * #GooCanvasStyle provides support for cascading style properties for canvas * items. It is intended to be used when implementing new canvas items. * * Style properties are identified by a unique #GQuark, and contain * arbitrary data stored in a #GValue. * * #GooCanvasStyle also provides a few convenience functions such as * goo_canvas_style_set_stroke_options() and * goo_canvas_style_set_fill_options() which efficiently apply an item's * standard style properties to the given cairo_t. */ #include #include #include "goocanvasstyle.h" #include "goocanvasutils.h" /* GQuarks for the basic properties. */ /** * goo_canvas_style_stroke_pattern_id: * * Unique #GQuark identifier used for the standard stroke pattern property. **/ GQuark goo_canvas_style_stroke_pattern_id; /** * goo_canvas_style_fill_pattern_id: * * Unique #GQuark identifier used for the standard fill pattern property. **/ GQuark goo_canvas_style_fill_pattern_id; /** * goo_canvas_style_fill_rule_id: * * Unique #GQuark identifier used for the standard fill rule property. **/ GQuark goo_canvas_style_fill_rule_id; /** * goo_canvas_style_operator_id: * * Unique #GQuark identifier used for the standard operator property. **/ GQuark goo_canvas_style_operator_id; /** * goo_canvas_style_antialias_id: * * Unique #GQuark identifier used for the standard antialias property. **/ GQuark goo_canvas_style_antialias_id; /** * goo_canvas_style_line_width_id: * * Unique #GQuark identifier used for the standard line width property. **/ GQuark goo_canvas_style_line_width_id; /** * goo_canvas_style_line_cap_id: * * Unique #GQuark identifier used for the standard line cap property. **/ GQuark goo_canvas_style_line_cap_id; /** * goo_canvas_style_line_join_id: * * Unique #GQuark identifier used for the standard line join property. **/ GQuark goo_canvas_style_line_join_id; /** * goo_canvas_style_line_join_miter_limit_id: * * Unique #GQuark identifier used for the standard miter limit property. **/ GQuark goo_canvas_style_line_join_miter_limit_id; /** * goo_canvas_style_line_dash_id: * * Unique #GQuark identifier used for the standard line dash property. **/ GQuark goo_canvas_style_line_dash_id; /** * goo_canvas_style_font_desc_id: * * Unique #GQuark identifier used for the standard font description property. **/ GQuark goo_canvas_style_font_desc_id; /** * goo_canvas_style_hint_metrics_id: * * Unique #GQuark identifier used for the standard hint metrics property. **/ GQuark goo_canvas_style_hint_metrics_id; static void goo_canvas_style_dispose (GObject *object); static void goo_canvas_style_finalize (GObject *object); G_DEFINE_TYPE (GooCanvasStyle, goo_canvas_style, G_TYPE_OBJECT) /* Create GQuarks for the basic properties. This is called by goo_canvas_style_class_init(), goo_canvas_item_base_init() and goo_canvas_item_model_base_init() to try to ensure the GQuarks are initialized before they are needed. */ void _goo_canvas_style_init (void) { static gboolean initialized = FALSE; if (!initialized) { goo_canvas_style_stroke_pattern_id = g_quark_from_static_string ("GooCanvasStyle:stroke_pattern"); goo_canvas_style_fill_pattern_id = g_quark_from_static_string ("GooCanvasStyle:fill_pattern"); goo_canvas_style_fill_rule_id = g_quark_from_static_string ("GooCanvasStyle:fill_rule"); goo_canvas_style_operator_id = g_quark_from_static_string ("GooCanvasStyle:operator"); goo_canvas_style_antialias_id = g_quark_from_static_string ("GooCanvasStyle:antialias"); goo_canvas_style_line_width_id = g_quark_from_static_string ("GooCanvasStyle:line_width"); goo_canvas_style_line_cap_id = g_quark_from_static_string ("GooCanvasStyle:line_cap"); goo_canvas_style_line_join_id = g_quark_from_static_string ("GooCanvasStyle:line_join"); goo_canvas_style_line_join_miter_limit_id = g_quark_from_static_string ("GooCanvasStyle:line_join_miter_limit"); goo_canvas_style_line_dash_id = g_quark_from_static_string ("GooCanvasStyle:line_dash"); goo_canvas_style_font_desc_id = g_quark_from_static_string ("GooCanvasStyle:font_desc"); goo_canvas_style_hint_metrics_id = g_quark_from_static_string ("GooCanvasStyle:hint_metrics"); initialized = TRUE; } } static void goo_canvas_style_class_init (GooCanvasStyleClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->dispose = goo_canvas_style_dispose; gobject_class->finalize = goo_canvas_style_finalize; _goo_canvas_style_init (); } static void goo_canvas_style_init (GooCanvasStyle *style) { style->properties = g_array_new (0, 0, sizeof (GooCanvasStyleProperty)); } /** * goo_canvas_style_new: * * Creates a new #GooCanvasStyle. * * Returns: a new #GooCanvasStyle. **/ GooCanvasStyle* goo_canvas_style_new (void) { return GOO_CANVAS_STYLE (g_object_new (GOO_TYPE_CANVAS_STYLE, NULL)); } static void goo_canvas_style_dispose (GObject *object) { GooCanvasStyle *style = (GooCanvasStyle*) object; GooCanvasStyleProperty *property; gint i; if (style->parent) { g_object_unref (style->parent); style->parent = NULL; } /* Free the property GValues. */ for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); g_value_unset (&property->value); } g_array_set_size (style->properties, 0); G_OBJECT_CLASS (goo_canvas_style_parent_class)->dispose (object); } static void goo_canvas_style_finalize (GObject *object) { GooCanvasStyle *style = (GooCanvasStyle*) object; g_array_free (style->properties, TRUE); G_OBJECT_CLASS (goo_canvas_style_parent_class)->finalize (object); } /** * goo_canvas_style_copy: * @style: a #GooCanvasStyle. * * Copies the given #GooCanvasStyle, by copying all of its properties. * Though the parent of the new style is left unset. * * Returns: a copy of the given #GooCanvasStyle. **/ GooCanvasStyle* goo_canvas_style_copy (GooCanvasStyle *style) { GooCanvasStyle *copy; GooCanvasStyleProperty *property; gint i; copy = goo_canvas_style_new (); for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); goo_canvas_style_set_property (copy, property->id, &property->value); } return copy; } /** * goo_canvas_style_get_parent: * @style: a style. * * Gets the parent of the style. * * Returns: the parent of the given style, or %NULL. **/ GooCanvasStyle* goo_canvas_style_get_parent (GooCanvasStyle *style) { return style->parent; } /** * goo_canvas_style_set_parent: * @style: a style. * @parent: the new parent. * * Sets the parent of the style. **/ void goo_canvas_style_set_parent (GooCanvasStyle *style, GooCanvasStyle *parent) { if (style->parent == parent) return; if (style->parent) g_object_unref (style->parent); style->parent = parent; if (style->parent) g_object_ref (style->parent); } /** * goo_canvas_style_get_property: * @style: a style. * @property_id: the property identifier. * * Gets the value of a property. * * This searches though all the #GooCanvasStyle's own list of property settings * and also all ancestor #GooCanvasStyle objects. * * Note that it returns a pointer to the internal #GValue setting, which should * not be changed. * * Returns: the property value, or %NULL if it isn't set. **/ GValue* goo_canvas_style_get_property (GooCanvasStyle *style, GQuark property_id) { GooCanvasStyleProperty *property; gint i; /* Step up the hierarchy of styles until we find the property. Note that if style is passed in as NULL we simply return NULL. */ while (style) { for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == property_id) return &property->value; } style = style->parent; } return NULL; } /** * goo_canvas_style_set_property: * @style: a style. * @property_id: the property identifier. * @value: the value of the property. * * Sets a property in the style, replacing any current setting. * * Note that this will override the property setting in ancestor * #GooCanvasStyle objects. **/ void goo_canvas_style_set_property (GooCanvasStyle *style, GQuark property_id, const GValue *value) { GooCanvasStyleProperty *property, new_property = { 0 }; gint i; /* See if the property is already set. */ for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == property_id) { /* If the new value is NULL, remove the property setting, otherwise update the property value. */ if (value) { g_value_copy (value, &property->value); } else { g_value_unset (&property->value); g_array_remove_index_fast (style->properties, i); } return; } } /* The property isn't set, so append a new property. */ if (value) { new_property.id = property_id; g_value_init (&new_property.value, G_VALUE_TYPE (value)); g_value_copy (value, &new_property.value); g_array_append_val (style->properties, new_property); } } /** * goo_canvas_style_set_stroke_options: * @style: a style. * @cr: a cairo context. * * Sets the standard cairo stroke options using the given style. * * Returns: %TRUE if a paint source is set, or %FALSE if the stroke should * be skipped. **/ gboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style, cairo_t *cr) { GooCanvasStyleProperty *property; gboolean operator_set = FALSE, antialias_set = FALSE; gboolean stroke_pattern_set = FALSE, line_width_set = FALSE; gboolean line_cap_set = FALSE, line_join_set = FALSE; gboolean miter_limit_set = FALSE, line_dash_set = FALSE; gboolean source_set = FALSE, need_stroke = TRUE; gint i; if (!style) return TRUE; /* Step up the hierarchy of styles looking for the properties. */ while (style) { for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == goo_canvas_style_operator_id && !operator_set) { cairo_set_operator (cr, property->value.data[0].v_long); operator_set = TRUE; } else if (property->id == goo_canvas_style_antialias_id && !antialias_set) { cairo_set_antialias (cr, property->value.data[0].v_long); antialias_set = TRUE; } else if (property->id == goo_canvas_style_stroke_pattern_id && !stroke_pattern_set) { if (property->value.data[0].v_pointer) { cairo_set_source (cr, property->value.data[0].v_pointer); source_set = TRUE; } else { /* If the stroke pattern has been explicitly set to NULL, then we don't need to do the stroke. */ need_stroke = FALSE; } stroke_pattern_set = TRUE; } else if (property->id == goo_canvas_style_line_width_id && !line_width_set) { cairo_set_line_width (cr, property->value.data[0].v_double); line_width_set = TRUE; } else if (property->id == goo_canvas_style_line_cap_id && !line_cap_set) { cairo_set_line_cap (cr, property->value.data[0].v_long); line_cap_set = TRUE; } else if (property->id == goo_canvas_style_line_join_id && !line_join_set) { cairo_set_line_join (cr, property->value.data[0].v_long); line_join_set = TRUE; } else if (property->id == goo_canvas_style_line_join_miter_limit_id && !miter_limit_set) { cairo_set_miter_limit (cr, property->value.data[0].v_double); miter_limit_set = TRUE; } else if (property->id == goo_canvas_style_line_dash_id && !line_dash_set) { GooCanvasLineDash *dash = property->value.data[0].v_pointer; if (dash) cairo_set_dash (cr, dash->dashes, dash->num_dashes, dash->dash_offset); else cairo_set_dash (cr, NULL, 0, 0); line_dash_set = TRUE; } } style = style->parent; } /* If a stroke pattern hasn't been set in the style we reset the source to black, just in case a fill pattern was used for the item. */ if (!source_set) cairo_set_source_rgb (cr, 0, 0, 0); return need_stroke; } /** * goo_canvas_style_set_fill_options: * @style: a style. * @cr: a cairo context. * * Sets the standard cairo fill options using the given style. * * Returns: %TRUE if a paint source is set, or %FALSE if the fill should * be skipped. **/ gboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style, cairo_t *cr) { GooCanvasStyleProperty *property; gboolean operator_set = FALSE, antialias_set = FALSE; gboolean fill_rule_set = FALSE, fill_pattern_set = FALSE; gboolean need_fill = FALSE; gint i; if (!style) return FALSE; /* Step up the hierarchy of styles looking for the properties. */ while (style) { for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == goo_canvas_style_operator_id && !operator_set) { cairo_set_operator (cr, property->value.data[0].v_long); operator_set = TRUE; } else if (property->id == goo_canvas_style_antialias_id && !antialias_set) { cairo_set_antialias (cr, property->value.data[0].v_long); antialias_set = TRUE; } else if (property->id == goo_canvas_style_fill_rule_id && !fill_rule_set) { cairo_set_fill_rule (cr, property->value.data[0].v_long); fill_rule_set = TRUE; } else if (property->id == goo_canvas_style_fill_pattern_id && !fill_pattern_set) { if (property->value.data[0].v_pointer) { cairo_set_source (cr, property->value.data[0].v_pointer); need_fill = TRUE; } fill_pattern_set = TRUE; } } style = style->parent; } return need_fill; } goocanvas-1.0.0/src/goocanvasitemmodel.h0000644000076400007640000002650211412723611015244 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitemmodel.h - interface for canvas item models. */ #ifndef __GOO_CANVAS_ITEM_MODEL_H__ #define __GOO_CANVAS_ITEM_MODEL_H__ #include #include "goocanvasitem.h" G_BEGIN_DECLS #define GOO_TYPE_CANVAS_ITEM_MODEL (goo_canvas_item_model_get_type ()) #define GOO_CANVAS_ITEM_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM_MODEL, GooCanvasItemModel)) #define GOO_IS_CANVAS_ITEM_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM_MODEL)) #define GOO_CANVAS_ITEM_MODEL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GOO_TYPE_CANVAS_ITEM_MODEL, GooCanvasItemModelIface)) /** * GooCanvasItemModel * * #GooCanvasItemModel is a typedef used for objects that implement the * #GooCanvasItemModel interface. * * (There is no actual #GooCanvasItemModel struct, since it is only an interface. * But using '#GooCanvasItemModel' is more helpful than using '#GObject'.) */ /* The typedef is in goocanvasitem.h */ /*typedef struct _GooCanvasItemModel GooCanvasItemModel;*/ /** * GooCanvasItemModelIface * @get_n_children: returns the number of children of the model. * @get_child: returns the child at the given index. * @add_child: adds a child. * @move_child: moves a child up or down the stacking order. * @remove_child: removes a child. * @get_child_property: gets a child property of a given child model, * e.g. the "row" or "column" property of a model in a #GooCanvasTableModel. * @set_child_property: sets a child property for a given child model. * @get_parent: gets the model's parent. * @set_parent: sets the model's parent. * @create_item: creates a default canvas item to view the model. * @get_transform: gets the model's transformation matrix. * @set_transform: sets the model's transformation matrix. * @get_style: gets the model's style. * @set_style: sets the model's style. * @child_added: signal emitted when a child is added. * @child_moved: signal emitted when a child is moved in the stacking order. * @child_removed: signal emitted when a child is removed. * @changed: signal emitted when the model has changed. * @child_notify: signal emitted when a child property has changed. * @animation_finished: signal emitted when the model's animation has finished. * * #GooCanvasItemModelIFace holds the virtual methods that make up the * #GooCanvasItemModel interface. * * Simple item models only need to implement the get_parent(), set_parent() * and create_item() methods. * * Items that support transforms should also implement get_transform() and * set_transform(). Items that support styles should implement get_style() * and set_style(). * * Container items must implement get_n_children() and get_child(). * Containers that support dynamic changes to their children should implement * add_child(), move_child() and remove_child(). * Layout containers like #GooCanvasTable may implement * get_child_property() and set_child_property(). */ typedef struct _GooCanvasItemModelIface GooCanvasItemModelIface; struct _GooCanvasItemModelIface { /*< private >*/ GTypeInterface base_iface; /*< public >*/ /* Virtual methods that group models must implement. */ gint (* get_n_children) (GooCanvasItemModel *model); GooCanvasItemModel* (* get_child) (GooCanvasItemModel *model, gint child_num); /* Virtual methods that group models may implement. */ void (* add_child) (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position); void (* move_child) (GooCanvasItemModel *model, gint old_position, gint new_position); void (* remove_child) (GooCanvasItemModel *model, gint child_num); void (* get_child_property) (GooCanvasItemModel *model, GooCanvasItemModel *child, guint property_id, GValue *value, GParamSpec *pspec); void (* set_child_property) (GooCanvasItemModel *item, GooCanvasItemModel *child, guint property_id, const GValue *value, GParamSpec *pspec); /* Virtual methods that all item models must implement. */ GooCanvasItemModel* (* get_parent) (GooCanvasItemModel *model); void (* set_parent) (GooCanvasItemModel *model, GooCanvasItemModel *parent); GooCanvasItem* (* create_item) (GooCanvasItemModel *model, GooCanvas *canvas); /* Virtual methods that all item models may implement. */ gboolean (* get_transform) (GooCanvasItemModel *model, cairo_matrix_t *transform); void (* set_transform) (GooCanvasItemModel *model, const cairo_matrix_t *transform); GooCanvasStyle* (* get_style) (GooCanvasItemModel *model); void (* set_style) (GooCanvasItemModel *model, GooCanvasStyle *style); /* Signals. */ void (* child_added) (GooCanvasItemModel *model, gint child_num); void (* child_moved) (GooCanvasItemModel *model, gint old_child_num, gint new_child_num); void (* child_removed) (GooCanvasItemModel *model, gint child_num); void (* changed) (GooCanvasItemModel *model, gboolean recompute_bounds); void (* child_notify) (GooCanvasItemModel *model, GParamSpec *pspec); void (* animation_finished) (GooCanvasItemModel *model, gboolean stopped); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); void (*_goo_canvas_reserved5) (void); void (*_goo_canvas_reserved6) (void); void (*_goo_canvas_reserved7) (void); }; GType goo_canvas_item_model_get_type (void) G_GNUC_CONST; /* * Group functions - these should only be called on container models. */ gint goo_canvas_item_model_get_n_children (GooCanvasItemModel *model); GooCanvasItemModel* goo_canvas_item_model_get_child (GooCanvasItemModel *model, gint child_num); void goo_canvas_item_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position); void goo_canvas_item_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position); void goo_canvas_item_model_remove_child (GooCanvasItemModel *model, gint child_num); gint goo_canvas_item_model_find_child (GooCanvasItemModel *model, GooCanvasItemModel *child); void goo_canvas_item_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, GValue *value); void goo_canvas_item_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, const GValue *value); void goo_canvas_item_model_get_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_model_set_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_model_get_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); void goo_canvas_item_model_set_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); /* * Model functions - these are safe to call on all models. */ GooCanvasItemModel* goo_canvas_item_model_get_parent (GooCanvasItemModel *model); void goo_canvas_item_model_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent); void goo_canvas_item_model_remove (GooCanvasItemModel *model); gboolean goo_canvas_item_model_is_container (GooCanvasItemModel *model); void goo_canvas_item_model_raise (GooCanvasItemModel *model, GooCanvasItemModel *above); void goo_canvas_item_model_lower (GooCanvasItemModel *model, GooCanvasItemModel *below); gboolean goo_canvas_item_model_get_transform (GooCanvasItemModel *model, cairo_matrix_t *transform); void goo_canvas_item_model_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform); gboolean goo_canvas_item_model_get_simple_transform (GooCanvasItemModel *model, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); void goo_canvas_item_model_set_simple_transform (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble rotation); void goo_canvas_item_model_translate (GooCanvasItemModel *model, gdouble tx, gdouble ty); void goo_canvas_item_model_scale (GooCanvasItemModel *model, gdouble sx, gdouble sy); void goo_canvas_item_model_rotate (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_model_skew_x (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_model_skew_y (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); GooCanvasStyle* goo_canvas_item_model_get_style (GooCanvasItemModel *model); void goo_canvas_item_model_set_style (GooCanvasItemModel *model, GooCanvasStyle *style); void goo_canvas_item_model_animate (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); void goo_canvas_item_model_stop_animation (GooCanvasItemModel *model); /* * Functions to support child properties when implementing new canvas items. */ void goo_canvas_item_model_class_install_child_property (GObjectClass *mclass, guint property_id, GParamSpec *pspec); GParamSpec* goo_canvas_item_model_class_find_child_property (GObjectClass *mclass, const gchar *property_name); GParamSpec** goo_canvas_item_model_class_list_child_properties (GObjectClass *mclass, guint *n_properties); G_END_DECLS #endif /* __GOO_CANVAS_ITEM_MODEL_H__ */ goocanvas-1.0.0/src/goocanvasutils.c0000644000076400007640000007551211412723611014425 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasutils.c - utility functions. */ /** * SECTION:goocanvasutils * @Title: GooCanvas Types * @Short_Description: types used in GooCanvas. * * This section describes the types used throughout GooCanvas. */ #include #include #include #include "goocanvas.h" /* Glib doesn't provide a g_ptr_array_index() so we need our own one. */ void goo_canvas_util_ptr_array_insert (GPtrArray *ptr_array, gpointer data, gint index) { gint i; /* Add the pointer at the end so there is enough room. */ g_ptr_array_add (ptr_array, data); /* If index is -1, we are done. */ if (index == -1) return; /* Move the other pointers to make room for the new one. */ for (i = ptr_array->len - 1; i > index; i--) ptr_array->pdata[i] = ptr_array->pdata[i - 1]; /* Put the new element in its proper place. */ ptr_array->pdata[index] = data; } /* Glib doesn't provide a g_ptr_array_move() so we need our own one. */ void goo_canvas_util_ptr_array_move (GPtrArray *ptr_array, gint old_index, gint new_index) { gpointer data; gint i; data = ptr_array->pdata[old_index]; if (new_index > old_index) { /* Move the pointers down one place. */ for (i = old_index; i < new_index; i++) ptr_array->pdata[i] = ptr_array->pdata[i + 1]; } else { /* Move the pointers up one place. */ for (i = old_index; i > new_index; i--) ptr_array->pdata[i] = ptr_array->pdata[i - 1]; } ptr_array->pdata[new_index] = data; } /* Glib doesn't provide a g_ptr_array_move() so we need our own one. */ gint goo_canvas_util_ptr_array_find_index (GPtrArray *ptr_array, gpointer data) { gint i; for (i = 0; i < ptr_array->len; i++) { if (ptr_array->pdata[i] == data) return i; } return -1; } /* * Cairo utilities. */ cairo_surface_t* goo_canvas_cairo_surface_from_pixbuf (GdkPixbuf *pixbuf) { gint width = gdk_pixbuf_get_width (pixbuf); gint height = gdk_pixbuf_get_height (pixbuf); guchar *gdk_pixels = gdk_pixbuf_get_pixels (pixbuf); int gdk_rowstride = gdk_pixbuf_get_rowstride (pixbuf); int n_channels = gdk_pixbuf_get_n_channels (pixbuf); guchar *cairo_pixels; cairo_format_t format; cairo_surface_t *surface; static const cairo_user_data_key_t key; int j; if (n_channels == 3) format = CAIRO_FORMAT_RGB24; else format = CAIRO_FORMAT_ARGB32; cairo_pixels = g_malloc (4 * width * height); surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels, format, width, height, 4 * width); cairo_surface_set_user_data (surface, &key, cairo_pixels, (cairo_destroy_func_t)g_free); for (j = height; j; j--) { guchar *p = gdk_pixels; guchar *q = cairo_pixels; if (n_channels == 3) { guchar *end = p + 3 * width; while (p < end) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN q[0] = p[2]; q[1] = p[1]; q[2] = p[0]; #else q[1] = p[0]; q[2] = p[1]; q[3] = p[2]; #endif p += 3; q += 4; } } else { guchar *end = p + 4 * width; guint t1,t2,t3; #define MULT(d,c,a,t) G_STMT_START { t = c * a; d = ((t >> 8) + t) >> 8; } G_STMT_END while (p < end) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN MULT(q[0], p[2], p[3], t1); MULT(q[1], p[1], p[3], t2); MULT(q[2], p[0], p[3], t3); q[3] = p[3]; #else q[0] = p[3]; MULT(q[1], p[0], p[3], t1); MULT(q[2], p[1], p[3], t2); MULT(q[3], p[2], p[3], t3); #endif p += 4; q += 4; } #undef MULT } gdk_pixels += gdk_rowstride; cairo_pixels += 4 * width; } return surface; } cairo_pattern_t* goo_canvas_cairo_pattern_from_pixbuf (GdkPixbuf *pixbuf) { cairo_surface_t *surface; cairo_pattern_t *pattern; surface = goo_canvas_cairo_surface_from_pixbuf (pixbuf); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); return pattern; } /* * Cairo types. */ GType goo_cairo_pattern_get_type (void) { static GType cairo_pattern_type = 0; if (cairo_pattern_type == 0) cairo_pattern_type = g_boxed_type_register_static ("GooCairoPattern", (GBoxedCopyFunc) cairo_pattern_reference, (GBoxedFreeFunc) cairo_pattern_destroy); return cairo_pattern_type; } GType goo_cairo_fill_rule_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_FILL_RULE_WINDING, "CAIRO_FILL_RULE_WINDING", "winding" }, { CAIRO_FILL_RULE_EVEN_ODD, "CAIRO_FILL_RULE_EVEN_ODD", "even-odd" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoFillRule", values); } return etype; } GType goo_cairo_operator_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_OPERATOR_CLEAR, "CAIRO_OPERATOR_CLEAR", "clear" }, { CAIRO_OPERATOR_SOURCE, "CAIRO_OPERATOR_SOURCE", "source" }, { CAIRO_OPERATOR_OVER, "CAIRO_OPERATOR_OVER", "over" }, { CAIRO_OPERATOR_IN, "CAIRO_OPERATOR_IN", "in" }, { CAIRO_OPERATOR_OUT, "CAIRO_OPERATOR_OUT", "out" }, { CAIRO_OPERATOR_ATOP, "CAIRO_OPERATOR_ATOP", "atop" }, { CAIRO_OPERATOR_DEST, "CAIRO_OPERATOR_DEST", "dest" }, { CAIRO_OPERATOR_DEST_OVER, "CAIRO_OPERATOR_DEST_OVER", "dest-over" }, { CAIRO_OPERATOR_DEST_IN, "CAIRO_OPERATOR_DEST_IN", "dest-in" }, { CAIRO_OPERATOR_DEST_OUT, "CAIRO_OPERATOR_DEST_OUT", "dest-out" }, { CAIRO_OPERATOR_DEST_ATOP, "CAIRO_OPERATOR_DEST_ATOP", "dest-atop" }, { CAIRO_OPERATOR_XOR, "CAIRO_OPERATOR_XOR", "xor" }, { CAIRO_OPERATOR_ADD, "CAIRO_OPERATOR_ADD", "add" }, { CAIRO_OPERATOR_SATURATE, "CAIRO_OPERATOR_SATURATE", "saturate" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoOperator", values); } return etype; } GType goo_cairo_antialias_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_ANTIALIAS_DEFAULT, "CAIRO_ANTIALIAS_DEFAULT", "default" }, { CAIRO_ANTIALIAS_NONE, "CAIRO_ANTIALIAS_NONE", "none" }, { CAIRO_ANTIALIAS_GRAY, "CAIRO_ANTIALIAS_GRAY", "gray" }, { CAIRO_ANTIALIAS_SUBPIXEL, "CAIRO_ANTIALIAS_SUBPIXEL", "subpixel" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoAntialias", values); } return etype; } GType goo_cairo_line_cap_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_LINE_CAP_BUTT, "CAIRO_LINE_CAP_BUTT", "butt" }, { CAIRO_LINE_CAP_ROUND, "CAIRO_LINE_CAP_ROUND", "round" }, { CAIRO_LINE_CAP_SQUARE, "CAIRO_LINE_CAP_SQUARE", "square" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoLineCap", values); } return etype; } GType goo_cairo_line_join_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_LINE_JOIN_MITER, "CAIRO_LINE_JOIN_MITER", "miter" }, { CAIRO_LINE_JOIN_ROUND, "CAIRO_LINE_JOIN_ROUND", "round" }, { CAIRO_LINE_JOIN_BEVEL, "CAIRO_LINE_JOIN_BEVEL", "bevel" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoLineJoin", values); } return etype; } GType goo_cairo_hint_metrics_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_HINT_METRICS_DEFAULT, "CAIRO_HINT_METRICS_DEFAULT", "default" }, { CAIRO_HINT_METRICS_OFF, "CAIRO_HINT_METRICS_OFF", "off" }, { CAIRO_HINT_METRICS_ON, "CAIRO_HINT_METRICS_ON", "on" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoHintMetrics", values); } return etype; } /** * goo_canvas_line_dash_ref: * @dash: a #GooCanvasLineDash. * * Increments the reference count of the dash pattern. * * Returns: the dash pattern. **/ GooCanvasLineDash* goo_canvas_line_dash_ref (GooCanvasLineDash *dash) { if (dash) dash->ref_count++; return dash; } /** * goo_canvas_line_dash_unref: * @dash: a #GooCanvasLineDash. * * Decrements the reference count of the dash pattern. If it falls to 0 * it is freed. **/ void goo_canvas_line_dash_unref (GooCanvasLineDash *dash) { if (dash && --dash->ref_count == 0) { g_free (dash->dashes); g_free (dash); } } GType goo_canvas_line_dash_get_type (void) { static GType cairo_line_dash_type = 0; if (cairo_line_dash_type == 0) cairo_line_dash_type = g_boxed_type_register_static ("GooCanvasLineDash", (GBoxedCopyFunc) goo_canvas_line_dash_ref, (GBoxedFreeFunc) goo_canvas_line_dash_unref); return cairo_line_dash_type; } /** * goo_canvas_line_dash_new: * @num_dashes: the number of dashes and gaps in the pattern. * @...: the length of each dash and gap. * * Creates a new dash pattern. * * Returns: a new dash pattern. **/ GooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes, ...) { GooCanvasLineDash *dash; va_list var_args; gint i; dash = g_new (GooCanvasLineDash, 1); dash->ref_count = 1; dash->num_dashes = num_dashes; dash->dashes = g_new (double, num_dashes); dash->dash_offset = 0.0; va_start (var_args, num_dashes); for (i = 0; i < num_dashes; i++) { dash->dashes[i] = va_arg (var_args, double); } va_end (var_args); return dash; } /** * goo_canvas_line_dash_newv: * @num_dashes: the number of dashes and gaps in the pattern. * @dashes: a g_new-allocated vector of doubles, the length of each * dash and gap. * * Creates a new dash pattern. Takes ownership of the @dashes vector. * * Returns: a new dash pattern. **/ GooCanvasLineDash* goo_canvas_line_dash_newv (gint num_dashes, double *dashes) { GooCanvasLineDash *dash; dash = g_new (GooCanvasLineDash, 1); dash->ref_count = 1; dash->num_dashes = num_dashes; dash->dashes = dashes; dash->dash_offset = 0.0; return dash; } cairo_matrix_t* goo_cairo_matrix_copy (const cairo_matrix_t *matrix) { cairo_matrix_t *matrix_copy; if (!matrix) return NULL; matrix_copy = g_slice_new (cairo_matrix_t); *matrix_copy = *matrix; return matrix_copy; } void goo_cairo_matrix_free (cairo_matrix_t *matrix) { g_slice_free (cairo_matrix_t, matrix); } GType goo_cairo_matrix_get_type (void) { static GType type_cairo_matrix = 0; if (!type_cairo_matrix) type_cairo_matrix = g_boxed_type_register_static ("GooCairoMatrix", (GBoxedCopyFunc) goo_cairo_matrix_copy, (GBoxedFreeFunc) goo_cairo_matrix_free); return type_cairo_matrix; } /* This is a semi-private function to help gtk-doc find child properties. */ GParamSpec** goo_canvas_query_child_properties (gpointer class, guint *n_properties) { if (!G_TYPE_IS_CLASSED (G_TYPE_FROM_CLASS (class))) return NULL; if (g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM)) return goo_canvas_item_class_list_child_properties (class, n_properties); if (g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM_MODEL)) return goo_canvas_item_model_class_list_child_properties (class, n_properties); return NULL; } static gdouble parse_double (gchar **pos, gboolean *error) { gdouble result; gchar *p; /* If an error has already occurred, just return. */ if (*error) return 0; /* Skip whitespace and commas. */ p = *pos; while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n' || *p == ',') p++; /* Parse the double, and set pos to the first char after it. */ result = g_ascii_strtod (p, pos); /* If no characters were parsed, set the error flag. */ if (p == *pos) *error = TRUE; return result; } static gint parse_flag (gchar **pos, gboolean *error) { gint result = 0; gchar *p; /* If an error has already occurred, just return. */ if (*error) return 0; /* Skip whitespace and commas. */ p = *pos; while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n' || *p == ',') p++; /* The flag must be a '0' or a '1'. */ if (*p == '0') result = 0; else if (*p == '1') result = 1; else { *error = TRUE; return 0; } *pos = p + 1; return result; } /** * goo_canvas_parse_path_data: * @path_data: the sequence of path commands, specified as a string using the * same syntax as in the Scalable * Vector Graphics (SVG) path element. * * Parses the given SVG path specification string. * * Returns: a #GArray of #GooCanvasPathCommand elements. **/ GArray* goo_canvas_parse_path_data (const gchar *path_data) { GArray *commands; GooCanvasPathCommand cmd; gchar *pos, command = 0, next_command; gboolean error = FALSE; commands = g_array_new (0, 0, sizeof (GooCanvasPathCommand)); if (!path_data) return commands; pos = (gchar*) path_data; for (;;) { while (*pos == ' ' || *pos == '\t' || *pos == '\r' || *pos == '\n') pos++; if (!*pos) break; next_command = *pos; /* If there is no command letter, we use the same command as the last one, except for the first command, and 'moveto' (which becomes 'lineto'). */ if ((next_command < 'a' || next_command > 'z') && (next_command < 'A' || next_command > 'Z')) { /* If this is the first command, then set the error flag and assume a simple close-path command. */ if (!command) { error = TRUE; command = 'Z'; } /* moveto commands change to lineto. */ else if (command == 'm') command = 'l'; else if (command == 'M') command = 'L'; } else { command = next_command; pos++; } cmd.simple.relative = 0; switch (command) { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ case 'm': cmd.simple.relative = 1; case 'M': cmd.simple.type = GOO_CANVAS_PATH_MOVE_TO; cmd.simple.x = parse_double (&pos, &error); cmd.simple.y = parse_double (&pos, &error); break; case 'Z': case 'z': cmd.simple.type = GOO_CANVAS_PATH_CLOSE_PATH; break; case 'l': cmd.simple.relative = 1; case 'L': cmd.simple.type = GOO_CANVAS_PATH_LINE_TO; cmd.simple.x = parse_double (&pos, &error); cmd.simple.y = parse_double (&pos, &error); break; case 'h': cmd.simple.relative = 1; case 'H': cmd.simple.type = GOO_CANVAS_PATH_HORIZONTAL_LINE_TO; cmd.simple.x = parse_double (&pos, &error); break; case 'v': cmd.simple.relative = 1; case 'V': cmd.simple.type = GOO_CANVAS_PATH_VERTICAL_LINE_TO; cmd.simple.y = parse_double (&pos, &error); break; /* Bezier curve commands: CcSsQqTt. */ case 'c': cmd.curve.relative = 1; case 'C': cmd.curve.type = GOO_CANVAS_PATH_CURVE_TO; cmd.curve.x1 = parse_double (&pos, &error); cmd.curve.y1 = parse_double (&pos, &error); cmd.curve.x2 = parse_double (&pos, &error); cmd.curve.y2 = parse_double (&pos, &error); cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; case 's': cmd.curve.relative = 1; case 'S': cmd.curve.type = GOO_CANVAS_PATH_SMOOTH_CURVE_TO; cmd.curve.x2 = parse_double (&pos, &error); cmd.curve.y2 = parse_double (&pos, &error); cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; case 'q': cmd.curve.relative = 1; case 'Q': cmd.curve.type = GOO_CANVAS_PATH_QUADRATIC_CURVE_TO; cmd.curve.x1 = parse_double (&pos, &error); cmd.curve.y1 = parse_double (&pos, &error); cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; case 't': cmd.curve.relative = 1; case 'T': cmd.curve.type = GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO; cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; /* The elliptical arc commands: Aa. */ case 'a': cmd.arc.relative = 1; case 'A': cmd.arc.type = GOO_CANVAS_PATH_ELLIPTICAL_ARC; cmd.arc.rx = parse_double (&pos, &error); cmd.arc.ry = parse_double (&pos, &error); cmd.arc.x_axis_rotation = parse_double (&pos, &error); cmd.arc.large_arc_flag = parse_flag (&pos, &error); cmd.arc.sweep_flag = parse_flag (&pos, &error); cmd.arc.x = parse_double (&pos, &error); cmd.arc.y = parse_double (&pos, &error); break; default: error = TRUE; break; } /* If an error has occurred, return without adding the new command. Thus we include everything in the path up to the error, like SVG. */ if (error) return commands; g_array_append_val (commands, cmd); } return commands; } static void do_curve_to (GooCanvasPathCommand *cmd, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { if (cmd->curve.relative) { cairo_curve_to (cr, *x + cmd->curve.x1, *y + cmd->curve.y1, *x + cmd->curve.x2, *y + cmd->curve.y2, *x + cmd->curve.x, *y + cmd->curve.y); *last_control_point_x = *x + cmd->curve.x2; *last_control_point_y = *y + cmd->curve.y2; *x += cmd->curve.x; *y += cmd->curve.y; } else { cairo_curve_to (cr, cmd->curve.x1, cmd->curve.y1, cmd->curve.x2, cmd->curve.y2, cmd->curve.x, cmd->curve.y); *last_control_point_x = cmd->curve.x2; *last_control_point_y = cmd->curve.y2; *x = cmd->curve.x; *y = cmd->curve.y; } } static void do_smooth_curve_to (GooCanvasPathCommand *cmd, GooCanvasPathCommandType prev_cmd_type, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { gdouble x1, y1; /* If the last command was a curveto or smooth curveto, we use the reflection of the last control point about the current point as the first control point of this curve. Otherwise we use the current point as the first control point. */ if (prev_cmd_type == GOO_CANVAS_PATH_CURVE_TO || prev_cmd_type == GOO_CANVAS_PATH_SMOOTH_CURVE_TO) { x1 = *x + (*x - *last_control_point_x); y1 = *y + (*y - *last_control_point_y); } else { x1 = *x; y1 = *y; } if (cmd->curve.relative) { cairo_curve_to (cr, x1, y1, *x + cmd->curve.x2, *y + cmd->curve.y2, *x + cmd->curve.x, *y + cmd->curve.y); *last_control_point_x = *x + cmd->curve.x2; *last_control_point_y = *y + cmd->curve.y2; *x += cmd->curve.x; *y += cmd->curve.y; } else { cairo_curve_to (cr, x1, y1, cmd->curve.x2, cmd->curve.y2, cmd->curve.x, cmd->curve.y); *last_control_point_x = cmd->curve.x2; *last_control_point_y = cmd->curve.y2; *x = cmd->curve.x; *y = cmd->curve.y; } } static void do_quadratic_curve_to (GooCanvasPathCommand *cmd, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { gdouble qx1, qy1, qx2, qy2, x1, y1, x2, y2; if (cmd->curve.relative) { qx1 = *x + cmd->curve.x1; qy1 = *y + cmd->curve.y1; qx2 = *x + cmd->curve.x; qy2 = *y + cmd->curve.y; } else { qx1 = cmd->curve.x1; qy1 = cmd->curve.y1; qx2 = cmd->curve.x; qy2 = cmd->curve.y; } /* We need to convert the quadratic into a cubic bezier. */ x1 = *x + (qx1 - *x) * 2.0 / 3.0; y1 = *y + (qy1 - *y) * 2.0 / 3.0; x2 = x1 + (qx2 - *x) / 3.0; y2 = y1 + (qy2 - *y) / 3.0; cairo_curve_to (cr, x1, y1, x2, y2, qx2, qy2); *x = qx2; *y = qy2; *last_control_point_x = qx1; *last_control_point_y = qy1; } static void do_smooth_quadratic_curve_to (GooCanvasPathCommand *cmd, GooCanvasPathCommandType prev_cmd_type, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { gdouble qx1, qy1, qx2, qy2, x1, y1, x2, y2; /* If the last command was a quadratic or smooth quadratic, we use the reflection of the last control point about the current point as the first control point of this curve. Otherwise we use the current point as the first control point. */ if (prev_cmd_type == GOO_CANVAS_PATH_QUADRATIC_CURVE_TO || prev_cmd_type == GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO) { qx1 = *x + (*x - *last_control_point_x); qy1 = *y + (*y - *last_control_point_y); } else { qx1 = *x; qy1 = *y; } if (cmd->curve.relative) { qx2 = *x + cmd->curve.x; qy2 = *y + cmd->curve.y; } else { qx2 = cmd->curve.x; qy2 = cmd->curve.y; } /* We need to convert the quadratic into a cubic bezier. */ x1 = *x + (qx1 - *x) * 2.0 / 3.0; y1 = *y + (qy1 - *y) * 2.0 / 3.0; x2 = x1 + (qx2 - *x) / 3.0; y2 = y1 + (qy2 - *y) / 3.0; cairo_curve_to (cr, x1, y1, x2, y2, qx2, qy2); *x = qx2; *y = qy2; *last_control_point_x = qx1; *last_control_point_y = qy1; } static gdouble calc_angle (gdouble ux, gdouble uy, gdouble vx, gdouble vy) { gdouble top, u_magnitude, v_magnitude, angle_cos, angle; top = ux * vx + uy * vy; u_magnitude = sqrt (ux * ux + uy * uy); v_magnitude = sqrt (vx * vx + vy * vy); angle_cos = top / (u_magnitude * v_magnitude); /* We check if the cosine is slightly out-of-bounds. */ if (angle_cos >= 1.0) angle = 0.0; if (angle_cos <= -1.0) angle = M_PI; else angle = acos (angle_cos); if (ux * vy - uy * vx < 0) angle = - angle; return angle; } /* FIXME: Maybe we should do these calculations once when the path data is parsed, and keep the cairo parameters we need in the command instead. */ static void do_elliptical_arc (GooCanvasPathCommand *cmd, cairo_t *cr, gdouble *x, gdouble *y) { gdouble x1 = *x, y1 = *y, x2, y2, rx, ry, lambda; gdouble v1, v2, angle, angle_sin, angle_cos, x11, y11; gdouble rx_squared, ry_squared, x11_squared, y11_squared, top, bottom; gdouble c, cx1, cy1, cx, cy, start_angle, angle_delta; /* Calculate the end point of the arc - x2,y2. */ if (cmd->arc.relative) { x2 = x1 + cmd->arc.x; y2 = y1 + cmd->arc.y; } else { x2 = cmd->arc.x; y2 = cmd->arc.y; } *x = x2; *y = y2; /* If the endpoints are exactly the same, just return (see SVG spec). */ if (x1 == x2 && y1 == y2) return; /* If either rx or ry is 0, do a simple lineto (see SVG spec). */ if (cmd->arc.rx == 0.0 || cmd->arc.ry == 0.0) { cairo_line_to (cr, x2, y2); return; } /* Calculate x1' and y1' (as per SVG implementation notes). */ v1 = (x1 - x2) / 2.0; v2 = (y1 - y2) / 2.0; angle = cmd->arc.x_axis_rotation * (M_PI / 180.0); angle_sin = sin (angle); angle_cos = cos (angle); x11 = (angle_cos * v1) + (angle_sin * v2); y11 = - (angle_sin * v1) + (angle_cos * v2); /* Ensure rx and ry are positive and large enough. */ rx = cmd->arc.rx > 0.0 ? cmd->arc.rx : - cmd->arc.rx; ry = cmd->arc.ry > 0.0 ? cmd->arc.ry : - cmd->arc.ry; lambda = (x11 * x11) / (rx * rx) + (y11 * y11) / (ry * ry); if (lambda > 1.0) { gdouble square_root = sqrt (lambda); rx *= square_root; ry *= square_root; } /* Calculate cx' and cy'. */ rx_squared = rx * rx; ry_squared = ry * ry; x11_squared = x11 * x11; y11_squared = y11 * y11; top = (rx_squared * ry_squared) - (rx_squared * y11_squared) - (ry_squared * x11_squared); if (top < 0.0) { c = 0.0; } else { bottom = (rx_squared * y11_squared) + (ry_squared * x11_squared); c = sqrt (top / bottom); } if (cmd->arc.large_arc_flag == cmd->arc.sweep_flag) c = - c; cx1 = c * ((rx * y11) / ry); cy1 = c * (- (ry * x11) / rx); /* Calculate cx and cy. */ cx = (angle_cos * cx1) - (angle_sin * cy1) + (x1 + x2) / 2; cy = (angle_sin * cx1) + (angle_cos * cy1) + (y1 + y2) / 2; /* Calculate the start and end angles. */ v1 = (x11 - cx1) / rx; v2 = (y11 - cy1) / ry; start_angle = calc_angle (1, 0, v1, v2); angle_delta = calc_angle (v1, v2, (-x11 - cx1) / rx, (-y11 - cy1) / ry); if (cmd->arc.sweep_flag == 0 && angle_delta > 0.0) angle_delta -= 2 * M_PI; else if (cmd->arc.sweep_flag == 1 && angle_delta < 0.0) angle_delta += 2 * M_PI; /* Now draw the arc. */ cairo_save (cr); cairo_translate (cr, cx, cy); cairo_rotate (cr, angle); cairo_scale (cr, rx, ry); if (angle_delta > 0.0) cairo_arc (cr, 0.0, 0.0, 1.0, start_angle, start_angle + angle_delta); else cairo_arc_negative (cr, 0.0, 0.0, 1.0, start_angle, start_angle + angle_delta); cairo_restore (cr); } /** * goo_canvas_create_path: * @commands: an array of #GooCanvasPathCommand. * @cr: a cairo context. * * Creates the path specified by the given #GooCanvasPathCommand array. **/ void goo_canvas_create_path (GArray *commands, cairo_t *cr) { GooCanvasPathCommand *cmd; GooCanvasPathCommandType prev_cmd_type = GOO_CANVAS_PATH_CLOSE_PATH; gdouble x = 0, y = 0, path_start_x = 0, path_start_y = 0; gdouble last_control_point_x = 0.0, last_control_point_y = 0.0; gint i; cairo_new_path (cr); if (!commands || commands->len == 0) return; for (i = 0; i < commands->len; i++) { cmd = &g_array_index (commands, GooCanvasPathCommand, i); switch (cmd->simple.type) { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ case GOO_CANVAS_PATH_MOVE_TO: if (cmd->simple.relative) { x += cmd->simple.x; y += cmd->simple.y; } else { x = cmd->simple.x; y = cmd->simple.y; } path_start_x = x; path_start_y = y; cairo_move_to (cr, x, y); break; case GOO_CANVAS_PATH_CLOSE_PATH: x = path_start_x; y = path_start_y; cairo_close_path (cr); break; case GOO_CANVAS_PATH_LINE_TO: if (cmd->simple.relative) { x += cmd->simple.x; y += cmd->simple.y; } else { x = cmd->simple.x; y = cmd->simple.y; } cairo_line_to (cr, x, y); break; case GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: if (cmd->simple.relative) x += cmd->simple.x; else x = cmd->simple.x; cairo_line_to (cr, x, y); break; case GOO_CANVAS_PATH_VERTICAL_LINE_TO: if (cmd->simple.relative) y += cmd->simple.y; else y = cmd->simple.y; cairo_line_to (cr, x, y); break; /* Bezier curve commands: CcSsQqTt. */ case GOO_CANVAS_PATH_CURVE_TO: do_curve_to (cmd, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; case GOO_CANVAS_PATH_SMOOTH_CURVE_TO: do_smooth_curve_to (cmd, prev_cmd_type, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; case GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: do_quadratic_curve_to (cmd, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; case GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: do_smooth_quadratic_curve_to (cmd, prev_cmd_type, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; /* The elliptical arc commands: Aa. */ case GOO_CANVAS_PATH_ELLIPTICAL_ARC: do_elliptical_arc (cmd, cr, &x, &y); break; } prev_cmd_type = cmd->simple.type; } } /* This is a copy of _gtk_boolean_handled_accumulator. */ gboolean goo_canvas_boolean_handled_accumulator (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy) { gboolean continue_emission; gboolean signal_handled; signal_handled = g_value_get_boolean (handler_return); g_value_set_boolean (return_accu, signal_handled); continue_emission = !signal_handled; return continue_emission; } static GooCanvasBounds * goo_canvas_bounds_copy (const GooCanvasBounds *bounds) { GooCanvasBounds *result = g_new (GooCanvasBounds, 1); *result = *bounds; return result; } GType goo_canvas_bounds_get_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GooCanvasBounds", (GBoxedCopyFunc) goo_canvas_bounds_copy, (GBoxedFreeFunc) g_free); return our_type; } /* Converts red, green, blue and alpha doubles to an RGBA guint. */ guint goo_canvas_convert_colors_to_rgba (double red, double green, double blue, double alpha) { guint red_byte, green_byte, blue_byte, alpha_byte; red_byte = red * 256; red_byte -= red_byte >> 8; green_byte = green * 256; green_byte -= green_byte >> 8; blue_byte = blue * 256; blue_byte -= blue_byte >> 8; alpha_byte = alpha * 256; alpha_byte -= alpha_byte >> 8; return (red_byte << 24) + (green_byte << 16) + (blue_byte << 8) + alpha_byte; } void goo_canvas_get_rgba_value_from_pattern (cairo_pattern_t *pattern, GValue *value) { double red, green, blue, alpha; guint rgba = 0; if (pattern && cairo_pattern_get_type (pattern) == CAIRO_PATTERN_TYPE_SOLID) { cairo_pattern_get_rgba (pattern, &red, &green, &blue, &alpha); rgba = goo_canvas_convert_colors_to_rgba (red, green, blue, alpha); } g_value_set_uint (value, rgba); } /* Sets a style property to the given pattern, taking ownership of it. */ void goo_canvas_set_style_property_from_pattern (GooCanvasStyle *style, GQuark property_id, cairo_pattern_t *pattern) { GValue tmpval = { 0 }; g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style, property_id, &tmpval); g_value_unset (&tmpval); } cairo_pattern_t* goo_canvas_create_pattern_from_color_value (const GValue *value) { GdkColor color = { 0, 0, 0, 0, }; if (g_value_get_string (value)) gdk_color_parse (g_value_get_string (value), &color); return cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); } cairo_pattern_t* goo_canvas_create_pattern_from_rgba_value (const GValue *value) { guint rgba, red, green, blue, alpha; rgba = g_value_get_uint (value); red = (rgba >> 24) & 0xFF; green = (rgba >> 16) & 0xFF; blue = (rgba >> 8) & 0xFF; alpha = (rgba) & 0xFF; return cairo_pattern_create_rgba (red / 255.0, green / 255.0, blue / 255.0, alpha / 255.0); } cairo_pattern_t* goo_canvas_create_pattern_from_pixbuf_value (const GValue *value) { GdkPixbuf *pixbuf; cairo_surface_t *surface; cairo_pattern_t *pattern; pixbuf = g_value_get_object (value); surface = goo_canvas_cairo_surface_from_pixbuf (pixbuf); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); return pattern; } goocanvas-1.0.0/src/goocanvasgroup.h0000644000076400007640000000677511412723611014433 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgroup.h - group item. */ #ifndef __GOO_CANVAS_GROUP_H__ #define __GOO_CANVAS_GROUP_H__ #include #include "goocanvasitemsimple.h" #include "goocanvasutils.h" G_BEGIN_DECLS #define GOO_TYPE_CANVAS_GROUP (goo_canvas_group_get_type ()) #define GOO_CANVAS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GROUP, GooCanvasGroup)) #define GOO_CANVAS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GROUP, GooCanvasGroupClass)) #define GOO_IS_CANVAS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GROUP)) #define GOO_IS_CANVAS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GROUP)) #define GOO_CANVAS_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GROUP, GooCanvasGroupClass)) typedef struct _GooCanvasGroup GooCanvasGroup; typedef struct _GooCanvasGroupClass GooCanvasGroupClass; typedef struct _GooCanvasGroupModel GooCanvasGroupModel; typedef struct _GooCanvasGroupModelClass GooCanvasGroupModelClass; /** * GooCanvasGroup * * The #GooCanvasGroup-struct struct contains private data only. */ struct _GooCanvasGroup { GooCanvasItemSimple parent_object; /* An array of pointers to GooCanvasItems. The first element is at the bottom of the display stack and the last element is at the top. */ GPtrArray *items; }; struct _GooCanvasGroupClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_group_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_group_new (GooCanvasItem *parent, ...); #define GOO_TYPE_CANVAS_GROUP_MODEL (goo_canvas_group_model_get_type ()) #define GOO_CANVAS_GROUP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupModel)) #define GOO_CANVAS_GROUP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupModelClass)) #define GOO_IS_CANVAS_GROUP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GROUP_MODEL)) #define GOO_IS_CANVAS_GROUP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GROUP_MODEL)) #define GOO_CANVAS_GROUP_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupModelClass)) /** * GooCanvasGroupModel * * The #GooCanvasGroupModel-struct struct contains private data only. */ struct _GooCanvasGroupModel { GooCanvasItemModelSimple parent_object; /* An array of pointers to GooCanvasItemModels. The first element is at the bottom of the display stack and the last element is at the top. */ GPtrArray *children; }; struct _GooCanvasGroupModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_group_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_group_model_new (GooCanvasItemModel *parent, ...); G_END_DECLS #endif /* __GOO_CANVAS_GROUP_H__ */ goocanvas-1.0.0/src/goocanvasimage.c0000644000076400007640000005240011512446261014342 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasimage.c - image item. */ /** * SECTION:goocanvasimage * @Title: GooCanvasImage * @Short_Description: an image item. * * GooCanvasImage represents an image item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "operator" and "pointer-events". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasImage use goo_canvas_image_new(). * * To get or set the properties of an existing #GooCanvasImage, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvasprivate.h" #include "goocanvasimage.h" #include "goocanvas.h" #include "goocanvasutils.h" typedef struct _GooCanvasImagePrivate GooCanvasImagePrivate; struct _GooCanvasImagePrivate { gboolean scale_to_fit; gdouble alpha; }; #define GOO_CANVAS_IMAGE_GET_PRIVATE(image) \ (G_TYPE_INSTANCE_GET_PRIVATE ((image), GOO_TYPE_CANVAS_IMAGE, GooCanvasImagePrivate)) #define GOO_CANVAS_IMAGE_MODEL_GET_PRIVATE(image) \ (G_TYPE_INSTANCE_GET_PRIVATE ((image), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImagePrivate)) enum { PROP_0, PROP_PATTERN, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_SCALE_TO_FIT, PROP_ALPHA, /* Convenience properties. */ PROP_PIXBUF }; static void goo_canvas_image_dispose (GObject *object); static void goo_canvas_image_finalize (GObject *object); static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_image_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_image_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasImage, goo_canvas_image, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_image_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_PATTERN, g_param_spec_boxed ("pattern", _("Pattern"), _("The cairo pattern to paint"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the image"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the image"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the image"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the image"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_TO_FIT, g_param_spec_boolean ("scale-to-fit", _("Scale To Fit"), _("If the image is scaled to fit the width and height settings"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ALPHA, g_param_spec_double ("alpha", _("Alpha"), _("The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque."), 0.0, 1.0, 1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PIXBUF, g_param_spec_object ("pixbuf", _("Pixbuf"), _("The GdkPixbuf to display"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); } /* Gets the private data to use, from the model or from the item itself. */ static GooCanvasImagePrivate* goo_canvas_image_get_private (gpointer object) { GooCanvasItemSimple *simple; if (GOO_IS_CANVAS_IMAGE (object)) { simple = (GooCanvasItemSimple*) object; if (simple->model) return GOO_CANVAS_IMAGE_MODEL_GET_PRIVATE (simple->model); else return GOO_CANVAS_IMAGE_GET_PRIVATE (object); } else { return GOO_CANVAS_IMAGE_MODEL_GET_PRIVATE (object); } } static void goo_canvas_image_init (GooCanvasImage *image) { GooCanvasImagePrivate *priv = GOO_CANVAS_IMAGE_GET_PRIVATE (image); image->image_data = g_slice_new0 (GooCanvasImageData); priv->alpha = 1.0; } /** * goo_canvas_image_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @pixbuf: the #GdkPixbuf containing the image data, or %NULL. * @x: the x coordinate of the image. * @y: the y coordinate of the image. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new image item. * * * * Here's an example showing how to create an image at (100.0, 100.0), using * the given pixbuf at its natural width and height: * * * GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0, * NULL); * * * Returns: a new image item. **/ GooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...) { GooCanvasItem *item; GooCanvasImage *image; GooCanvasImageData *image_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_IMAGE, NULL); image = (GooCanvasImage*) item; image_data = image->image_data; image_data->x = x; image_data->y = y; if (pixbuf) { image_data->pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); image_data->width = gdk_pixbuf_get_width (pixbuf); image_data->height = gdk_pixbuf_get_height (pixbuf); } va_start (var_args, y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_image_dispose (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasImage *image = (GooCanvasImage*) object; if (!simple->model) { cairo_pattern_destroy (image->image_data->pattern); image->image_data->pattern = NULL; } G_OBJECT_CLASS (goo_canvas_image_parent_class)->dispose (object); } static void goo_canvas_image_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasImage *image = (GooCanvasImage*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) g_slice_free (GooCanvasImageData, image->image_data); image->image_data = NULL; G_OBJECT_CLASS (goo_canvas_image_parent_class)->finalize (object); } static void goo_canvas_image_get_common_property (GObject *object, GooCanvasImageData *image_data, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasImagePrivate *priv = goo_canvas_image_get_private (object); switch (prop_id) { case PROP_PATTERN: g_value_set_boxed (value, image_data->pattern); break; case PROP_X: g_value_set_double (value, image_data->x); break; case PROP_Y: g_value_set_double (value, image_data->y); break; case PROP_WIDTH: g_value_set_double (value, image_data->width); break; case PROP_HEIGHT: g_value_set_double (value, image_data->height); break; case PROP_SCALE_TO_FIT: g_value_set_boolean (value, priv->scale_to_fit); break; case PROP_ALPHA: g_value_set_double (value, priv->alpha); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_image_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasImage *image = (GooCanvasImage*) object; goo_canvas_image_get_common_property (object, image->image_data, prop_id, value, pspec); } static gboolean goo_canvas_image_set_common_property (GObject *object, GooCanvasImageData *image_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasImagePrivate *priv = goo_canvas_image_get_private (object); GdkPixbuf *pixbuf; gboolean recompute_bounds = TRUE; switch (prop_id) { case PROP_PATTERN: cairo_pattern_destroy (image_data->pattern); image_data->pattern = g_value_get_boxed (value); cairo_pattern_reference (image_data->pattern); break; case PROP_X: image_data->x = g_value_get_double (value); break; case PROP_Y: image_data->y = g_value_get_double (value); break; case PROP_WIDTH: image_data->width = g_value_get_double (value); break; case PROP_HEIGHT: image_data->height = g_value_get_double (value); break; case PROP_SCALE_TO_FIT: priv->scale_to_fit = g_value_get_boolean (value); break; case PROP_PIXBUF: cairo_pattern_destroy (image_data->pattern); pixbuf = g_value_get_object (value); image_data->pattern = pixbuf ? goo_canvas_cairo_pattern_from_pixbuf (pixbuf) : NULL; image_data->width = pixbuf ? gdk_pixbuf_get_width (pixbuf) : 0; image_data->height = pixbuf ? gdk_pixbuf_get_height (pixbuf) : 0; break; case PROP_ALPHA: priv->alpha = g_value_get_double (value); recompute_bounds = FALSE; break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } return recompute_bounds; } static void goo_canvas_image_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasImage *image = (GooCanvasImage*) object; gboolean recompute_bounds; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } recompute_bounds = goo_canvas_image_set_common_property (object, image->image_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, recompute_bounds); } static gboolean goo_canvas_image_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasImage *image = (GooCanvasImage*) simple; GooCanvasImageData *image_data = image->image_data; if (x < image_data->x || (x > image_data->x + image_data->width) || y < image_data->y || (y > image_data->y + image_data->height)) return FALSE; return TRUE; } static void goo_canvas_image_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasImage *image = (GooCanvasImage*) simple; GooCanvasImageData *image_data = image->image_data; /* Compute the new bounds. */ simple->bounds.x1 = image_data->x; simple->bounds.y1 = image_data->y; simple->bounds.x2 = image_data->x + image_data->width; simple->bounds.y2 = image_data->y + image_data->height; } static void goo_canvas_image_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasImagePrivate *priv = goo_canvas_image_get_private (simple); GooCanvasImage *image = (GooCanvasImage*) simple; GooCanvasImageData *image_data = image->image_data; cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; cairo_surface_t *surface; gdouble width, height; if (!image_data->pattern) return; #if 1 if (priv->scale_to_fit) { if (cairo_pattern_get_surface (image_data->pattern, &surface) == CAIRO_STATUS_SUCCESS && cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE) { width = cairo_image_surface_get_width (surface); height = cairo_image_surface_get_height (surface); cairo_matrix_scale (&matrix, width / image_data->width, height / image_data->height); } } cairo_matrix_translate (&matrix, -image_data->x, -image_data->y); cairo_pattern_set_matrix (image_data->pattern, &matrix); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_set_source (cr, image_data->pattern); cairo_rectangle (cr, image_data->x, image_data->y, image_data->width, image_data->height); /* To have better performance, we don't use cairo_paint_with_alpha if * the image is not transparent at all. */ if (priv->alpha != 1.0) cairo_paint_with_alpha (cr, priv->alpha); else cairo_fill (cr); #else /* Using cairo_paint() used to be much slower than cairo_fill(), though they seem similar now. I'm not sure if it matters which we use. */ cairo_matrix_init_translate (&matrix, -image_data->x, -image_data->y); cairo_pattern_set_matrix (image_data->pattern, &matrix); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_set_source (cr, image_data->pattern); cairo_paint (cr); #endif } static void goo_canvas_image_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasImage *image = (GooCanvasImage*) item; GooCanvasImageModel *imodel = (GooCanvasImageModel*) model; /* If our data was allocated, free it. */ if (!simple->model) { cairo_pattern_destroy (image->image_data->pattern); g_slice_free (GooCanvasImageData, image->image_data); } /* Now use the new model's data instead. */ image->image_data = &imodel->image_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_image_set_model; } static void goo_canvas_image_class_init (GooCanvasImageClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasImagePrivate)); gobject_class->dispose = goo_canvas_image_dispose; gobject_class->finalize = goo_canvas_image_finalize; gobject_class->get_property = goo_canvas_image_get_property; gobject_class->set_property = goo_canvas_image_set_property; simple_class->simple_update = goo_canvas_image_update; simple_class->simple_paint = goo_canvas_image_paint; simple_class->simple_is_item_at = goo_canvas_image_is_item_at; goo_canvas_image_install_common_properties (gobject_class); } /** * SECTION:goocanvasimagemodel * @Title: GooCanvasImageModel * @Short_Description: a model for image items. * * GooCanvasImageModel represent a model for image items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "operator" and "pointer-events". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasImageModel use goo_canvas_image_model_new(). * * To get or set the properties of an existing #GooCanvasImageModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the image you must connect * to the signal handlers of the corresponding #GooCanvasImage objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_image_model_dispose (GObject *object); static void goo_canvas_image_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_image_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasImageModel, goo_canvas_image_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_image_model_class_init (GooCanvasImageModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasImagePrivate)); gobject_class->dispose = goo_canvas_image_model_dispose; gobject_class->get_property = goo_canvas_image_model_get_property; gobject_class->set_property = goo_canvas_image_model_set_property; goo_canvas_image_install_common_properties (gobject_class); } static void goo_canvas_image_model_init (GooCanvasImageModel *emodel) { GooCanvasImagePrivate *priv = GOO_CANVAS_IMAGE_MODEL_GET_PRIVATE (emodel); priv->alpha = 1.0; } /** * goo_canvas_image_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @pixbuf: the #GdkPixbuf containing the image data, or %NULL. * @x: the x coordinate of the image. * @y: the y coordinate of the image. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new image model. * * * * Here's an example showing how to create an image at (100.0, 100.0), using * the given pixbuf at its natural width and height: * * * GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0, * NULL); * * * Returns: a new image model. **/ GooCanvasItemModel* goo_canvas_image_model_new (GooCanvasItemModel *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...) { GooCanvasItemModel *model; GooCanvasImageModel *imodel; GooCanvasImageData *image_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_IMAGE_MODEL, NULL); imodel = (GooCanvasImageModel*) model; image_data = &imodel->image_data; image_data->x = x; image_data->y = y; if (pixbuf) { image_data->pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); image_data->width = gdk_pixbuf_get_width (pixbuf); image_data->height = gdk_pixbuf_get_height (pixbuf); } va_start (var_args, y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_image_model_dispose (GObject *object) { GooCanvasImageModel *imodel = (GooCanvasImageModel*) object; cairo_pattern_destroy (imodel->image_data.pattern); imodel->image_data.pattern = NULL; G_OBJECT_CLASS (goo_canvas_image_model_parent_class)->dispose (object); } static void goo_canvas_image_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasImageModel *imodel = (GooCanvasImageModel*) object; goo_canvas_image_get_common_property (object, &imodel->image_data, prop_id, value, pspec); } static void goo_canvas_image_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasImageModel *imodel = (GooCanvasImageModel*) object; gboolean recompute_bounds; recompute_bounds = goo_canvas_image_set_common_property (object, &imodel->image_data, prop_id, value, pspec); g_signal_emit_by_name (imodel, "changed", recompute_bounds); } static GooCanvasItem* goo_canvas_image_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_IMAGE, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_image_model_create_item; } goocanvas-1.0.0/src/goocanvasprivate.h0000644000076400007640000000326511412723611014740 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasprivate.h - private types & utility functions. */ #ifndef __GOO_CANVAS_PRIVATE_H__ #define __GOO_CANVAS_PRIVATE_H__ #include #include "goocanvasstyle.h" G_BEGIN_DECLS /* * GPtrArray extensions. */ void goo_canvas_util_ptr_array_insert (GPtrArray *ptr_array, gpointer data, gint index); void goo_canvas_util_ptr_array_move (GPtrArray *ptr_array, gint old_index, gint new_index); gint goo_canvas_util_ptr_array_find_index (GPtrArray *ptr_array, gpointer data); cairo_pattern_t* goo_canvas_cairo_pattern_from_pixbuf (GdkPixbuf *pixbuf); cairo_surface_t* goo_canvas_cairo_surface_from_pixbuf (GdkPixbuf *pixbuf); guint goo_canvas_convert_colors_to_rgba (double red, double green, double blue, double alpha); void goo_canvas_get_rgba_value_from_pattern (cairo_pattern_t *pattern, GValue *value); void goo_canvas_set_style_property_from_pattern (GooCanvasStyle *style, GQuark property_id, cairo_pattern_t *pattern); cairo_pattern_t* goo_canvas_create_pattern_from_color_value (const GValue *value); cairo_pattern_t* goo_canvas_create_pattern_from_rgba_value (const GValue *value); cairo_pattern_t* goo_canvas_create_pattern_from_pixbuf_value (const GValue *value); gboolean goo_canvas_boolean_handled_accumulator (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy); G_END_DECLS #endif /* __GOO_CANVAS_PRIVATE_H__ */ goocanvas-1.0.0/src/goocanvasitemsimple.h0000644000076400007640000002142311412723611015432 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitemsimple.h - abstract base class for simple items. */ #ifndef __GOO_CANVAS_ITEM_SIMPLE_H__ #define __GOO_CANVAS_ITEM_SIMPLE_H__ #include #include "goocanvasitem.h" #include "goocanvasitemmodel.h" #include "goocanvasstyle.h" #include "goocanvasutils.h" G_BEGIN_DECLS /** * GooCanvasItemSimpleData * @style: the style to draw with. * @transform: the transformation matrix of the item, or %NULL. * @clip_path_commands: an array of #GooCanvasPathCommand specifying the clip * path of the item, or %NULL. * @tooltip: the item's tooltip. * @visibility_threshold: the threshold scale setting at which to show the item * (if the @visibility setting is set to %VISIBLE_ABOVE_THRESHOLD). * @visibility: the #GooCanvasItemVisibility setting specifying whether the * item is visible, invisible, or visible above a given canvas scale setting. * @pointer_events: the #GooCanvasPointerEvents setting specifying the events * the item should receive. * @can_focus: if the item can take the keyboard focus. * @own_style: if the item has its own style, rather than using its parent's. * @clip_fill_rule: the #cairo_fill_rule_t setting specifying the fill rule * used for the clip path. * @is_static: if the item is static. * * This is the data common to both the model and view classes. */ typedef struct _GooCanvasItemSimpleData GooCanvasItemSimpleData; struct _GooCanvasItemSimpleData { GooCanvasStyle *style; cairo_matrix_t *transform; GArray *clip_path_commands; gchar *tooltip; /*< public >*/ gdouble visibility_threshold; guint visibility : 2; guint pointer_events : 4; guint can_focus : 1; guint own_style : 1; guint clip_fill_rule : 4; guint is_static : 1; /*< private >*/ /* We might use this in future for a cache setting - never/always/visible. */ guint cache_setting : 2; /* We might need this for tooltips in future. */ guint has_tooltip : 1; }; #define GOO_TYPE_CANVAS_ITEM_SIMPLE (goo_canvas_item_simple_get_type ()) #define GOO_CANVAS_ITEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM_SIMPLE, GooCanvasItemSimple)) #define GOO_CANVAS_ITEM_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ITEM_SIMPLE, GooCanvasItemSimpleClass)) #define GOO_IS_CANVAS_ITEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM_SIMPLE)) #define GOO_IS_CANVAS_ITEM_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ITEM_SIMPLE)) #define GOO_CANVAS_ITEM_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ITEM_SIMPLE, GooCanvasItemSimpleClass)) typedef struct _GooCanvasItemSimple GooCanvasItemSimple; typedef struct _GooCanvasItemSimpleClass GooCanvasItemSimpleClass; typedef struct _GooCanvasItemModelSimple GooCanvasItemModelSimple; /** * GooCanvasItemSimple * @canvas: the canvas. * @parent: the parent item. * @model: the item's model, if it has one. * @simple_data: data that is common to both the model and view classes. If * the canvas item has a model, this will point to the model's * #GooCanvasItemSimpleData, otherwise the canvas item will have its own * #GooCanvasItemSimpleData. * @bounds: the bounds of the item, in device space. * @need_update: if the item needs to recompute its bounds and redraw. * @need_entire_subtree_update: if all descendants need to be updated. * * The #GooCanvasItemSimple-struct struct contains the basic data needed to * implement canvas items. */ struct _GooCanvasItemSimple { /* */ GObject parent_object; /* */ GooCanvas *canvas; GooCanvasItem *parent; GooCanvasItemModelSimple *model; GooCanvasItemSimpleData *simple_data; GooCanvasBounds bounds; guint need_update : 1; guint need_entire_subtree_update : 1; /* */ /* We might use this in future for things like a cache. */ gpointer priv; }; /** * GooCanvasItemSimpleClass * @simple_create_path: simple subclasses that draw basic shapes and paths only * need to override this one method. It creates the path for the item. * All updating, painting and hit-testing is provided automatically by the * #GooCanvasItemSimple class. (This method is used by the builtin * #GooCanvasEllipse, #GooCanvasRect and #GooCanvasPath items.) * More complicated subclasses must override @simple_update, @simple_paint and * @simple_is_item_at instead. * @simple_update: subclasses should override this to calculate their new * bounds, in user space. * @simple_paint: subclasses should override this to paint their item. * @simple_is_item_at: subclasses should override this to do hit-testing. * * The #GooCanvasItemSimpleClass-struct struct contains several methods that * subclasses can override. * * Simple items need only implement the create_path() method. More complex * items must override the update(), paint() and is_item_at() methods instead. */ struct _GooCanvasItemSimpleClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ void (* simple_create_path) (GooCanvasItemSimple *simple, cairo_t *cr); void (* simple_update) (GooCanvasItemSimple *simple, cairo_t *cr); void (* simple_paint) (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds); gboolean (* simple_is_item_at) (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_item_simple_get_type (void) G_GNUC_CONST; void goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_simple_user_bounds_to_parent (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); gboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events); void goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr); void goo_canvas_item_simple_changed (GooCanvasItemSimple *item, gboolean recompute_bounds); void goo_canvas_item_simple_check_style (GooCanvasItemSimple *item); gdouble goo_canvas_item_simple_get_line_width (GooCanvasItemSimple *item); void goo_canvas_item_simple_set_model (GooCanvasItemSimple *item, GooCanvasItemModel *model); #define GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE (goo_canvas_item_model_simple_get_type ()) #define GOO_CANVAS_ITEM_MODEL_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, GooCanvasItemModelSimple)) #define GOO_CANVAS_ITEM_MODEL_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, GooCanvasItemModelSimpleClass)) #define GOO_IS_CANVAS_ITEM_MODEL_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE)) #define GOO_IS_CANVAS_ITEM_MODEL_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE)) #define GOO_CANVAS_ITEM_MODEL_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, GooCanvasItemModelSimpleClass)) typedef struct _GooCanvasItemModelSimpleClass GooCanvasItemModelSimpleClass; /** * GooCanvasItemModelSimple * @parent: the parent model. * @simple_data: data used by the canvas item for viewing the model. * * The #GooCanvasItemModelSimple-struct struct contains the basic data needed * to implement canvas item models. */ struct _GooCanvasItemModelSimple { GObject parent_object; /*< public >*/ GooCanvasItemModel *parent; GooCanvasItemSimpleData simple_data; /*< private >*/ /* The title and description of the item for accessibility. */ gchar *title; gchar *description; }; struct _GooCanvasItemModelSimpleClass { GObjectClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_item_model_simple_get_type (void) G_GNUC_CONST; G_END_DECLS #endif /* __GOO_CANVAS_ITEM_SIMPLE_H__ */ goocanvas-1.0.0/src/goocanvasgroup.c0000644000076400007640000010257611412723611014422 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgroup.c - group item. */ /** * SECTION:goocanvasgroup * @Title: GooCanvasGroup * @Short_Description: a group of items. * * #GooCanvasGroup represents a group of items. Groups can be nested to * any depth, to create a hierarchy of items. Items are ordered within each * group, with later items being displayed above earlier items. * * #GooCanvasGroup is a subclass of #GooCanvasItemSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasGroup will affect * all children of the #GooCanvasGroup (unless the children override the * property setting). * * #GooCanvasGroup implements the #GooCanvasItem interface, so you can use * the #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(), and the properties such as "visibility" and * "pointer-events". * * If the #GooCanvasGroup:width and #GooCanvasGroup:height properties are * set to positive values then the group is clipped to the given size. * * To create a #GooCanvasGroup use goo_canvas_group_new(). * * To get or set the properties of an existing #GooCanvasGroup, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvasprivate.h" #include "goocanvasgroup.h" #include "goocanvasitemmodel.h" #include "goocanvas.h" #include "goocanvasmarshal.h" #include "goocanvasatk.h" typedef struct _GooCanvasGroupPrivate GooCanvasGroupPrivate; struct _GooCanvasGroupPrivate { gdouble x; gdouble y; gdouble width; gdouble height; }; #define GOO_CANVAS_GROUP_GET_PRIVATE(group) \ (G_TYPE_INSTANCE_GET_PRIVATE ((group), GOO_TYPE_CANVAS_GROUP, GooCanvasGroupPrivate)) #define GOO_CANVAS_GROUP_MODEL_GET_PRIVATE(group) \ (G_TYPE_INSTANCE_GET_PRIVATE ((group), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupPrivate)) enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void goo_canvas_group_dispose (GObject *object); static void goo_canvas_group_finalize (GObject *object); static void goo_canvas_group_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_group_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasGroup, goo_canvas_group, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_group_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the group"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the group"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the group, or -1 to use the default width"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the group, or -1 to use the default height"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); } static void goo_canvas_group_class_init (GooCanvasGroupClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasGroupPrivate)); gobject_class->dispose = goo_canvas_group_dispose; gobject_class->finalize = goo_canvas_group_finalize; gobject_class->get_property = goo_canvas_group_get_property; gobject_class->set_property = goo_canvas_group_set_property; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS_GROUP, goo_canvas_item_accessible_factory_get_type ()); } goo_canvas_group_install_common_properties (gobject_class); } static void goo_canvas_group_init (GooCanvasGroup *group) { GooCanvasGroupPrivate* priv = GOO_CANVAS_GROUP_GET_PRIVATE (group); group->items = g_ptr_array_sized_new (8); priv->x = 0.0; priv->y = 0.0; priv->width = -1.0; priv->height = -1.0; } /** * goo_canvas_group_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new group item. * * Return value: a new group item. **/ GooCanvasItem* goo_canvas_group_new (GooCanvasItem *parent, ...) { GooCanvasItem *item; GooCanvasGroup *group; va_list var_args; const char *first_property; item = g_object_new (GOO_TYPE_CANVAS_GROUP, NULL); group = (GooCanvasGroup*) item; va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (item), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_group_dispose (GObject *object) { GooCanvasGroup *group = (GooCanvasGroup*) object; gint i; /* Unref all the items in the group. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *item = group->items->pdata[i]; goo_canvas_item_set_parent (item, NULL); g_object_unref (item); } g_ptr_array_set_size (group->items, 0); G_OBJECT_CLASS (goo_canvas_group_parent_class)->dispose (object); } static void goo_canvas_group_finalize (GObject *object) { GooCanvasGroup *group = (GooCanvasGroup*) object; g_ptr_array_free (group->items, TRUE); G_OBJECT_CLASS (goo_canvas_group_parent_class)->finalize (object); } /* Gets the private data to use, from the model or from the item itself. */ static GooCanvasGroupPrivate* goo_canvas_group_get_private (GooCanvasGroup *group) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) group; if (simple->model) return GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (simple->model); else return GOO_CANVAS_GROUP_GET_PRIVATE (group); } static void goo_canvas_group_get_common_property (GObject *object, GooCanvasGroupPrivate *priv, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, priv->x); break; case PROP_Y: g_value_set_double (value, priv->y); break; case PROP_WIDTH: g_value_set_double (value, priv->width); break; case PROP_HEIGHT: g_value_set_double (value, priv->height); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_group_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGroup *group = (GooCanvasGroup*) object; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); goo_canvas_group_get_common_property (object, priv, prop_id, value, pspec); } static void goo_canvas_group_set_common_property (GObject *object, GooCanvasGroupPrivate *priv, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: priv->x = g_value_get_double (value); break; case PROP_Y: priv->y = g_value_get_double (value); break; case PROP_WIDTH: priv->width = g_value_get_double (value); break; case PROP_HEIGHT: priv->height = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_group_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasGroup *group = (GooCanvasGroup*) object; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_group_set_common_property (object, priv, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_group_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; AtkObject *atk_obj, *child_atk_obj; g_object_ref (child); if (position >= 0) { goo_canvas_util_ptr_array_insert (group->items, child, position); } else { position = group->items->len; g_ptr_array_add (group->items, child); } goo_canvas_item_set_parent (child, item); goo_canvas_item_set_is_static (child, simple->simple_data->is_static); /* Emit the "children_changed" ATK signal, if ATK is enabled. */ atk_obj = atk_gobject_accessible_for_object (G_OBJECT (item)); if (!ATK_IS_NO_OP_OBJECT (atk_obj)) { child_atk_obj = atk_gobject_accessible_for_object (G_OBJECT (child)); g_signal_emit_by_name (atk_obj, "children_changed::add", position, child_atk_obj); } goo_canvas_item_request_update (item); } static void goo_canvas_group_move_child (GooCanvasItem *item, gint old_position, gint new_position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasItem *child; GooCanvasBounds bounds; /* Request a redraw of the item's bounds. */ child = group->items->pdata[old_position]; if (simple->canvas) { goo_canvas_item_get_bounds (child, &bounds); goo_canvas_request_item_redraw (simple->canvas, &bounds, simple->simple_data->is_static); } goo_canvas_util_ptr_array_move (group->items, old_position, new_position); goo_canvas_item_request_update (item); } static void goo_canvas_group_remove_child (GooCanvasItem *item, gint child_num) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasItem *child; GooCanvasBounds bounds; AtkObject *atk_obj, *child_atk_obj; g_return_if_fail (child_num < group->items->len); /* Request a redraw of the item's bounds. */ child = group->items->pdata[child_num]; if (simple->canvas) { goo_canvas_item_get_bounds (child, &bounds); goo_canvas_request_item_redraw (simple->canvas, &bounds, simple->simple_data->is_static); } /* Emit the "children_changed" ATK signal, if ATK is enabled. */ atk_obj = atk_gobject_accessible_for_object (G_OBJECT (item)); if (!ATK_IS_NO_OP_OBJECT (atk_obj)) { child_atk_obj = atk_gobject_accessible_for_object (G_OBJECT (child)); g_signal_emit_by_name (atk_obj, "children_changed::remove", child_num, child_atk_obj); } g_ptr_array_remove_index (group->items, child_num); goo_canvas_item_set_parent (child, NULL); g_object_unref (child); goo_canvas_item_request_update (item); } static gint goo_canvas_group_get_n_children (GooCanvasItem *item) { GooCanvasGroup *group = (GooCanvasGroup*) item; return group->items->len; } static GooCanvasItem* goo_canvas_group_get_child (GooCanvasItem *item, gint child_num) { GooCanvasGroup *group = (GooCanvasGroup*) item; if (child_num < group->items->len) return group->items->pdata[child_num]; return NULL; } /* This is only used to set the canvas of the root group. It isn't normally needed by apps. */ static void goo_canvas_group_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; gint i; if (simple->canvas == canvas) return; simple->canvas = canvas; /* Recursively set the canvas of all child items. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *item = group->items->pdata[i]; goo_canvas_item_set_canvas (item, canvas); } } static void goo_canvas_group_set_is_static (GooCanvasItem *item, gboolean is_static) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; gint i; if (simple_data->is_static == is_static) return; simple_data->is_static = is_static; /* Recursively set the canvas of all child items. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *item = group->items->pdata[i]; goo_canvas_item_set_is_static (item, is_static); } } static void on_model_child_added (GooCanvasGroupModel *model, gint position, GooCanvasGroup *group) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) group; GooCanvasItem *item = (GooCanvasItem*) group; GooCanvasItemModel *child_model; GooCanvasItem *child; /* Create a canvas item for the model. */ child_model = goo_canvas_item_model_get_child ((GooCanvasItemModel*) model, position); child = goo_canvas_create_item (simple->canvas, child_model); goo_canvas_item_add_child (item, child, position); g_object_unref (child); } static void on_model_child_moved (GooCanvasGroupModel *model, gint old_position, gint new_position, GooCanvasGroup *group) { goo_canvas_item_move_child ((GooCanvasItem*) group, old_position, new_position); } static void on_model_child_removed (GooCanvasGroupModel *model, gint child_num, GooCanvasGroup *group) { goo_canvas_item_remove_child ((GooCanvasItem*) group, child_num); } static void goo_canvas_group_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; gint n_children, i; /* Do the default GooCanvasItemSimple code first. */ goo_canvas_item_simple_set_model (simple, model); /* Now add our own handlers. */ g_signal_connect (model, "child-added", G_CALLBACK (on_model_child_added), group); g_signal_connect (model, "child-moved", G_CALLBACK (on_model_child_moved), group); g_signal_connect (model, "child-removed", G_CALLBACK (on_model_child_removed), group); /* Recursively create child items for any children. */ n_children = goo_canvas_item_model_get_n_children (model); for (i = 0; i < n_children; i++) on_model_child_added ((GooCanvasGroupModel*) simple->model, i, group); } static void goo_canvas_group_request_update (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; if (!simple->need_update) { simple->need_update = TRUE; if (simple->parent) goo_canvas_item_request_update (simple->parent); else if (simple->canvas) goo_canvas_request_update (simple->canvas); } } static void goo_canvas_group_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); GooCanvasBounds child_bounds; gboolean initial_bounds = TRUE; gint i; if (entire_tree || simple->need_update) { if (simple->need_entire_subtree_update) entire_tree = TRUE; simple->need_update = FALSE; simple->need_entire_subtree_update = FALSE; goo_canvas_item_simple_check_style (simple); simple->bounds.x1 = simple->bounds.y1 = 0.0; simple->bounds.x2 = simple->bounds.y2 = 0.0; cairo_save (cr); if (simple->simple_data->transform) cairo_transform (cr, simple->simple_data->transform); cairo_translate (cr, priv->x, priv->y); for (i = 0; i < group->items->len; i++) { GooCanvasItem *child = group->items->pdata[i]; goo_canvas_item_update (child, entire_tree, cr, &child_bounds); /* If the child has non-empty bounds, compute the union. */ if (child_bounds.x1 < child_bounds.x2 && child_bounds.y1 < child_bounds.y2) { if (initial_bounds) { simple->bounds.x1 = child_bounds.x1; simple->bounds.y1 = child_bounds.y1; simple->bounds.x2 = child_bounds.x2; simple->bounds.y2 = child_bounds.y2; initial_bounds = FALSE; } else { simple->bounds.x1 = MIN (simple->bounds.x1, child_bounds.x1); simple->bounds.y1 = MIN (simple->bounds.y1, child_bounds.y1); simple->bounds.x2 = MAX (simple->bounds.x2, child_bounds.x2); simple->bounds.y2 = MAX (simple->bounds.y2, child_bounds.y2); } } } cairo_restore (cr); } *bounds = simple->bounds; } static GList* goo_canvas_group_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_visible, GList *found_items) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); gboolean visible = parent_visible; int i; if (simple->need_update) goo_canvas_item_ensure_updated (item); /* Skip the item if the point isn't in the item's bounds. */ if (simple->bounds.x1 > x || simple->bounds.x2 < x || simple->bounds.y1 > y || simple->bounds.y2 < y) return found_items; if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) visible = FALSE; /* Check if the group should receive events. */ if (is_pointer_event && (simple_data->pointer_events == GOO_CANVAS_EVENTS_NONE || ((simple_data->pointer_events & GOO_CANVAS_EVENTS_VISIBLE_MASK) && !visible))) return found_items; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, priv->x, priv->y); /* If the group has a clip path, check if the point is inside it. */ if (simple_data->clip_path_commands) { double user_x = x, user_y = y; cairo_device_to_user (cr, &user_x, &user_y); goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); if (!cairo_in_fill (cr, user_x, user_y)) { cairo_restore (cr); return found_items; } } if (priv->width > 0.0 && priv->height > 0.0) { double user_x = x, user_y = y; cairo_device_to_user (cr, &user_x, &user_y); if (user_x < 0.0 || user_x >= priv->width || user_y < 0.0 || user_y >= priv->height) { cairo_restore (cr); return found_items; } } /* Step up from the bottom of the children to the top, adding any items found to the start of the list. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *child = group->items->pdata[i]; found_items = goo_canvas_item_get_items_at (child, x, y, cr, is_pointer_event, visible, found_items); } cairo_restore (cr); return found_items; } static void goo_canvas_group_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); gint i; /* Skip the item if the bounds don't intersect the expose rectangle. */ if (simple->bounds.x1 > bounds->x2 || simple->bounds.x2 < bounds->x1 || simple->bounds.y1 > bounds->y2 || simple->bounds.y2 < bounds->y1) return; /* Check if the item should be visible. */ if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && scale < simple_data->visibility_threshold)) return; /* Paint all the items in the group. */ cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, priv->x, priv->y); /* Clip with the group's clip path, if it is set. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_clip (cr); } if (priv->width > 0.0 && priv->height > 0.0) { cairo_rectangle (cr, 0.0, 0.0, priv->width, priv->height); cairo_clip (cr); } for (i = 0; i < group->items->len; i++) { GooCanvasItem *child = group->items->pdata[i]; goo_canvas_item_paint (child, cr, bounds, scale); } cairo_restore (cr); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_canvas = goo_canvas_group_set_canvas; iface->get_n_children = goo_canvas_group_get_n_children; iface->get_child = goo_canvas_group_get_child; iface->request_update = goo_canvas_group_request_update; iface->add_child = goo_canvas_group_add_child; iface->move_child = goo_canvas_group_move_child; iface->remove_child = goo_canvas_group_remove_child; iface->get_items_at = goo_canvas_group_get_items_at; iface->update = goo_canvas_group_update; iface->paint = goo_canvas_group_paint; iface->set_model = goo_canvas_group_set_model; iface->set_is_static = goo_canvas_group_set_is_static; } /** * SECTION:goocanvasgroupmodel * @Title: GooCanvasGroupModel * @Short_Description: a model for a group of items. * * #GooCanvasGroupModel represents a group of items. Groups can be nested to * any depth, to create a hierarchy of items. Items are ordered within each * group, with later items being displayed above earlier items. * * #GooCanvasGroupModel is a subclass of #GooCanvasItemModelSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasGroupModel will * affect all children of the #GooCanvasGroupModel (unless the children * override the property setting). * * #GooCanvasGroupModel implements the #GooCanvasItemModel interface, so you * can use the #GooCanvasItemModel functions such as * goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(), and the * properties such as "visibility" and "pointer-events". * * To create a #GooCanvasGroupModel use goo_canvas_group_model_new(). * * To get or set the properties of an existing #GooCanvasGroupModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the group you must connect * to the signal handlers of the corresponding #GooCanvasGroup objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_group_model_dispose (GObject *object); static void goo_canvas_group_model_finalize (GObject *object); static void goo_canvas_group_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_group_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasGroupModel, goo_canvas_group_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_group_model_class_init (GooCanvasGroupModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasGroupPrivate)); gobject_class->dispose = goo_canvas_group_model_dispose; gobject_class->finalize = goo_canvas_group_model_finalize; gobject_class->get_property = goo_canvas_group_model_get_property; gobject_class->set_property = goo_canvas_group_model_set_property; goo_canvas_group_install_common_properties (gobject_class); } static void goo_canvas_group_model_init (GooCanvasGroupModel *gmodel) { GooCanvasGroupPrivate *priv = GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (gmodel); gmodel->children = g_ptr_array_sized_new (8); priv->x = 0.0; priv->y = 0.0; priv->width = -1.0; priv->height = -1.0; } /** * goo_canvas_group_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new group item. * * Return value: a new group model. **/ GooCanvasItemModel* goo_canvas_group_model_new (GooCanvasItemModel *parent, ...) { GooCanvasItemModel *model; GooCanvasGroupModel *gmodel; va_list var_args; const char *first_property; model = g_object_new (GOO_TYPE_CANVAS_GROUP_MODEL, NULL); gmodel = (GooCanvasGroupModel*) model; va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (model), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_group_model_dispose (GObject *object) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) object; gint i; /* Unref all the items in the group. */ for (i = 0; i < gmodel->children->len; i++) { GooCanvasItemModel *child = gmodel->children->pdata[i]; goo_canvas_item_model_set_parent (child, NULL); g_object_unref (child); } g_ptr_array_set_size (gmodel->children, 0); G_OBJECT_CLASS (goo_canvas_group_model_parent_class)->dispose (object); } static void goo_canvas_group_model_finalize (GObject *object) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) object; g_ptr_array_free (gmodel->children, TRUE); G_OBJECT_CLASS (goo_canvas_group_model_parent_class)->finalize (object); } static void goo_canvas_group_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *model = (GooCanvasGroupModel*) object; GooCanvasGroupPrivate *priv = GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (model); goo_canvas_group_get_common_property (object, priv, prop_id, value, pspec); } static void goo_canvas_group_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *model = (GooCanvasGroupModel*) object; GooCanvasGroupPrivate *priv = GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (model); goo_canvas_group_set_common_property (object, priv, prop_id, value, pspec); g_signal_emit_by_name (model, "changed", TRUE); } extern void _goo_canvas_item_model_emit_child_added (GooCanvasItemModel *model, gint position); static void goo_canvas_group_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; g_object_ref (child); if (position >= 0) { goo_canvas_util_ptr_array_insert (gmodel->children, child, position); } else { position = gmodel->children->len; g_ptr_array_add (gmodel->children, child); } goo_canvas_item_model_set_parent (child, model); _goo_canvas_item_model_emit_child_added (model, position); } static void goo_canvas_group_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; goo_canvas_util_ptr_array_move (gmodel->children, old_position, new_position); g_signal_emit_by_name (gmodel, "child-moved", old_position, new_position); } static void goo_canvas_group_model_remove_child (GooCanvasItemModel *model, gint child_num) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; GooCanvasItemModel *child; child = gmodel->children->pdata[child_num]; goo_canvas_item_model_set_parent (child, NULL); g_ptr_array_remove_index (gmodel->children, child_num); g_signal_emit_by_name (gmodel, "child-removed", child_num); g_object_unref (child); } static gint goo_canvas_group_model_get_n_children (GooCanvasItemModel *model) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; return gmodel->children->len; } static GooCanvasItemModel* goo_canvas_group_model_get_child (GooCanvasItemModel *model, gint child_num) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; if (child_num < gmodel->children->len) return gmodel->children->pdata[child_num]; return NULL; } static GooCanvasItem* goo_canvas_group_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = goo_canvas_group_new (NULL, NULL); /* Note that we set the canvas before the model, since we may need the canvas to create any child items. */ goo_canvas_item_set_canvas (item, canvas); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->add_child = goo_canvas_group_model_add_child; iface->move_child = goo_canvas_group_model_move_child; iface->remove_child = goo_canvas_group_model_remove_child; iface->get_n_children = goo_canvas_group_model_get_n_children; iface->get_child = goo_canvas_group_model_get_child; iface->create_item = goo_canvas_group_model_create_item; } goocanvas-1.0.0/src/goocanvaswidget.h0000644000076400007640000000373111412723611014547 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaswidget.h - wrapper item for an embedded GtkWidget. */ #ifndef __GOO_CANVAS_WIDGET_H__ #define __GOO_CANVAS_WIDGET_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_CANVAS_WIDGET (goo_canvas_widget_get_type ()) #define GOO_CANVAS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_WIDGET, GooCanvasWidget)) #define GOO_CANVAS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_WIDGET, GooCanvasWidgetClass)) #define GOO_IS_CANVAS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_WIDGET)) #define GOO_IS_CANVAS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_WIDGET)) #define GOO_CANVAS_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_WIDGET, GooCanvasWidgetClass)) typedef struct _GooCanvasWidget GooCanvasWidget; typedef struct _GooCanvasWidgetClass GooCanvasWidgetClass; /** * GooCanvasWidget * * The #GooCanvasWidget-struct struct contains private data only. */ struct _GooCanvasWidget { GooCanvasItemSimple parent_object; GtkWidget *widget; gdouble x, y, width, height; GtkAnchorType anchor; }; struct _GooCanvasWidgetClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_widget_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_widget_new (GooCanvasItem *parent, GtkWidget *widget, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_CANVAS_WIDGET_H__ */ goocanvas-1.0.0/src/goocanvasmarshal.c0000644000076400007640000002513611412724107014712 00000000000000#include "goocanvasmarshal.h" #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_char (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:VOID (./goocanvasmarshal.list:1) */ /* VOID:INT (./goocanvasmarshal.list:2) */ /* VOID:INT,INT (./goocanvasmarshal.list:3) */ void goo_canvas_marshal_VOID__INT_INT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, gint arg_1, gint arg_2, gpointer data2); register GMarshalFunc_VOID__INT_INT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_int (param_values + 1), g_marshal_value_peek_int (param_values + 2), data2); } /* VOID:BOOLEAN (./goocanvasmarshal.list:4) */ /* VOID:OBJECT,OBJECT (./goocanvasmarshal.list:5) */ void goo_canvas_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__OBJECT_OBJECT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_object (param_values + 2), data2); } /* BOOLEAN:BOXED (./goocanvasmarshal.list:6) */ void goo_canvas_marshal_BOOLEAN__BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED) (gpointer data1, gpointer arg_1, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 2); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:OBJECT,BOXED (./goocanvasmarshal.list:7) */ void goo_canvas_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_BOXED) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__OBJECT_BOXED callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__OBJECT_BOXED) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_boxed (param_values + 2), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:DOUBLE,DOUBLE,BOOLEAN,OBJECT (./goocanvasmarshal.list:8) */ void goo_canvas_marshal_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT) (gpointer data1, gdouble arg_1, gdouble arg_2, gboolean arg_3, gpointer arg_4, gpointer data2); register GMarshalFunc_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 5); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_double (param_values + 1), g_marshal_value_peek_double (param_values + 2), g_marshal_value_peek_boolean (param_values + 3), g_marshal_value_peek_object (param_values + 4), data2); g_value_set_boolean (return_value, v_return); } goocanvas-1.0.0/src/goocanvastext.c0000644000076400007640000010125111412723611014237 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastext.c - text item. */ /** * SECTION:goocanvastext * @Title: GooCanvasText * @Short_Description: a text item. * * GooCanvasText represents a text item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "fill-color". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * The #GooCanvasText:width and #GooCanvasText:height properties specify the * area of the item. If it exceeds that area because there is too much text, * it is clipped. The properties can be set to -1 to disable clipping. * * To create a #GooCanvasText use goo_canvas_text_new(). * * To get or set the properties of an existing #GooCanvasText, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvastext.h" #include "goocanvas.h" typedef struct _GooCanvasTextPrivate GooCanvasTextPrivate; struct _GooCanvasTextPrivate { gdouble height; }; #define GOO_CANVAS_TEXT_GET_PRIVATE(text) \ (G_TYPE_INSTANCE_GET_PRIVATE ((text), GOO_TYPE_CANVAS_TEXT, GooCanvasTextPrivate)) #define GOO_CANVAS_TEXT_MODEL_GET_PRIVATE(text) \ (G_TYPE_INSTANCE_GET_PRIVATE ((text), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextPrivate)) enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_TEXT, PROP_USE_MARKUP, PROP_ANCHOR, PROP_ALIGN, PROP_ELLIPSIZE, PROP_WRAP }; static PangoLayout* goo_canvas_text_create_layout (GooCanvasItemSimpleData *simple_data, GooCanvasTextData *text_data, gdouble layout_width, cairo_t *cr, GooCanvasBounds *bounds, gdouble *origin_x_return, gdouble *origin_y_return); static void goo_canvas_text_finalize (GObject *object); static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_text_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_text_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasText, goo_canvas_text, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_text_install_common_properties (GObjectClass *gobject_class) { /* Text */ g_object_class_install_property (gobject_class, PROP_TEXT, g_param_spec_string ("text", _("Text"), _("The text to display"), NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_USE_MARKUP, g_param_spec_boolean ("use-markup", _("Use Markup"), _("Whether to parse PangoMarkup in the text, to support different styles"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ELLIPSIZE, g_param_spec_enum ("ellipsize", _("Ellipsize"), _("The preferred place to ellipsize the string, if the label does not have enough room to display the entire string"), PANGO_TYPE_ELLIPSIZE_MODE, PANGO_ELLIPSIZE_NONE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WRAP, g_param_spec_enum ("wrap", _("Wrap"), _("The preferred method of wrapping the string if a width has been set"), PANGO_TYPE_WRAP_MODE, PANGO_WRAP_WORD, G_PARAM_READWRITE)); /* Position */ g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the text"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the text"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width to use to layout the text, or -1 to let the text use as much horizontal space as needed"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height to use to layout the text, or -1 to let the text use as much vertical space as needed"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANCHOR, g_param_spec_enum ("anchor", _("Anchor"), _("How to position the text relative to the given x and y coordinates"), GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_NW, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ALIGN, g_param_spec_enum ("alignment", _("Alignment"), _("How to align the text"), PANGO_TYPE_ALIGNMENT, PANGO_ALIGN_LEFT, G_PARAM_READWRITE)); } static void goo_canvas_text_init (GooCanvasText *text) { GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_GET_PRIVATE (text); text->text_data = g_slice_new0 (GooCanvasTextData); text->text_data->width = -1.0; text->text_data->anchor = GTK_ANCHOR_NW; text->text_data->ellipsize = PANGO_ELLIPSIZE_NONE; text->text_data->wrap = PANGO_WRAP_WORD; text->layout_width = -1.0; priv->height = -1.0; } /** * goo_canvas_text_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @string: the text to display. * @x: the x coordinate of the text. * @y: the y coordinate of the text. * @width: the width of the text item, or -1 for unlimited width. * @anchor: the position of the text relative to the given @x and @y * coordinates. For example an anchor of %GDK_ANCHOR_NW will result in the * top-left of the text being placed at the given @x and @y coordinates. * An anchor of %GDK_ANCHOR_CENTER will result in the center of the text being * placed at the @x and @y coordinates. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new text item. * * * * Here's an example showing how to create a text item with the bottom right * of the text box placed at (500,500): * * * GooCanvasItem *text = goo_canvas_text_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE, * "fill-color", "blue", * NULL); * * * Returns: a new text item. **/ GooCanvasItem* goo_canvas_text_new (GooCanvasItem *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...) { GooCanvasItem *item; GooCanvasText *text; GooCanvasTextData *text_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_TEXT, NULL); text = (GooCanvasText*) item; text_data = text->text_data; text_data->text = g_strdup (string); text_data->x = x; text_data->y = y; text_data->width = width; text_data->anchor = anchor; va_start (var_args, anchor); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_text_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasText *text = (GooCanvasText*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { g_free (text->text_data->text); g_slice_free (GooCanvasTextData, text->text_data); } text->text_data = NULL; G_OBJECT_CLASS (goo_canvas_text_parent_class)->finalize (object); } /* Gets the private data to use, from the model or from the item itself. */ static GooCanvasTextPrivate* goo_canvas_text_get_private (GooCanvasText *text) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) text; if (simple->model) return GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (simple->model); else return GOO_CANVAS_TEXT_GET_PRIVATE (text); } static void goo_canvas_text_get_common_property (GObject *object, GooCanvasTextData *text_data, GooCanvasTextPrivate *priv, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, text_data->x); break; case PROP_Y: g_value_set_double (value, text_data->y); break; case PROP_WIDTH: g_value_set_double (value, text_data->width); break; case PROP_HEIGHT: g_value_set_double (value, priv->height); break; case PROP_TEXT: g_value_set_string (value, text_data->text); break; case PROP_USE_MARKUP: g_value_set_boolean (value, text_data->use_markup); break; case PROP_ELLIPSIZE: g_value_set_enum (value, text_data->ellipsize); break; case PROP_WRAP: g_value_set_enum (value, text_data->wrap); break; case PROP_ANCHOR: g_value_set_enum (value, text_data->anchor); break; case PROP_ALIGN: g_value_set_enum (value, text_data->alignment); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_text_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasText *text = (GooCanvasText*) object; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); goo_canvas_text_get_common_property (object, text->text_data, priv, prop_id, value, pspec); } static void goo_canvas_text_set_common_property (GObject *object, GooCanvasTextData *text_data, GooCanvasTextPrivate *priv, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: text_data->x = g_value_get_double (value); break; case PROP_Y: text_data->y = g_value_get_double (value); break; case PROP_WIDTH: text_data->width = g_value_get_double (value); break; case PROP_HEIGHT: priv->height = g_value_get_double (value); break; case PROP_TEXT: g_free (text_data->text); text_data->text = g_value_dup_string (value); break; case PROP_USE_MARKUP: text_data->use_markup = g_value_get_boolean (value); break; case PROP_ELLIPSIZE: text_data->ellipsize = g_value_get_enum (value); break; case PROP_WRAP: text_data->wrap = g_value_get_enum (value); break; case PROP_ANCHOR: text_data->anchor = g_value_get_enum (value); break; case PROP_ALIGN: text_data->alignment = g_value_get_enum (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_text_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasText *text = (GooCanvasText*) object; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_text_set_common_property (object, text->text_data, priv, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static PangoLayout* goo_canvas_text_create_layout (GooCanvasItemSimpleData *simple_data, GooCanvasTextData *text_data, gdouble layout_width, cairo_t *cr, GooCanvasBounds *bounds, gdouble *origin_x_return, gdouble *origin_y_return) { GooCanvasStyle *style = simple_data->style; GValue *svalue; PangoLayout *layout; PangoContext *context; PangoRectangle ink_rect, logical_rect; double logical_width, logical_height, align_width, origin_x, origin_y; gchar *string; double x1_extension, x2_extension, y1_extension, y2_extension; cairo_font_options_t *font_options; cairo_hint_metrics_t hint_metrics = CAIRO_HINT_METRICS_OFF; string = text_data->text ? text_data->text : ""; layout = pango_cairo_create_layout (cr); context = pango_layout_get_context (layout); if (layout_width > 0) pango_layout_set_width (layout, (double) layout_width * PANGO_SCALE); if (text_data->use_markup) pango_layout_set_markup (layout, string, -1); else pango_layout_set_text (layout, string, -1); svalue = goo_canvas_style_get_property (style, goo_canvas_style_font_desc_id); if (svalue) pango_layout_set_font_description (layout, svalue->data[0].v_pointer); svalue = goo_canvas_style_get_property (style, goo_canvas_style_hint_metrics_id); if (svalue) hint_metrics = svalue->data[0].v_long; font_options = cairo_font_options_create (); cairo_font_options_set_hint_metrics (font_options, hint_metrics); pango_cairo_context_set_font_options (context, font_options); cairo_font_options_destroy (font_options); if (text_data->alignment != PANGO_ALIGN_LEFT) pango_layout_set_alignment (layout, text_data->alignment); pango_layout_set_ellipsize (layout, text_data->ellipsize); pango_layout_set_wrap (layout, text_data->wrap); if (bounds) { /* Get size of the text, so we can position it according to anchor. */ pango_layout_get_extents (layout, &ink_rect, &logical_rect); logical_width = (double) logical_rect.width / PANGO_SCALE; logical_height = (double) logical_rect.height / PANGO_SCALE; /* If the text width has been set, that width is used to do the alignment positioning. Otherwise the actual width is used. */ if (text_data->width > 0) align_width = text_data->width; else align_width = logical_width; /* Now calculate the origin of the text, i.e. where we will tell Pango to draw it. */ origin_x = text_data->x; origin_y = text_data->y; switch (text_data->anchor) { case GTK_ANCHOR_N: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_S: origin_x -= align_width / 2.0; break; case GTK_ANCHOR_NE: case GTK_ANCHOR_E: case GTK_ANCHOR_SE: origin_x -= align_width; break; default: break; } switch (text_data->anchor) { case GTK_ANCHOR_W: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_E: origin_y -= logical_height / 2.0; break; case GTK_ANCHOR_SW: case GTK_ANCHOR_S: case GTK_ANCHOR_SE: origin_y -= logical_height; break; default: break; } /* Return the origin of the text if required. */ if (origin_x_return) *origin_x_return = origin_x; if (origin_y_return) *origin_y_return = origin_y; /* Now calculate the logical bounds. */ bounds->x1 = origin_x; bounds->y1 = origin_y; if (text_data->width > 0) { /* If the text width has been set, and the alignment isn't PANGO_ALIGN_LEFT, we need to adjust for the difference between the actual width of the text and the width that was used for alignment. */ switch (text_data->alignment) { case PANGO_ALIGN_CENTER: bounds->x1 += (align_width - logical_width) / 2.0; break; case PANGO_ALIGN_RIGHT: bounds->x1 += align_width - logical_width; break; default: break; } } bounds->x2 = bounds->x1 + logical_width; bounds->y2 = bounds->y1 + logical_height; /* Now adjust it to take into account the ink bounds. Calculate how far the ink rect extends outside each edge of the logical rect and adjust the bounds as necessary. */ x1_extension = logical_rect.x - ink_rect.x; if (x1_extension > 0) bounds->x1 -= x1_extension / PANGO_SCALE; x2_extension = (ink_rect.x + ink_rect.width) - (logical_rect.x + logical_rect.width); if (x2_extension > 0) bounds->x2 += x2_extension / PANGO_SCALE; y1_extension = logical_rect.y - ink_rect.y; if (y1_extension > 0) bounds->y1 -= y1_extension / PANGO_SCALE; y2_extension = (ink_rect.y + ink_rect.height) - (logical_rect.y + logical_rect.height); if (y2_extension > 0) bounds->y2 += y2_extension / PANGO_SCALE; } return layout; } static void goo_canvas_text_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasText *text = (GooCanvasText*) simple; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; /* Initialize the layout width to the text item's specified width property. It may get changed later in get_requested_height() according to the layout container and settings. */ text->layout_width = text->text_data->width; /* Compute the new bounds. */ layout = goo_canvas_text_create_layout (simple->simple_data, text->text_data, text->layout_width, cr, &simple->bounds, NULL, NULL); g_object_unref (layout); /* If the height is set, use that. */ if (priv->height > 0.0) simple->bounds.y2 = simple->bounds.y1 + priv->height; } static gboolean goo_canvas_text_is_unpainted (GooCanvasStyle *style) { GValue *value; value = goo_canvas_style_get_property (style, goo_canvas_style_fill_pattern_id); /* We only return TRUE if the value is explicitly set to NULL. */ if (value && !value->data[0].v_pointer) return TRUE; return FALSE; } static gboolean goo_canvas_text_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasText *text = (GooCanvasText*) simple; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; GooCanvasBounds bounds; PangoLayoutIter *iter; PangoRectangle ink_rect, log_rect; int px, py, x1, y1, x2, y2; int log_x2, ink_x2, log_y2, ink_y2; gdouble origin_x, origin_y; gboolean in_item = FALSE; /* If there is no text just return. */ if (!text->text_data->text || !text->text_data->text[0]) return FALSE; if (is_pointer_event && simple_data->pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK && goo_canvas_text_is_unpainted (simple_data->style)) return FALSE; /* Check if the point is outside the clipped height. */ if (priv->height > 0.0 && y > priv->height) return FALSE; layout = goo_canvas_text_create_layout (simple_data, text->text_data, text->layout_width, cr, &bounds, &origin_x, &origin_y); /* Convert the coordinates into Pango units. */ px = (x - origin_x) * PANGO_SCALE; py = (y - origin_y) * PANGO_SCALE; /* We use line extents here. Note that SVG uses character cells to determine hits so we have slightly different behavior. */ iter = pango_layout_get_iter (layout); do { pango_layout_iter_get_line_extents (iter, &ink_rect, &log_rect); /* We use a union of the ink rect and the logical rect, as we want to let the user click on any part of the ink, even if it extends outside the character cell (i.e. the ink rect), or click on the space in the character cell (i.e. the logical rect). */ x1 = MIN (log_rect.x, ink_rect.x); y1 = MIN (log_rect.y, ink_rect.y); log_x2 = log_rect.x + log_rect.width; ink_x2 = ink_rect.x + ink_rect.width; x2 = MAX (log_x2, ink_x2); log_y2 = log_rect.y + log_rect.height; ink_y2 = ink_rect.y + ink_rect.height; y2 = MAX (log_y2, ink_y2); if (px >= x1 && px < x2 && py >= y1 && py < y2) { in_item = TRUE; break; } } while (pango_layout_iter_next_line (iter)); pango_layout_iter_free (iter); g_object_unref (layout); return in_item; } static void goo_canvas_text_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasText *text = (GooCanvasText*) simple; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; GooCanvasBounds layout_bounds; gdouble origin_x, origin_y; /* If there is no text just return. */ if (!text->text_data->text || !text->text_data->text[0]) return; goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_new_path (cr); layout = goo_canvas_text_create_layout (simple->simple_data, text->text_data, text->layout_width, cr, &layout_bounds, &origin_x, &origin_y); cairo_save (cr); if (priv->height > 0.0) { cairo_rectangle (cr, origin_x, origin_y, text->layout_width, priv->height); cairo_clip (cr); } cairo_move_to (cr, origin_x, origin_y); pango_cairo_show_layout (cr, layout); cairo_restore (cr); g_object_unref (layout); } static gdouble goo_canvas_text_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasText *text = (GooCanvasText*) item; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; gdouble height; /* If we have a transformation besides a simple scale & translation, just return -1 as we can't adjust the height in that case. */ if (simple_data->clip_path_commands || (simple_data->transform && (simple_data->transform->xy != 0.0 || simple_data->transform->yx != 0.0))) return -1; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Convert the width from the parent's coordinate space. Note that we only need to support a simple scale operation here. */ text->layout_width = width; if (simple_data->transform) text->layout_width /= simple_data->transform->xx; if (priv->height < 0.0) { /* Create layout with given width. */ layout = goo_canvas_text_create_layout (simple_data, text->text_data, text->layout_width, cr, &simple->bounds, NULL, NULL); g_object_unref (layout); height = simple->bounds.y2 - simple->bounds.y1; } else { height = priv->height; } /* Convert to the parent's coordinate space. As above, we only need to support a simple scale operation here. */ if (simple_data->transform) height *= simple_data->transform->yy; /* Convert the item's bounds to device space. */ goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); cairo_restore (cr); /* Return the new requested height of the text. */ return height; } /** * goo_canvas_text_get_natural_extents: * @text: a #GooCanvasText. * @ink_rect: the location to return the ink rect, or %NULL. * @logical_rect: the location to return the logical rect, or %NULL. * * Gets the natural extents of the text, in the text item's coordinate space. * * The final extents of the text may be different, if the text item is placed * in a layout container such as #GooCanvasTable. **/ void goo_canvas_text_get_natural_extents (GooCanvasText *text, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { GooCanvasItem *item = (GooCanvasItem*) text; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) text; PangoLayout *layout; cairo_t *cr; if (simple->need_update) goo_canvas_item_ensure_updated (item); cr = goo_canvas_create_cairo_context (simple->canvas); layout = goo_canvas_text_create_layout (simple->simple_data, text->text_data, text->text_data->width, cr, NULL, NULL, NULL); pango_layout_get_extents (layout, ink_rect, logical_rect); g_object_unref (layout); cairo_destroy (cr); } static void goo_canvas_text_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasText *text = (GooCanvasText*) item; GooCanvasTextModel *tmodel = (GooCanvasTextModel*) model; /* If our text_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasTextData, text->text_data); /* Now use the new model's text_data instead. */ text->text_data = &tmodel->text_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->get_requested_height = goo_canvas_text_get_requested_height; iface->set_model = goo_canvas_text_set_model; } static void goo_canvas_text_class_init (GooCanvasTextClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasTextPrivate)); gobject_class->finalize = goo_canvas_text_finalize; gobject_class->get_property = goo_canvas_text_get_property; gobject_class->set_property = goo_canvas_text_set_property; simple_class->simple_update = goo_canvas_text_update; simple_class->simple_paint = goo_canvas_text_paint; simple_class->simple_is_item_at = goo_canvas_text_is_item_at; goo_canvas_text_install_common_properties (gobject_class); } /** * SECTION:goocanvastextmodel * @Title: GooCanvasTextModel * @Short_Description: a model for text items. * * GooCanvasTextModel represents a model for text items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "fill-color". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasTextModel use goo_canvas_text_model_new(). * * To get or set the properties of an existing #GooCanvasTextModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the text item you must connect * to the signal handlers of the corresponding #GooCanvasText objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_text_model_finalize (GObject *object); static void goo_canvas_text_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_text_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasTextModel, goo_canvas_text_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_text_model_class_init (GooCanvasTextModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasTextPrivate)); gobject_class->finalize = goo_canvas_text_model_finalize; gobject_class->get_property = goo_canvas_text_model_get_property; gobject_class->set_property = goo_canvas_text_model_set_property; goo_canvas_text_install_common_properties (gobject_class); } static void goo_canvas_text_model_init (GooCanvasTextModel *tmodel) { GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (tmodel); tmodel->text_data.width = -1.0; tmodel->text_data.anchor = GTK_ANCHOR_NW; tmodel->text_data.ellipsize = PANGO_ELLIPSIZE_NONE; tmodel->text_data.wrap = PANGO_WRAP_WORD; priv->height = -1.0; } /** * goo_canvas_text_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @string: the text to display. * @x: the x coordinate of the text. * @y: the y coordinate of the text. * @width: the width of the text item, or -1 for unlimited width. * @anchor: the position of the text relative to the given @x and @y * coordinates. For example an anchor of %GDK_ANCHOR_NW will result in the * top-left of the text being placed at the given @x and @y coordinates. * An anchor of %GDK_ANCHOR_CENTER will result in the center of the text being * placed at the @x and @y coordinates. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new text model. * * * * Here's an example showing how to create a text item with the bottom right * of the text box placed at (500,500): * * * GooCanvasItemModel *text = goo_canvas_text_model_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE, * "fill-color", "blue", * NULL); * * * Returns: a new text model. **/ GooCanvasItemModel* goo_canvas_text_model_new (GooCanvasItemModel *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...) { GooCanvasItemModel *model; GooCanvasTextModel *tmodel; GooCanvasTextData *text_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_TEXT_MODEL, NULL); tmodel = (GooCanvasTextModel*) model; text_data = &tmodel->text_data; text_data->text = g_strdup (string); text_data->x = x; text_data->y = y; text_data->width = width; text_data->anchor = anchor; va_start (var_args, anchor); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_text_model_finalize (GObject *object) { GooCanvasTextModel *tmodel = (GooCanvasTextModel*) object; g_free (tmodel->text_data.text); G_OBJECT_CLASS (goo_canvas_text_model_parent_class)->finalize (object); } static void goo_canvas_text_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasTextModel *tmodel = (GooCanvasTextModel*) object; GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (tmodel); goo_canvas_text_get_common_property (object, &tmodel->text_data, priv, prop_id, value, pspec); } static void goo_canvas_text_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasTextModel *tmodel = (GooCanvasTextModel*) object; GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (tmodel); goo_canvas_text_set_common_property (object, &tmodel->text_data, priv, prop_id, value, pspec); g_signal_emit_by_name (tmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_text_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_TEXT, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_text_model_create_item; } goocanvas-1.0.0/src/goocanvasenumtypes.c0000644000076400007640000000753311512612677015326 00000000000000 /* Generated data (by glib-mkenums) */ #include #include "goocanvas.h" /* Enumerations from "goocanvasitem.h" */ GType goo_canvas_animate_type_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GEnumValue values[] = { { GOO_CANVAS_ANIMATE_FREEZE, "GOO_CANVAS_ANIMATE_FREEZE", "freeze" }, { GOO_CANVAS_ANIMATE_RESET, "GOO_CANVAS_ANIMATE_RESET", "reset" }, { GOO_CANVAS_ANIMATE_RESTART, "GOO_CANVAS_ANIMATE_RESTART", "restart" }, { GOO_CANVAS_ANIMATE_BOUNCE, "GOO_CANVAS_ANIMATE_BOUNCE", "bounce" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCanvasAnimateType", values ); } return etype; } /* Enumerations from "goocanvasutils.h" */ GType goo_canvas_pointer_events_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GFlagsValue values[] = { { GOO_CANVAS_EVENTS_VISIBLE_MASK, "GOO_CANVAS_EVENTS_VISIBLE_MASK", "visible-mask" }, { GOO_CANVAS_EVENTS_PAINTED_MASK, "GOO_CANVAS_EVENTS_PAINTED_MASK", "painted-mask" }, { GOO_CANVAS_EVENTS_FILL_MASK, "GOO_CANVAS_EVENTS_FILL_MASK", "fill-mask" }, { GOO_CANVAS_EVENTS_STROKE_MASK, "GOO_CANVAS_EVENTS_STROKE_MASK", "stroke-mask" }, { GOO_CANVAS_EVENTS_NONE, "GOO_CANVAS_EVENTS_NONE", "none" }, { GOO_CANVAS_EVENTS_VISIBLE_PAINTED, "GOO_CANVAS_EVENTS_VISIBLE_PAINTED", "visible-painted" }, { GOO_CANVAS_EVENTS_VISIBLE_FILL, "GOO_CANVAS_EVENTS_VISIBLE_FILL", "visible-fill" }, { GOO_CANVAS_EVENTS_VISIBLE_STROKE, "GOO_CANVAS_EVENTS_VISIBLE_STROKE", "visible-stroke" }, { GOO_CANVAS_EVENTS_VISIBLE, "GOO_CANVAS_EVENTS_VISIBLE", "visible" }, { GOO_CANVAS_EVENTS_PAINTED, "GOO_CANVAS_EVENTS_PAINTED", "painted" }, { GOO_CANVAS_EVENTS_FILL, "GOO_CANVAS_EVENTS_FILL", "fill" }, { GOO_CANVAS_EVENTS_STROKE, "GOO_CANVAS_EVENTS_STROKE", "stroke" }, { GOO_CANVAS_EVENTS_ALL, "GOO_CANVAS_EVENTS_ALL", "all" }, { 0, NULL, NULL } }; etype = g_flags_register_static ("GooCanvasPointerEvents", values ); } return etype; } GType goo_canvas_item_visibility_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GEnumValue values[] = { { GOO_CANVAS_ITEM_HIDDEN, "GOO_CANVAS_ITEM_HIDDEN", "hidden" }, { GOO_CANVAS_ITEM_INVISIBLE, "GOO_CANVAS_ITEM_INVISIBLE", "invisible" }, { GOO_CANVAS_ITEM_VISIBLE, "GOO_CANVAS_ITEM_VISIBLE", "visible" }, { GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD", "visible-above-threshold" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCanvasItemVisibility", values ); } return etype; } GType goo_canvas_path_command_type_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GEnumValue values[] = { { GOO_CANVAS_PATH_MOVE_TO, "GOO_CANVAS_PATH_MOVE_TO", "move-to" }, { GOO_CANVAS_PATH_CLOSE_PATH, "GOO_CANVAS_PATH_CLOSE_PATH", "close-path" }, { GOO_CANVAS_PATH_LINE_TO, "GOO_CANVAS_PATH_LINE_TO", "line-to" }, { GOO_CANVAS_PATH_HORIZONTAL_LINE_TO, "GOO_CANVAS_PATH_HORIZONTAL_LINE_TO", "horizontal-line-to" }, { GOO_CANVAS_PATH_VERTICAL_LINE_TO, "GOO_CANVAS_PATH_VERTICAL_LINE_TO", "vertical-line-to" }, { GOO_CANVAS_PATH_CURVE_TO, "GOO_CANVAS_PATH_CURVE_TO", "curve-to" }, { GOO_CANVAS_PATH_SMOOTH_CURVE_TO, "GOO_CANVAS_PATH_SMOOTH_CURVE_TO", "smooth-curve-to" }, { GOO_CANVAS_PATH_QUADRATIC_CURVE_TO, "GOO_CANVAS_PATH_QUADRATIC_CURVE_TO", "quadratic-curve-to" }, { GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO, "GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO", "smooth-quadratic-curve-to" }, { GOO_CANVAS_PATH_ELLIPTICAL_ARC, "GOO_CANVAS_PATH_ELLIPTICAL_ARC", "elliptical-arc" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCanvasPathCommandType", values ); } return etype; } /* Generated data ends here */ goocanvas-1.0.0/src/goocanvasitemmodel.c0000644000076400007640000010576411412723611015247 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitem.c - interface for canvas items & groups. */ /** * SECTION:goocanvasitemmodel * @Title: GooCanvasItemModel * @Short_Description: the interface for canvas item models. * * #GooCanvasItemModel defines the interface that models for canvas items must * implement, and contains methods for operating on canvas item models. */ #include #include #include #include #include #include #include "goocanvasprivate.h" #include #include "goocanvasitemmodel.h" #include "goocanvasutils.h" #include "goocanvasmarshal.h" static GParamSpecPool *_goo_canvas_item_model_child_property_pool = NULL; static GObjectNotifyContext *_goo_canvas_item_model_child_property_notify_context = NULL; static const char *animation_key = "GooCanvasItemAnimation"; enum { CHILD_ADDED, CHILD_MOVED, CHILD_REMOVED, CHANGED, CHILD_NOTIFY, ANIMATION_FINISHED, LAST_SIGNAL }; static guint item_model_signals[LAST_SIGNAL] = { 0 }; static void goo_canvas_item_model_base_init (gpointer g_class); extern void _goo_canvas_style_init (void); extern void _goo_canvas_item_get_child_property_internal (GObject *object, GObject *child, const gchar *property_name, GValue *value, GParamSpecPool *property_pool, gboolean is_model); GType goo_canvas_item_model_get_type (void) { static GType item_model_type = 0; if (!item_model_type) { static const GTypeInfo item_model_info = { sizeof (GooCanvasItemModelIface), /* class_size */ goo_canvas_item_model_base_init, /* base_init */ NULL, /* base_finalize */ }; item_model_type = g_type_register_static (G_TYPE_INTERFACE, "GooCanvasItemModel", &item_model_info, 0); g_type_interface_add_prerequisite (item_model_type, G_TYPE_OBJECT); } return item_model_type; } static void child_property_notify_dispatcher (GObject *object, guint n_pspecs, GParamSpec **pspecs) { guint i; for (i = 0; i < n_pspecs; i++) g_signal_emit (object, item_model_signals[CHILD_NOTIFY], g_quark_from_string (pspecs[i]->name), pspecs[i]); } static void goo_canvas_item_model_base_init (gpointer g_iface) { static GObjectNotifyContext cpn_context = { 0, NULL, NULL }; static gboolean initialized = FALSE; if (!initialized) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); _goo_canvas_item_model_child_property_pool = g_param_spec_pool_new (TRUE); cpn_context.quark_notify_queue = g_quark_from_static_string ("GooCanvasItemModel-child-property-notify-queue"); cpn_context.dispatcher = child_property_notify_dispatcher; _goo_canvas_item_model_child_property_notify_context = &cpn_context; /** * GooCanvasItemModel::child-added * @model: the item model that received the signal. * @child_num: the index of the new child. * * Emitted when a child has been added. */ item_model_signals[CHILD_ADDED] = g_signal_new ("child-added", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_added), NULL, NULL, goo_canvas_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); /** * GooCanvasItemModel::child-moved * @model: the item model that received the signal. * @old_child_num: the old index of the child. * @new_child_num: the new index of the child. * * Emitted when a child has been moved in the stacking order. */ item_model_signals[CHILD_MOVED] = g_signal_new ("child-moved", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_moved), NULL, NULL, goo_canvas_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); /** * GooCanvasItemModel::child-removed * @model: the item model that received the signal. * @child_num: the index of the child that was removed. * * Emitted when a child has been removed. */ item_model_signals[CHILD_REMOVED] = g_signal_new ("child-removed", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_removed), NULL, NULL, goo_canvas_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); /** * GooCanvasItemModel::changed * @model: the item model that received the signal. * @recompute_bounds: if the bounds of the item need to be recomputed. * * Emitted when the item model has been changed. */ item_model_signals[CHANGED] = g_signal_new ("changed", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, changed), NULL, NULL, goo_canvas_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); /** * GooCanvasItemModel::child-notify * @item: the item model that received the signal. * @pspec: the #GParamSpec of the changed child property. * * Emitted for each child property that has changed. * The signal's detail holds the property name. */ item_model_signals[CHILD_NOTIFY] = g_signal_new ("child_notify", iface_type, G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_notify), NULL, NULL, g_cclosure_marshal_VOID__PARAM, G_TYPE_NONE, 1, G_TYPE_PARAM); /** * GooCanvasItemModel::animation-finished * @item: the item model that received the signal. * @stopped: if the animation was explicitly stopped. * * Emitted when the item model animation has finished. */ item_model_signals[ANIMATION_FINISHED] = g_signal_new ("animation-finished", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, animation_finished), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); g_object_interface_install_property (g_iface, g_param_spec_object ("parent", _("Parent"), _("The parent item model"), GOO_TYPE_CANVAS_ITEM_MODEL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_enum ("visibility", _("Visibility"), _("When the canvas item is visible"), GOO_TYPE_CANVAS_ITEM_VISIBILITY, GOO_CANVAS_ITEM_VISIBLE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_double ("visibility-threshold", _("Visibility Threshold"), _("The scale threshold at which the item becomes visible"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boxed ("transform", _("Transform"), _("The transformation matrix of the item"), GOO_TYPE_CAIRO_MATRIX, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_flags ("pointer-events", _("Pointer Events"), _("Specifies when the item receives pointer events"), GOO_TYPE_CANVAS_POINTER_EVENTS, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("title", _("Title"), _("A short context-rich description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("description", _("Description"), _("A description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boolean ("can-focus", _("Can Focus"), _("If the item can take the keyboard focus"), FALSE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("tooltip", _("Tooltip"), _("The tooltip to display for the item"), NULL, G_PARAM_READWRITE)); _goo_canvas_style_init (); initialized = TRUE; } } /** * goo_canvas_item_model_add_child: * @model: an item model. * @child: the child to add. * @position: the position of the child, or -1 to place it last (at the top of * the stacking order). * * Adds a child at the given stack position. **/ void goo_canvas_item_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); g_return_if_fail (iface->add_child != NULL); g_return_if_fail (model != child); iface->add_child (model, child, position); } /** * goo_canvas_item_model_move_child: * @model: an item model. * @old_position: the current position of the child. * @new_position: the new position of the child. * * Moves a child to a new stack position. **/ void goo_canvas_item_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); g_return_if_fail (iface->move_child != NULL); iface->move_child (model, old_position, new_position); } /** * goo_canvas_item_model_remove_child: * @model: an item model. * @child_num: the position of the child to remove. * * Removes the child at the given position. **/ void goo_canvas_item_model_remove_child (GooCanvasItemModel *model, gint child_num) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); g_return_if_fail (iface->remove_child != NULL); iface->remove_child (model, child_num); } /** * goo_canvas_item_model_find_child: * @model: an item model. * @child: the child to find. * * Attempts to find the given child with the container's stack. * * Returns: the position of the given @child, or -1 if it isn't found. **/ gint goo_canvas_item_model_find_child (GooCanvasItemModel *model, GooCanvasItemModel *child) { GooCanvasItemModel *item; int n_children, i; /* Find the current position of item and above. */ n_children = goo_canvas_item_model_get_n_children (model); for (i = 0; i < n_children; i++) { item = goo_canvas_item_model_get_child (model, i); if (child == item) return i; } return -1; } /** * goo_canvas_item_model_is_container: * @model: an item model. * * Tests to see if the given item model is a container. * * Returns: %TRUE if the item model is a container. **/ gboolean goo_canvas_item_model_is_container (GooCanvasItemModel *model) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_n_children ? TRUE : FALSE; } /** * goo_canvas_item_model_get_n_children: * @model: an item model. * * Gets the number of children of the container. * * Returns: the number of children. **/ gint goo_canvas_item_model_get_n_children (GooCanvasItemModel *model) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_n_children ? iface->get_n_children (model) : 0; } /** * goo_canvas_item_model_get_child: * @model: an item model. * @child_num: the position of a child in the container's stack. * * Gets the child at the given stack position. * * Returns: the child at the given stack position, or %NULL if @child_num * is out of range. **/ GooCanvasItemModel* goo_canvas_item_model_get_child (GooCanvasItemModel *model, gint child_num) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_child ? iface->get_child (model, child_num) : NULL; } /** * goo_canvas_item_model_get_parent: * @model: an item model. * * Gets the parent of the given model. * * Returns: the parent model, or %NULL if the model has no parent. **/ GooCanvasItemModel* goo_canvas_item_model_get_parent (GooCanvasItemModel *model) { return GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->get_parent (model); } /** * goo_canvas_item_model_set_parent: * @model: an item model. * @parent: the new parent item model. * * This function is only intended to be used when implementing new canvas * item models (specifically container models such as #GooCanvasGroupModel). * It sets the parent of the child model. * * * This function cannot be used to add a model to a group * or to change the parent of a model. * To do that use the #GooCanvasItemModel:parent property. * **/ void goo_canvas_item_model_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent) { GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->set_parent (model, parent); } /** * goo_canvas_item_model_remove: * @model: an item model. * * Removes a model from its parent. If the model is in a canvas it will be * removed. * * This would normally also result in the model being freed. **/ void goo_canvas_item_model_remove (GooCanvasItemModel *model) { GooCanvasItemModel *parent; gint child_num; parent = goo_canvas_item_model_get_parent (model); if (!parent) return; child_num = goo_canvas_item_model_find_child (parent, model); if (child_num == -1) return; goo_canvas_item_model_remove_child (parent, child_num); } /** * goo_canvas_item_model_raise: * @model: an item model. * @above: the item model to raise @model above, or %NULL to raise @model to the top * of the stack. * * Raises a model in the stacking order. **/ void goo_canvas_item_model_raise (GooCanvasItemModel *model, GooCanvasItemModel *above) { GooCanvasItemModel *parent, *child; int n_children, i, model_pos = -1, above_pos = -1; parent = goo_canvas_item_model_get_parent (model); if (!parent || model == above) return; /* Find the current position of model and above. */ n_children = goo_canvas_item_model_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_model_get_child (parent, i); if (child == model) model_pos = i; if (child == above) above_pos = i; } /* If above is NULL we raise the model to the top of the stack. */ if (!above) above_pos = n_children - 1; g_return_if_fail (model_pos != -1); g_return_if_fail (above_pos != -1); /* Only move the model if the new position is higher in the stack. */ if (above_pos > model_pos) goo_canvas_item_model_move_child (parent, model_pos, above_pos); } /** * goo_canvas_item_model_lower: * @model: an item model. * @below: the item model to lower @model below, or %NULL to lower @model to the * bottom of the stack. * * Lowers a model in the stacking order. **/ void goo_canvas_item_model_lower (GooCanvasItemModel *model, GooCanvasItemModel *below) { GooCanvasItemModel *parent, *child; int n_children, i, model_pos = -1, below_pos = -1; parent = goo_canvas_item_model_get_parent (model); if (!parent || model == below) return; /* Find the current position of model and below. */ n_children = goo_canvas_item_model_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_model_get_child (parent, i); if (child == model) model_pos = i; if (child == below) below_pos = i; } /* If below is NULL we lower the model to the bottom of the stack. */ if (!below) below_pos = 0; g_return_if_fail (model_pos != -1); g_return_if_fail (below_pos != -1); /* Only move the model if the new position is lower in the stack. */ if (below_pos < model_pos) goo_canvas_item_model_move_child (parent, model_pos, below_pos); } /** * goo_canvas_item_model_get_transform: * @model: an item model. * @transform: the place to store the transform. * * Gets the transformation matrix of an item model. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_model_get_transform (GooCanvasItemModel *model, cairo_matrix_t *transform) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_transform ? iface->get_transform (model, transform) : FALSE; } /** * goo_canvas_item_model_set_transform: * @model: an item model. * @transform: the new transformation matrix, or %NULL to reset the * transformation to the identity matrix. * * Sets the transformation matrix of an item model. **/ void goo_canvas_item_model_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform) { GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->set_transform (model, transform); } /** * goo_canvas_item_model_get_simple_transform: * @model: an item model. * @x: returns the x coordinate of the origin of the model's coordinate space. * @y: returns the y coordinate of the origin of the model's coordinate space. * @scale: returns the scale of the model. * @rotation: returns the clockwise rotation of the model, in degrees (0-360). * * This function can be used to get the position, scale and rotation of an * item model, providing that the model has a simple transformation matrix * (e.g. set with goo_canvas_item_model_set_simple_transform(), or using a * combination of simple translate, scale and rotate operations). If the model * has a complex transformation matrix the results will be incorrect. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_model_get_simple_transform (GooCanvasItemModel *model, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; double x1 = 1.0, y1 = 0.0, radians; gboolean has_transform = FALSE; if (iface->get_transform) has_transform = iface->get_transform (model, &matrix); if (!has_transform) { *x = *y = *rotation = 0.0; *scale = 1.0; return FALSE; } *x = matrix.x0; *y = matrix.y0; matrix.x0 = 0.0; matrix.y0 = 0.0; cairo_matrix_transform_point (&matrix, &x1, &y1); *scale = sqrt (x1 * x1 + y1 * y1); radians = atan2 (y1, x1); *rotation = radians * (180 / M_PI); if (*rotation < 0) *rotation += 360; return TRUE; } /** * goo_canvas_item_model_set_simple_transform: * @model: an item model. * @x: the x coordinate of the origin of the model's coordinate space. * @y: the y coordinate of the origin of the model's coordinate space. * @scale: the scale of the model. * @rotation: the clockwise rotation of the model, in degrees. * * A convenience function to set the item model's transformation matrix. **/ void goo_canvas_item_model_set_simple_transform (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble rotation) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; cairo_matrix_translate (&new_matrix, x, y); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, rotation * (M_PI / 180)); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_translate: * @model: an item model. * @tx: the amount to move the origin in the horizontal direction. * @ty: the amount to move the origin in the vertical direction. * * Translates the origin of the model's coordinate system by the given amounts. **/ void goo_canvas_item_model_translate (GooCanvasItemModel *model, gdouble tx, gdouble ty) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, tx, ty); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_scale: * @model: an item model. * @sx: the amount to scale the horizontal axis. * @sy: the amount to scale the vertical axis. * * Scales the model's coordinate system by the given amounts. **/ void goo_canvas_item_model_scale (GooCanvasItemModel *model, gdouble sx, gdouble sy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (model, &new_matrix); cairo_matrix_scale (&new_matrix, sx, sy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_rotate: * @model: an item model. * @degrees: the clockwise angle of rotation. * @cx: the x coordinate of the origin of the rotation. * @cy: the y coordinate of the origin of the rotation. * * Rotates the model's coordinate system by the given amount, about the given * origin. **/ void goo_canvas_item_model_rotate (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_rotate (&new_matrix, radians); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_skew_x: * @model: an item model. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the model's coordinate system along the x axis by the given amount, * about the given origin. **/ void goo_canvas_item_model_skew_x (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, 0, tan (radians), 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_skew_y: * @model: an item model. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the model's coordinate system along the y axis by the given amount, * about the given origin. **/ void goo_canvas_item_model_skew_y (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, tan (radians), 0, 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_get_style: * @model: an item model. * * Gets the model's style. If the model doesn't have its own style it will * return its parent's style. * * Returns: the model's style. **/ GooCanvasStyle* goo_canvas_item_model_get_style (GooCanvasItemModel *model) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_style ? iface->get_style (model) : NULL; } /** * goo_canvas_item_model_set_style: * @model: an item model. * @style: a style. * * Sets the model's style, by copying the properties from the given style. **/ void goo_canvas_item_model_set_style (GooCanvasItemModel *model, GooCanvasStyle *style) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); if (iface->set_style) iface->set_style (model, style); } extern void _goo_canvas_item_animate_internal (GooCanvasItem *item, GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); /** * goo_canvas_item_model_animate: * @model: an item model. * @x: the final x coordinate. * @y: the final y coordinate. * @scale: the final scale. * @degrees: the final rotation. This can be negative to rotate anticlockwise, * and can also be greater than 360 to rotate a number of times. * @absolute: if the @x, @y, @scale and @degrees values are absolute, or * relative to the current transform. Note that absolute animations only work * if the model currently has a simple transform. If the model has a shear or * some other complicated transform it may result in strange animations. * @duration: the duration of the animation, in milliseconds (1/1000ths of a * second). * @step_time: the time between each animation step, in milliseconds. * @type: specifies what happens when the animation finishes. * * Animates a model from its current position to the given offsets, scale * and rotation. **/ void goo_canvas_item_model_animate (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type) { _goo_canvas_item_animate_internal (NULL, model, x, y, scale, degrees, absolute, duration, step_time, type); } /** * goo_canvas_item_model_stop_animation: * @model: an item model. * * Stops any current animation for the given model, leaving it at its current * position. **/ void goo_canvas_item_model_stop_animation (GooCanvasItemModel *model) { /* This will result in a call to goo_canvas_item_free_animation() above. */ g_object_set_data (G_OBJECT (model), animation_key, NULL); g_signal_emit_by_name (model, "animation-finished", TRUE); } /* * Child Properties. */ extern void _goo_canvas_item_set_child_property_internal (GObject *object, GObject *child, const gchar *property_name, const GValue *value, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model); extern void _goo_canvas_item_get_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model); extern void _goo_canvas_item_set_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model); /** * goo_canvas_item_model_get_child_property: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @property_name: the name of the child property to get. * @value: a location to return the value. * * Gets a child property of @child. **/ void goo_canvas_item_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_get_child_property_internal ((GObject*) model, (GObject*) child, property_name, value, _goo_canvas_item_model_child_property_pool, TRUE); } /** * goo_canvas_item_model_set_child_property: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @property_name: the name of the child property to set. * @value: the value to set the property to. * * Sets a child property of @child. **/ void goo_canvas_item_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, const GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_set_child_property_internal ((GObject*) model, (GObject*) child, property_name, value, _goo_canvas_item_model_child_property_pool, _goo_canvas_item_model_child_property_notify_context, TRUE); } /** * goo_canvas_item_model_get_child_properties_valist: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @var_args: pairs of property names and value pointers, and a terminating * %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_model_get_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); _goo_canvas_item_get_child_properties_internal ((GObject*) model, (GObject*) child, var_args, _goo_canvas_item_model_child_property_pool, _goo_canvas_item_model_child_property_notify_context, TRUE); } /** * goo_canvas_item_model_set_child_properties_valist: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @var_args: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_model_set_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); _goo_canvas_item_set_child_properties_internal ((GObject*) model, (GObject*) child, var_args, _goo_canvas_item_model_child_property_pool, _goo_canvas_item_model_child_property_notify_context, TRUE); } /** * goo_canvas_item_model_get_child_properties: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @...: pairs of property names and value pointers, and a terminating %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_model_get_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_model_get_child_properties_valist (model, child, var_args); va_end (var_args); } /** * goo_canvas_item_model_set_child_properties: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @...: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_model_set_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_model_set_child_properties_valist (model, child, var_args); va_end (var_args); } /** * goo_canvas_item_model_class_install_child_property: * @mclass: a #GObjectClass * @property_id: the id for the property * @pspec: the #GParamSpec for the property * * This function is only intended to be used when implementing new canvas * item models, specifically layout container item models such as * #GooCanvasTableModel. * * It installs a child property on a canvas item class. **/ void goo_canvas_item_model_class_install_child_property (GObjectClass *mclass, guint property_id, GParamSpec *pspec) { g_return_if_fail (G_IS_OBJECT_CLASS (mclass)); g_return_if_fail (G_IS_PARAM_SPEC (pspec)); g_return_if_fail (property_id > 0); if (g_param_spec_pool_lookup (_goo_canvas_item_model_child_property_pool, pspec->name, G_OBJECT_CLASS_TYPE (mclass), FALSE)) { g_warning (G_STRLOC ": class `%s' already contains a child property named `%s'", G_OBJECT_CLASS_NAME (mclass), pspec->name); return; } g_param_spec_ref (pspec); g_param_spec_sink (pspec); pspec->param_id = property_id; g_param_spec_pool_insert (_goo_canvas_item_model_child_property_pool, pspec, G_OBJECT_CLASS_TYPE (mclass)); } /** * goo_canvas_item_model_class_find_child_property: * @mclass: a #GObjectClass * @property_name: the name of the child property to find * @returns: the #GParamSpec of the child property or %NULL if @class has no * child property with that name. * * This function is only intended to be used when implementing new canvas * item models, specifically layout container item models such as * #GooCanvasTableModel. * * It finds a child property of a canvas item class by name. */ GParamSpec* goo_canvas_item_model_class_find_child_property (GObjectClass *mclass, const gchar *property_name) { g_return_val_if_fail (G_IS_OBJECT_CLASS (mclass), NULL); g_return_val_if_fail (property_name != NULL, NULL); return g_param_spec_pool_lookup (_goo_canvas_item_model_child_property_pool, property_name, G_OBJECT_CLASS_TYPE (mclass), TRUE); } /** * goo_canvas_item_model_class_list_child_properties: * @mclass: a #GObjectClass * @n_properties: location to return the number of child properties found * @returns: a newly allocated array of #GParamSpec*. The array must be * freed with g_free(). * * This function is only intended to be used when implementing new canvas * item models, specifically layout container item models such as * #GooCanvasTableModel. * * It returns all child properties of a canvas item class. */ GParamSpec** goo_canvas_item_model_class_list_child_properties (GObjectClass *mclass, guint *n_properties) { GParamSpec **pspecs; guint n; g_return_val_if_fail (G_IS_OBJECT_CLASS (mclass), NULL); pspecs = g_param_spec_pool_list (_goo_canvas_item_model_child_property_pool, G_OBJECT_CLASS_TYPE (mclass), &n); if (n_properties) *n_properties = n; return pspecs; } void _goo_canvas_item_model_emit_child_added (GooCanvasItemModel *model, gint position) { g_signal_emit (model, item_model_signals[CHILD_ADDED], 0, position); } void _goo_canvas_item_model_emit_changed (GooCanvasItemModel *model, gboolean recompute_bounds) { g_signal_emit (model, item_model_signals[CHANGED], 0, recompute_bounds); } goocanvas-1.0.0/src/goocanvasitem.c0000644000076400007640000020510511423522125014213 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitem.c - interface for canvas items & groups. */ /** * SECTION:goocanvasitem * @Title: GooCanvasItem * @Short_Description: the interface for canvas items. * * #GooCanvasItem defines the interface that canvas items must implement, * and contains methods for operating on canvas items. */ #include #include #include #include #include #include #include "goocanvasprivate.h" #include "goocanvasitem.h" #include "goocanvas.h" #include "goocanvasutils.h" #include "goocanvasmarshal.h" static GParamSpecPool *_goo_canvas_item_child_property_pool = NULL; static GObjectNotifyContext *_goo_canvas_item_child_property_notify_context = NULL; static const char *animation_key = "GooCanvasItemAnimation"; enum { /* Mouse events. */ ENTER_NOTIFY_EVENT, LEAVE_NOTIFY_EVENT, MOTION_NOTIFY_EVENT, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, /* Keyboard events. */ FOCUS_IN_EVENT, FOCUS_OUT_EVENT, KEY_PRESS_EVENT, KEY_RELEASE_EVENT, /* Miscellaneous signals. */ GRAB_BROKEN_EVENT, CHILD_NOTIFY, ANIMATION_FINISHED, SCROLL_EVENT, QUERY_TOOLTIP, LAST_SIGNAL }; static guint canvas_item_signals[LAST_SIGNAL] = { 0 }; static void goo_canvas_item_base_init (gpointer g_class); extern void _goo_canvas_style_init (void); GType goo_canvas_item_get_type (void) { static GType canvas_item_type = 0; if (!canvas_item_type) { static const GTypeInfo canvas_item_info = { sizeof (GooCanvasItemIface), /* class_size */ goo_canvas_item_base_init, /* base_init */ NULL, /* base_finalize */ }; canvas_item_type = g_type_register_static (G_TYPE_INTERFACE, "GooCanvasItem", &canvas_item_info, 0); g_type_interface_add_prerequisite (canvas_item_type, G_TYPE_OBJECT); } return canvas_item_type; } static void child_property_notify_dispatcher (GObject *object, guint n_pspecs, GParamSpec **pspecs) { guint i; for (i = 0; i < n_pspecs; i++) g_signal_emit (object, canvas_item_signals[CHILD_NOTIFY], g_quark_from_string (pspecs[i]->name), pspecs[i]); } static void goo_canvas_item_base_init (gpointer g_iface) { static GObjectNotifyContext cpn_context = { 0, NULL, NULL }; static gboolean initialized = FALSE; if (!initialized) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); _goo_canvas_item_child_property_pool = g_param_spec_pool_new (TRUE); cpn_context.quark_notify_queue = g_quark_from_static_string ("GooCanvasItem-child-property-notify-queue"); cpn_context.dispatcher = child_property_notify_dispatcher; _goo_canvas_item_child_property_notify_context = &cpn_context; /* Mouse events. */ /** * GooCanvasItem::enter-notify-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when the mouse enters an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[ENTER_NOTIFY_EVENT] = g_signal_new ("enter_notify_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, enter_notify_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::leave-notify-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when the mouse leaves an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[LEAVE_NOTIFY_EVENT] = g_signal_new ("leave_notify_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, leave_notify_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::motion-notify-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when the mouse moves within an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[MOTION_NOTIFY_EVENT] = g_signal_new ("motion_notify_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, motion_notify_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::button-press-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when a mouse button is pressed in an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[BUTTON_PRESS_EVENT] = g_signal_new ("button_press_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, button_press_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::button-release-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when a mouse button is released in an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[BUTTON_RELEASE_EVENT] = g_signal_new ("button_release_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, button_release_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /* Keyboard events. */ /** * GooCanvasItem::focus-in-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when the item receives the keyboard focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[FOCUS_IN_EVENT] = g_signal_new ("focus_in_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, focus_in_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::focus-out-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when the item loses the keyboard focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[FOCUS_OUT_EVENT] = g_signal_new ("focus_out_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, focus_out_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::key-press-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when a key is pressed and the item has the keyboard * focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[KEY_PRESS_EVENT] = g_signal_new ("key_press_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, key_press_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::key-release-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when a key is released and the item has the keyboard * focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[KEY_RELEASE_EVENT] = g_signal_new ("key_release_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, key_release_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::query-tooltip: * @item: the item which received the signal. * @x: the x coordinate of the mouse. * @y: the y coordinate of the mouse. * @keyboard_mode: %TRUE if the tooltip was triggered using the keyboard. * @tooltip: a #GtkTooltip. * * Emitted when the mouse has paused over the item for a certain amount * of time, or the tooltip was requested via the keyboard. * * Note that if @keyboard_mode is %TRUE, the values of @x and @y are * undefined and should not be used. * * If the item wants to display a tooltip it should update @tooltip * and return %TRUE. * * Returns: %TRUE if the item has set a tooltip to show. */ canvas_item_signals[QUERY_TOOLTIP] = g_signal_new ("query-tooltip", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, query_tooltip), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT, G_TYPE_BOOLEAN, 4, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_BOOLEAN, GTK_TYPE_TOOLTIP); /** * GooCanvasItem::grab-broken-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when the item's keyboard or pointer grab was lost * unexpectedly. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[GRAB_BROKEN_EVENT] = g_signal_new ("grab_broken_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, grab_broken_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::child-notify * @item: the item that received the signal. * @pspec: the #GParamSpec of the changed child property. * * Emitted for each child property that has changed. * The signal's detail holds the property name. */ canvas_item_signals[CHILD_NOTIFY] = g_signal_new ("child_notify", iface_type, G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (GooCanvasItemIface, child_notify), NULL, NULL, g_cclosure_marshal_VOID__PARAM, G_TYPE_NONE, 1, G_TYPE_PARAM); /** * GooCanvasItem::animation-finished * @item: the item that received the signal. * @stopped: if the animation was explicitly stopped. * * Emitted when the item animation has finished. */ canvas_item_signals[ANIMATION_FINISHED] = g_signal_new ("animation-finished", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, animation_finished), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); /** * GooCanvasItem::scroll-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when a button in the 4 to 7 range is pressed. Wheel mice are * usually configured to generate button press events for buttons 4 and 5 * when the wheel is turned in an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[SCROLL_EVENT] = g_signal_new ("scroll_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, scroll_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); g_object_interface_install_property (g_iface, g_param_spec_object ("parent", _("Parent"), _("The parent item"), GOO_TYPE_CANVAS_ITEM, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_enum ("visibility", _("Visibility"), _("When the canvas item is visible"), GOO_TYPE_CANVAS_ITEM_VISIBILITY, GOO_CANVAS_ITEM_VISIBLE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_double ("visibility-threshold", _("Visibility Threshold"), _("The scale threshold at which the item becomes visible"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boxed ("transform", _("Transform"), _("The transformation matrix of the item"), GOO_TYPE_CAIRO_MATRIX, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_flags ("pointer-events", _("Pointer Events"), _("Specifies when the item receives pointer events"), GOO_TYPE_CANVAS_POINTER_EVENTS, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("title", _("Title"), _("A short context-rich description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("description", _("Description"), _("A description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boolean ("can-focus", _("Can Focus"), _("If the item can take the keyboard focus"), FALSE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("tooltip", _("Tooltip"), _("The tooltip to display for the item"), NULL, G_PARAM_READWRITE)); _goo_canvas_style_init (); initialized = TRUE; } } /** * goo_canvas_item_get_canvas: * @item: a #GooCanvasItem. * * Returns the #GooCanvas containing the given #GooCanvasItem. * * Returns: the #GooCanvas. **/ GooCanvas* goo_canvas_item_get_canvas (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_canvas) { return iface->get_canvas (item); } else { GooCanvasItem *parent = iface->get_parent (item); if (parent) return goo_canvas_item_get_canvas (parent); return NULL; } } /** * goo_canvas_item_set_canvas: * @item: a #GooCanvasItem. * @canvas: a #GooCanvas * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * It sets the canvas of the item. **/ void goo_canvas_item_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_canvas) iface->set_canvas (item, canvas); } /** * goo_canvas_item_add_child: * @item: the container to add the item to. * @child: the item to add. * @position: the position of the item, or -1 to place it last (at the top of * the stacking order). * * Adds a child item to a container item at the given stack position. **/ void goo_canvas_item_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); g_return_if_fail (iface->add_child != NULL); g_return_if_fail (item != child); iface->add_child (item, child, position); } /** * goo_canvas_item_move_child: * @item: a container item. * @old_position: the current position of the child item. * @new_position: the new position of the child item. * * Moves a child item to a new stack position within the container. **/ void goo_canvas_item_move_child (GooCanvasItem *item, gint old_position, gint new_position) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); g_return_if_fail (iface->move_child != NULL); iface->move_child (item, old_position, new_position); } /** * goo_canvas_item_remove_child: * @item: a container item. * @child_num: the position of the child item to remove. * * Removes the child item at the given position. **/ void goo_canvas_item_remove_child (GooCanvasItem *item, gint child_num) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); g_return_if_fail (iface->remove_child != NULL); iface->remove_child (item, child_num); } /** * goo_canvas_item_find_child: * @item: a container item. * @child: the child item to find. * * Attempts to find the given child item with the container's stack. * * Returns: the position of the given @child item, or -1 if it isn't found. **/ gint goo_canvas_item_find_child (GooCanvasItem *item, GooCanvasItem *child) { GooCanvasItem *tmp; int n_children, i; /* Find the current position of item and above. */ n_children = goo_canvas_item_get_n_children (item); for (i = 0; i < n_children; i++) { tmp = goo_canvas_item_get_child (item, i); if (child == tmp) return i; } return -1; } /** * goo_canvas_item_is_container: * @item: an item. * * Tests to see if the given item is a container. * * Returns: %TRUE if the item is a container. **/ gboolean goo_canvas_item_is_container (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_n_children ? TRUE : FALSE; } /** * goo_canvas_item_get_n_children: * @item: a container item. * * Gets the number of children of the container. * * Returns: the number of children. **/ gint goo_canvas_item_get_n_children (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_n_children ? iface->get_n_children (item) : 0; } /** * goo_canvas_item_get_child: * @item: a container item. * @child_num: the position of a child in the container's stack. * * Gets the child item at the given stack position. * * Returns: the child item at the given stack position, or %NULL if @child_num * is out of range. **/ GooCanvasItem* goo_canvas_item_get_child (GooCanvasItem *item, gint child_num) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_child ? iface->get_child (item, child_num) : NULL; } /** * goo_canvas_item_get_parent: * @item: an item. * * Gets the parent of the given item. * * Returns: the parent item, or %NULL if the item has no parent. **/ GooCanvasItem* goo_canvas_item_get_parent (GooCanvasItem *item) { g_return_val_if_fail (GOO_IS_CANVAS_ITEM (item), NULL); return GOO_CANVAS_ITEM_GET_IFACE (item)->get_parent (item); } /** * goo_canvas_item_set_parent: * @item: an item. * @parent: the new parent item. * * This function is only intended to be used when implementing new canvas * items (specifically container items such as #GooCanvasGroup). * It sets the parent of the child item. * * * This function cannot be used to add an item to a group * or to change the parent of an item. * To do that use the #GooCanvasItem:parent property. * **/ void goo_canvas_item_set_parent (GooCanvasItem *item, GooCanvasItem *parent) { GOO_CANVAS_ITEM_GET_IFACE (item)->set_parent (item, parent); } /** * goo_canvas_item_get_is_static: * @item: an item. * * Returns %TRUE if the item is static. Static items do not move or change * size when the canvas is scrolled or the scale changes. * * Returns: %TRUE if the item is static. **/ gboolean goo_canvas_item_get_is_static (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_is_static) return iface->get_is_static (item); return FALSE; } /** * goo_canvas_item_set_is_static: * @item: an item. * @is_static: if the item is static. * * Notifies the item that it is static. Static items do not move or change * size when the canvas is scrolled or the scale changes. * * Container items such as #GooCanvasGroup should call this function when * children are added, to notify children whether they are static or not. * Containers should also pass on any changes in their own status to children. **/ void goo_canvas_item_set_is_static (GooCanvasItem *item, gboolean is_static) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_is_static) iface->set_is_static (item, is_static); } /** * goo_canvas_item_remove: * @item: an item. * * Removes an item from its parent. If the item is in a canvas it will be * removed. * * This would normally also result in the item being freed. **/ void goo_canvas_item_remove (GooCanvasItem *item) { GooCanvasItem *parent; gint child_num; parent = goo_canvas_item_get_parent (item); if (!parent) return; child_num = goo_canvas_item_find_child (parent, item); if (child_num == -1) return; goo_canvas_item_remove_child (parent, child_num); } /** * goo_canvas_item_raise: * @item: an item. * @above: the item to raise @item above, or %NULL to raise @item to the top * of the stack. * * Raises an item in the stacking order. **/ void goo_canvas_item_raise (GooCanvasItem *item, GooCanvasItem *above) { GooCanvasItem *parent, *child; int n_children, i, item_pos = -1, above_pos = -1; parent = goo_canvas_item_get_parent (item); if (!parent || item == above) return; /* Find the current position of item and above. */ n_children = goo_canvas_item_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_get_child (parent, i); if (child == item) item_pos = i; if (child == above) above_pos = i; } /* If above is NULL we raise the item to the top of the stack. */ if (!above) above_pos = n_children - 1; g_return_if_fail (item_pos != -1); g_return_if_fail (above_pos != -1); /* Only move the item if the new position is higher in the stack. */ if (above_pos > item_pos) goo_canvas_item_move_child (parent, item_pos, above_pos); } /** * goo_canvas_item_lower: * @item: an item. * @below: the item to lower @item below, or %NULL to lower @item to the * bottom of the stack. * * Lowers an item in the stacking order. **/ void goo_canvas_item_lower (GooCanvasItem *item, GooCanvasItem *below) { GooCanvasItem *parent, *child; int n_children, i, item_pos = -1, below_pos = -1; parent = goo_canvas_item_get_parent (item); if (!parent || item == below) return; /* Find the current position of item and below. */ n_children = goo_canvas_item_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_get_child (parent, i); if (child == item) item_pos = i; if (child == below) below_pos = i; } /* If below is NULL we lower the item to the bottom of the stack. */ if (!below) below_pos = 0; g_return_if_fail (item_pos != -1); g_return_if_fail (below_pos != -1); /* Only move the item if the new position is lower in the stack. */ if (below_pos < item_pos) goo_canvas_item_move_child (parent, item_pos, below_pos); } /** * goo_canvas_item_get_transform: * @item: an item. * @transform: the place to store the transform. * * Gets the transformation matrix of an item. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_get_transform (GooCanvasItem *item, cairo_matrix_t *transform) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_transform ? iface->get_transform (item, transform) : FALSE; } /** * goo_canvas_item_get_transform_for_child: * @item: an item. * @child: a child of @item. * @transform: the place to store the transform. * * Gets the transformation matrix of an item combined with any special * transform needed for the given child. These special transforms are used * by layout items such as #GooCanvasTable. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (child && iface->get_transform_for_child) return iface->get_transform_for_child (item, child, transform); /* We fallback to the standard get_transform method. */ if (iface->get_transform) return iface->get_transform (item, transform); return FALSE; } /** * goo_canvas_item_set_transform: * @item: an item. * @transform: the new transformation matrix, or %NULL to reset the * transformation to the identity matrix. * * Sets the transformation matrix of an item. **/ void goo_canvas_item_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform) { GOO_CANVAS_ITEM_GET_IFACE (item)->set_transform (item, transform); } /** * goo_canvas_item_get_simple_transform: * @item: an item. * @x: returns the x coordinate of the origin of the item's coordinate space. * @y: returns the y coordinate of the origin of the item's coordinate space. * @scale: returns the scale of the item. * @rotation: returns the clockwise rotation of the item, in degrees (0-360). * * This function can be used to get the position, scale and rotation of an * item, providing that the item has a simple transformation matrix * (e.g. set with goo_canvas_item_set_simple_transform(), or using a * combination of simple translate, scale and rotate operations). If the item * has a complex transformation matrix the results will be incorrect. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_get_simple_transform (GooCanvasItem *item, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; double x1 = 1.0, y1 = 0.0, radians; gboolean has_transform = FALSE; if (iface->get_transform) has_transform = iface->get_transform (item, &matrix); if (!has_transform) { *x = *y = *rotation = 0.0; *scale = 1.0; return FALSE; } *x = matrix.x0; *y = matrix.y0; matrix.x0 = 0.0; matrix.y0 = 0.0; cairo_matrix_transform_point (&matrix, &x1, &y1); *scale = sqrt (x1 * x1 + y1 * y1); radians = atan2 (y1, x1); *rotation = radians * (180 / M_PI); if (*rotation < 0) *rotation += 360; return TRUE; } /** * goo_canvas_item_set_simple_transform: * @item: an item. * @x: the x coordinate of the origin of the item's coordinate space. * @y: the y coordinate of the origin of the item's coordinate space. * @scale: the scale of the item. * @rotation: the clockwise rotation of the item, in degrees. * * A convenience function to set the item's transformation matrix. **/ void goo_canvas_item_set_simple_transform (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble rotation) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; cairo_matrix_translate (&new_matrix, x, y); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, rotation * (M_PI / 180)); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_translate: * @item: an item. * @tx: the amount to move the origin in the horizontal direction. * @ty: the amount to move the origin in the vertical direction. * * Translates the origin of the item's coordinate system by the given amounts. **/ void goo_canvas_item_translate (GooCanvasItem *item, gdouble tx, gdouble ty) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, tx, ty); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_scale: * @item: an item. * @sx: the amount to scale the horizontal axis. * @sy: the amount to scale the vertical axis. * * Scales the item's coordinate system by the given amounts. **/ void goo_canvas_item_scale (GooCanvasItem *item, gdouble sx, gdouble sy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (item, &new_matrix); cairo_matrix_scale (&new_matrix, sx, sy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_rotate: * @item: an item. * @degrees: the clockwise angle of rotation. * @cx: the x coordinate of the origin of the rotation. * @cy: the y coordinate of the origin of the rotation. * * Rotates the item's coordinate system by the given amount, about the given * origin. **/ void goo_canvas_item_rotate (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_rotate (&new_matrix, radians); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_skew_x: * @item: an item. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the item's coordinate system along the x axis by the given amount, * about the given origin. **/ void goo_canvas_item_skew_x (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, 0, tan (radians), 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_skew_y: * @item: an item. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the item's coordinate system along the y axis by the given amount, * about the given origin. **/ void goo_canvas_item_skew_y (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, tan (radians), 0, 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_get_style: * @item: an item. * * Gets the item's style. If the item doesn't have its own style it will return * its parent's style. * * Returns: the item's style. **/ GooCanvasStyle* goo_canvas_item_get_style (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_style ? iface->get_style (item) : NULL; } /** * goo_canvas_item_set_style: * @item: an item. * @style: a style. * * Sets the item's style, by copying the properties from the given style. **/ void goo_canvas_item_set_style (GooCanvasItem *item, GooCanvasStyle *style) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_style) iface->set_style (item, style); } typedef struct _GooCanvasItemAnimation GooCanvasItemAnimation; struct _GooCanvasItemAnimation { GooCanvasAnimateType type; GooCanvasItem *item; GooCanvasItemModel *model; int step, total_steps; cairo_matrix_t start; gdouble x_start, y_start, scale_start, radians_start; gdouble x_step, y_step, scale_step, radians_step; gboolean absolute; gboolean forward; guint timeout_id; }; static void goo_canvas_item_free_animation (GooCanvasItemAnimation *anim) { if (anim->timeout_id) { g_source_remove (anim->timeout_id); anim->timeout_id = 0; } g_free (anim); } static gboolean goo_canvas_item_animate_cb (GooCanvasItemAnimation *anim) { GooCanvasItem *item = anim->item; GooCanvasItemModel *model = anim->model; GooCanvasAnimateType type = anim->type; GooCanvasItemIface *iface = NULL; GooCanvasItemModelIface *model_iface = NULL; cairo_matrix_t new_matrix; gboolean keep_source = TRUE; gdouble scale; gint step; GDK_THREADS_ENTER (); if (model) model_iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); else iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (++anim->step > anim->total_steps) { switch (type) { case GOO_CANVAS_ANIMATE_RESET: /* Reset the transform to the initial value. */ if (model) model_iface->set_transform (model, &anim->start); else iface->set_transform (item, &anim->start); /* Fall through.. */ case GOO_CANVAS_ANIMATE_FREEZE: keep_source = FALSE; anim->timeout_id = 0; /* This will result in a call to goo_canvas_item_free_animation() above. We've set the timeout_id to 0 so it isn't removed twice. */ if (model) { g_object_set_data (G_OBJECT (model), animation_key, NULL); g_signal_emit_by_name (model, "animation-finished", FALSE); } else { g_object_set_data (G_OBJECT (item), animation_key, NULL); g_signal_emit_by_name (item, "animation-finished", FALSE); } break; case GOO_CANVAS_ANIMATE_RESTART: anim->step = 0; break; case GOO_CANVAS_ANIMATE_BOUNCE: anim->forward = !anim->forward; anim->step = 1; break; } } if (keep_source) { step = anim->forward ? anim->step : anim->total_steps - anim->step; if (anim->absolute) { cairo_matrix_init_identity (&new_matrix); scale = anim->scale_start + anim->scale_step * step; cairo_matrix_translate (&new_matrix, anim->x_start + anim->x_step * step, anim->y_start + anim->y_step * step); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, anim->radians_start + anim->radians_step * step); } else { new_matrix = anim->start; scale = 1 + anim->scale_step * step; cairo_matrix_translate (&new_matrix, anim->x_step * step, anim->y_step * step); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, anim->radians_step * step); } if (model) model_iface->set_transform (model, &new_matrix); else iface->set_transform (item, &new_matrix); } GDK_THREADS_LEAVE (); /* Return FALSE to remove the timeout handler when we are finished. */ return keep_source; } void _goo_canvas_item_animate_internal (GooCanvasItem *item, GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type) { GObject *object; cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; GooCanvasItemAnimation *anim; if (item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->get_transform (item, &matrix); object = (GObject*) item; } else { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); iface->get_transform (model, &matrix); object = (GObject*) model; } anim = g_new (GooCanvasItemAnimation, 1); anim->type = type; anim->item = item; anim->model = model; anim->step = 0; anim->total_steps = duration / step_time; anim->start = matrix; anim->absolute = absolute; anim->forward = TRUE; /* For absolute animation we have to try to calculate the current position, scale and rotation. */ if (absolute) { cairo_matrix_t tmp_matrix = anim->start; double x1 = 1.0, y1 = 0.0; anim->x_start = tmp_matrix.x0; anim->y_start = tmp_matrix.y0; tmp_matrix.x0 = 0.0; tmp_matrix.y0 = 0.0; cairo_matrix_transform_point (&tmp_matrix, &x1, &y1); anim->scale_start = sqrt (x1 * x1 + y1 * y1); anim->radians_start = atan2 (y1, x1); anim->x_step = (x - anim->x_start) / anim->total_steps; anim->y_step = (y - anim->y_start) / anim->total_steps; anim->scale_step = (scale - anim->scale_start) / anim->total_steps; anim->radians_step = (degrees * (M_PI / 180) - anim->radians_start) / anim->total_steps; } else { anim->x_step = x / anim->total_steps; anim->y_step = y / anim->total_steps; anim->scale_step = (scale - 1.0) / anim->total_steps; anim->radians_step = (degrees * (M_PI / 180)) / anim->total_steps; } /* Store a pointer to the new animation in the item. This will automatically stop any current animation and free it. */ g_object_set_data_full (object, animation_key, anim, (GDestroyNotify) goo_canvas_item_free_animation); anim->timeout_id = g_timeout_add (step_time, (GSourceFunc) goo_canvas_item_animate_cb, anim); } /** * goo_canvas_item_animate: * @item: an item. * @x: the final x coordinate. * @y: the final y coordinate. * @scale: the final scale. * @degrees: the final rotation. This can be negative to rotate anticlockwise, * and can also be greater than 360 to rotate a number of times. * @absolute: if the @x, @y, @scale and @degrees values are absolute, or * relative to the current transform. Note that absolute animations only work * if the item currently has a simple transform. If the item has a shear or * some other complicated transform it may result in strange animations. * @duration: the duration of the animation, in milliseconds (1/1000ths of a * second). * @step_time: the time between each animation step, in milliseconds. * @type: specifies what happens when the animation finishes. * * Animates an item from its current position to the given offsets, scale * and rotation. **/ void goo_canvas_item_animate (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type) { _goo_canvas_item_animate_internal (item, NULL, x, y, scale, degrees, absolute, duration, step_time, type); } /** * goo_canvas_item_stop_animation: * @item: an item. * * Stops any current animation for the given item, leaving it at its current * position. **/ void goo_canvas_item_stop_animation (GooCanvasItem *item) { /* This will result in a call to goo_canvas_item_free_animation() above. */ g_object_set_data (G_OBJECT (item), animation_key, NULL); g_signal_emit_by_name (item, "animation-finished", TRUE); } /** * goo_canvas_item_request_update: * @item: a #GooCanvasItem. * * This function is only intended to be used when implementing new canvas * items. * * It requests that an update of the item is scheduled. It will be performed * as soon as the application is idle, and before the canvas is redrawn. **/ void goo_canvas_item_request_update (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->request_update) iface->request_update (item); else goo_canvas_item_request_update (iface->get_parent (item)); } /** * goo_canvas_item_get_bounds: * @item: a #GooCanvasItem. * @bounds: a #GooCanvasBounds to return the bounds in. * * Gets the bounds of the item. * * Note that the bounds includes the entire fill and stroke extents of the * item, whether they are painted or not. **/ void goo_canvas_item_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->get_bounds (item, bounds); } /** * goo_canvas_item_get_items_at: * @item: a #GooCanvasItem. * @x: the x coordinate of the point. * @y: the y coordinate of the point. * @cr: a cairo contect. * @is_pointer_event: %TRUE if the "pointer-events" properties of items should * be used to determine which parts of the item are tested. * @parent_is_visible: %TRUE if the parent item is visible (which * implies that all ancestors are also visible). * @found_items: the list of items found so far. * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * It gets the items at the given point. * * Returns: the @found_items list, with any more found items added onto * the start of the list, leaving the top item first. **/ GList* goo_canvas_item_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_items_at) return iface->get_items_at (item, x, y, cr, is_pointer_event, parent_is_visible, found_items); else return found_items; } /** * goo_canvas_item_is_visible: * @item: a #GooCanvasItem. * * Checks if the item is visible. * * This entails checking the item's own visibility setting, as well as those * of its ancestors. * * Note that the item may be scrolled off the screen and so may not * be actually visible to the user. * * Returns: %TRUE if the item is visible. **/ gboolean goo_canvas_item_is_visible (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); GooCanvasItem *parent; if (iface->is_visible) return iface->is_visible (item); /* If the item doesn't implement the is_visible method we assume it is visible and check its ancestors. */ parent = goo_canvas_item_get_parent (item); if (parent) return goo_canvas_item_is_visible (parent); return TRUE; } /** * goo_canvas_item_get_model: * @item: a #GooCanvasItem. * * Gets the model of the given canvas item. * * Returns: the item's model, or %NULL if it has no model. **/ GooCanvasItemModel* goo_canvas_item_get_model (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_model ? iface->get_model (item) : NULL; } /** * goo_canvas_item_set_model: * @item: a #GooCanvasItem. * @model: a #GooCanvasItemModel. * * Sets the model of the given canvas item. **/ void goo_canvas_item_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_model) iface->set_model (item, model); } /** * goo_canvas_item_ensure_updated: * @item: a #GooCanvasItem. * * This function is only intended to be used when implementing new canvas * items. * * It updates the canvas immediately, if an update is scheduled. * This ensures that all item bounds are up-to-date. **/ void goo_canvas_item_ensure_updated (GooCanvasItem *item) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); if (canvas) goo_canvas_update (canvas); } /** * goo_canvas_item_update: * @item: a #GooCanvasItem. * @entire_tree: if the entire subtree should be updated. * @cr: a cairo context. * @bounds: a #GooCanvasBounds to return the new bounds in. * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * Updates the item, if needed, and any children. **/ void goo_canvas_item_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->update (item, entire_tree, cr, bounds); } /** * goo_canvas_item_paint: * @item: a #GooCanvasItem. * @cr: a cairo context. * @bounds: the bounds that need to be repainted, in device space. * @scale: the scale to use to determine whether an item should be painted. * See #GooCanvasItem:visibility-threshold. * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * It paints the item and all children if they intersect the given bounds. * * Note that the @scale argument may be different to the current scale in the * #GooCanvasItem, e.g. when the canvas is being printed. **/ void goo_canvas_item_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->paint (item, cr, bounds, scale); } /** * goo_canvas_item_get_requested_area: * @item: a #GooCanvasItem. * @cr: a cairo context. * @requested_area: a #GooCanvasBounds to return the requested area in, in the * parent's coordinate space. * * This function is only intended to be used when implementing new canvas * items, specifically layout items such as #GooCanvasTable. * * It gets the requested area of a child item. * * Returns: %TRUE if the item should be allocated space. **/ gboolean goo_canvas_item_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_requested_area (item, cr, requested_area); } /** * goo_canvas_item_get_requested_height: * @item: a #GooCanvasItem. * @cr: a cairo context. * @width: the width that the item may be allocated. * * This function is only intended to be used when implementing new canvas * items, specifically layout items such as #GooCanvasTable. * * It gets the requested height of a child item, assuming it is allocated the * given width. This is useful for text items whose requested height may change * depending on the allocated width. * * Returns: the requested height of the item, given the allocated width, * or %-1 if the item doesn't support this method or its height doesn't * change when allocated different widths. **/ gdouble goo_canvas_item_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_requested_height) return iface->get_requested_height (item, cr, width); else return -1; } /** * goo_canvas_item_allocate_area: * @item: a #GooCanvasItem. * @cr: a cairo context. * @requested_area: the area that the item originally requested, in the * parent's coordinate space. * @allocated_area: the area that the item has been allocated, in the parent's * coordinate space. * @x_offset: the x offset of the allocated area from the requested area in * the device coordinate space. * @y_offset: the y offset of the allocated area from the requested area in * the device coordinate space. * * This function is only intended to be used when implementing new canvas * items, specifically layout items such as #GooCanvasTable. * * It allocates an area to a child #GooCanvasItem. * * Note that the parent layout item will use a transform to move each of its * children for the layout, so there is no need for the child item to * reposition itself. It only needs to recalculate its device bounds. * * To help recalculate the item's device bounds, the @x_offset and @y_offset * of the child item's allocated position from its requested position are * provided. Simple items can just add these to their bounds. **/ void goo_canvas_item_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->allocate_area (item, cr, requested_area, allocated_area, x_offset, y_offset); } /* * Child Properties. */ static inline void item_get_child_property (GObject *object, GObject *child, GParamSpec *pspec, GValue *value, gboolean is_model) { GObjectClass *class; class = g_type_class_peek (pspec->owner_type); if (is_model) { GooCanvasItemModelIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM_MODEL); iface->get_child_property ((GooCanvasItemModel*) object, (GooCanvasItemModel*) child, pspec->param_id, value, pspec); } else { GooCanvasItemIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM); iface->get_child_property ((GooCanvasItem*) object, (GooCanvasItem*) child, pspec->param_id, value, pspec); } } void _goo_canvas_item_get_child_property_internal (GObject *object, GObject *child, const gchar *property_name, GValue *value, GParamSpecPool *property_pool, gboolean is_model) { GParamSpec *pspec; g_object_ref (object); g_object_ref (child); pspec = g_param_spec_pool_lookup (property_pool, property_name, G_OBJECT_TYPE (object), TRUE); if (!pspec) g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), property_name); else if (!(pspec->flags & G_PARAM_READABLE)) g_warning ("%s: child property `%s' of class `%s' is not readable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); else { GValue *prop_value, tmp_value = { 0, }; /* auto-conversion of the callers value type */ if (G_VALUE_TYPE (value) == G_PARAM_SPEC_VALUE_TYPE (pspec)) { g_value_reset (value); prop_value = value; } else if (!g_value_type_transformable (G_PARAM_SPEC_VALUE_TYPE (pspec), G_VALUE_TYPE (value))) { g_warning ("can't retrieve child property `%s' of type `%s' as value of type `%s'", pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)), G_VALUE_TYPE_NAME (value)); g_object_unref (child); g_object_unref (object); return; } else { g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); prop_value = &tmp_value; } item_get_child_property (object, child, pspec, prop_value, is_model); if (prop_value != value) { g_value_transform (prop_value, value); g_value_unset (&tmp_value); } } g_object_unref (child); g_object_unref (object); } void _goo_canvas_item_get_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model) { g_object_ref (object); g_object_ref (child); for (;;) { GValue value = { 0, }; GParamSpec *pspec; gchar *name, *error = NULL; name = va_arg (var_args, gchar*); if (!name) break; pspec = g_param_spec_pool_lookup (property_pool, name, G_OBJECT_TYPE (object), TRUE); if (!pspec) { g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), name); break; } if (!(pspec->flags & G_PARAM_READABLE)) { g_warning ("%s: child property `%s' of class `%s' is not readable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); break; } g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); item_get_child_property (object, child, pspec, &value, is_model); G_VALUE_LCOPY (&value, var_args, 0, &error); if (error) { g_warning ("%s: %s", G_STRLOC, error); g_free (error); g_value_unset (&value); break; } g_value_unset (&value); } g_object_unref (child); g_object_unref (object); } static inline void canvas_item_set_child_property (GObject *object, GObject *child, GParamSpec *pspec, const GValue *value, GObjectNotifyQueue *nqueue, gboolean is_model) { GValue tmp_value = { 0, }; /* provide a copy to work from, convert (if necessary) and validate */ g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); if (!g_value_transform (value, &tmp_value)) g_warning ("unable to set child property `%s' of type `%s' from value of type `%s'", pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)), G_VALUE_TYPE_NAME (value)); else if (g_param_value_validate (pspec, &tmp_value) && !(pspec->flags & G_PARAM_LAX_VALIDATION)) { gchar *contents = g_strdup_value_contents (value); g_warning ("value \"%s\" of type `%s' is invalid for property `%s' of type `%s'", contents, G_VALUE_TYPE_NAME (value), pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec))); g_free (contents); } else { GObjectClass *class = g_type_class_peek (pspec->owner_type); if (is_model) { GooCanvasItemModelIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM_MODEL); iface->set_child_property ((GooCanvasItemModel*) object, (GooCanvasItemModel*) child, pspec->param_id, &tmp_value, pspec); } else { GooCanvasItemIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM); iface->set_child_property ((GooCanvasItem*) object, (GooCanvasItem*) child, pspec->param_id, &tmp_value, pspec); } g_object_notify_queue_add (G_OBJECT (child), nqueue, pspec); } g_value_unset (&tmp_value); } void _goo_canvas_item_set_child_property_internal (GObject *object, GObject *child, const gchar *property_name, const GValue *value, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model) { GObjectNotifyQueue *nqueue; GParamSpec *pspec; g_object_ref (object); g_object_ref (child); nqueue = g_object_notify_queue_freeze (child, notify_context); pspec = g_param_spec_pool_lookup (property_pool, property_name, G_OBJECT_TYPE (object), TRUE); if (!pspec) g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), property_name); else if (!(pspec->flags & G_PARAM_WRITABLE)) g_warning ("%s: child property `%s' of class `%s' is not writable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); else { canvas_item_set_child_property (object, child, pspec, value, nqueue, is_model); } g_object_notify_queue_thaw (child, nqueue); g_object_unref (object); g_object_unref (child); } void _goo_canvas_item_set_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model) { GObjectNotifyQueue *nqueue; g_object_ref (object); g_object_ref (child); nqueue = g_object_notify_queue_freeze (child, notify_context); for (;;) { GValue value = { 0, }; GParamSpec *pspec; gchar *name, *error = NULL; name = va_arg (var_args, gchar*); if (!name) break; pspec = g_param_spec_pool_lookup (property_pool, name, G_OBJECT_TYPE (object), TRUE); if (!pspec) { g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), name); break; } if (!(pspec->flags & G_PARAM_WRITABLE)) { g_warning ("%s: child property `%s' of class `%s' is not writable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); break; } g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); G_VALUE_COLLECT (&value, var_args, 0, &error); if (error) { g_warning ("%s: %s", G_STRLOC, error); g_free (error); /* we purposely leak the value here, it might not be * in a sane state if an error condition occoured */ break; } canvas_item_set_child_property (object, child, pspec, &value, nqueue, is_model); g_value_unset (&value); } g_object_notify_queue_thaw (G_OBJECT (child), nqueue); g_object_unref (object); g_object_unref (child); } /** * goo_canvas_item_get_child_property: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @property_name: the name of the child property to get. * @value: a location to return the value. * * Gets a child property of @child. **/ void goo_canvas_item_get_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_get_child_property_internal ((GObject*) item, (GObject*) child, property_name, value, _goo_canvas_item_child_property_pool, FALSE); } /** * goo_canvas_item_set_child_property: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @property_name: the name of the child property to set. * @value: the value to set the property to. * * Sets a child property of @child. **/ void goo_canvas_item_set_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, const GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_set_child_property_internal ((GObject*) item, (GObject*) child, property_name, value, _goo_canvas_item_child_property_pool, _goo_canvas_item_child_property_notify_context, FALSE); } /** * goo_canvas_item_get_child_properties_valist: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @var_args: pairs of property names and value pointers, and a terminating * %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_get_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); _goo_canvas_item_get_child_properties_internal ((GObject*) item, (GObject*) child, var_args, _goo_canvas_item_child_property_pool, _goo_canvas_item_child_property_notify_context, FALSE); } /** * goo_canvas_item_set_child_properties_valist: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @var_args: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_set_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); _goo_canvas_item_set_child_properties_internal ((GObject*) item, (GObject*) child, var_args, _goo_canvas_item_child_property_pool, _goo_canvas_item_child_property_notify_context, FALSE); } /** * goo_canvas_item_get_child_properties: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @...: pairs of property names and value pointers, and a terminating %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_get_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_get_child_properties_valist (item, child, var_args); va_end (var_args); } /** * goo_canvas_item_set_child_properties: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @...: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_set_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_set_child_properties_valist (item, child, var_args); va_end (var_args); } /** * goo_canvas_item_class_install_child_property: * @iclass: a #GObjectClass * @property_id: the id for the property * @pspec: the #GParamSpec for the property * * This function is only intended to be used when implementing new canvas * items, specifically layout container items such as #GooCanvasTable. * * It installs a child property on a canvas item class. **/ void goo_canvas_item_class_install_child_property (GObjectClass *iclass, guint property_id, GParamSpec *pspec) { g_return_if_fail (G_IS_OBJECT_CLASS (iclass)); g_return_if_fail (G_IS_PARAM_SPEC (pspec)); g_return_if_fail (property_id > 0); if (g_param_spec_pool_lookup (_goo_canvas_item_child_property_pool, pspec->name, G_OBJECT_CLASS_TYPE (iclass), FALSE)) { g_warning (G_STRLOC ": class `%s' already contains a child property named `%s'", G_OBJECT_CLASS_NAME (iclass), pspec->name); return; } g_param_spec_ref (pspec); g_param_spec_sink (pspec); pspec->param_id = property_id; g_param_spec_pool_insert (_goo_canvas_item_child_property_pool, pspec, G_OBJECT_CLASS_TYPE (iclass)); } /** * goo_canvas_item_class_find_child_property: * @iclass: a #GObjectClass * @property_name: the name of the child property to find * @returns: the #GParamSpec of the child property or %NULL if @class has no * child property with that name. * * This function is only intended to be used when implementing new canvas * items, specifically layout container items such as #GooCanvasTable. * * It finds a child property of a canvas item class by name. */ GParamSpec* goo_canvas_item_class_find_child_property (GObjectClass *iclass, const gchar *property_name) { g_return_val_if_fail (G_IS_OBJECT_CLASS (iclass), NULL); g_return_val_if_fail (property_name != NULL, NULL); return g_param_spec_pool_lookup (_goo_canvas_item_child_property_pool, property_name, G_OBJECT_CLASS_TYPE (iclass), TRUE); } /** * goo_canvas_item_class_list_child_properties: * @iclass: a #GObjectClass * @n_properties: location to return the number of child properties found * @returns: a newly allocated array of #GParamSpec*. The array must be * freed with g_free(). * * This function is only intended to be used when implementing new canvas * items, specifically layout container items such as #GooCanvasTable. * * It returns all child properties of a canvas item class. */ GParamSpec** goo_canvas_item_class_list_child_properties (GObjectClass *iclass, guint *n_properties) { GParamSpec **pspecs; guint n; g_return_val_if_fail (G_IS_OBJECT_CLASS (iclass), NULL); pspecs = g_param_spec_pool_list (_goo_canvas_item_child_property_pool, G_OBJECT_CLASS_TYPE (iclass), &n); if (n_properties) *n_properties = n; return pspecs; } goocanvas-1.0.0/src/goocanvasmarshal.h0000644000076400007640000000630411412724107014713 00000000000000 #ifndef __goo_canvas_marshal_MARSHAL_H__ #define __goo_canvas_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* VOID:VOID (./goocanvasmarshal.list:1) */ #define goo_canvas_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID /* VOID:INT (./goocanvasmarshal.list:2) */ #define goo_canvas_marshal_VOID__INT g_cclosure_marshal_VOID__INT /* VOID:INT,INT (./goocanvasmarshal.list:3) */ extern void goo_canvas_marshal_VOID__INT_INT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:BOOLEAN (./goocanvasmarshal.list:4) */ #define goo_canvas_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN /* VOID:OBJECT,OBJECT (./goocanvasmarshal.list:5) */ extern void goo_canvas_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED (./goocanvasmarshal.list:6) */ extern void goo_canvas_marshal_BOOLEAN__BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:OBJECT,BOXED (./goocanvasmarshal.list:7) */ extern void goo_canvas_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:DOUBLE,DOUBLE,BOOLEAN,OBJECT (./goocanvasmarshal.list:8) */ extern void goo_canvas_marshal_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __goo_canvas_marshal_MARSHAL_H__ */ goocanvas-1.0.0/src/Makefile.in0000644000076400007640000006106011512612655013264 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ subdir = src DIST_COMMON = $(libgoocanvasinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/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__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libgoocanvasincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libgoocanvas_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libgoocanvas_la_OBJECTS = goocanvasatk.lo goocanvasellipse.lo \ goocanvasenumtypes.lo goocanvasgrid.lo goocanvasgroup.lo \ goocanvasimage.lo goocanvasitem.lo goocanvasitemmodel.lo \ goocanvasitemsimple.lo goocanvasmarshal.lo \ goocanvaspolyline.lo goocanvaspath.lo goocanvasrect.lo \ goocanvasstyle.lo goocanvastable.lo goocanvastext.lo \ goocanvasutils.lo goocanvaswidget.lo goocanvas.lo libgoocanvas_la_OBJECTS = $(am_libgoocanvas_la_OBJECTS) libgoocanvas_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgoocanvas_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(libgoocanvas_la_SOURCES) DIST_SOURCES = $(libgoocanvas_la_SOURCES) HEADERS = $(libgoocanvasinclude_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@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -DG_LOG_DOMAIN=\"GooCanvas\" \ @PACKAGE_CFLAGS@ # -DG_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED \ # -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED \ # -DGTK_DISABLE_DEPRECATED lib_LTLIBRARIES = libgoocanvas.la libgoocanvas_la_LIBADD = @PACKAGE_LIBS@ $(INTLLIBS) @PLATFORM_WIN32_TRUE@no_undefined = -no-undefined libtool_opts = \ -version-info $(LT_VERSION_INFO) \ -export-dynamic $(no_undefined) \ -rpath $(libdir) libgoocanvas_la_LDFLAGS = $(libtool_opts) libgoocanvasincludedir = $(includedir)/goocanvas-1.0 libgoocanvas_public_headers = \ goocanvasellipse.h \ goocanvasgrid.h \ goocanvasgroup.h \ goocanvasimage.h \ goocanvasitem.h \ goocanvasitemmodel.h \ goocanvasitemsimple.h \ goocanvaspolyline.h \ goocanvaspath.h \ goocanvasrect.h \ goocanvasstyle.h \ goocanvastable.h \ goocanvastext.h \ goocanvasutils.h \ goocanvaswidget.h \ goocanvas.h libgoocanvas_la_SOURCES = \ goocanvasatk.h \ goocanvasatk.c \ goocanvasellipse.c \ goocanvasenumtypes.c \ goocanvasgrid.c \ goocanvasgroup.c \ goocanvasimage.c \ goocanvasitem.c \ goocanvasitemmodel.c \ goocanvasitemsimple.c \ goocanvasmarshal.c \ goocanvaspolyline.c \ goocanvaspath.c \ goocanvasprivate.h \ goocanvasrect.c \ goocanvasstyle.c \ goocanvastable.c \ goocanvastext.c \ goocanvasutils.c \ goocanvaswidget.c \ goocanvas.c libgoocanvas_extra_sources = \ goocanvasmarshal.list libgoocanvas_built_headers = \ goocanvasenumtypes.h \ goocanvasmarshal.h libgoocanvas_built_sources = \ goocanvasenumtypes.c \ goocanvasmarshal.c stamp_files = \ stamp-goocanvasmarshal.h \ stamp-goocanvasenumtypes.h libgoocanvasinclude_HEADERS = \ $(libgoocanvas_public_headers) \ $(libgoocanvas_built_headers) gen_sources = xgen-gdef xgen-gtbh xgen-gtic xgen-gmh xgen-gmc xgen-gmlh xgen-gmlc CLEANFILES = $(gen_sources) BUILT_SOURCES = $(libgoocanvas_built_headers) $(libgoocanvas_built_sources) MAINTAINERCLEANFILES = $(BUILT_SOURCES) $(stamp_files) EXTRA_DIST = $(BUILT_SOURCES) $(libgoocanvas_extra_sources) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.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) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/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_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 libgoocanvas.la: $(libgoocanvas_la_OBJECTS) $(libgoocanvas_la_DEPENDENCIES) $(libgoocanvas_la_LINK) -rpath $(libdir) $(libgoocanvas_la_OBJECTS) $(libgoocanvas_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasatk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasellipse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasenumtypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasgrid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasgroup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasimage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasitem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasitemmodel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasitemsimple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasmarshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvaspath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvaspolyline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasrect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasstyle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvastable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvastext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvaswidget.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-libgoocanvasincludeHEADERS: $(libgoocanvasinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(libgoocanvasincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libgoocanvasincludedir)" @list='$(libgoocanvasinclude_HEADERS)'; test -n "$(libgoocanvasincludedir)" || 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)$(libgoocanvasincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgoocanvasincludedir)" || exit $$?; \ done uninstall-libgoocanvasincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libgoocanvasinclude_HEADERS)'; test -n "$(libgoocanvasincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(libgoocanvasincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libgoocanvasincludedir)" && rm -f $$files 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libgoocanvasincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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) 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 "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -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-libgoocanvasincludeHEADERS 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-libLTLIBRARIES \ uninstall-libgoocanvasincludeHEADERS .MAKE: all check install 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-info install-info-am \ install-libLTLIBRARIES install-libgoocanvasincludeHEADERS \ 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-libLTLIBRARIES \ uninstall-libgoocanvasincludeHEADERS # # Most of the stuff below has been pinched from the GTK+ Makefile.am, as # it is tricky to get right and we know it works for GTK+. # # all autogenerated files need to be generated in the srcdir, # so old versions get remade and are not confused with newer # versions in the build dir. thus a development setup requires # srcdir to be writable, passing --disable-rebuilds to # ../configure will supress all autogeneration rules. goocanvasmarshal.h: stamp-goocanvasmarshal.h @true stamp-goocanvasmarshal.h: @REBUILD@ goocanvasmarshal.list $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --header >> xgen-gmlh \ && (cmp -s xgen-gmlh goocanvasmarshal.h || cp xgen-gmlh goocanvasmarshal.h) \ && rm -f xgen-gmlh \ && echo timestamp > $(@F) goocanvasmarshal.c: @REBUILD@ goocanvasmarshal.list (echo "#include \"goocanvasmarshal.h\""; \ $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --body) >> xgen-gmlc \ && cp xgen-gmlc goocanvasmarshal.c \ && rm -f xgen-gmlc goocanvasenumtypes.h: stamp-goocanvasenumtypes.h @true stamp-goocanvasenumtypes.h: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#ifndef __GOO_CANVAS_ENUM_TYPES_H__\n#define __GOO_CANVAS_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* Enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void);\n#define GOO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n\n\n" \ --ftail "G_END_DECLS\n\n#endif /* __GOO_CANVAS_ENUM_TYPES_H__ */" \ $(libgoocanvas_public_headers)) >> xgen-gtbh \ && (cmp -s xgen-gtbh goocanvasenumtypes.h || cp xgen-gtbh goocanvasenumtypes.h ) \ && rm -f xgen-gtbh \ && echo timestamp > $(@F) goocanvasenumtypes.c: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#include \n" \ --fhead "#include \"goocanvas.h\"\n" \ --fprod "\n/* Enumerations from \"@filename@\" */" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if( etype == 0 ) \n {\n static const G@Type@Value values[] = {" \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values );\n }\n return etype;\n}\n" \ $(libgoocanvas_public_headers)) > xgen-gtbc \ && cp xgen-gtbc goocanvasenumtypes.c \ && rm -f xgen-gtbc # 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: goocanvas-1.0.0/src/goocanvasgrid.c0000644000076400007640000011536411412723611014212 00000000000000/* * GooCanvas. Copyright (C) 2005-8 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgrid.c - a grid item. */ /** * SECTION:goocanvasgrid * @Title: GooCanvasGrid * @Short_Description: a grid item. * * GooCanvasGrid represents a grid item. * A grid consists of a number of equally-spaced horizontal and vertical * grid lines, plus an optional border. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasGrid use goo_canvas_grid_new(). * * To get or set the properties of an existing #GooCanvasGrid, use * g_object_get() and g_object_set(). * * The grid's position and size is specified with the #GooCanvasGrid:x, * #GooCanvasGrid:y, #GooCanvasGrid:width and #GooCanvasGrid:height properties. * * The #GooCanvasGrid:x-step and #GooCanvasGrid:y-step properties specify the * distance between grid lines. The #GooCanvasGrid:x-offset and * #GooCanvasGrid:y-offset properties specify the distance before the first * grid lines. * * The horizontal or vertical grid lines can be hidden using the * #GooCanvasGrid:show-horz-grid-lines and #GooCanvasGrid:show-vert-grid-lines * properties. * * The width of the border can be set using the #GooCanvasGrid:border-width * property. The border is drawn outside the area specified with the * #GooCanvasGrid:x, #GooCanvasGrid:y, #GooCanvasGrid:width and * #GooCanvasGrid:height properties. * * Other properties allow the colors and widths of the grid lines to be set. * The grid line color and width properties override the standard * #GooCanvasItemSimple:stroke-color and #GooCanvasItemSimple:line-width * properties, enabling different styles for horizontal and vertical grid lines. */ #include #include #include #include #include "goocanvasprivate.h" #include "goocanvas.h" enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_X_STEP, PROP_Y_STEP, PROP_X_OFFSET, PROP_Y_OFFSET, PROP_HORZ_GRID_LINE_WIDTH, PROP_VERT_GRID_LINE_WIDTH, PROP_HORZ_GRID_LINE_PATTERN, PROP_VERT_GRID_LINE_PATTERN, PROP_BORDER_WIDTH, PROP_BORDER_PATTERN, PROP_SHOW_HORZ_GRID_LINES, PROP_SHOW_VERT_GRID_LINES, PROP_VERT_GRID_LINES_ON_TOP, /* Convenience properties. */ PROP_HORZ_GRID_LINE_COLOR, PROP_HORZ_GRID_LINE_COLOR_RGBA, PROP_HORZ_GRID_LINE_PIXBUF, PROP_VERT_GRID_LINE_COLOR, PROP_VERT_GRID_LINE_COLOR_RGBA, PROP_VERT_GRID_LINE_PIXBUF, PROP_BORDER_COLOR, PROP_BORDER_COLOR_RGBA, PROP_BORDER_PIXBUF }; GooCanvasItemIface *goo_canvas_grid_parent_iface; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasGrid, goo_canvas_grid, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_grid_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the grid"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the grid"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the grid"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the grid"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X_STEP, g_param_spec_double ("x-step", "X Step", _("The distance between the vertical grid lines"), 0.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y_STEP, g_param_spec_double ("y-step", "Y Step", _("The distance between the horizontal grid lines"), 0.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X_OFFSET, g_param_spec_double ("x-offset", "X Offset", _("The distance before the first vertical grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y_OFFSET, g_param_spec_double ("y-offset", "Y Offset", _("The distance before the first horizontal grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_WIDTH, g_param_spec_double ("horz-grid-line-width", _("Horizontal Grid Line Width"), _("The width of the horizontal grid lines"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_WIDTH, g_param_spec_double ("vert-grid-line-width", _("Vertical Grid Line Width"), _("The width of the vertical grid lines"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_PATTERN, g_param_spec_boxed ("horz-grid-line-pattern", _("Horizontal Grid Line Pattern"), _("The cairo pattern to paint the horizontal grid lines with"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_PATTERN, g_param_spec_boxed ("vert-grid-line-pattern", _("Vertical Grid Line Pattern"), _("The cairo pattern to paint the vertical grid lines with"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BORDER_WIDTH, g_param_spec_double ("border-width", _("Border Width"), _("The width of the border around the grid"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BORDER_PATTERN, g_param_spec_boxed ("border-pattern", _("Border Pattern"), _("The cairo pattern to paint the border with"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOW_HORZ_GRID_LINES, g_param_spec_boolean ("show-horz-grid-lines", _("Show Horizontal Grid Lines"), _("If the horizontal grid lines are shown"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOW_VERT_GRID_LINES, g_param_spec_boolean ("show-vert-grid-lines", _("Show Vertical Grid Lines"), _("If the vertical grid lines are shown"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINES_ON_TOP, g_param_spec_boolean ("vert-grid-lines-on-top", _("Vertical Grid Lines On Top"), _("If the vertical grid lines are painted above the horizontal grid lines"), FALSE, G_PARAM_READWRITE)); /* Convenience properties - some are writable only. */ g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_COLOR, g_param_spec_string ("horz-grid-line-color", _("Horizontal Grid Line Color"), _("The color to use for the horizontal grid lines"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_COLOR_RGBA, g_param_spec_uint ("horz-grid-line-color-rgba", _("Horizontal Grid Line Color RGBA"), _("The color to use for the horizontal grid lines, specified as a 32-bit integer value"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_PIXBUF, g_param_spec_object ("horz-grid-line-pixbuf", _("Horizontal Grid Line Pixbuf"), _("The pixbuf to use to draw the horizontal grid lines"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_COLOR, g_param_spec_string ("vert-grid-line-color", _("Vertical Grid Line Color"), _("The color to use for the vertical grid lines"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_COLOR_RGBA, g_param_spec_uint ("vert-grid-line-color-rgba", _("Vertical Grid Line Color RGBA"), _("The color to use for the vertical grid lines, specified as a 32-bit integer value"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_PIXBUF, g_param_spec_object ("vert-grid-line-pixbuf", _("Vertical Grid Line Pixbuf"), _("The pixbuf to use to draw the vertical grid lines"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_BORDER_COLOR, g_param_spec_string ("border-color", _("Border Color"), _("The color to use for the border"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_BORDER_COLOR_RGBA, g_param_spec_uint ("border-color-rgba", _("Border Color RGBA"), _("The color to use for the border, specified as a 32-bit integer value"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BORDER_PIXBUF, g_param_spec_object ("border-pixbuf", _("Border Pixbuf"), _("The pixbuf to use to draw the border"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); } /* This initializes the common grid data. */ static void goo_canvas_grid_init_data (GooCanvasGridData *grid_data) { grid_data->x = 0.0; grid_data->y = 0.0; grid_data->width = 0.0; grid_data->height = 0.0; grid_data->x_step = 10.0; grid_data->y_step = 10.0; grid_data->x_offset = 0.0; grid_data->y_offset = 0.0; grid_data->horz_grid_line_width = -1.0; grid_data->vert_grid_line_width = -1.0; grid_data->horz_grid_line_pattern = NULL; grid_data->vert_grid_line_pattern = NULL; grid_data->border_width = -1.0; grid_data->border_pattern = NULL; grid_data->show_horz_grid_lines = TRUE; grid_data->show_vert_grid_lines = TRUE; grid_data->vert_grid_lines_on_top = FALSE; } /* This frees the contents of the grid data, but not the struct itself. */ static void goo_canvas_grid_free_data (GooCanvasGridData *grid_data) { } static void goo_canvas_grid_init (GooCanvasGrid *grid) { grid->grid_data = g_slice_new0 (GooCanvasGridData); goo_canvas_grid_init_data (grid->grid_data); } /** * goo_canvas_grid_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the grid. * @y: the y coordinate of the top of the grid. * @width: the width of the grid. * @height: the height of the grid. * @x_step: the distance between the vertical grid lines. * @y_step: the distance between the horizontal grid lines. * @x_offset: the distance before the first vertical grid line. * @y_offset: the distance before the first horizontal grid line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new grid item. * * * * Here's an example showing how to create a grid: * * * GooCanvasItem *grid = goo_canvas_grid_new (mygroup, 100.0, 100.0, 400.0, 200.0, * 20.0, 20.0, 10.0, 10.0, * "horz-grid-line-width", 4.0, * "horz-grid-line-color", "yellow", * "vert-grid-line-width", 2.0, * "vert-grid-line-color", "red", * "border-width", 3.0, * "border-color", "white", * "fill-color", "blue", * NULL); * * * Returns: a new grid item. **/ GooCanvasItem* goo_canvas_grid_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...) { GooCanvasItem *item; GooCanvasGrid *grid; GooCanvasGridData *grid_data; va_list var_args; const char *first_property; item = g_object_new (GOO_TYPE_CANVAS_GRID, NULL); grid = (GooCanvasGrid*) item; grid_data = grid->grid_data; grid_data->x = x; grid_data->y = y; grid_data->width = width; grid_data->height = height; grid_data->x_step = x_step; grid_data->y_step = y_step; grid_data->x_offset = x_offset; grid_data->y_offset = y_offset; va_start (var_args, y_offset); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (item), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_grid_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasGrid *grid = (GooCanvasGrid*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { goo_canvas_grid_free_data (grid->grid_data); g_slice_free (GooCanvasGridData, grid->grid_data); } grid->grid_data = NULL; G_OBJECT_CLASS (goo_canvas_grid_parent_class)->finalize (object); } static void goo_canvas_grid_get_common_property (GObject *object, GooCanvasGridData *grid_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, grid_data->x); break; case PROP_Y: g_value_set_double (value, grid_data->y); break; case PROP_WIDTH: g_value_set_double (value, grid_data->width); break; case PROP_HEIGHT: g_value_set_double (value, grid_data->height); break; case PROP_X_STEP: g_value_set_double (value, grid_data->x_step); break; case PROP_Y_STEP: g_value_set_double (value, grid_data->y_step); break; case PROP_X_OFFSET: g_value_set_double (value, grid_data->x_offset); break; case PROP_Y_OFFSET: g_value_set_double (value, grid_data->y_offset); break; case PROP_HORZ_GRID_LINE_WIDTH: g_value_set_double (value, grid_data->horz_grid_line_width); break; case PROP_VERT_GRID_LINE_WIDTH: g_value_set_double (value, grid_data->vert_grid_line_width); break; case PROP_HORZ_GRID_LINE_PATTERN: g_value_set_boxed (value, grid_data->horz_grid_line_pattern); break; case PROP_VERT_GRID_LINE_PATTERN: g_value_set_boxed (value, grid_data->vert_grid_line_pattern); break; case PROP_BORDER_WIDTH: g_value_set_double (value, grid_data->border_width); break; case PROP_BORDER_PATTERN: g_value_set_boxed (value, grid_data->border_pattern); break; case PROP_SHOW_HORZ_GRID_LINES: g_value_set_boolean (value, grid_data->show_horz_grid_lines); break; case PROP_SHOW_VERT_GRID_LINES: g_value_set_boolean (value, grid_data->show_vert_grid_lines); break; case PROP_VERT_GRID_LINES_ON_TOP: g_value_set_boolean (value, grid_data->vert_grid_lines_on_top); break; /* Convenience properties. */ case PROP_HORZ_GRID_LINE_COLOR_RGBA: goo_canvas_get_rgba_value_from_pattern (grid_data->horz_grid_line_pattern, value); break; case PROP_VERT_GRID_LINE_COLOR_RGBA: goo_canvas_get_rgba_value_from_pattern (grid_data->vert_grid_line_pattern, value); break; case PROP_BORDER_COLOR_RGBA: goo_canvas_get_rgba_value_from_pattern (grid_data->border_pattern, value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_grid_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGrid *grid = (GooCanvasGrid*) object; goo_canvas_grid_get_common_property (object, grid->grid_data, prop_id, value, pspec); } static void goo_canvas_grid_set_common_property (GObject *object, GooCanvasGridData *grid_data, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: grid_data->x = g_value_get_double (value); break; case PROP_Y: grid_data->y = g_value_get_double (value); break; case PROP_WIDTH: grid_data->width = g_value_get_double (value); break; case PROP_HEIGHT: grid_data->height = g_value_get_double (value); break; case PROP_X_STEP: grid_data->x_step = g_value_get_double (value); break; case PROP_Y_STEP: grid_data->y_step = g_value_get_double (value); break; case PROP_X_OFFSET: grid_data->x_offset = g_value_get_double (value); break; case PROP_Y_OFFSET: grid_data->y_offset = g_value_get_double (value); break; case PROP_HORZ_GRID_LINE_WIDTH: grid_data->horz_grid_line_width = g_value_get_double (value); break; case PROP_VERT_GRID_LINE_WIDTH: grid_data->vert_grid_line_width = g_value_get_double (value); break; case PROP_HORZ_GRID_LINE_PATTERN: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = g_value_get_boxed (value); cairo_pattern_reference (grid_data->horz_grid_line_pattern); break; case PROP_VERT_GRID_LINE_PATTERN: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = g_value_get_boxed (value); cairo_pattern_reference (grid_data->vert_grid_line_pattern); break; case PROP_BORDER_WIDTH: grid_data->border_width = g_value_get_double (value); break; case PROP_BORDER_PATTERN: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = g_value_get_boxed (value); cairo_pattern_reference (grid_data->border_pattern); break; case PROP_SHOW_HORZ_GRID_LINES: grid_data->show_horz_grid_lines = g_value_get_boolean (value); break; case PROP_SHOW_VERT_GRID_LINES: grid_data->show_vert_grid_lines = g_value_get_boolean (value); break; case PROP_VERT_GRID_LINES_ON_TOP: grid_data->vert_grid_lines_on_top = g_value_get_boolean (value); break; /* Convenience properties. */ case PROP_HORZ_GRID_LINE_COLOR: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = goo_canvas_create_pattern_from_color_value (value); break; case PROP_HORZ_GRID_LINE_COLOR_RGBA: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = goo_canvas_create_pattern_from_rgba_value (value); break; case PROP_HORZ_GRID_LINE_PIXBUF: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = goo_canvas_create_pattern_from_pixbuf_value (value); break; case PROP_VERT_GRID_LINE_COLOR: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = goo_canvas_create_pattern_from_color_value (value); break; case PROP_VERT_GRID_LINE_COLOR_RGBA: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = goo_canvas_create_pattern_from_rgba_value (value); break; case PROP_VERT_GRID_LINE_PIXBUF: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = goo_canvas_create_pattern_from_pixbuf_value (value); break; case PROP_BORDER_COLOR: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = goo_canvas_create_pattern_from_color_value (value); break; case PROP_BORDER_COLOR_RGBA: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = goo_canvas_create_pattern_from_rgba_value (value); break; case PROP_BORDER_PIXBUF: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = goo_canvas_create_pattern_from_pixbuf_value (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_grid_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasGrid *grid = (GooCanvasGrid*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_grid_set_common_property (object, grid->grid_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_grid_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; gdouble border_width = 0.0; /* We can quickly compute the bounds as being just the grid's size plus the border width around each edge. */ if (grid_data->border_width > 0.0) border_width = grid_data->border_width; simple->bounds.x1 = grid_data->x - border_width; simple->bounds.y1 = grid_data->y - border_width; simple->bounds.x2 = grid_data->x + grid_data->width + border_width; simple->bounds.y2 = grid_data->y + grid_data->height + border_width; } static gdouble calculate_start_position (gdouble start_pos, gdouble step, gdouble redraw_start_pos, gdouble line_width) { gdouble n = 0.0, result; /* We want the first position where pos + line_width/2 >= redraw_start_pos. i.e. start_pos + (n * step) + (line_width / 2) >= redraw_start_pos, or (n * step) >= redraw_start_pos - start_pos - (line_width / 2), or n >= (redraw_start_pos - start_pos - (line_width / 2) / step). */ if (step > 0.0) n = ceil (((redraw_start_pos - start_pos - (line_width / 2.0))) / step); if (n <= 0.0) result = start_pos; else result = start_pos + (n * step); return result; } static void paint_vertical_lines (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; double x, max_x, max_y, max_bounds_x, line_width; gboolean has_stroke; if (!grid_data->show_vert_grid_lines) return; max_x = grid_data->x + grid_data->width; max_y = grid_data->y + grid_data->height; has_stroke = goo_canvas_style_set_stroke_options (simple_data->style, cr); line_width = goo_canvas_item_simple_get_line_width (simple); /* If the grid's vertical grid line pattern/color has been set, use that. If not, and we don't have a stroke color just return. */ if (grid_data->vert_grid_line_pattern) cairo_set_source (cr, grid_data->vert_grid_line_pattern); else if (!has_stroke) return; /* If the grid's vertical grid line width has been set, use that. */ if (grid_data->vert_grid_line_width > 0.0) { line_width = grid_data->vert_grid_line_width; cairo_set_line_width (cr, line_width); } cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); /* Calculate the first grid line that intersects the bounds to redraw. */ x = calculate_start_position (grid_data->x + grid_data->x_offset, grid_data->x_step, bounds->x1, line_width); /* Calculate the last possible line position. */ max_bounds_x = bounds->x2 + (line_width / 2.0); max_x = MIN (max_x, max_bounds_x); /* Add on a tiny fraction of step to avoid any double comparison issues. */ max_x += grid_data->x_step * 0.00001; while (x <= max_x) { cairo_move_to (cr, x, grid_data->y); cairo_line_to (cr, x, max_y); cairo_stroke (cr); /* Avoid an infinite loop. */ if (grid_data->x_step <= 0.0) break; x += grid_data->x_step; } } static void paint_horizontal_lines (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; double y, max_x, max_y, max_bounds_y, line_width; gboolean has_stroke; if (!grid_data->show_horz_grid_lines) return; max_x = grid_data->x + grid_data->width; max_y = grid_data->y + grid_data->height; has_stroke = goo_canvas_style_set_stroke_options (simple_data->style, cr); line_width = goo_canvas_item_simple_get_line_width (simple); /* If the grid's horizontal grid line pattern/color has been set, use that. If not, and we don't have a stroke color just return. */ if (grid_data->horz_grid_line_pattern) cairo_set_source (cr, grid_data->horz_grid_line_pattern); else if (!has_stroke) return; /* If the grid's horizontal grid line width has been set, use that. */ if (grid_data->horz_grid_line_width > 0.0) { line_width = grid_data->horz_grid_line_width; cairo_set_line_width (cr, grid_data->horz_grid_line_width); } cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); /* Calculate the first grid line that intersects the bounds to redraw. */ y = calculate_start_position (grid_data->y + grid_data->y_offset, grid_data->y_step, bounds->y1, line_width); /* Calculate the last possible line position. */ max_bounds_y = bounds->y2 + (line_width / 2.0); max_y = MIN (max_y, max_bounds_y); /* Add on a tiny fraction of step to avoid any double comparison issues. */ max_y += grid_data->y_step * 0.00001; while (y <= max_y) { cairo_move_to (cr, grid_data->x, y); cairo_line_to (cr, max_x, y); cairo_stroke (cr); /* Avoid an infinite loop. */ if (grid_data->y_step <= 0.0) break; y += grid_data->y_step; } } static void goo_canvas_grid_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; GooCanvasBounds redraw_bounds = *bounds; gdouble half_border_width; /* Paint the background in the fill pattern/color, if one is set. */ if (goo_canvas_style_set_fill_options (simple_data->style, cr)) { cairo_rectangle (cr, grid_data->x, grid_data->y, grid_data->width, grid_data->height); cairo_fill (cr); } /* Clip to the grid's area while painting the grid lines. */ cairo_save (cr); cairo_rectangle (cr, grid_data->x, grid_data->y, grid_data->width, grid_data->height); cairo_clip (cr); /* Convert the bounds to be redrawn from device space to item space. */ goo_canvas_convert_bounds_to_item_space (simple->canvas, (GooCanvasItem*) simple, &redraw_bounds); /* Paint the grid lines, in the required order. */ if (grid_data->vert_grid_lines_on_top) { paint_horizontal_lines (simple, cr, &redraw_bounds); paint_vertical_lines (simple, cr, &redraw_bounds); } else { paint_vertical_lines (simple, cr, &redraw_bounds); paint_horizontal_lines (simple, cr, &redraw_bounds); } cairo_restore (cr); /* Paint the border. */ if (grid_data->border_width > 0) { if (grid_data->border_pattern) cairo_set_source (cr, grid_data->border_pattern); else goo_canvas_style_set_stroke_options (simple_data->style, cr); cairo_set_line_width (cr, grid_data->border_width); half_border_width = grid_data->border_width / 2.0; cairo_rectangle (cr, grid_data->x - half_border_width, grid_data->y - half_border_width, grid_data->width + grid_data->border_width, grid_data->height + grid_data->border_width); cairo_stroke (cr); } } static void goo_canvas_grid_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGrid *grid = (GooCanvasGrid*) item; GooCanvasGridModel *gmodel = (GooCanvasGridModel*) model; /* If our grid_data was allocated, free it. */ if (!simple->model) { goo_canvas_grid_free_data (grid->grid_data); g_slice_free (GooCanvasGridData, grid->grid_data); } /* Now use the new model's grid_data instead. */ grid->grid_data = &gmodel->grid_data; /* Let the parent class do the rest. */ goo_canvas_grid_parent_iface->set_model (item, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_grid_set_model; } static void goo_canvas_grid_class_init (GooCanvasGridClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; goo_canvas_grid_parent_iface = g_type_interface_peek (goo_canvas_grid_parent_class, GOO_TYPE_CANVAS_ITEM); gobject_class->finalize = goo_canvas_grid_finalize; gobject_class->get_property = goo_canvas_grid_get_property; gobject_class->set_property = goo_canvas_grid_set_property; simple_class->simple_update = goo_canvas_grid_update; simple_class->simple_paint = goo_canvas_grid_paint; goo_canvas_grid_install_common_properties (gobject_class); } /** * SECTION:goocanvasgridmodel * @Title: GooCanvasGridModel * @Short_Description: a model for grid items. * * GooCanvasGridModel represents a model for grid items. * A grid consists of a number of equally-spaced horizontal and vertical * grid lines, plus an optional border. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasGridModel use goo_canvas_grid_model_new(). * * To get or set the properties of an existing #GooCanvasGridModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the grid you must connect * to the signal handlers of the corresponding #GooCanvasGrid objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) * * The grid's position and size is specified with the #GooCanvasGridModel:x, * #GooCanvasGridModel:y, #GooCanvasGridModel:width and * #GooCanvasGridModel:height properties. * * The #GooCanvasGridModel:x-step and #GooCanvasGridModel:y-step properties * specify the distance between grid lines. The #GooCanvasGridModel:x-offset * and #GooCanvasGridModel:y-offset properties specify the distance before the * first grid lines. * * The horizontal or vertical grid lines can be hidden using the * #GooCanvasGridModel:show-horz-grid-lines and * #GooCanvasGridModel:show-vert-grid-lines properties. * * The width of the border can be set using the #GooCanvasGridModel:border-width * property. The border is drawn outside the area specified with the * #GooCanvasGridModel:x, #GooCanvasGridModel:y, #GooCanvasGridModel:width and * #GooCanvasGridModel:height properties. * * Other properties allow the colors and widths of the grid lines to be set. * The grid line color and width properties override the standard * #GooCanvasItemModelSimple:stroke-color and * #GooCanvasItemModelSimple:line-width properties, enabling different styles * for horizontal and vertical grid lines. */ GooCanvasItemModelIface *goo_canvas_grid_model_parent_iface; static void item_model_interface_init (GooCanvasItemModelIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasGridModel, goo_canvas_grid_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_grid_model_init (GooCanvasGridModel *gmodel) { goo_canvas_grid_init_data (&gmodel->grid_data); } /** * goo_canvas_grid_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the grid. * @y: the y coordinate of the top of the grid. * @width: the width of the grid. * @height: the height of the grid. * @x_step: the distance between the vertical grid lines. * @y_step: the distance between the horizontal grid lines. * @x_offset: the distance before the first vertical grid line. * @y_offset: the distance before the first horizontal grid line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new grid model. * * * * Here's an example showing how to create a grid: * * * GooCanvasItemModel *grid = goo_canvas_grid_model_new (mygroup, 100.0, 100.0, 400.0, 200.0, * 20.0, 20.0, 10.0, 10.0, * "horz-grid-line-width", 4.0, * "horz-grid-line-color", "yellow", * "vert-grid-line-width", 2.0, * "vert-grid-line-color", "red", * "border-width", 3.0, * "border-color", "white", * "fill-color", "blue", * NULL); * * * Returns: a new grid model. **/ GooCanvasItemModel* goo_canvas_grid_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...) { GooCanvasItemModel *model; GooCanvasGridModel *gmodel; GooCanvasGridData *grid_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_GRID_MODEL, NULL); gmodel = (GooCanvasGridModel*) model; grid_data = &gmodel->grid_data; grid_data->x = x; grid_data->y = y; grid_data->width = width; grid_data->height = height; grid_data->x_step = x_step; grid_data->y_step = y_step; grid_data->x_offset = x_offset; grid_data->y_offset = y_offset; va_start (var_args, y_offset); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_grid_model_finalize (GObject *object) { GooCanvasGridModel *gmodel = (GooCanvasGridModel*) object; goo_canvas_grid_free_data (&gmodel->grid_data); G_OBJECT_CLASS (goo_canvas_grid_model_parent_class)->finalize (object); } static void goo_canvas_grid_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGridModel *gmodel = (GooCanvasGridModel*) object; goo_canvas_grid_get_common_property (object, &gmodel->grid_data, prop_id, value, pspec); } static void goo_canvas_grid_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasGridModel *gmodel = (GooCanvasGridModel*) object; goo_canvas_grid_set_common_property (object, &gmodel->grid_data, prop_id, value, pspec); g_signal_emit_by_name (gmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_grid_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_GRID, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_grid_model_create_item; } static void goo_canvas_grid_model_class_init (GooCanvasGridModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; goo_canvas_grid_model_parent_iface = g_type_interface_peek (goo_canvas_grid_model_parent_class, GOO_TYPE_CANVAS_ITEM_MODEL); gobject_class->finalize = goo_canvas_grid_model_finalize; gobject_class->get_property = goo_canvas_grid_model_get_property; gobject_class->set_property = goo_canvas_grid_model_set_property; goo_canvas_grid_install_common_properties (gobject_class); } goocanvas-1.0.0/src/goocanvasellipse.c0000644000076400007640000004553611412723611014725 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasellipse.c - ellipse item. */ /** * SECTION:goocanvasellipse * @Title: GooCanvasEllipse * @Short_Description: an ellipse item. * * GooCanvasEllipse represents an ellipse item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasEllipse use goo_canvas_ellipse_new(). * * To get or set the properties of an existing #GooCanvasEllipse, use * g_object_get() and g_object_set(). * * The ellipse can be specified either with the "center-x", "center-y", * "radius-x" and "radius-y" properties, or with the "x", "y", "width" and * "height" properties. */ #include #include #include #include #include "goocanvasellipse.h" enum { PROP_0, PROP_CENTER_X, PROP_CENTER_Y, PROP_RADIUS_X, PROP_RADIUS_Y, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_ellipse_finalize (GObject *object); static void goo_canvas_ellipse_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_ellipse_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_ellipse_create_path (GooCanvasItemSimple *simple, cairo_t *cr); G_DEFINE_TYPE_WITH_CODE (GooCanvasEllipse, goo_canvas_ellipse, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_ellipse_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_CENTER_X, g_param_spec_double ("center-x", _("Center X"), _("The x coordinate of the center of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CENTER_Y, g_param_spec_double ("center-y", _("Center Y"), _("The y coordinate of the center of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_X, g_param_spec_double ("radius-x", _("Radius X"), _("The horizontal radius of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_Y, g_param_spec_double ("radius-y", _("Radius Y"), _("The vertical radius of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the left side of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the top of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_ellipse_class_init (GooCanvasEllipseClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_ellipse_finalize; gobject_class->get_property = goo_canvas_ellipse_get_property; gobject_class->set_property = goo_canvas_ellipse_set_property; simple_class->simple_create_path = goo_canvas_ellipse_create_path; goo_canvas_ellipse_install_common_properties (gobject_class); } static void goo_canvas_ellipse_init (GooCanvasEllipse *ellipse) { ellipse->ellipse_data = g_slice_new0 (GooCanvasEllipseData); } /** * goo_canvas_ellipse_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @center_x: the x coordinate of the center of the ellipse. * @center_y: the y coordinate of the center of the ellipse. * @radius_x: the horizontal radius of the ellipse. * @radius_y: the vertical radius of the ellipse. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new ellipse item. * * * * Here's an example showing how to create an ellipse centered at (100.0, * 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. * It is drawn with a red outline with a width of 5.0 and filled with blue: * * * GooCanvasItem *ellipse = goo_canvas_ellipse_new (mygroup, 100.0, 100.0, 50.0, 30.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new ellipse item. **/ GooCanvasItem* goo_canvas_ellipse_new (GooCanvasItem *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...) { GooCanvasItem *item; GooCanvasEllipse *ellipse; GooCanvasEllipseData *ellipse_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_ELLIPSE, NULL); ellipse = (GooCanvasEllipse*) item; ellipse_data = ellipse->ellipse_data; ellipse_data->center_x = center_x; ellipse_data->center_y = center_y; ellipse_data->radius_x = radius_x; ellipse_data->radius_y = radius_y; va_start (var_args, radius_y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_ellipse_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasEllipse *ellipse = (GooCanvasEllipse*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) g_slice_free (GooCanvasEllipseData, ellipse->ellipse_data); ellipse->ellipse_data = NULL; G_OBJECT_CLASS (goo_canvas_ellipse_parent_class)->finalize (object); } static void goo_canvas_ellipse_get_common_property (GObject *object, GooCanvasEllipseData *ellipse_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_CENTER_X: g_value_set_double (value, ellipse_data->center_x); break; case PROP_CENTER_Y: g_value_set_double (value, ellipse_data->center_y); break; case PROP_RADIUS_X: g_value_set_double (value, ellipse_data->radius_x); break; case PROP_RADIUS_Y: g_value_set_double (value, ellipse_data->radius_y); break; case PROP_X: g_value_set_double (value, ellipse_data->center_x - ellipse_data->radius_x); break; case PROP_Y: g_value_set_double (value, ellipse_data->center_y - ellipse_data->radius_y); break; case PROP_WIDTH: g_value_set_double (value, 2.0 * ellipse_data->radius_x); break; case PROP_HEIGHT: g_value_set_double (value, 2.0 * ellipse_data->radius_y); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_ellipse_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasEllipse *ellipse = (GooCanvasEllipse*) object; goo_canvas_ellipse_get_common_property (object, ellipse->ellipse_data, prop_id, value, pspec); } static void goo_canvas_ellipse_set_common_property (GObject *object, GooCanvasEllipseData *ellipse_data, guint prop_id, const GValue *value, GParamSpec *pspec) { gdouble x, y; switch (prop_id) { case PROP_CENTER_X: ellipse_data->center_x = g_value_get_double (value); g_object_notify (object, "x"); break; case PROP_CENTER_Y: ellipse_data->center_y = g_value_get_double (value); g_object_notify (object, "y"); break; case PROP_RADIUS_X: ellipse_data->radius_x = g_value_get_double (value); g_object_notify (object, "width"); break; case PROP_RADIUS_Y: ellipse_data->radius_y = g_value_get_double (value); g_object_notify (object, "height"); break; case PROP_X: ellipse_data->center_x = g_value_get_double (value) + ellipse_data->radius_x; g_object_notify (object, "center-x"); break; case PROP_Y: ellipse_data->center_y = g_value_get_double (value) + ellipse_data->radius_y; g_object_notify (object, "center-y"); break; case PROP_WIDTH: /* Calculate the current x coordinate. */ x = ellipse_data->center_x - ellipse_data->radius_x; /* Calculate the new radius_x, which is half the width. */ ellipse_data->radius_x = g_value_get_double (value) / 2.0; /* Now calculate the new center_x. */ ellipse_data->center_x = x + ellipse_data->radius_x; g_object_notify (object, "center-x"); g_object_notify (object, "radius-x"); break; case PROP_HEIGHT: /* Calculate the current y coordinate. */ y = ellipse_data->center_y - ellipse_data->radius_y; /* Calculate the new radius_y, which is half the height. */ ellipse_data->radius_y = g_value_get_double (value) / 2.0; /* Now calculate the new center_y. */ ellipse_data->center_y = y + ellipse_data->radius_y; g_object_notify (object, "center-y"); g_object_notify (object, "radius-y"); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_ellipse_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasEllipse *ellipse = (GooCanvasEllipse*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_ellipse_set_common_property (object, ellipse->ellipse_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_ellipse_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasEllipse *ellipse = (GooCanvasEllipse*) simple; GooCanvasEllipseData *ellipse_data = ellipse->ellipse_data; cairo_new_path (cr); cairo_save (cr); cairo_translate (cr, ellipse_data->center_x, ellipse_data->center_y); cairo_scale (cr, ellipse_data->radius_x, ellipse_data->radius_y); cairo_arc (cr, 0.0, 0.0, 1.0, 0.0, 2.0 * M_PI); cairo_restore (cr); } static void goo_canvas_ellipse_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasEllipse *ellipse = (GooCanvasEllipse*) item; GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) model; /* If our ellipse_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasEllipseData, ellipse->ellipse_data); /* Now use the new model's ellipse_data instead. */ ellipse->ellipse_data = &emodel->ellipse_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_ellipse_set_model; } /** * SECTION:goocanvasellipsemodel * @Title: GooCanvasEllipseModel * @Short_Description: a model for ellipse items. * * GooCanvasEllipseModel represents a model for ellipse items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasEllipseModel use goo_canvas_ellipse_model_new(). * * To get or set the properties of an existing #GooCanvasEllipseModel, use * g_object_get() and g_object_set(). * * The ellipse can be specified either with the "center-x", "center-y", * "radius-x" and "radius-y" properties, or with the "x", "y", "width" and * "height" properties. * * To respond to events such as mouse clicks on the ellipse you must connect * to the signal handlers of the corresponding #GooCanvasEllipse objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_ellipse_model_finalize (GObject *object); static void goo_canvas_ellipse_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_ellipse_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasEllipseModel, goo_canvas_ellipse_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_ellipse_model_class_init (GooCanvasEllipseModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->finalize = goo_canvas_ellipse_model_finalize; gobject_class->get_property = goo_canvas_ellipse_model_get_property; gobject_class->set_property = goo_canvas_ellipse_model_set_property; goo_canvas_ellipse_install_common_properties (gobject_class); } static void goo_canvas_ellipse_model_init (GooCanvasEllipseModel *emodel) { } /** * goo_canvas_ellipse_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @center_x: the x coordinate of the center of the ellipse. * @center_y: the y coordinate of the center of the ellipse. * @radius_x: the horizontal radius of the ellipse. * @radius_y: the vertical radius of the ellipse. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new ellipse model. * * * * Here's an example showing how to create an ellipse centered at (100.0, * 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. * It is drawn with a red outline with a width of 5.0 and filled with blue: * * * GooCanvasItemModel *ellipse = goo_canvas_ellipse_model_new (mygroup, 100.0, 100.0, 50.0, 30.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new ellipse model. **/ GooCanvasItemModel* goo_canvas_ellipse_model_new (GooCanvasItemModel *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...) { GooCanvasItemModel *model; GooCanvasEllipseModel *emodel; GooCanvasEllipseData *ellipse_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_ELLIPSE_MODEL, NULL); emodel = (GooCanvasEllipseModel*) model; ellipse_data = &emodel->ellipse_data; ellipse_data->center_x = center_x; ellipse_data->center_y = center_y; ellipse_data->radius_x = radius_x; ellipse_data->radius_y = radius_y; va_start (var_args, radius_y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_ellipse_model_finalize (GObject *object) { /*GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) object;*/ G_OBJECT_CLASS (goo_canvas_ellipse_model_parent_class)->finalize (object); } static void goo_canvas_ellipse_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) object; goo_canvas_ellipse_get_common_property (object, &emodel->ellipse_data, prop_id, value, pspec); } static void goo_canvas_ellipse_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) object; goo_canvas_ellipse_set_common_property (object, &emodel->ellipse_data, prop_id, value, pspec); g_signal_emit_by_name (emodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_ellipse_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_ELLIPSE, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_ellipse_model_create_item; } goocanvas-1.0.0/src/Makefile.am0000644000076400007640000001120411412723611013240 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -DG_LOG_DOMAIN=\"GooCanvas\" \ @PACKAGE_CFLAGS@ # -DG_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED \ # -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED \ # -DGTK_DISABLE_DEPRECATED lib_LTLIBRARIES = libgoocanvas.la libgoocanvas_la_LIBADD = @PACKAGE_LIBS@ $(INTLLIBS) if PLATFORM_WIN32 no_undefined = -no-undefined endif libtool_opts = \ -version-info $(LT_VERSION_INFO) \ -export-dynamic $(no_undefined) \ -rpath $(libdir) libgoocanvas_la_LDFLAGS = $(libtool_opts) libgoocanvasincludedir = $(includedir)/goocanvas-1.0 libgoocanvas_public_headers = \ goocanvasellipse.h \ goocanvasgrid.h \ goocanvasgroup.h \ goocanvasimage.h \ goocanvasitem.h \ goocanvasitemmodel.h \ goocanvasitemsimple.h \ goocanvaspolyline.h \ goocanvaspath.h \ goocanvasrect.h \ goocanvasstyle.h \ goocanvastable.h \ goocanvastext.h \ goocanvasutils.h \ goocanvaswidget.h \ goocanvas.h libgoocanvas_la_SOURCES = \ goocanvasatk.h \ goocanvasatk.c \ goocanvasellipse.c \ goocanvasenumtypes.c \ goocanvasgrid.c \ goocanvasgroup.c \ goocanvasimage.c \ goocanvasitem.c \ goocanvasitemmodel.c \ goocanvasitemsimple.c \ goocanvasmarshal.c \ goocanvaspolyline.c \ goocanvaspath.c \ goocanvasprivate.h \ goocanvasrect.c \ goocanvasstyle.c \ goocanvastable.c \ goocanvastext.c \ goocanvasutils.c \ goocanvaswidget.c \ goocanvas.c libgoocanvas_extra_sources = \ goocanvasmarshal.list libgoocanvas_built_headers = \ goocanvasenumtypes.h \ goocanvasmarshal.h libgoocanvas_built_sources = \ goocanvasenumtypes.c \ goocanvasmarshal.c stamp_files = \ stamp-goocanvasmarshal.h \ stamp-goocanvasenumtypes.h libgoocanvasinclude_HEADERS = \ $(libgoocanvas_public_headers) \ $(libgoocanvas_built_headers) # # Most of the stuff below has been pinched from the GTK+ Makefile.am, as # it is tricky to get right and we know it works for GTK+. # # all autogenerated files need to be generated in the srcdir, # so old versions get remade and are not confused with newer # versions in the build dir. thus a development setup requires # srcdir to be writable, passing --disable-rebuilds to # ../configure will supress all autogeneration rules. goocanvasmarshal.h: stamp-goocanvasmarshal.h @true stamp-goocanvasmarshal.h: @REBUILD@ goocanvasmarshal.list $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --header >> xgen-gmlh \ && (cmp -s xgen-gmlh goocanvasmarshal.h || cp xgen-gmlh goocanvasmarshal.h) \ && rm -f xgen-gmlh \ && echo timestamp > $(@F) goocanvasmarshal.c: @REBUILD@ goocanvasmarshal.list (echo "#include \"goocanvasmarshal.h\""; \ $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --body) >> xgen-gmlc \ && cp xgen-gmlc goocanvasmarshal.c \ && rm -f xgen-gmlc goocanvasenumtypes.h: stamp-goocanvasenumtypes.h @true stamp-goocanvasenumtypes.h: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#ifndef __GOO_CANVAS_ENUM_TYPES_H__\n#define __GOO_CANVAS_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* Enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void);\n#define GOO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n\n\n" \ --ftail "G_END_DECLS\n\n#endif /* __GOO_CANVAS_ENUM_TYPES_H__ */" \ $(libgoocanvas_public_headers)) >> xgen-gtbh \ && (cmp -s xgen-gtbh goocanvasenumtypes.h || cp xgen-gtbh goocanvasenumtypes.h ) \ && rm -f xgen-gtbh \ && echo timestamp > $(@F) goocanvasenumtypes.c: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#include \n" \ --fhead "#include \"goocanvas.h\"\n" \ --fprod "\n/* Enumerations from \"@filename@\" */" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if( etype == 0 ) \n {\n static const G@Type@Value values[] = {" \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values );\n }\n return etype;\n}\n" \ $(libgoocanvas_public_headers)) > xgen-gtbc \ && cp xgen-gtbc goocanvasenumtypes.c \ && rm -f xgen-gtbc gen_sources = xgen-gdef xgen-gtbh xgen-gtic xgen-gmh xgen-gmc xgen-gmlh xgen-gmlc CLEANFILES = $(gen_sources) BUILT_SOURCES = $(libgoocanvas_built_headers) $(libgoocanvas_built_sources) MAINTAINERCLEANFILES = $(BUILT_SOURCES) $(stamp_files) EXTRA_DIST = $(BUILT_SOURCES) $(libgoocanvas_extra_sources) goocanvas-1.0.0/src/goocanvasutils.h0000644000076400007640000002624711412723611014433 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasutils.h - utility functions. */ #ifndef __GOO_CANVAS_UTILS_H__ #define __GOO_CANVAS_UTILS_H__ #include G_BEGIN_DECLS /* * Enum types. */ /** * GooCanvasPointerEvents * @GOO_CANVAS_EVENTS_VISIBLE_MASK: a mask indicating that the item only * receives events when it is visible. * @GOO_CANVAS_EVENTS_PAINTED_MASK: a mask indicating that the item only * receives events when the specified parts of it are painted. * @GOO_CANVAS_EVENTS_FILL_MASK: a mask indicating that the filled part of * the item receives events. * @GOO_CANVAS_EVENTS_STROKE_MASK: a mask indicating that the stroked part * of the item receives events. * @GOO_CANVAS_EVENTS_NONE: the item doesn't receive events at all. * @GOO_CANVAS_EVENTS_VISIBLE_PAINTED: the item receives events in its * painted areas when it is visible (the default). * @GOO_CANVAS_EVENTS_VISIBLE_FILL: the item's interior receives events * when it is visible. * @GOO_CANVAS_EVENTS_VISIBLE_STROKE: the item's perimeter receives * events when it is visible. * @GOO_CANVAS_EVENTS_VISIBLE: the item receives events when it is visible, * whether it is painted or not. * @GOO_CANVAS_EVENTS_PAINTED: the item receives events in its painted areas, * whether it is visible or not. * @GOO_CANVAS_EVENTS_FILL: the item's interior receives events, whether it * is visible or painted or not. * @GOO_CANVAS_EVENTS_STROKE: the item's perimeter receives events, whether * it is visible or painted or not. * @GOO_CANVAS_EVENTS_ALL: the item's perimeter and interior receive events, * whether it is visible or painted or not. * * Specifies when an item receives pointer events such as mouse clicks. */ typedef enum { GOO_CANVAS_EVENTS_VISIBLE_MASK = 1 << 0, GOO_CANVAS_EVENTS_PAINTED_MASK = 1 << 1, GOO_CANVAS_EVENTS_FILL_MASK = 1 << 2, GOO_CANVAS_EVENTS_STROKE_MASK = 1 << 3, GOO_CANVAS_EVENTS_NONE = 0, GOO_CANVAS_EVENTS_VISIBLE_PAINTED = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_VISIBLE_FILL = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK, GOO_CANVAS_EVENTS_VISIBLE_STROKE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_VISIBLE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_PAINTED = GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_FILL = GOO_CANVAS_EVENTS_FILL_MASK, GOO_CANVAS_EVENTS_STROKE = GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_ALL = GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK } GooCanvasPointerEvents; /** * GooCanvasItemVisibility * @GOO_CANVAS_ITEM_HIDDEN: the item is invisible, and is not allocated any * space in layout container items such as #GooCanvasTable. * @GOO_CANVAS_ITEM_INVISIBLE: the item is invisible, but it is still allocated * space in layout container items. * @GOO_CANVAS_ITEM_VISIBLE: the item is visible. * @GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD: the item is visible when the * canvas scale setting is greater than or equal to the item's visibility * threshold setting. * * The #GooCanvasItemVisibility enumeration is used to specify when a canvas * item is visible. */ /* NOTE: Values are important here, as we test for <= GOO_CANVAS_ITEM_INVISIBLE to check if an item is invisible or hidden. */ typedef enum { GOO_CANVAS_ITEM_HIDDEN = 0, GOO_CANVAS_ITEM_INVISIBLE = 1, GOO_CANVAS_ITEM_VISIBLE = 2, GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD = 3 } GooCanvasItemVisibility; /** * GooCanvasPathCommandType * @GOO_CANVAS_PATH_MOVE_TO: move to the given point. * @GOO_CANVAS_PATH_CLOSE_PATH: close the current path, drawing a line from the * current position to the start of the path. * @GOO_CANVAS_PATH_LINE_TO: draw a line to the given point. * @GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: draw a horizontal line to the given * x coordinate. * @GOO_CANVAS_PATH_VERTICAL_LINE_TO: draw a vertical line to the given y * coordinate. * @GOO_CANVAS_PATH_CURVE_TO: draw a bezier curve using two control * points to the given point. * @GOO_CANVAS_PATH_SMOOTH_CURVE_TO: draw a bezier curve using a reflection * of the last control point of the last curve as the first control point, * and one new control point, to the given point. * @GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve using * a single control point to the given point. * @GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve * using a reflection of the control point from the previous curve as the * control point, to the given point. * @GOO_CANVAS_PATH_ELLIPTICAL_ARC: draw an elliptical arc, using the given * 2 radii, the x axis rotation, and the 2 flags to disambiguate the arc, * to the given point. * * GooCanvasPathCommandType specifies the type of each command in the path. * See the path element in the * Scalable Vector Graphics (SVG) specification for more details. */ typedef enum { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ GOO_CANVAS_PATH_MOVE_TO, GOO_CANVAS_PATH_CLOSE_PATH, GOO_CANVAS_PATH_LINE_TO, GOO_CANVAS_PATH_HORIZONTAL_LINE_TO, GOO_CANVAS_PATH_VERTICAL_LINE_TO, /* Bezier curve commands: CcSsQqTt. */ GOO_CANVAS_PATH_CURVE_TO, GOO_CANVAS_PATH_SMOOTH_CURVE_TO, GOO_CANVAS_PATH_QUADRATIC_CURVE_TO, GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO, /* The elliptical arc commands: Aa. */ GOO_CANVAS_PATH_ELLIPTICAL_ARC } GooCanvasPathCommandType; typedef union _GooCanvasPathCommand GooCanvasPathCommand; /* Note that the command type is always the first element in each struct, so we can always use it whatever type of command it is. */ /** * GooCanvasPathCommand * * GooCanvasPathCommand holds the data for each command in the path. * * The @relative flag specifies that the coordinates for the command are * relative to the current point. Otherwise they are assumed to be absolute * coordinates. */ union _GooCanvasPathCommand { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; gdouble x, y; } simple; /* Bezier curve commands: CcSsQqTt. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; gdouble x, y, x1, y1, x2, y2; } curve; /* The elliptical arc commands: Aa. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; guint large_arc_flag : 1; guint sweep_flag : 1; gdouble rx, ry, x_axis_rotation, x, y; } arc; }; GArray* goo_canvas_parse_path_data (const gchar *path_data); void goo_canvas_create_path (GArray *commands, cairo_t *cr); /* * Cairo utilities. */ typedef struct _GooCanvasLineDash GooCanvasLineDash; /** * GooCanvasLineDash * @ref_count: the reference count of the struct. * @num_dashes: the number of dashes and gaps between them. * @dashes: the sizes of each dash and gap. * @dash_offset: the start offset into the dash pattern. * * #GooCanvasLineDash specifies a dash pattern to be used when drawing items. */ struct _GooCanvasLineDash { int ref_count; int num_dashes; double *dashes; double dash_offset; }; /* These are here so we can document the cairo type wrappers - don't use. */ #if 0 typedef cairo_antialias_t GooCairoAntialias; typedef cairo_fill_rule_t GooCairoFillRule; typedef cairo_hint_metrics_t GooCairoHintMetrics; typedef cairo_line_cap_t GooCairoLineCap; typedef cairo_line_join_t GooCairoLineJoin; typedef cairo_operator_t GooCairoOperator; typedef cairo_matrix_t GooCairoMatrix; typedef cairo_pattern_t GooCairoPattern; #endif /** * GooCairoAntialias * * #GooCairoAntialias is simply a wrapper for the #cairo_antialias_t type, * allowing it to be used for #GObject properties. * * See the #cairo_antialias_t documentation. */ /** * GooCairoFillRule * * #GooCairoFillRule is simply a wrapper for the #cairo_fill_rule_t type, * allowing it to be used for #GObject properties. * * See the #cairo_fill_rule_t documentation. */ /** * GooCairoHintMetrics * * #GooCairoHintMetrics is simply a wrapper for the #cairo_hint_metrics_t type, * allowing it to be used for #GObject properties. * * See the #cairo_hint_metrics_t documentation. */ /** * GooCairoLineCap * * #GooCairoLineCap is simply a wrapper for the #cairo_line_cap_t type, * allowing it to be used for #GObject properties. * * See the #cairo_line_cap_t documentation. */ /** * GooCairoLineJoin * * #GooCairoLineJoin is simply a wrapper for the #cairo_line_join_t type, * allowing it to be used for #GObject properties. * * See the #cairo_line_join_t documentation. */ /** * GooCairoOperator * * #GooCairoOperator is simply a wrapper for the #cairo_operator_t type, * allowing it to be used for #GObject properties. * * See the #cairo_operator_t documentation. */ /** * GooCairoMatrix * * #GooCairoMatrix is simply a wrapper for the #cairo_matrix_t type, * allowing it to be used for #GObject properties. * * See the #cairo_matrix_t documentation. */ /** * GooCairoPattern * * #GooCairoPattern is simply a wrapper for the #cairo_pattern_t type, * allowing it to be used for #GObject properties. * * See the #cairo_pattern_t documentation. */ #define GOO_TYPE_CANVAS_LINE_DASH (goo_canvas_line_dash_get_type ()) GType goo_canvas_line_dash_get_type (void) G_GNUC_CONST; GooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes, ...); GooCanvasLineDash* goo_canvas_line_dash_newv (gint num_dashes, double *dashes); GooCanvasLineDash* goo_canvas_line_dash_ref (GooCanvasLineDash *dash); void goo_canvas_line_dash_unref (GooCanvasLineDash *dash); #define GOO_TYPE_CAIRO_MATRIX (goo_cairo_matrix_get_type()) GType goo_cairo_matrix_get_type (void) G_GNUC_CONST; cairo_matrix_t* goo_cairo_matrix_copy (const cairo_matrix_t *matrix); void goo_cairo_matrix_free (cairo_matrix_t *matrix); #define GOO_TYPE_CAIRO_PATTERN (goo_cairo_pattern_get_type ()) GType goo_cairo_pattern_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_FILL_RULE (goo_cairo_fill_rule_get_type ()) GType goo_cairo_fill_rule_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_OPERATOR (goo_cairo_operator_get_type()) GType goo_cairo_operator_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_ANTIALIAS (goo_cairo_antialias_get_type()) GType goo_cairo_antialias_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_LINE_CAP (goo_cairo_line_cap_get_type ()) GType goo_cairo_line_cap_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_LINE_JOIN (goo_cairo_line_join_get_type ()) GType goo_cairo_line_join_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_HINT_METRICS (goo_cairo_hint_metrics_get_type ()) GType goo_cairo_hint_metrics_get_type (void) G_GNUC_CONST; G_END_DECLS #endif /* __GOO_CANVAS_UTILS_H__ */ goocanvas-1.0.0/src/goocanvastable.h0000644000076400007640000000775211412723611014362 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastable.h - table item. */ #ifndef __GOO_CANVAS_TABLE_H__ #define __GOO_CANVAS_TABLE_H__ #include #include "goocanvasgroup.h" G_BEGIN_DECLS typedef struct _GooCanvasTableDimension GooCanvasTableDimension; struct _GooCanvasTableDimension { gint size; gdouble default_spacing; /* These are specific spacings for particular rows or columns. A negative value indicates that the default should be used. */ gdouble *spacings; guint homogeneous : 1; }; /* This is the data used by both model and view classes. */ typedef struct _GooCanvasTableData GooCanvasTableData; typedef struct _GooCanvasTableLayoutData GooCanvasTableLayoutData; struct _GooCanvasTableData { /* The explicitly set width or height, or -1. */ gdouble width, height; /* One for rows & one for columns. */ GooCanvasTableDimension dimensions[2]; gdouble border_width; /* An array of GooCanvasTableChild. */ GArray *children; GooCanvasTableLayoutData *layout_data; }; #define GOO_TYPE_CANVAS_TABLE (goo_canvas_table_get_type ()) #define GOO_CANVAS_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TABLE, GooCanvasTable)) #define GOO_CANVAS_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TABLE, GooCanvasTableClass)) #define GOO_IS_CANVAS_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TABLE)) #define GOO_IS_CANVAS_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TABLE)) #define GOO_CANVAS_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TABLE, GooCanvasTableClass)) typedef struct _GooCanvasTable GooCanvasTable; typedef struct _GooCanvasTableClass GooCanvasTableClass; /** * GooCanvasTable * * The #GooCanvasTable-struct struct contains private data only. */ struct _GooCanvasTable { GooCanvasGroup parent; GooCanvasTableData *table_data; }; struct _GooCanvasTableClass { GooCanvasGroupClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_table_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_table_new (GooCanvasItem *parent, ...); #define GOO_TYPE_CANVAS_TABLE_MODEL (goo_canvas_table_model_get_type ()) #define GOO_CANVAS_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TABLE_MODEL, GooCanvasTableModel)) #define GOO_CANVAS_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TABLE_MODEL, GooCanvasTableModelClass)) #define GOO_IS_CANVAS_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TABLE_MODEL)) #define GOO_IS_CANVAS_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TABLE_MODEL)) #define GOO_CANVAS_TABLE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TABLE_MODEL, GooCanvasTableModelClass)) typedef struct _GooCanvasTableModel GooCanvasTableModel; typedef struct _GooCanvasTableModelClass GooCanvasTableModelClass; /** * GooCanvasTableModel * * The #GooCanvasTableModel-struct struct contains private data only. */ struct _GooCanvasTableModel { GooCanvasGroupModel parent_object; GooCanvasTableData table_data; }; struct _GooCanvasTableModelClass { GooCanvasGroupModelClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_table_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_table_model_new (GooCanvasItemModel *parent, ...); G_END_DECLS #endif /* __GOO_CANVAS_TABLE_H__ */ goocanvas-1.0.0/src/goocanvas.c0000644000076400007640000040336211461232740013344 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvas.c - the main canvas widget. */ /** * SECTION: goocanvas * @Title: GooCanvas * @Short_Description: the main canvas widget. * * #GooCanvas is the main widget containing a number of canvas items. * * Here is a simple example: * * * #include <goocanvas.h> * * static gboolean on_rect_button_press (GooCanvasItem *view, * GooCanvasItem *target, * GdkEventButton *event, * gpointer data); * * int * main (int argc, char *argv[]) * { * GtkWidget *window, *scrolled_win, *canvas; * GooCanvasItem *root, *rect_item, *text_item; * * /* Initialize GTK+. */ * gtk_set_locale (); * gtk_init (&argc, &argv); * * /* Create the window and widgets. */ * window = gtk_window_new (GTK_WINDOW_TOPLEVEL); * gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); * gtk_widget_show (window); * g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, * NULL); * * scrolled_win = gtk_scrolled_window_new (NULL, NULL); * gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), * GTK_SHADOW_IN); * gtk_widget_show (scrolled_win); * gtk_container_add (GTK_CONTAINER (window), scrolled_win); * * canvas = goo_canvas_new (); * gtk_widget_set_size_request (canvas, 600, 450); * goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); * gtk_widget_show (canvas); * gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); * * root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); * * /* Add a few simple items. */ * rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, * "line-width", 10.0, * "radius-x", 20.0, * "radius-y", 10.0, * "stroke-color", "yellow", * "fill-color", "red", * NULL); * * text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, * GTK_ANCHOR_CENTER, * "font", "Sans 24", * NULL); * goo_canvas_item_rotate (text_item, 45, 300, 300); * * /* Connect a signal handler for the rectangle item. */ * g_signal_connect (rect_item, "button_press_event", * (GtkSignalFunc) on_rect_button_press, NULL); * * /* Pass control to the GTK+ main event loop. */ * gtk_main (); * * return 0; * } * * * /* This handles button presses in item views. We simply output a message to * the console. */ * static gboolean * on_rect_button_press (GooCanvasItem *item, * GooCanvasItem *target, * GdkEventButton *event, * gpointer data) * { * g_print ("rect item received button press event\n"); * return TRUE; * } * * */ #include #include #include #include #include "goocanvasatk.h" #include "goocanvas.h" #include "goocanvasitemmodel.h" #include "goocanvasitem.h" #include "goocanvasgroup.h" #include "goocanvasmarshal.h" #define GOO_CANVAS_GET_PRIVATE(canvas) \ (G_TYPE_INSTANCE_GET_PRIVATE ((canvas), GOO_TYPE_CANVAS, GooCanvasPrivate)) typedef struct _GooCanvasPrivate GooCanvasPrivate; struct _GooCanvasPrivate { GooCanvasItem *static_root_item; GooCanvasItemModel *static_root_item_model; gint window_x, window_y; }; enum { PROP_0, PROP_SCALE, PROP_SCALE_X, PROP_SCALE_Y, PROP_ANCHOR, PROP_X1, PROP_Y1, PROP_X2, PROP_Y2, PROP_AUTOMATIC_BOUNDS, PROP_BOUNDS_FROM_ORIGIN, PROP_BOUNDS_PADDING, PROP_UNITS, PROP_RESOLUTION_X, PROP_RESOLUTION_Y, PROP_BACKGROUND_COLOR, PROP_BACKGROUND_COLOR_RGB, PROP_INTEGER_LAYOUT, PROP_CLEAR_BACKGROUND, PROP_REDRAW_WHEN_SCROLLED }; enum { ITEM_CREATED, LAST_SIGNAL }; static guint canvas_signals[LAST_SIGNAL] = { 0 }; static void goo_canvas_dispose (GObject *object); static void goo_canvas_finalize (GObject *object); static void goo_canvas_realize (GtkWidget *widget); static void goo_canvas_unrealize (GtkWidget *widget); static void goo_canvas_map (GtkWidget *widget); static void goo_canvas_style_set (GtkWidget *widget, GtkStyle *old_style); static void goo_canvas_size_request (GtkWidget *widget, GtkRequisition *requisition); static void goo_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void goo_canvas_set_adjustments (GooCanvas *canvas, GtkAdjustment *hadj, GtkAdjustment *vadj); static gboolean goo_canvas_expose_event (GtkWidget *widget, GdkEventExpose *event); static gboolean goo_canvas_button_press (GtkWidget *widget, GdkEventButton *event); static gboolean goo_canvas_button_release (GtkWidget *widget, GdkEventButton *event); static gboolean goo_canvas_motion (GtkWidget *widget, GdkEventMotion *event); static gboolean goo_canvas_scroll (GtkWidget *widget, GdkEventScroll *event); static gboolean goo_canvas_focus (GtkWidget *widget, GtkDirectionType direction); static gboolean goo_canvas_key_press (GtkWidget *widget, GdkEventKey *event); static gboolean goo_canvas_key_release (GtkWidget *widget, GdkEventKey *event); static gboolean goo_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event); static gboolean goo_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event); static gboolean goo_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event); static gboolean goo_canvas_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event); static void goo_canvas_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_remove (GtkContainer *container, GtkWidget *widget); static void goo_canvas_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); static gboolean goo_canvas_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip); static void goo_canvas_set_scale_internal (GooCanvas *canvas, gdouble scale_x, gdouble scale_y); static void set_item_pointer (GooCanvasItem **item, GooCanvasItem *new_item); static void update_pointer_item (GooCanvas *canvas, GdkEvent *event); static void reconfigure_canvas (GooCanvas *canvas, gboolean redraw_if_needed); static void goo_canvas_update_automatic_bounds (GooCanvas *canvas); static void goo_canvas_convert_to_static_item_space (GooCanvas *canvas, gdouble *x, gdouble *y); G_DEFINE_TYPE (GooCanvas, goo_canvas, GTK_TYPE_CONTAINER) /* This evaluates to TRUE if an item is still in the canvas. */ #define ITEM_IS_VALID(item) (goo_canvas_item_get_canvas (item)) #define GOO_CANVAS_DEFAULT_WIDTH 1000.0 #define GOO_CANVAS_DEFAULT_HEIGHT 1000.0 static void goo_canvas_class_init (GooCanvasClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GtkWidgetClass *widget_class = (GtkWidgetClass*) klass; GtkContainerClass *container_class = (GtkContainerClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasPrivate)); gobject_class->dispose = goo_canvas_dispose; gobject_class->finalize = goo_canvas_finalize; gobject_class->get_property = goo_canvas_get_property; gobject_class->set_property = goo_canvas_set_property; widget_class->realize = goo_canvas_realize; widget_class->unrealize = goo_canvas_unrealize; widget_class->map = goo_canvas_map; widget_class->size_request = goo_canvas_size_request; widget_class->size_allocate = goo_canvas_size_allocate; widget_class->style_set = goo_canvas_style_set; widget_class->expose_event = goo_canvas_expose_event; widget_class->button_press_event = goo_canvas_button_press; widget_class->button_release_event = goo_canvas_button_release; widget_class->motion_notify_event = goo_canvas_motion; widget_class->scroll_event = goo_canvas_scroll; widget_class->focus = goo_canvas_focus; widget_class->key_press_event = goo_canvas_key_press; widget_class->key_release_event = goo_canvas_key_release; widget_class->enter_notify_event = goo_canvas_crossing; widget_class->leave_notify_event = goo_canvas_crossing; widget_class->focus_in_event = goo_canvas_focus_in; widget_class->focus_out_event = goo_canvas_focus_out; widget_class->grab_broken_event = goo_canvas_grab_broken; widget_class->query_tooltip = goo_canvas_query_tooltip; container_class->remove = goo_canvas_remove; container_class->forall = goo_canvas_forall; klass->set_scroll_adjustments = goo_canvas_set_adjustments; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS, goo_canvas_accessible_factory_get_type ()); } g_object_class_install_property (gobject_class, PROP_SCALE, g_param_spec_double ("scale", _("Scale"), _("The magnification factor of the canvas"), 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_X, g_param_spec_double ("scale-x", _("Scale X"), _("The horizontal magnification factor of the canvas"), 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_Y, g_param_spec_double ("scale-y", _("Scale Y"), _("The vertical magnification factor of the canvas"), 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANCHOR, g_param_spec_enum ("anchor", _("Anchor"), _("Where to place the canvas when it is smaller than the widget's allocated area"), GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_NW, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X1, g_param_spec_double ("x1", _("X1"), _("The x coordinate of the left edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y1, g_param_spec_double ("y1", _("Y1"), _("The y coordinate of the top edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X2, g_param_spec_double ("x2", _("X2"), _("The x coordinate of the right edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, GOO_CANVAS_DEFAULT_WIDTH, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y2, g_param_spec_double ("y2", _("Y2"), _("The y coordinate of the bottom edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, GOO_CANVAS_DEFAULT_HEIGHT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_AUTOMATIC_BOUNDS, g_param_spec_boolean ("automatic-bounds", _("Automatic Bounds"), _("If the bounds are automatically calculated based on the bounds of all the items in the canvas"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BOUNDS_FROM_ORIGIN, g_param_spec_boolean ("bounds-from-origin", _("Bounds From Origin"), _("If the automatic bounds are calculated from the origin"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BOUNDS_PADDING, g_param_spec_double ("bounds-padding", _("Bounds Padding"), _("The padding added to the automatic bounds"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_UNITS, g_param_spec_enum ("units", _("Units"), _("The units to use for the canvas"), GTK_TYPE_UNIT, GTK_UNIT_PIXEL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RESOLUTION_X, g_param_spec_double ("resolution-x", _("Resolution X"), _("The horizontal resolution of the display, in dots per inch"), 0.0, G_MAXDOUBLE, 96.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RESOLUTION_Y, g_param_spec_double ("resolution-y", _("Resolution Y"), _("The vertical resolution of the display, in dots per inch"), 0.0, G_MAXDOUBLE, 96.0, G_PARAM_READWRITE)); /* Convenience properties - writable only. */ g_object_class_install_property (gobject_class, PROP_BACKGROUND_COLOR, g_param_spec_string ("background-color", _("Background Color"), _("The color to use for the canvas background"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_BACKGROUND_COLOR_RGB, g_param_spec_uint ("background-color-rgb", _("Background Color RGB"), _("The color to use for the canvas background, specified as a 24-bit integer value, 0xRRGGBB"), 0, G_MAXUINT, 0, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_INTEGER_LAYOUT, g_param_spec_boolean ("integer-layout", _("Integer Layout"), _("If all item layout is done to the nearest integer"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CLEAR_BACKGROUND, g_param_spec_boolean ("clear-background", _("Clear Background"), _("If the background is cleared before the canvas is painted"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_REDRAW_WHEN_SCROLLED, g_param_spec_boolean ("redraw-when-scrolled", _("Redraw When Scrolled"), _("If the canvas is completely redrawn when scrolled, to reduce the flicker of static items"), FALSE, G_PARAM_READWRITE)); /** * GooCanvas::set-scroll-adjustments * @canvas: the canvas. * @hadjustment: the horizontal adjustment. * @vadjustment: the vertical adjustment. * * This is used when the #GooCanvas is placed inside a #GtkScrolledWindow, * to connect up the adjustments so scrolling works properly. * * It isn't useful for applications. */ widget_class->set_scroll_adjustments_signal = g_signal_new ("set_scroll_adjustments", G_OBJECT_CLASS_TYPE (gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GooCanvasClass, set_scroll_adjustments), NULL, NULL, goo_canvas_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); /* Signals. */ /** * GooCanvas::item-created * @canvas: the canvas. * @item: the new item. * @model: the item's model. * * This is emitted when a new canvas item is created, in model/view mode. * * Applications can set up signal handlers for the new items here. */ canvas_signals[ITEM_CREATED] = g_signal_new ("item-created", G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasClass, item_created), NULL, NULL, goo_canvas_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, GOO_TYPE_CANVAS_ITEM, GOO_TYPE_CANVAS_ITEM_MODEL); } static void goo_canvas_init (GooCanvas *canvas) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); /* We set GTK_CAN_FOCUS by default, so it works as people expect. Though developers can turn this off if not needed for efficiency. */ GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); canvas->scale_x = 1.0; canvas->scale_y = 1.0; canvas->scale = 1.0; canvas->need_update = TRUE; canvas->need_entire_subtree_update = TRUE; canvas->crossing_event.type = GDK_LEAVE_NOTIFY; canvas->anchor = GTK_ANCHOR_NORTH_WEST; canvas->clear_background = TRUE; canvas->redraw_when_scrolled = FALSE; canvas->before_initial_expose = TRUE; /* Set the default bounds to a reasonable size. */ canvas->bounds.x1 = 0.0; canvas->bounds.y1 = 0.0; canvas->bounds.x2 = GOO_CANVAS_DEFAULT_WIDTH; canvas->bounds.y2 = GOO_CANVAS_DEFAULT_HEIGHT; canvas->automatic_bounds = FALSE; canvas->bounds_from_origin = TRUE; canvas->bounds_padding = 0.0; canvas->units = GTK_UNIT_PIXEL; canvas->resolution_x = 96.0; canvas->resolution_y = 96.0; /* Create our own adjustments, in case we aren't inserted into a scrolled window. The accessibility code needs these. */ canvas->hadjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); canvas->vadjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); g_object_ref_sink (canvas->hadjustment); g_object_ref_sink (canvas->vadjustment); canvas->model_to_item = g_hash_table_new (g_direct_hash, g_direct_equal); /* Use a simple group as the default root item, which is fine 99% of the time. Apps can set their own root item if required. */ canvas->root_item = goo_canvas_group_new (NULL, NULL); goo_canvas_item_set_canvas (canvas->root_item, canvas); priv->static_root_item = goo_canvas_group_new (NULL, NULL); goo_canvas_item_set_canvas (priv->static_root_item, canvas); goo_canvas_item_set_is_static (priv->static_root_item, TRUE); priv->static_root_item_model = NULL; priv->window_x = 0; priv->window_y = 0; } /** * goo_canvas_new: * * Creates a new #GooCanvas widget. * * A #GooCanvasGroup is created automatically as the root item of the canvas, * though this can be overriden with goo_canvas_set_root_item() or * goo_canvas_set_root_item_model(). * * Returns: a new #GooCanvas widget. **/ GtkWidget* goo_canvas_new (void) { return GTK_WIDGET (g_object_new (GOO_TYPE_CANVAS, NULL)); } static void goo_canvas_dispose (GObject *object) { GooCanvas *canvas = (GooCanvas*) object; GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); if (canvas->model_to_item) { g_hash_table_destroy (canvas->model_to_item); canvas->model_to_item = NULL; } if (canvas->root_item) { g_object_unref (canvas->root_item); canvas->root_item = NULL; } if (canvas->root_item_model) { g_object_unref (canvas->root_item_model); canvas->root_item_model = NULL; } if (priv->static_root_item) { g_object_unref (priv->static_root_item); priv->static_root_item = NULL; } if (priv->static_root_item_model) { g_object_unref (priv->static_root_item_model); priv->static_root_item_model = NULL; } if (canvas->idle_id) { g_source_remove (canvas->idle_id); canvas->idle_id = 0; } /* Release any references we hold to items. */ set_item_pointer (&canvas->pointer_item, NULL); set_item_pointer (&canvas->pointer_grab_item, NULL); set_item_pointer (&canvas->pointer_grab_initial_item, NULL); set_item_pointer (&canvas->focused_item, NULL); set_item_pointer (&canvas->keyboard_grab_item, NULL); if (canvas->hadjustment) { g_object_unref (canvas->hadjustment); canvas->hadjustment = NULL; } if (canvas->vadjustment) { g_object_unref (canvas->vadjustment); canvas->vadjustment = NULL; } G_OBJECT_CLASS (goo_canvas_parent_class)->dispose (object); } static void goo_canvas_finalize (GObject *object) { /*GooCanvas *canvas = (GooCanvas*) object;*/ G_OBJECT_CLASS (goo_canvas_parent_class)->finalize (object); } /** * goo_canvas_get_default_line_width: * @canvas: a #GooCanvas. * * Gets the default line width, which depends on the current units setting. * * Returns: the default line width of the canvas. **/ gdouble goo_canvas_get_default_line_width (GooCanvas *canvas) { gdouble line_width = 2.0; if (!canvas) return 2.0; /* We use the same default as cairo when using pixels, i.e. 2 pixels. For other units we use 2 points, or thereabouts. */ switch (canvas->units) { case GTK_UNIT_PIXEL: line_width = 2.0; break; case GTK_UNIT_POINTS: line_width = 2.0; break; case GTK_UNIT_INCH: line_width = 2.0 / 72.0; break; case GTK_UNIT_MM: line_width = 0.7; break; } return line_width; } /** * goo_canvas_create_cairo_context: * @canvas: a #GooCanvas. * * Creates a cairo context, initialized with the default canvas settings. * * Returns: a new cairo context. It should be freed with cairo_destroy(). **/ cairo_t* goo_canvas_create_cairo_context (GooCanvas *canvas) { cairo_t *cr; cairo_surface_t *surface; /* If the canvas is realized we can use the GDK function to create a cairo context for the canvas window. Otherwise we create a small temporary image surface. */ if (canvas && canvas->canvas_window) { cr = gdk_cairo_create (canvas->canvas_window); } else { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1); cr = cairo_create (surface); /* The cairo context will keep a reference to the surface so we can drop our reference. */ cairo_surface_destroy (surface); } /* We use CAIRO_ANTIALIAS_GRAY as the default antialiasing mode, as that is what is recommended when using unhinted text. */ cairo_set_antialias (cr, CAIRO_ANTIALIAS_GRAY); /* Set the default line width based on the current units setting. */ cairo_set_line_width (cr, goo_canvas_get_default_line_width (canvas)); return cr; } static void goo_canvas_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvas *canvas = (GooCanvas*) object; switch (prop_id) { case PROP_SCALE: g_value_set_double (value, canvas->scale); break; case PROP_SCALE_X: g_value_set_double (value, canvas->scale_x); break; case PROP_SCALE_Y: g_value_set_double (value, canvas->scale_y); break; case PROP_ANCHOR: g_value_set_enum (value, canvas->anchor); break; case PROP_X1: g_value_set_double (value, canvas->bounds.x1); break; case PROP_Y1: g_value_set_double (value, canvas->bounds.y1); break; case PROP_X2: g_value_set_double (value, canvas->bounds.x2); break; case PROP_Y2: g_value_set_double (value, canvas->bounds.y2); break; case PROP_AUTOMATIC_BOUNDS: g_value_set_boolean (value, canvas->automatic_bounds); break; case PROP_BOUNDS_FROM_ORIGIN: g_value_set_boolean (value, canvas->bounds_from_origin); break; case PROP_BOUNDS_PADDING: g_value_set_double (value, canvas->bounds_padding); break; case PROP_UNITS: g_value_set_enum (value, canvas->units); break; case PROP_RESOLUTION_X: g_value_set_double (value, canvas->resolution_x); break; case PROP_RESOLUTION_Y: g_value_set_double (value, canvas->resolution_y); break; case PROP_INTEGER_LAYOUT: g_value_set_boolean (value, canvas->integer_layout); break; case PROP_CLEAR_BACKGROUND: g_value_set_boolean (value, canvas->clear_background); break; case PROP_REDRAW_WHEN_SCROLLED: g_value_set_boolean (value, canvas->redraw_when_scrolled); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvas *canvas = (GooCanvas*) object; GdkColor color = { 0, 0, 0, 0, }; gboolean need_reconfigure = FALSE; gboolean need_update_automatic_bounds = FALSE; guint rgb; switch (prop_id) { case PROP_SCALE: goo_canvas_set_scale (canvas, g_value_get_double (value)); break; case PROP_SCALE_X: goo_canvas_set_scale_internal (canvas, g_value_get_double (value), canvas->scale_y); break; case PROP_SCALE_Y: goo_canvas_set_scale_internal (canvas, canvas->scale_x, g_value_get_double (value)); break; case PROP_ANCHOR: canvas->anchor = g_value_get_enum (value); need_reconfigure = TRUE; break; case PROP_X1: canvas->bounds.x1 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_Y1: canvas->bounds.y1 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_X2: canvas->bounds.x2 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_Y2: canvas->bounds.y2 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_AUTOMATIC_BOUNDS: canvas->automatic_bounds = g_value_get_boolean (value); if (canvas->automatic_bounds) need_update_automatic_bounds = TRUE; break; case PROP_BOUNDS_FROM_ORIGIN: canvas->bounds_from_origin = g_value_get_boolean (value); if (canvas->automatic_bounds) need_update_automatic_bounds = TRUE; break; case PROP_BOUNDS_PADDING: canvas->bounds_padding = g_value_get_double (value); if (canvas->automatic_bounds) need_update_automatic_bounds = TRUE; break; case PROP_UNITS: canvas->units = g_value_get_enum (value); need_reconfigure = TRUE; break; case PROP_RESOLUTION_X: canvas->resolution_x = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_RESOLUTION_Y: canvas->resolution_y = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_BACKGROUND_COLOR: if (!g_value_get_string (value)) gtk_widget_modify_base ((GtkWidget*) canvas, GTK_STATE_NORMAL, NULL); else if (gdk_color_parse (g_value_get_string (value), &color)) gtk_widget_modify_base ((GtkWidget*) canvas, GTK_STATE_NORMAL, &color); else g_warning ("Unknown color: %s", g_value_get_string (value)); break; case PROP_BACKGROUND_COLOR_RGB: rgb = g_value_get_uint (value); color.red = ((rgb >> 16) & 0xFF) * 257; color.green = ((rgb >> 8) & 0xFF) * 257; color.blue = ((rgb) & 0xFF) * 257; gtk_widget_modify_base ((GtkWidget*) canvas, GTK_STATE_NORMAL, &color); break; case PROP_INTEGER_LAYOUT: canvas->integer_layout = g_value_get_boolean (value); canvas->need_entire_subtree_update = TRUE; goo_canvas_request_update (canvas); break; case PROP_CLEAR_BACKGROUND: canvas->clear_background = g_value_get_boolean (value); break; case PROP_REDRAW_WHEN_SCROLLED: canvas->redraw_when_scrolled = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } if (need_update_automatic_bounds) { goo_canvas_update_automatic_bounds (canvas); } if (need_reconfigure) { reconfigure_canvas (canvas, FALSE); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } } /** * goo_canvas_get_root_item_model: * @canvas: a #GooCanvas. * * Gets the root item model of the canvas. * * Returns: the root item model, or %NULL if there is no root item model. **/ GooCanvasItemModel* goo_canvas_get_root_item_model (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return canvas->root_item_model; } /** * goo_canvas_set_root_item_model: * @canvas: a #GooCanvas. * @model: a #GooCanvasItemModel. * * Sets the root item model of the canvas. * * A hierarchy of canvas items will be created, corresponding to the hierarchy * of items in the model. Any current canvas items will be removed. **/ void goo_canvas_set_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model) { g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); if (canvas->root_item_model == model) return; if (canvas->root_item_model) { g_object_unref (canvas->root_item_model); canvas->root_item_model = NULL; } if (canvas->root_item) { g_object_unref (canvas->root_item); canvas->root_item = NULL; } if (model) { canvas->root_item_model = g_object_ref (model); /* Create a hierarchy of canvas items for all the items in the model. */ canvas->root_item = goo_canvas_create_item (canvas, model); } else { /* The model has been reset so we go back to a default root group. */ canvas->root_item = goo_canvas_group_new (NULL, NULL); } goo_canvas_item_set_canvas (canvas->root_item, canvas); canvas->need_update = TRUE; #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_get_realized (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_REALIZED (canvas)) #endif goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_root_item: * @canvas: a #GooCanvas. * * Gets the root item of the canvas, usually a #GooCanvasGroup. * * Returns: the root item, or %NULL if there is no root item. **/ GooCanvasItem* goo_canvas_get_root_item (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return canvas->root_item; } /** * goo_canvas_set_root_item: * @canvas: a #GooCanvas. * @item: the root canvas item. * * Sets the root item of the canvas. Any existing canvas items are removed. **/ void goo_canvas_set_root_item (GooCanvas *canvas, GooCanvasItem *item) { g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); if (canvas->root_item == item) return; /* Remove any current model. */ if (canvas->root_item_model) { g_object_unref (canvas->root_item_model); canvas->root_item_model = NULL; } if (canvas->root_item) g_object_unref (canvas->root_item); canvas->root_item = g_object_ref (item); goo_canvas_item_set_canvas (canvas->root_item, canvas); canvas->need_update = TRUE; #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_get_realized (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_REALIZED (canvas)) #endif goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_static_root_item: * @canvas: a #GooCanvas. * * Gets the static root item of the canvas. * * Static items are exactly the same as ordinary canvas items, except that * they do not move or change size when the canvas is scrolled or the scale * changes. * * Static items are added to the static root item in exactly the same way that * ordinary items are added to the root item. * * Returns: the static root item, or %NULL. **/ GooCanvasItem* goo_canvas_get_static_root_item (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return GOO_CANVAS_GET_PRIVATE (canvas)->static_root_item; } /** * goo_canvas_set_static_root_item: * @canvas: a #GooCanvas. * @item: the static root item. * * Sets the static root item. Any existing static items are removed. * * Static items are exactly the same as ordinary canvas items, except that * they do not move or change size when the canvas is scrolled or the scale * changes. * * Static items are added to the static root item in exactly the same way that * ordinary items are added to the root item. **/ void goo_canvas_set_static_root_item (GooCanvas *canvas, GooCanvasItem *item) { GooCanvasPrivate *priv; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); priv = GOO_CANVAS_GET_PRIVATE (canvas); if (priv->static_root_item == item) return; /* Remove any current model. */ if (priv->static_root_item_model) { g_object_unref (priv->static_root_item_model); priv->static_root_item_model = NULL; } if (priv->static_root_item) g_object_unref (priv->static_root_item); priv->static_root_item = g_object_ref (item); goo_canvas_item_set_canvas (priv->static_root_item, canvas); goo_canvas_item_set_is_static (priv->static_root_item, TRUE); canvas->need_update = TRUE; #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_get_realized (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_REALIZED (canvas)) #endif goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_static_root_item_model: * @canvas: a #GooCanvas. * * Gets the static root item model of the canvas. * * Static item models are exactly the same as ordinary item models, except that * the corresponding items do not move or change size when the canvas is * scrolled or the scale changes. * * Static items models are added to the static root item model in exactly the * same way that ordinary item models are added to the root item model. * * Returns: the static root item model, or %NULL. **/ GooCanvasItemModel* goo_canvas_get_static_root_item_model (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return GOO_CANVAS_GET_PRIVATE (canvas)->static_root_item_model; } /** * goo_canvas_set_static_root_item_model: * @canvas: a #GooCanvas. * @model: the static root item model. * * Sets the static root item model. Any existing static item models are * removed. * * Static item models are exactly the same as ordinary item models, except that * the corresponding items do not move or change size when the canvas is * scrolled or the scale changes. * * Static items models are added to the static root item model in exactly the * same way that ordinary item models are added to the root item model. **/ void goo_canvas_set_static_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model) { GooCanvasPrivate *priv; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); priv = GOO_CANVAS_GET_PRIVATE (canvas); if (priv->static_root_item_model == model) return; if (priv->static_root_item_model) { g_object_unref (priv->static_root_item_model); priv->static_root_item_model = NULL; } if (priv->static_root_item) { g_object_unref (priv->static_root_item); priv->static_root_item = NULL; } if (model) { priv->static_root_item_model = g_object_ref (model); /* Create a hierarchy of canvas items for all the items in the model. */ priv->static_root_item = goo_canvas_create_item (canvas, model); } else { /* The model has been reset so we go back to a default root group. */ priv->static_root_item = goo_canvas_group_new (NULL, NULL); } goo_canvas_item_set_canvas (priv->static_root_item, canvas); goo_canvas_item_set_is_static (priv->static_root_item, TRUE); canvas->need_update = TRUE; #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_get_realized (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_REALIZED (canvas)) #endif goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_item: * @canvas: a #GooCanvas. * @model: a #GooCanvasItemModel. * * Gets the canvas item associated with the given #GooCanvasItemModel. * This is only useful when goo_canvas_set_root_item_model() has been used to * set a model for the canvas. * * For simple applications you can use goo_canvas_get_item() to set up * signal handlers for your items, e.g. * * * item = goo_canvas_get_item (GOO_CANVAS (canvas), my_item); * g_signal_connect (item, "button_press_event", * (GtkSignalFunc) on_my_item_button_press, NULL); * * * More complex applications may want to use the #GooCanvas::item-created * signal to hook up their signal handlers. * * Returns: the canvas item corresponding to the given #GooCanvasItemModel, * or %NULL if no canvas item has been created for it yet. **/ GooCanvasItem* goo_canvas_get_item (GooCanvas *canvas, GooCanvasItemModel *model) { GooCanvasItem *item = NULL; g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); g_return_val_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model), NULL); if (canvas->model_to_item) item = g_hash_table_lookup (canvas->model_to_item, model); /* If the item model has a canvas item check it is valid. */ g_return_val_if_fail (!item || GOO_IS_CANVAS_ITEM (item), NULL); return item; } /** * goo_canvas_get_item_at: * @canvas: a #GooCanvas. * @x: the x coordinate of the point. * @y: the y coordinate of the point * @is_pointer_event: %TRUE if the "pointer-events" property of * items should be used to determine which parts of the item are tested. * * Gets the item at the given point. * * Returns: the item found at the given point, or %NULL if no item was found. **/ GooCanvasItem* goo_canvas_get_item_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event) { GooCanvasPrivate *priv; cairo_t *cr; GooCanvasItem *result = NULL; GList *list = NULL; g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); priv = GOO_CANVAS_GET_PRIVATE (canvas); cr = goo_canvas_create_cairo_context (canvas); if (canvas->root_item) list = goo_canvas_item_get_items_at (canvas->root_item, x, y, cr, is_pointer_event, TRUE, NULL); if (!list && priv->static_root_item) { gdouble static_x = x, static_y = y; goo_canvas_convert_to_static_item_space (canvas, &static_x, &static_y); list = goo_canvas_item_get_items_at (priv->static_root_item, static_x, static_y, cr, is_pointer_event, TRUE, NULL); } cairo_destroy (cr); /* We just return the top item in the list. */ if (list) result = list->data; g_list_free (list); return result; } /** * goo_canvas_get_items_at: * @canvas: a #GooCanvas. * @x: the x coordinate of the point. * @y: the y coordinate of the point * @is_pointer_event: %TRUE if the "pointer-events" property of * items should be used to determine which parts of the item are tested. * * Gets all items at the given point. * * Returns: a list of items found at the given point, with the top item at * the start of the list, or %NULL if no items were found. The list must be * freed with g_list_free(). **/ GList* goo_canvas_get_items_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event) { GooCanvasPrivate *priv; cairo_t *cr; GList *result = NULL; g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); priv = GOO_CANVAS_GET_PRIVATE (canvas); cr = goo_canvas_create_cairo_context (canvas); if (canvas->root_item) result = goo_canvas_item_get_items_at (canvas->root_item, x, y, cr, is_pointer_event, TRUE, NULL); if (priv->static_root_item) { gdouble static_x = x, static_y = y; goo_canvas_convert_to_static_item_space (canvas, &static_x, &static_y); result = goo_canvas_item_get_items_at (priv->static_root_item, static_x, static_y, cr, is_pointer_event, TRUE, result); } cairo_destroy (cr); return result; } static GList* goo_canvas_get_items_in_area_recurse (GooCanvas *canvas, GooCanvasItem *item, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers, GList *found_items) { GooCanvasBounds bounds; gboolean completely_inside = FALSE, completely_outside = FALSE; gboolean is_container, add_item = FALSE; gint n_children, i; /* First check the item/container itself. */ goo_canvas_item_get_bounds (item, &bounds); is_container = goo_canvas_item_is_container (item); if (bounds.x1 >= area->x1 && bounds.x2 <= area->x2 && bounds.y1 >= area->y1 && bounds.y2 <= area->y2) completely_inside = TRUE; if (bounds.x1 > area->x2 || bounds.x2 < area->x1 || bounds.y1 > area->y2 || bounds.y2 < area->y1) completely_outside = TRUE; if (inside_area) { if (completely_inside || (allow_overlaps && !completely_outside)) add_item = TRUE; } else { if (completely_outside || (allow_overlaps && !completely_inside)) add_item = TRUE; } if (add_item && (!is_container || include_containers)) found_items = g_list_prepend (found_items, item); /* Now check any children, if appropriate. */ if ((inside_area && !completely_outside) || (!inside_area && !completely_inside)) { n_children = goo_canvas_item_get_n_children (item); for (i = 0; i < n_children; i++) { GooCanvasItem *child = goo_canvas_item_get_child (item, i); found_items = goo_canvas_get_items_in_area_recurse (canvas, child, area, inside_area, allow_overlaps, include_containers, found_items); } } return found_items; } /** * goo_canvas_get_items_in_area: * @canvas: a #GooCanvas. * @area: the area to compare with each item's bounds. * @inside_area: %TRUE if items inside @area should be returned, or %FALSE if * items outside @area should be returned. * @allow_overlaps: %TRUE if items which are partly inside and partly outside * should be returned. * @include_containers: %TRUE if containers should be checked as well as * normal items. * * Gets a list of items inside or outside a given area. * * Returns: a list of items in the given area, or %NULL if no items are found. * The list should be freed with g_list_free(). **/ GList* goo_canvas_get_items_in_area (GooCanvas *canvas, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); /* If no root item is set, just return NULL. */ if (!canvas->root_item) return NULL; return goo_canvas_get_items_in_area_recurse (canvas, canvas->root_item, area, inside_area, allow_overlaps, include_containers, NULL); } static void goo_canvas_realize (GtkWidget *widget) { GooCanvas *canvas; GooCanvasPrivate *priv; GdkWindowAttr attributes; gint attributes_mask; gint width_pixels, height_pixels; GList *tmp_list; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); priv = GOO_CANVAS_GET_PRIVATE (canvas); GTK_WIDGET_SET_FLAGS (canvas, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.colormap = gtk_widget_get_colormap (widget); attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (widget->window, widget); /* We want to round the sizes up to the next pixel. */ width_pixels = ((canvas->bounds.x2 - canvas->bounds.x1) * canvas->device_to_pixels_x) + 1; height_pixels = ((canvas->bounds.y2 - canvas->bounds.y1) * canvas->device_to_pixels_y) + 1; attributes.x = canvas->hadjustment ? - canvas->hadjustment->value : 0, attributes.y = canvas->vadjustment ? - canvas->vadjustment->value : 0; attributes.width = MAX (width_pixels, widget->allocation.width); attributes.height = MAX (height_pixels, widget->allocation.height); attributes.event_mask = GDK_EXPOSURE_MASK | GDK_SCROLL_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | gtk_widget_get_events (widget); priv->window_x = attributes.x; priv->window_y = attributes.y; canvas->canvas_window = gdk_window_new (widget->window, &attributes, attributes_mask); gdk_window_set_user_data (canvas->canvas_window, widget); attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.event_mask = 0; canvas->tmp_window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (canvas->tmp_window, widget); widget->style = gtk_style_attach (widget->style, widget->window); /* Make sure the window backgrounds aren't set, to avoid flicker when scrolling (due to the delay between X clearing the background and GooCanvas painting it). */ gdk_window_set_back_pixmap (widget->window, NULL, FALSE); gdk_window_set_back_pixmap (canvas->canvas_window, NULL, FALSE); gdk_window_set_back_pixmap (canvas->tmp_window, NULL, FALSE); /* Set the parent window of all the child widget items. */ tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget) gtk_widget_set_parent_window (witem->widget, canvas->canvas_window); } goo_canvas_update (GOO_CANVAS (widget)); } static void goo_canvas_unrealize (GtkWidget *widget) { GooCanvas *canvas; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); gdk_window_set_user_data (canvas->canvas_window, NULL); gdk_window_destroy (canvas->canvas_window); canvas->canvas_window = NULL; gdk_window_set_user_data (canvas->tmp_window, NULL); gdk_window_destroy (canvas->tmp_window); canvas->tmp_window = NULL; if (GTK_WIDGET_CLASS (goo_canvas_parent_class)->unrealize) GTK_WIDGET_CLASS (goo_canvas_parent_class)->unrealize (widget); } static void goo_canvas_map (GtkWidget *widget) { GooCanvas *canvas; GList *tmp_list; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; tmp_list = tmp_list->next; #if GTK_CHECK_VERSION(2, 19, 6) if (witem->widget && gtk_widget_get_visible (witem->widget)) #else if (witem->widget && GTK_WIDGET_VISIBLE (witem->widget)) #endif { #if GTK_CHECK_VERSION(2, 19, 6) if (!gtk_widget_get_mapped (witem->widget)) #else if (!GTK_WIDGET_MAPPED (witem->widget)) #endif gtk_widget_map (witem->widget); } } gdk_window_show (canvas->canvas_window); gdk_window_show (widget->window); } static void goo_canvas_style_set (GtkWidget *widget, GtkStyle *old_style) { if (GTK_WIDGET_CLASS (goo_canvas_parent_class)->style_set) GTK_WIDGET_CLASS (goo_canvas_parent_class)->style_set (widget, old_style); #if GTK_CHECK_VERSION(2, 19, 6) if (gtk_widget_get_realized (widget)) #else if (GTK_WIDGET_REALIZED (widget)) #endif { /* Make sure the window backgrounds aren't set, to avoid flicker when scrolling (due to the delay between X clearing the background and GooCanvas painting it). */ gdk_window_set_back_pixmap (widget->window, NULL, FALSE); gdk_window_set_back_pixmap (GOO_CANVAS (widget)->canvas_window, NULL, FALSE); } } static void goo_canvas_configure_hadjustment (GooCanvas *canvas, gint window_width) { GtkWidget *widget = GTK_WIDGET (canvas); GtkAdjustment *adj = canvas->hadjustment; gboolean changed = FALSE; gboolean value_changed = FALSE; gdouble max_value; if (adj->upper != window_width) { adj->upper = window_width; changed = TRUE; } if (adj->page_size != widget->allocation.width) { adj->page_size = widget->allocation.width; adj->page_increment = adj->page_size * 0.9; adj->step_increment = adj->page_size * 0.1; changed = TRUE; } max_value = MAX (0.0, adj->upper - adj->page_size); if (adj->value > max_value) { adj->value = max_value; value_changed = TRUE; } if (changed) gtk_adjustment_changed (adj); if (value_changed) gtk_adjustment_value_changed (adj); } static void goo_canvas_configure_vadjustment (GooCanvas *canvas, gint window_height) { GtkWidget *widget = GTK_WIDGET (canvas); GtkAdjustment *adj = canvas->vadjustment; gboolean changed = FALSE; gboolean value_changed = FALSE; gdouble max_value; if (adj->upper != window_height) { adj->upper = window_height; changed = TRUE; } if (adj->page_size != widget->allocation.height) { adj->page_size = widget->allocation.height; adj->page_increment = adj->page_size * 0.9; adj->step_increment = adj->page_size * 0.1; changed = TRUE; } max_value = MAX (0.0, adj->upper - adj->page_size); if (adj->value > max_value) { adj->value = max_value; value_changed = TRUE; } if (changed) gtk_adjustment_changed (adj); if (value_changed) gtk_adjustment_value_changed (adj); } static void recalculate_scales (GooCanvas *canvas) { switch (canvas->units) { case GTK_UNIT_PIXEL: canvas->device_to_pixels_x = canvas->scale_x; canvas->device_to_pixels_y = canvas->scale_y; break; case GTK_UNIT_POINTS: canvas->device_to_pixels_x = canvas->scale_x * (canvas->resolution_x / 72.0); canvas->device_to_pixels_y = canvas->scale_y * (canvas->resolution_y / 72.0); break; case GTK_UNIT_INCH: canvas->device_to_pixels_x = canvas->scale_x * canvas->resolution_x; canvas->device_to_pixels_y = canvas->scale_y * canvas->resolution_y; break; case GTK_UNIT_MM: /* There are 25.4 mm to an inch. */ canvas->device_to_pixels_x = canvas->scale_x * (canvas->resolution_x / 25.4); canvas->device_to_pixels_y = canvas->scale_y * (canvas->resolution_y / 25.4); break; } } static void request_static_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GdkRectangle rect; #if GTK_CHECK_VERSION (2, 19, 6) if (!gtk_widget_is_drawable (GTK_WIDGET (canvas)) || (bounds->x1 == bounds->x2)) #else if (!GTK_WIDGET_DRAWABLE (canvas) || (bounds->x1 == bounds->x2)) #endif return; /* We subtract one from the left & top edges, in case anti-aliasing makes the drawing use an extra pixel. */ rect.x = (double) bounds->x1 - priv->window_x - 1; rect.y = (double) bounds->y1 - priv->window_y - 1; /* We add an extra one here for the same reason. (The other extra one is to round up to the next pixel.) And one for luck! */ rect.width = (double) bounds->x2 - priv->window_x - rect.x + 2 + 1; rect.height = (double) bounds->y2 - priv->window_y - rect.y + 2 + 1; gdk_window_invalidate_rect (canvas->canvas_window, &rect, FALSE); } /* This requests a redraw of all the toplevel static items at their current position, but redraws them at their given new position. We redraw one item at a time to avoid GTK+ merging the rectangles into one big one. */ static void redraw_static_items_at_position (GooCanvas *canvas, gint x, gint y) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GooCanvasBounds bounds; GooCanvasItem *item; gint n_children, i, window_x_copy, window_y_copy; if (!priv->static_root_item) return; window_x_copy = priv->window_x; window_y_copy = priv->window_y; n_children = goo_canvas_item_get_n_children (priv->static_root_item); for (i = 0; i < n_children; i++) { item = goo_canvas_item_get_child (priv->static_root_item, i); /* Get the bounds of all the static items, relative to the window. */ goo_canvas_item_get_bounds (item, &bounds); /* Request a redraw of the old position. */ request_static_redraw (canvas, &bounds); /* Redraw the item in its new position. */ priv->window_x = x; priv->window_y = y; gdk_window_process_updates (canvas->canvas_window, TRUE); /* Now reset the window position. */ priv->window_x = window_x_copy; priv->window_y = window_y_copy; } } /* This makes sure the canvas is all set up correctly, i.e. the scrollbar adjustments are set, the canvas x & y offsets are calculated, and the canvas window is sized. */ static void reconfigure_canvas (GooCanvas *canvas, gboolean redraw_if_needed) { gint width_pixels, height_pixels; gint window_x = 0, window_y = 0, window_width, window_height; gint new_x_offset = 0, new_y_offset = 0; GtkWidget *widget; widget = GTK_WIDGET (canvas); /* Make sure the bounds are sane. */ if (canvas->bounds.x2 < canvas->bounds.x1) canvas->bounds.x2 = canvas->bounds.x1; if (canvas->bounds.y2 < canvas->bounds.y1) canvas->bounds.y2 = canvas->bounds.y1; /* Recalculate device_to_pixels_x & device_to_pixels_y. */ recalculate_scales (canvas); /* This is the natural size of the canvas window in pixels, rounded up to the next pixel. */ width_pixels = ((canvas->bounds.x2 - canvas->bounds.x1) * canvas->device_to_pixels_x) + 1; height_pixels = ((canvas->bounds.y2 - canvas->bounds.y1) * canvas->device_to_pixels_y) + 1; /* The actual window size is always at least as big as the widget's window.*/ window_width = MAX (width_pixels, widget->allocation.width); window_height = MAX (height_pixels, widget->allocation.height); /* If the width or height is smaller than the window, we need to calculate the canvas x & y offsets according to the anchor. */ if (width_pixels < widget->allocation.width) { switch (canvas->anchor) { case GTK_ANCHOR_NORTH_WEST: case GTK_ANCHOR_WEST: case GTK_ANCHOR_SOUTH_WEST: new_x_offset = 0; break; case GTK_ANCHOR_NORTH: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_SOUTH: new_x_offset = (widget->allocation.width - width_pixels) / 2; break; case GTK_ANCHOR_NORTH_EAST: case GTK_ANCHOR_EAST: case GTK_ANCHOR_SOUTH_EAST: new_x_offset = widget->allocation.width - width_pixels; break; } } if (height_pixels < widget->allocation.height) { switch (canvas->anchor) { case GTK_ANCHOR_NORTH_WEST: case GTK_ANCHOR_NORTH: case GTK_ANCHOR_NORTH_EAST: new_y_offset = 0; break; case GTK_ANCHOR_WEST: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_EAST: new_y_offset = (widget->allocation.height - height_pixels) / 2; break; case GTK_ANCHOR_SOUTH_WEST: case GTK_ANCHOR_SOUTH: case GTK_ANCHOR_SOUTH_EAST: new_y_offset = widget->allocation.height - height_pixels; break; } } canvas->freeze_count++; if (canvas->hadjustment) { goo_canvas_configure_hadjustment (canvas, window_width); window_x = - canvas->hadjustment->value; } if (canvas->vadjustment) { goo_canvas_configure_vadjustment (canvas, window_height); window_y = - canvas->vadjustment->value; } canvas->freeze_count--; #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_get_realized (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_REALIZED (canvas)) #endif { gdk_window_move_resize (canvas->canvas_window, window_x, window_y, window_width, window_height); } /* If one of the offsets has changed we have to redraw the widget. */ if (canvas->canvas_x_offset != new_x_offset || canvas->canvas_y_offset != new_y_offset) { canvas->canvas_x_offset = new_x_offset; canvas->canvas_y_offset = new_y_offset; if (redraw_if_needed) gtk_widget_queue_draw (GTK_WIDGET (canvas)); } } static void goo_canvas_size_request (GtkWidget *widget, GtkRequisition *requisition) { GList *tmp_list; GooCanvas *canvas; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); requisition->width = 0; requisition->height = 0; tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; GtkRequisition child_requisition; tmp_list = tmp_list->next; if (witem->widget) gtk_widget_size_request (witem->widget, &child_requisition); } } static void goo_canvas_allocate_child_widget (GooCanvas *canvas, GooCanvasWidget *witem) { GooCanvasBounds bounds; GtkAllocation allocation; goo_canvas_item_get_bounds ((GooCanvasItem*) witem, &bounds); goo_canvas_convert_to_pixels (canvas, &bounds.x1, &bounds.y1); goo_canvas_convert_to_pixels (canvas, &bounds.x2, &bounds.y2); /* Note that we only really support integers for the bounds, and we don't support scaling of a canvas with widget items in it. */ allocation.x = bounds.x1; allocation.y = bounds.y1; allocation.width = bounds.x2 - allocation.x; allocation.height = bounds.y2 - allocation.y; gtk_widget_size_allocate (witem->widget, &allocation); } static void goo_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GooCanvas *canvas; GList *tmp_list; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); widget->allocation = *allocation; #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_get_realized (widget)) #else if (GTK_WIDGET_REALIZED (widget)) #endif { /* We can only allocate our children when we are realized, since we need a window to create a cairo_t which we use for layout. */ tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget) goo_canvas_allocate_child_widget (canvas, witem); } gdk_window_move_resize (widget->window, allocation->x, allocation->y, allocation->width, allocation->height); gdk_window_move_resize (canvas->tmp_window, allocation->x, allocation->y, allocation->width, allocation->height); } reconfigure_canvas (canvas, TRUE); } static void goo_canvas_adjustment_value_changed (GtkAdjustment *adjustment, GooCanvas *canvas) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); AtkObject *accessible; #if GTK_CHECK_VERSION (2, 19, 6) if (!canvas->freeze_count && gtk_widget_get_realized (GTK_WIDGET(canvas))) #else if (!canvas->freeze_count && GTK_WIDGET_REALIZED (canvas)) #endif { if (canvas->redraw_when_scrolled) { /* Map the temporary window to stop the canvas window being scrolled. When it is unmapped the entire canvas will be redrawn. */ #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_get_mapped (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_MAPPED (canvas)) #endif gdk_window_show (canvas->tmp_window); } else { /* Redraw the area currently occupied by the static items. But draw the static items in their new position. This stops them from being "dragged" when the window is scrolled. */ redraw_static_items_at_position (canvas, -canvas->hadjustment->value, -canvas->vadjustment->value); /* Move the static items to the new position. */ priv->window_x = -canvas->hadjustment->value; priv->window_y = -canvas->vadjustment->value; } gdk_window_move (canvas->canvas_window, - canvas->hadjustment->value, - canvas->vadjustment->value); if (canvas->redraw_when_scrolled) { /* Unmap the temporary window, causing the entire canvas to be redrawn. */ #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_get_mapped (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_MAPPED (canvas)) #endif gdk_window_hide (canvas->tmp_window); } else { /* Process updates here for smoother scrolling. */ gdk_window_process_updates (canvas->canvas_window, TRUE); /* Now ensure the static items are redrawn in their new position. */ redraw_static_items_at_position (canvas, priv->window_x, priv->window_y); } /* Notify any accessibility modules that the view has changed. */ accessible = gtk_widget_get_accessible (GTK_WIDGET (canvas)); g_signal_emit_by_name (accessible, "visible_data_changed"); } } /* Sets either or both adjustments, If hadj or vadj is NULL a new adjustment is created. */ static void goo_canvas_set_adjustments (GooCanvas *canvas, GtkAdjustment *hadj, GtkAdjustment *vadj) { gboolean need_reconfigure = FALSE; g_return_if_fail (GOO_IS_CANVAS (canvas)); if (hadj) g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); else if (canvas->hadjustment) hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); if (vadj) g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); else if (canvas->vadjustment) vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); if (canvas->hadjustment && (canvas->hadjustment != hadj)) { g_signal_handlers_disconnect_by_func (canvas->hadjustment, goo_canvas_adjustment_value_changed, canvas); g_object_unref (canvas->hadjustment); } if (canvas->vadjustment && (canvas->vadjustment != vadj)) { g_signal_handlers_disconnect_by_func (canvas->vadjustment, goo_canvas_adjustment_value_changed, canvas); g_object_unref (canvas->vadjustment); } if (canvas->hadjustment != hadj) { canvas->hadjustment = hadj; g_object_ref_sink (canvas->hadjustment); g_signal_connect (canvas->hadjustment, "value_changed", G_CALLBACK (goo_canvas_adjustment_value_changed), canvas); need_reconfigure = TRUE; } if (canvas->vadjustment != vadj) { canvas->vadjustment = vadj; g_object_ref_sink (canvas->vadjustment); g_signal_connect (canvas->vadjustment, "value_changed", G_CALLBACK (goo_canvas_adjustment_value_changed), canvas); need_reconfigure = TRUE; } if (need_reconfigure) reconfigure_canvas (canvas, TRUE); } /* Sets one of our pointers to an item, adding a reference to it and releasing any reference to the current item. */ static void set_item_pointer (GooCanvasItem **item, GooCanvasItem *new) { /* If the item hasn't changed, just return. */ if (*item == new) return; /* Unref the current item, if it isn't NULL. */ if (*item) g_object_unref (*item); /* Set the new item. */ *item = new; /* Add a reference to it, if it isn't NULL. */ if (*item) g_object_ref (*item); } /** * goo_canvas_get_bounds: * @canvas: a #GooCanvas. * @left: a pointer to a #gdouble to return the left edge, or %NULL. * @top: a pointer to a #gdouble to return the top edge, or %NULL. * @right: a pointer to a #gdouble to return the right edge, or %NULL. * @bottom: a pointer to a #gdouble to return the bottom edge, or %NULL. * * Gets the bounds of the canvas, in canvas units. * * By default, canvas units are pixels, though the #GooCanvas:units property * can be used to change the units to points, inches or millimeters. **/ void goo_canvas_get_bounds (GooCanvas *canvas, gdouble *left, gdouble *top, gdouble *right, gdouble *bottom) { g_return_if_fail (GOO_IS_CANVAS (canvas)); if (left) *left = canvas->bounds.x1; if (top) *top = canvas->bounds.y1; if (right) *right = canvas->bounds.x2; if (bottom) *bottom = canvas->bounds.y2; } /** * goo_canvas_set_bounds: * @canvas: a #GooCanvas. * @left: the left edge. * @top: the top edge. * @right: the right edge. * @bottom: the bottom edge. * * Sets the bounds of the #GooCanvas, in canvas units. * * By default, canvas units are pixels, though the #GooCanvas:units property * can be used to change the units to points, inches or millimeters. **/ void goo_canvas_set_bounds (GooCanvas *canvas, gdouble left, gdouble top, gdouble right, gdouble bottom) { g_return_if_fail (GOO_IS_CANVAS (canvas)); canvas->bounds.x1 = left; canvas->bounds.y1 = top; canvas->bounds.x2 = right; canvas->bounds.y2 = bottom; reconfigure_canvas (canvas, FALSE); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_scroll_to: * @canvas: a #GooCanvas. * @left: the x coordinate to scroll to. * @top: the y coordinate to scroll to. * * Scrolls the canvas, placing the given point as close to the top-left of * the view as possible. **/ void goo_canvas_scroll_to (GooCanvas *canvas, gdouble left, gdouble top) { gdouble x = left, y = top; g_return_if_fail (GOO_IS_CANVAS (canvas)); /* The scrollbar adjustments use pixel values, so convert to pixels. */ goo_canvas_convert_to_pixels (canvas, &x, &y); /* Make sure we stay within the bounds. */ x = CLAMP (x, canvas->hadjustment->lower, canvas->hadjustment->upper - canvas->hadjustment->page_size); y = CLAMP (y, canvas->vadjustment->lower, canvas->vadjustment->upper - canvas->vadjustment->page_size); canvas->freeze_count++; gtk_adjustment_set_value (canvas->hadjustment, x); gtk_adjustment_set_value (canvas->vadjustment, y); canvas->freeze_count--; goo_canvas_adjustment_value_changed (NULL, canvas); } /* This makes sure the given item is displayed, scrolling if necessary. */ static void goo_canvas_scroll_to_item (GooCanvas *canvas, GooCanvasItem *item) { GooCanvasBounds bounds; gdouble hvalue, vvalue; /* We can't scroll to static items. */ if (goo_canvas_item_get_is_static (item)) return; goo_canvas_item_get_bounds (item, &bounds); goo_canvas_convert_to_pixels (canvas, &bounds.x1, &bounds.y1); goo_canvas_convert_to_pixels (canvas, &bounds.x2, &bounds.y2); canvas->freeze_count++; /* Remember the current adjustment values. */ hvalue = canvas->hadjustment->value; vvalue = canvas->vadjustment->value; /* Update the adjustments so the item is displayed. */ gtk_adjustment_clamp_page (canvas->hadjustment, bounds.x1, bounds.x2); gtk_adjustment_clamp_page (canvas->vadjustment, bounds.y1, bounds.y2); canvas->freeze_count--; /* If the adjustments have changed we need to scroll. */ if (hvalue != canvas->hadjustment->value || vvalue != canvas->vadjustment->value) goo_canvas_adjustment_value_changed (NULL, canvas); } /** * goo_canvas_get_scale: * @canvas: a #GooCanvas. * * Gets the current scale of the canvas. * * The scale specifies the magnification factor of the canvas, e.g. if an item * has a width of 2 pixels and the scale is set to 3, it will be displayed with * a width of 2 x 3 = 6 pixels. * * Returns: the current scale setting. **/ gdouble goo_canvas_get_scale (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), 1.0); return canvas->scale; } static void goo_canvas_set_scale_internal (GooCanvas *canvas, gdouble scale_x, gdouble scale_y) { gdouble x, y; g_return_if_fail (GOO_IS_CANVAS (canvas)); /* Calculate the coords of the current center point in pixels. */ x = canvas->hadjustment->value + canvas->hadjustment->page_size / 2; y = canvas->vadjustment->value + canvas->vadjustment->page_size / 2; /* Convert from pixel units to device units. */ goo_canvas_convert_from_pixels (canvas, &x, &y); /* Show our temporary window above the canvas window, so that the windowing system doesn't try to scroll the contents when we change the adjustments. Since we are changing the scale we need to redraw everything so the scrolling is unnecessary and really ugly. FIXME: There is a possible issue with keyboard focus/input methods here, since hidden windows can't have the keyboard focus. */ #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_get_mapped (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_MAPPED (canvas)) #endif gdk_window_show (canvas->tmp_window); canvas->freeze_count++; canvas->scale_x = scale_x; canvas->scale_y = scale_y; canvas->scale = MIN (scale_x, scale_y); reconfigure_canvas (canvas, FALSE); /* Convert from the center point to the new desired top-left posision. */ x -= canvas->hadjustment->page_size / canvas->device_to_pixels_x / 2; y -= canvas->vadjustment->page_size / canvas->device_to_pixels_y / 2; /* Now try to scroll to it. */ goo_canvas_scroll_to (canvas, x, y); canvas->freeze_count--; goo_canvas_adjustment_value_changed (NULL, canvas); /* Now hide the temporary window, so the canvas window will get an expose event. */ #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_get_mapped (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_MAPPED (canvas)) #endif gdk_window_hide (canvas->tmp_window); } /** * goo_canvas_set_scale: * @canvas: a #GooCanvas. * @scale: the new scale setting. * * Sets the scale of the canvas. * * The scale specifies the magnification factor of the canvas, e.g. if an item * has a width of 2 pixels and the scale is set to 3, it will be displayed with * a width of 2 x 3 = 6 pixels. **/ void goo_canvas_set_scale (GooCanvas *canvas, gdouble scale) { g_return_if_fail (GOO_IS_CANVAS (canvas)); goo_canvas_set_scale_internal (canvas, scale, scale); } /** * goo_canvas_unregister_item: * @canvas: a #GooCanvas. * @model: the item model whose canvas item is being finalized. * * This function is only intended to be used when implementing new canvas * items. * * It should be called in the finalize method of #GooCanvasItem * objects, to remove the canvas item from the #GooCanvas's hash table. **/ void goo_canvas_unregister_item (GooCanvas *canvas, GooCanvasItemModel *model) { if (canvas->model_to_item) g_hash_table_remove (canvas->model_to_item, model); } /** * goo_canvas_create_item: * @canvas: a #GooCanvas. * @model: the item model to create a canvas item for. * * This function is only intended to be used when implementing new canvas * items, typically container items such as #GooCanvasGroup. * * It creates a new canvas item for the given item model, and recursively * creates items for any children. * * It uses the create_item() virtual method if it has been set. * Subclasses of #GooCanvas can define this method if they want to use * custom views for items. * * It emits the #GooCanvas::item-created signal after creating the view, so * application code can connect signal handlers to the new view if desired. * * Returns: a new canvas item. **/ GooCanvasItem* goo_canvas_create_item (GooCanvas *canvas, GooCanvasItemModel *model) { GooCanvasItem *item = NULL; /* Use the virtual method if it has been set. */ if (GOO_CANVAS_GET_CLASS (canvas)->create_item) item = GOO_CANVAS_GET_CLASS (canvas)->create_item (canvas, model); /* The virtual method can return NULL to use the default view for an item. */ if (!item) item = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->create_item (model, canvas); if (canvas->model_to_item) g_hash_table_insert (canvas->model_to_item, model, item); /* Emit a signal so apps can hook up signal handlers if they want. */ g_signal_emit (canvas, canvas_signals[ITEM_CREATED], 0, item, model); return item; } static void goo_canvas_update_automatic_bounds (GooCanvas *canvas) { GooCanvasBounds bounds = { 0.0, 0.0, GOO_CANVAS_DEFAULT_WIDTH, GOO_CANVAS_DEFAULT_HEIGHT }; if (canvas->root_item) goo_canvas_item_get_bounds (canvas->root_item, &bounds); /* Calculate the new automatic bounds, which is the bounds of all the items in the canvas plus any specified padding. If bounds_from_origin is set x1 and y1 are set to 0.0. */ if (canvas->bounds_from_origin) { bounds.x1 = 0.0; bounds.y1 = 0.0; bounds.x2 += canvas->bounds_padding; bounds.y2 += canvas->bounds_padding; } else { bounds.x1 -= canvas->bounds_padding; bounds.y1 -= canvas->bounds_padding; bounds.x2 += canvas->bounds_padding; bounds.y2 += canvas->bounds_padding; } /* Make sure the bounds are sane. */ if (bounds.x2 < bounds.x1) bounds.x2 = bounds.x1; if (bounds.y2 < bounds.y1) bounds.y2 = bounds.y1; /* If the bounds have changed, reconfigure the canvas and redraw. */ if (bounds.x1 != canvas->bounds.x1 || bounds.y1 != canvas->bounds.y1 || bounds.x2 != canvas->bounds.x2 || bounds.y2 != canvas->bounds.y2) { canvas->bounds = bounds; reconfigure_canvas (canvas, FALSE); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } } static void goo_canvas_update_internal (GooCanvas *canvas, cairo_t *cr) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GooCanvasBounds bounds, static_bounds; /* It is possible that processing the first set of updates causes other updates to be scheduled, so we loop round until all are done. Items should ensure that they don't cause this to loop forever. */ while (canvas->need_update) { gboolean entire_tree = canvas->need_entire_subtree_update; canvas->need_update = FALSE; canvas->need_entire_subtree_update = FALSE; if (canvas->root_item) goo_canvas_item_update (canvas->root_item, entire_tree, cr, &bounds); if (priv->static_root_item) goo_canvas_item_update (priv->static_root_item, entire_tree, cr, &static_bounds); } /* If the bounds are automatically-calculated, update them now. */ if (canvas->root_item && canvas->automatic_bounds) goo_canvas_update_automatic_bounds (canvas); /* Check which item is under the pointer. */ update_pointer_item (canvas, NULL); } /** * goo_canvas_update: * @canvas: a #GooCanvas. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * It updates any items that need updating. * * If the bounds of items change, they will request a redraw of the old and * new bounds so the display is updated correctly. **/ void goo_canvas_update (GooCanvas *canvas) { cairo_t *cr = goo_canvas_create_cairo_context (canvas); goo_canvas_update_internal (canvas, cr); cairo_destroy (cr); } static gint goo_canvas_idle_handler (GooCanvas *canvas) { GDK_THREADS_ENTER (); goo_canvas_update (canvas); /* Reset idle id. Note that we do this after goo_canvas_update(), to make sure we don't schedule another idle handler while that is running. */ canvas->idle_id = 0; GDK_THREADS_LEAVE (); /* Return FALSE to remove the idle handler. */ return FALSE; } /** * goo_canvas_request_update: * @canvas: a #GooCanvas. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * It schedules an update of the #GooCanvas. This will be performed in * the idle loop, after all pending events have been handled, but before * the canvas has been repainted. **/ void goo_canvas_request_update (GooCanvas *canvas) { canvas->need_update = TRUE; /* We have to wait until we are realized. We'll do a full update then. */ #if GTK_CHECK_VERSION (2, 19, 6) if (!gtk_widget_get_realized (GTK_WIDGET (canvas))) #else if (!GTK_WIDGET_REALIZED (canvas)) #endif return; /* We use a higher priority than the normal GTK+ resize/redraw idle handlers * so the canvas state will be updated before allocating sizes & redrawing. */ if (!canvas->idle_id) canvas->idle_id = g_idle_add_full (GTK_PRIORITY_RESIZE - 5, (GSourceFunc) goo_canvas_idle_handler, canvas, NULL); } /** * goo_canvas_request_redraw: * @canvas: a #GooCanvas. * @bounds: the bounds to redraw, in device space. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * Requests that the given bounds be redrawn. The bounds must be in the canvas * coordinate space. **/ void goo_canvas_request_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds) { GdkRectangle rect; #if GTK_CHECK_VERSION (2, 19, 6) if (!gtk_widget_is_drawable (GTK_WIDGET (canvas)) || (bounds->x1 == bounds->x2)) #else if (!GTK_WIDGET_DRAWABLE (canvas) || (bounds->x1 == bounds->x2)) #endif return; /* We subtract one from the left & top edges, in case anti-aliasing makes the drawing use an extra pixel. */ rect.x = (double) (bounds->x1 - canvas->bounds.x1) * canvas->device_to_pixels_x - 1; rect.y = (double) (bounds->y1 - canvas->bounds.y1) * canvas->device_to_pixels_y - 1; /* We add an extra one here for the same reason. (The other extra one is to round up to the next pixel.) And one for luck! */ rect.width = (double) (bounds->x2 - canvas->bounds.x1) * canvas->device_to_pixels_x - rect.x + 2 + 1; rect.height = (double) (bounds->y2 - canvas->bounds.y1) * canvas->device_to_pixels_y - rect.y + 2 + 1; rect.x += canvas->canvas_x_offset; rect.y += canvas->canvas_y_offset; gdk_window_invalidate_rect (canvas->canvas_window, &rect, FALSE); } /** * goo_canvas_request_item_redraw: * @canvas: a #GooCanvas. * @bounds: the bounds of the item to redraw. * @is_static: if the item is static. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * Requests that the given bounds be redrawn. If @is_static is %TRUE the bounds * are assumed to be in the static item coordinate space, otherwise they are * assumed to be in the canvas coordinate space. * * If @is_static is %FALSE this function behaves the same as * goo_canvas_request_redraw(). **/ void goo_canvas_request_item_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds, gboolean is_static) { /* If the canvas hasn't been painted yet, we can just return as it all needs a redraw. This can save a lot of time if there are lots of items. */ if (canvas->before_initial_expose) return; if (is_static) request_static_redraw (canvas, bounds); else goo_canvas_request_redraw (canvas, bounds); } static void paint_static_items (GooCanvas *canvas, GdkEventExpose *event, cairo_t *cr) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GooCanvasBounds static_bounds; double static_x_offset, static_y_offset; cairo_save (cr); cairo_identity_matrix (cr); static_x_offset = floor (canvas->hadjustment->value); static_y_offset = floor (canvas->vadjustment->value); cairo_translate (cr, static_x_offset, static_y_offset); /* FIXME: Uses pixels at present - use canvas units instead? */ static_bounds.x1 = event->area.x - static_x_offset; static_bounds.y1 = event->area.y - static_y_offset; static_bounds.x2 = event->area.width + static_bounds.x1; static_bounds.y2 = event->area.height + static_bounds.y1; goo_canvas_item_paint (priv->static_root_item, cr, &static_bounds, 1.0); cairo_restore (cr); } static gboolean goo_canvas_expose_event (GtkWidget *widget, GdkEventExpose *event) { GooCanvas *canvas = GOO_CANVAS (widget); GooCanvasBounds bounds, root_item_bounds; cairo_t *cr; double x1, y1, x2, y2; if (!canvas->root_item) { canvas->before_initial_expose = FALSE; return FALSE; } if (event->window != canvas->canvas_window) return FALSE; /* Clear the background. */ if (canvas->clear_background) { gdk_draw_rectangle (canvas->canvas_window, widget->style->base_gc[widget->state], TRUE, event->area.x, event->area.y, event->area.width, event->area.height); } cr = goo_canvas_create_cairo_context (canvas); cairo_save (cr); if (canvas->need_update) goo_canvas_update_internal (canvas, cr); bounds.x1 = ((event->area.x - canvas->canvas_x_offset) / canvas->device_to_pixels_x) + canvas->bounds.x1; bounds.y1 = ((event->area.y - canvas->canvas_y_offset) / canvas->device_to_pixels_y) + canvas->bounds.y1; bounds.x2 = (event->area.width / canvas->device_to_pixels_x) + bounds.x1; bounds.y2 = (event->area.height / canvas->device_to_pixels_y) + bounds.y1; /* Translate it to use the canvas pixel offsets (used when the canvas is smaller than the window and the anchor isn't set to NORTH_WEST). */ cairo_translate (cr, canvas->canvas_x_offset, canvas->canvas_y_offset); /* Scale it so we can use canvas coordinates. */ cairo_scale (cr, canvas->device_to_pixels_x, canvas->device_to_pixels_y); /* Translate it so the top-left of the canvas becomes (0,0). */ cairo_translate (cr, -canvas->bounds.x1, -canvas->bounds.y1); /* Clip to the canvas bounds, if necessary. We only need to clip if the items in the canvas extend outside the canvas bounds and the canvas bounds is less than the area being painted. */ goo_canvas_item_get_bounds (canvas->root_item, &root_item_bounds); if ((root_item_bounds.x1 < canvas->bounds.x1 && canvas->bounds.x1 > bounds.x1) || (root_item_bounds.x2 > canvas->bounds.x2 && canvas->bounds.x2 < bounds.x2) || (root_item_bounds.y1 < canvas->bounds.y1 && canvas->bounds.y1 > bounds.y1) || (root_item_bounds.y2 > canvas->bounds.y2 && canvas->bounds.y2 < bounds.y2)) { /* Clip to the intersection of the canvas bounds and the expose bounds, to avoid cairo's 16-bit limits. */ x1 = MAX (canvas->bounds.x1, bounds.x1); y1 = MAX (canvas->bounds.y1, bounds.y1); x2 = MIN (canvas->bounds.x2, bounds.x2); y2 = MIN (canvas->bounds.y2, bounds.y2); cairo_new_path (cr); cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y1); cairo_line_to (cr, x2, y2); cairo_line_to (cr, x1, y2); cairo_close_path (cr); cairo_clip (cr); } goo_canvas_item_paint (canvas->root_item, cr, &bounds, canvas->scale); cairo_restore (cr); paint_static_items (canvas, event, cr); cairo_destroy (cr); GTK_WIDGET_CLASS (goo_canvas_parent_class)->expose_event (widget, event); canvas->before_initial_expose = FALSE; return FALSE; } /** * goo_canvas_render: * @canvas: a #GooCanvas. * @cr: a cairo context. * @bounds: the area to render, or %NULL to render the entire canvas. * @scale: the scale to compare with each item's visibility * threshold to see if they should be rendered. This only affects items that * have their visibility set to %GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD. * * Renders all or part of a canvas to the given cairo context. **/ void goo_canvas_render (GooCanvas *canvas, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { if (canvas->need_update) goo_canvas_update (canvas); /* Set the default line width based on the current units setting. */ cairo_set_line_width (cr, goo_canvas_get_default_line_width (canvas)); if (bounds) { /* Clip to the given bounds. */ cairo_new_path (cr); cairo_move_to (cr, bounds->x1, bounds->y1); cairo_line_to (cr, bounds->x2, bounds->y1); cairo_line_to (cr, bounds->x2, bounds->y2); cairo_line_to (cr, bounds->x1, bounds->y2); cairo_close_path (cr); cairo_clip (cr); goo_canvas_item_paint (canvas->root_item, cr, bounds, scale); } else { goo_canvas_item_paint (canvas->root_item, cr, &canvas->bounds, scale); } } /* * Keyboard/Mouse Event & Grab Handling. */ /* Initializes a synthesized crossing event from a given button press/release, motion, or crossing event. */ static void initialize_crossing_event (GooCanvas *canvas, GdkEvent *event) { GdkEventCrossing *crossing_event = &canvas->crossing_event; /* Initialize the crossing event. */ crossing_event->type = event->any.type; crossing_event->window = event->any.window; crossing_event->send_event = event->any.send_event; crossing_event->subwindow = NULL; crossing_event->detail = GDK_NOTIFY_ANCESTOR; crossing_event->focus = FALSE; crossing_event->mode = GDK_CROSSING_NORMAL; switch (event->type) { case GDK_MOTION_NOTIFY: crossing_event->time = event->motion.time; crossing_event->x = event->motion.x; crossing_event->y = event->motion.y; crossing_event->x_root = event->motion.x_root; crossing_event->y_root = event->motion.y_root; crossing_event->state = event->motion.state; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: crossing_event->time = event->crossing.time; crossing_event->x = event->crossing.x; crossing_event->y = event->crossing.y; crossing_event->x_root = event->crossing.x_root; crossing_event->y_root = event->crossing.y_root; crossing_event->state = event->crossing.state; break; case GDK_SCROLL: crossing_event->time = event->scroll.time; crossing_event->x = event->scroll.x; crossing_event->y = event->scroll.y; crossing_event->x_root = event->scroll.x_root; crossing_event->y_root = event->scroll.y_root; crossing_event->state = event->scroll.state; break; default: /* It must be a button press/release event. */ crossing_event->time = event->button.time; crossing_event->x = event->button.x; crossing_event->y = event->button.y; crossing_event->x_root = event->button.x_root; crossing_event->y_root = event->button.y_root; crossing_event->state = event->button.state; break; } } /* Emits a signal for an item and all its parents, until one of them returns TRUE. */ static gboolean propagate_event (GooCanvas *canvas, GooCanvasItem *item, gchar *signal_name, GdkEvent *event) { GooCanvasItem *ancestor; gboolean stop_emission = FALSE, valid; /* Don't emit any events if the canvas is not realized. */ #if GTK_CHECK_VERSION (2, 19, 6) if (!gtk_widget_get_realized (GTK_WIDGET (canvas))) #else if (!GTK_WIDGET_REALIZED (canvas)) #endif return FALSE; if (item) { /* Check if the item is still in the canvas. */ if (!ITEM_IS_VALID (item)) return FALSE; ancestor = item; } else { /* If there is no target item, we send the event to the root item, with target set to NULL. */ ancestor = canvas->root_item; } /* Make sure the item pointer remains valid throughout the emission. */ if (item) g_object_ref (item); while (ancestor) { g_object_ref (ancestor); g_signal_emit_by_name (ancestor, signal_name, item, event, &stop_emission); /* Check if the ancestor is still in the canvas. */ valid = ITEM_IS_VALID (ancestor) ? TRUE : FALSE; g_object_unref (ancestor); if (stop_emission || !valid) break; ancestor = goo_canvas_item_get_parent (ancestor); } if (item) g_object_unref (item); return stop_emission; } /* This is called to emit pointer events - enter/leave notify, motion notify, and button press/release. */ static gboolean emit_pointer_event (GooCanvas *canvas, gchar *signal_name, GdkEvent *original_event) { GdkEvent event = *original_event; GooCanvasItem *target_item = canvas->pointer_item; double *x, *y, *x_root, *y_root; /* Check if an item has grabbed the pointer. */ if (canvas->pointer_grab_item) { /* When the pointer is grabbed, it receives all the pointer motion, button press/release events and its own enter/leave notify events. Enter/leave notify events for other items are discarded. */ if ((event.type == GDK_ENTER_NOTIFY || event.type == GDK_LEAVE_NOTIFY) && canvas->pointer_item != canvas->pointer_grab_item) return FALSE; target_item = canvas->pointer_grab_item; } /* Check if the target item is still in the canvas. */ if (target_item && !ITEM_IS_VALID (target_item)) return FALSE; /* Translate the x & y coordinates to the item's space. */ switch (event.type) { case GDK_MOTION_NOTIFY: x = &event.motion.x; y = &event.motion.y; x_root = &event.motion.x_root; y_root = &event.motion.y_root; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: x = &event.crossing.x; y = &event.crossing.y; x_root = &event.crossing.x_root; y_root = &event.crossing.y_root; break; case GDK_SCROLL: x = &event.scroll.x; y = &event.scroll.y; x_root = &event.scroll.x_root; y_root = &event.scroll.y_root; break; default: /* It must be a button press/release event. */ x = &event.button.x; y = &event.button.y; x_root = &event.button.x_root; y_root = &event.button.y_root; break; } /* Add 0.5 to the pixel coordinates so we use the center of the pixel. */ *x += 0.5; *y += 0.5; /* Convert to the canvas coordinate space. */ goo_canvas_convert_from_pixels (canvas, x, y); /* Convert to static item space, if necessary. */ if (target_item && goo_canvas_item_get_is_static (target_item)) goo_canvas_convert_to_static_item_space (canvas, x, y); /* Copy to the x_root & y_root fields. */ *x_root = *x; *y_root = *y; /* Convert to the item's coordinate space. */ goo_canvas_convert_to_item_space (canvas, target_item, x, y); return propagate_event (canvas, target_item, signal_name, &event); } /* Finds the item that the mouse is over, using the given event's * coordinates. It emits enter/leave events for items as appropriate. */ static void update_pointer_item (GooCanvas *canvas, GdkEvent *event) { GooCanvasItem *new_item = NULL; if (event) initialize_crossing_event (canvas, event); /* If the event type is GDK_LEAVE_NOTIFY, the mouse has left the canvas, so we leave new_item as NULL, otherwise we find which item is underneath the mouse. Note that we initialize the type to GDK_LEAVE_NOTIFY in goo_canvas_init() to indicate the mouse isn't in the canvas. */ if (canvas->crossing_event.type != GDK_LEAVE_NOTIFY && canvas->root_item) { double x = canvas->crossing_event.x; double y = canvas->crossing_event.y; goo_canvas_convert_from_pixels (canvas, &x, &y); new_item = goo_canvas_get_item_at (canvas, x, y, TRUE); } /* If the current item hasn't changed, just return. */ if (new_item == canvas->pointer_item) return; /* Ref the new item, in case it is removed below. */ if (new_item) g_object_ref (new_item); /* Emit a leave-notify event for the current item. */ if (canvas->pointer_item) { canvas->crossing_event.type = GDK_LEAVE_NOTIFY; emit_pointer_event (canvas, "leave_notify_event", (GdkEvent*) &canvas->crossing_event); } /* If there is no new item we are done. */ if (!new_item) { set_item_pointer (&canvas->pointer_item, NULL); return; } /* If the new item isn't in the canvas any more, don't use it. */ if (!ITEM_IS_VALID (new_item)) { set_item_pointer (&canvas->pointer_item, NULL); g_object_unref (new_item); return; } /* Emit an enter-notify for the new current item. */ set_item_pointer (&canvas->pointer_item, new_item); canvas->crossing_event.type = GDK_ENTER_NOTIFY; emit_pointer_event (canvas, "enter_notify_event", (GdkEvent*) &canvas->crossing_event); g_object_unref (new_item); } static gboolean goo_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event) { GooCanvas *canvas = GOO_CANVAS (widget); if (event->window != canvas->canvas_window) return FALSE; /* This will result in synthesizing focus_in/out events as appropriate. */ update_pointer_item (canvas, (GdkEvent*) event); return FALSE; } static gboolean goo_canvas_motion (GtkWidget *widget, GdkEventMotion *event) { GooCanvas *canvas = GOO_CANVAS (widget); if (event->window != canvas->canvas_window) return FALSE; /* For motion notify hint events we need to call gdk_window_get_pointer() to let X know we're ready for another pointer event. */ if (event->is_hint) gdk_window_get_pointer (event->window, NULL, NULL, NULL); update_pointer_item (canvas, (GdkEvent*) event); return emit_pointer_event (canvas, "motion_notify_event", (GdkEvent*) event); } static gboolean goo_canvas_button_press (GtkWidget *widget, GdkEventButton *event) { GooCanvas *canvas = GOO_CANVAS (widget); GdkDisplay *display; if (event->window != canvas->canvas_window) return FALSE; update_pointer_item (canvas, (GdkEvent*) event); /* Check if this is the start of an implicit pointer grab, i.e. if we don't already have a grab and the app has no active grab. */ display = gtk_widget_get_display (widget); if (!canvas->pointer_grab_item && !gdk_display_pointer_is_grabbed (display)) { set_item_pointer (&canvas->pointer_grab_initial_item, canvas->pointer_item); set_item_pointer (&canvas->pointer_grab_item, canvas->pointer_item); canvas->pointer_grab_button = event->button; } return emit_pointer_event (canvas, "button_press_event", (GdkEvent*) event); } static gboolean goo_canvas_button_release (GtkWidget *widget, GdkEventButton *event) { GooCanvas *canvas = GOO_CANVAS (widget); GdkDisplay *display; gboolean retval; if (event->window != canvas->canvas_window) return FALSE; update_pointer_item (canvas, (GdkEvent*) event); retval = emit_pointer_event (canvas, "button_release_event", (GdkEvent*) event); /* Check if an implicit (passive) grab has ended. */ display = gtk_widget_get_display (widget); if (canvas->pointer_grab_item && event->button == canvas->pointer_grab_button && !gdk_display_pointer_is_grabbed (display)) { /* We set the pointer item back to the item it was in before the grab, so we'll synthesize enter/leave notify events as appropriate. */ if (canvas->pointer_grab_initial_item && ITEM_IS_VALID (canvas->pointer_grab_initial_item)) set_item_pointer (&canvas->pointer_item, canvas->pointer_grab_initial_item); else set_item_pointer (&canvas->pointer_item, NULL); set_item_pointer (&canvas->pointer_grab_item, NULL); set_item_pointer (&canvas->pointer_grab_initial_item, NULL); update_pointer_item (canvas, (GdkEvent*) event); } return retval; } static gint goo_canvas_scroll (GtkWidget *widget, GdkEventScroll *event) { GooCanvas *canvas = GOO_CANVAS (widget); GtkAdjustment *adj; gdouble delta, new_value; if (event->window == canvas->canvas_window) { /* See if the current item wants the scroll event. */ update_pointer_item (canvas, (GdkEvent*) event); if (emit_pointer_event (canvas, "scroll_event", (GdkEvent*) event)) return TRUE; } if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN) adj = canvas->vadjustment; else adj = canvas->hadjustment; delta = pow (adj->page_size, 2.0 / 3.0); if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_LEFT) delta = - delta; new_value = CLAMP (adj->value + delta, adj->lower, adj->upper - adj->page_size); gtk_adjustment_set_value (adj, new_value); return TRUE; } static gboolean goo_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event) { GooCanvas *canvas = GOO_CANVAS (widget); GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); if (canvas->focused_item) return propagate_event (canvas, canvas->focused_item, "focus_in_event", (GdkEvent*) event); else return FALSE; } static gboolean goo_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event) { GooCanvas *canvas = GOO_CANVAS (widget); GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); if (canvas->focused_item) return propagate_event (canvas, canvas->focused_item, "focus_out_event", (GdkEvent*) event); else return FALSE; } static gboolean goo_canvas_key_press (GtkWidget *widget, GdkEventKey *event) { GooCanvas *canvas = GOO_CANVAS (widget); #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_has_focus (GTK_WIDGET (canvas)) && canvas->focused_item) #else if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item) #endif if (propagate_event (canvas, canvas->focused_item, "key_press_event", (GdkEvent*) event)) return TRUE; return GTK_WIDGET_CLASS (goo_canvas_parent_class)->key_press_event (widget, event); } static gboolean goo_canvas_key_release (GtkWidget *widget, GdkEventKey *event) { GooCanvas *canvas = GOO_CANVAS (widget); #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_has_focus (GTK_WIDGET (canvas)) && canvas->focused_item) #else if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item) #endif if (propagate_event (canvas, canvas->focused_item, "key_release_event", (GdkEvent*) event)) return TRUE; return GTK_WIDGET_CLASS (goo_canvas_parent_class)->key_release_event (widget, event); } static void generate_grab_broken (GooCanvas *canvas, GooCanvasItem *item, gboolean keyboard, gboolean implicit) { GdkEventGrabBroken event; if (!ITEM_IS_VALID (item)) return; event.type = GDK_GRAB_BROKEN; event.window = canvas->canvas_window; event.send_event = 0; event.keyboard = keyboard; event.implicit = implicit; event.grab_window = event.window; propagate_event (canvas, item, "grab_broken_event", (GdkEvent*) &event); } static gboolean goo_canvas_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event) { GooCanvas *canvas; g_return_val_if_fail (GOO_IS_CANVAS (widget), FALSE); canvas = GOO_CANVAS (widget); if (event->keyboard) { if (canvas->keyboard_grab_item) { generate_grab_broken (canvas, canvas->keyboard_grab_item, event->keyboard, event->implicit); set_item_pointer (&canvas->keyboard_grab_item, NULL); } } else { if (canvas->pointer_grab_item) { generate_grab_broken (canvas, canvas->pointer_grab_item, event->keyboard, event->implicit); set_item_pointer (&canvas->pointer_grab_item, NULL); } } return TRUE; } /** * goo_canvas_grab_focus: * @canvas: a #GooCanvas. * @item: the item to grab the focus. * * Grabs the keyboard focus for the given item. **/ void goo_canvas_grab_focus (GooCanvas *canvas, GooCanvasItem *item) { GdkEventFocus event; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GTK_WIDGET_CAN_FOCUS (canvas)); if (canvas->focused_item) { event.type = GDK_FOCUS_CHANGE; event.window = canvas->canvas_window; event.send_event = FALSE; event.in = FALSE; propagate_event (canvas, canvas->focused_item, "focus_out_event", (GdkEvent*) &event); } set_item_pointer (&canvas->focused_item, item); gtk_widget_grab_focus (GTK_WIDGET (canvas)); if (canvas->focused_item) { event.type = GDK_FOCUS_CHANGE; event.window = canvas->canvas_window; event.send_event = FALSE; event.in = TRUE; propagate_event (canvas, canvas->focused_item, "focus_in_event", (GdkEvent*) &event); } } /* * Pointer/keyboard grabbing & ungrabbing. */ /** * goo_canvas_pointer_grab: * @canvas: a #GooCanvas. * @item: the item to grab the pointer for. * @event_mask: the events to receive during the grab. * @cursor: the cursor to display during the grab, or NULL. * @time: the time of the event that lead to the pointer grab. This should * come from the relevant #GdkEvent. * * Attempts to grab the pointer for the given item. * * Returns: %GDK_GRAB_SUCCESS if the grab succeeded. **/ GdkGrabStatus goo_canvas_pointer_grab (GooCanvas *canvas, GooCanvasItem *item, GdkEventMask event_mask, GdkCursor *cursor, guint32 time) { GdkGrabStatus status = GDK_GRAB_SUCCESS; g_return_val_if_fail (GOO_IS_CANVAS (canvas), GDK_GRAB_NOT_VIEWABLE); g_return_val_if_fail (GOO_IS_CANVAS_ITEM (item), GDK_GRAB_NOT_VIEWABLE); /* If another item already has the pointer grab, we need to synthesize a grab-broken event for the current grab item. */ if (canvas->pointer_grab_item && canvas->pointer_grab_item != item) { generate_grab_broken (canvas, canvas->pointer_grab_item, FALSE, FALSE); set_item_pointer (&canvas->pointer_grab_item, NULL); } /* This overrides any existing grab. */ status = gdk_pointer_grab (canvas->canvas_window, FALSE, event_mask, NULL, cursor, time); if (status == GDK_GRAB_SUCCESS) { set_item_pointer (&canvas->pointer_grab_initial_item, canvas->pointer_item); set_item_pointer (&canvas->pointer_grab_item, item); } return status; } /** * goo_canvas_pointer_ungrab: * @canvas: a #GooCanvas. * @item: the item that has the grab. * @time: the time of the event that lead to the pointer ungrab. This should * come from the relevant #GdkEvent. * * Ungrabs the pointer, if the given item has the pointer grab. **/ void goo_canvas_pointer_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time) { GdkDisplay *display; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); /* If the item doesn't actually have the pointer grab, just return. */ if (canvas->pointer_grab_item != item) return; /* If it is an active pointer grab, ungrab it explicitly. */ display = gtk_widget_get_display (GTK_WIDGET (canvas)); if (gdk_display_pointer_is_grabbed (display)) gdk_display_pointer_ungrab (display, time); /* We set the pointer item back to the item it was in before the grab, so we'll synthesize enter/leave notify events as appropriate. */ if (canvas->pointer_grab_initial_item && ITEM_IS_VALID (canvas->pointer_grab_initial_item)) set_item_pointer (&canvas->pointer_item, canvas->pointer_grab_initial_item); else set_item_pointer (&canvas->pointer_item, NULL); set_item_pointer (&canvas->pointer_grab_item, NULL); set_item_pointer (&canvas->pointer_grab_initial_item, NULL); update_pointer_item (canvas, NULL); } /** * goo_canvas_keyboard_grab: * @canvas: a #GooCanvas. * @item: the item to grab the keyboard for. * @owner_events: %TRUE if keyboard events for this application will be * reported normally, or %FALSE if all keyboard events will be reported with * respect to the grab item. * @time: the time of the event that lead to the keyboard grab. This should * come from the relevant #GdkEvent. * * Attempts to grab the keyboard for the given item. * * Returns: %GDK_GRAB_SUCCESS if the grab succeeded. **/ GdkGrabStatus goo_canvas_keyboard_grab (GooCanvas *canvas, GooCanvasItem *item, gboolean owner_events, guint32 time) { GdkGrabStatus status = GDK_GRAB_SUCCESS; g_return_val_if_fail (GOO_IS_CANVAS (canvas), GDK_GRAB_NOT_VIEWABLE); g_return_val_if_fail (GOO_IS_CANVAS_ITEM (item), GDK_GRAB_NOT_VIEWABLE); /* Check if the item already has the keyboard grab. */ if (canvas->keyboard_grab_item == item) return GDK_GRAB_ALREADY_GRABBED; /* If another item already has the keyboard grab, we need to synthesize a grab-broken event for the current grab item. */ if (canvas->keyboard_grab_item) { generate_grab_broken (canvas, canvas->keyboard_grab_item, TRUE, FALSE); set_item_pointer (&canvas->keyboard_grab_item, NULL); } /* This overrides any existing grab. */ status = gdk_keyboard_grab (canvas->canvas_window, owner_events, time); if (status == GDK_GRAB_SUCCESS) set_item_pointer (&canvas->keyboard_grab_item, item); return status; } /** * goo_canvas_keyboard_ungrab: * @canvas: a #GooCanvas. * @item: the item that has the keyboard grab. * @time: the time of the event that lead to the keyboard ungrab. This should * come from the relevant #GdkEvent. * * Ungrabs the keyboard, if the given item has the keyboard grab. **/ void goo_canvas_keyboard_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time) { GdkDisplay *display; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); /* If the item doesn't actually have the keyboard grab, just return. */ if (canvas->keyboard_grab_item != item) return; set_item_pointer (&canvas->keyboard_grab_item, NULL); display = gtk_widget_get_display (GTK_WIDGET (canvas)); gdk_display_keyboard_ungrab (display, time); } /* * Coordinate conversion. */ /** * goo_canvas_convert_to_pixels: * @canvas: a #GooCanvas. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from the canvas coordinate space to pixels. * * The canvas coordinate space is specified in the call to * goo_canvas_set_bounds(). * * The pixel coordinate space specifies pixels from the top-left of the entire * canvas window, according to the current scale setting. * See goo_canvas_set_scale(). **/ void goo_canvas_convert_to_pixels (GooCanvas *canvas, gdouble *x, gdouble *y) { *x = ((*x - canvas->bounds.x1) * canvas->device_to_pixels_x) + canvas->canvas_x_offset; *y = ((*y - canvas->bounds.y1) * canvas->device_to_pixels_y) + canvas->canvas_y_offset; } /** * goo_canvas_convert_from_pixels: * @canvas: a #GooCanvas. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from pixels to the canvas coordinate space. * * The pixel coordinate space specifies pixels from the top-left of the entire * canvas window, according to the current scale setting. * See goo_canvas_set_scale(). * * The canvas coordinate space is specified in the call to * goo_canvas_set_bounds(). * **/ void goo_canvas_convert_from_pixels (GooCanvas *canvas, gdouble *x, gdouble *y) { *x = ((*x - canvas->canvas_x_offset) / canvas->device_to_pixels_x) + canvas->bounds.x1; *y = ((*y - canvas->canvas_y_offset) / canvas->device_to_pixels_y) + canvas->bounds.y1; } static void goo_canvas_convert_from_window_pixels (GooCanvas *canvas, gdouble *x, gdouble *y) { *x += canvas->hadjustment->value; *y += canvas->vadjustment->value; goo_canvas_convert_from_pixels (canvas, x, y); } /* Converts from the canvas coordinate space to the static item coordinate space, i.e. in pixels from the top-left of the viewport window. */ static void goo_canvas_convert_to_static_item_space (GooCanvas *canvas, gdouble *x, gdouble *y) { *x = ((*x - canvas->bounds.x1) * canvas->device_to_pixels_x) + canvas->canvas_x_offset - canvas->hadjustment->value; *y = ((*y - canvas->bounds.y1) * canvas->device_to_pixels_y) + canvas->canvas_y_offset - canvas->vadjustment->value; } static void get_transform_to_item_space (GooCanvasItem *item, cairo_matrix_t *transform) { GooCanvasItem *tmp = item, *parent, *child; GList *list = NULL, *l; cairo_matrix_t item_transform, inverse = { 1, 0, 0, 1, 0, 0 }; gboolean has_transform; /* Step up from the item to the top, pushing items onto the list. */ while (tmp) { list = g_list_prepend (list, tmp); tmp = goo_canvas_item_get_parent (tmp); } /* Now step down applying the inverse of each item's transformation. */ for (l = list; l; l = l->next) { parent = (GooCanvasItem*) l->data; child = l->next ? (GooCanvasItem*) l->next->data : NULL; has_transform = goo_canvas_item_get_transform_for_child (parent, child, &item_transform); if (has_transform) { cairo_matrix_invert (&item_transform); cairo_matrix_multiply (&inverse, &inverse, &item_transform); } } g_list_free (list); *transform = inverse; } /** * goo_canvas_convert_to_item_space: * @canvas: a #GooCanvas. * @item: a #GooCanvasItem. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from the canvas coordinate space to the given * item's coordinate space, applying all transformation matrices including the * item's own transformation matrix, if it has one. **/ void goo_canvas_convert_to_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y) { cairo_matrix_t transform; get_transform_to_item_space (item, &transform); cairo_matrix_transform_point (&transform, x, y); } /** * goo_canvas_convert_from_item_space: * @canvas: a #GooCanvas. * @item: a #GooCanvasItem. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from the given item's coordinate space to the canvas * coordinate space, applying all transformation matrices including the * item's own transformation matrix, if it has one. **/ void goo_canvas_convert_from_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y) { GooCanvasItem *tmp = item, *parent, *child; GList *list = NULL, *l; cairo_matrix_t item_transform, transform = { 1, 0, 0, 1, 0, 0 }; gboolean has_transform; /* Step up from the item to the top, pushing items onto the list. */ while (tmp) { list = g_list_prepend (list, tmp); tmp = goo_canvas_item_get_parent (tmp); } /* Now step down applying each item's transformation. */ for (l = list; l; l = l->next) { parent = (GooCanvasItem*) l->data; child = l->next ? (GooCanvasItem*) l->next->data : NULL; has_transform = goo_canvas_item_get_transform_for_child (parent, child, &item_transform); if (has_transform) { cairo_matrix_multiply (&transform, &item_transform, &transform); } } g_list_free (list); /* Now convert the coordinates. */ cairo_matrix_transform_point (&transform, x, y); } /** * goo_canvas_convert_bounds_to_item_space: * @canvas: a #GooCanvas. * @item: a #GooCanvasItem. * @bounds: the bounds in canvas coordinate space, to be converted. * * Converts the given bounds in the canvas coordinate space to a bounding box * in item space. This is useful in the item paint() methods to convert the * bounds to be painted to the item's coordinate space. **/ void goo_canvas_convert_bounds_to_item_space (GooCanvas *canvas, GooCanvasItem *item, GooCanvasBounds *bounds) { GooCanvasBounds tmp_bounds = *bounds, tmp_bounds2 = *bounds; cairo_matrix_t transform; get_transform_to_item_space (item, &transform); /* Convert the top-left and bottom-right corners to device coords. */ cairo_matrix_transform_point (&transform, &tmp_bounds.x1, &tmp_bounds.y1); cairo_matrix_transform_point (&transform, &tmp_bounds.x2, &tmp_bounds.y2); /* Now convert the top-right and bottom-left corners. */ cairo_matrix_transform_point (&transform, &tmp_bounds2.x1, &tmp_bounds2.y2); cairo_matrix_transform_point (&transform, &tmp_bounds2.x2, &tmp_bounds2.y1); /* Calculate the minimum x coordinate seen and put in x1. */ bounds->x1 = MIN (tmp_bounds.x1, tmp_bounds.x2); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x1); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x2); /* Calculate the maximum x coordinate seen and put in x2. */ bounds->x2 = MAX (tmp_bounds.x1, tmp_bounds.x2); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x1); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x2); /* Calculate the minimum y coordinate seen and put in y1. */ bounds->y1 = MIN (tmp_bounds.y1, tmp_bounds.y2); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y1); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y2); /* Calculate the maximum y coordinate seen and put in y2. */ bounds->y2 = MAX (tmp_bounds.y1, tmp_bounds.y2); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y1); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y2); } /* * Keyboard focus navigation. */ typedef struct _GooCanvasFocusData GooCanvasFocusData; struct _GooCanvasFocusData { /* The item to start from, usually the currently focused item, or NULL. */ GooCanvasItem *start_item; /* The bounds of the start item. We try to find the next closest one in the desired direction. */ GooCanvasBounds start_bounds; gdouble start_center_x, start_center_y; /* The direction to move the focus in. */ GtkDirectionType direction; /* The text direction of the widget. */ GtkTextDirection text_direction; /* The best item found so far, and the offsets for it. */ GooCanvasItem *best_item; gdouble best_x_offset, best_y_offset, best_score; /* The offsets for the item being tested. */ GooCanvasBounds current_bounds; gdouble current_x_offset, current_y_offset, current_score; }; /* This tries to figure out the bounds of the start item or widget. */ static void goo_canvas_get_start_bounds (GooCanvas *canvas, GooCanvasFocusData *data) { GooCanvasBounds *bounds; GtkWidget *toplevel, *focus_widget; GtkAllocation *allocation; gint focus_widget_x, focus_widget_y; /* If an item is currently focused, we just need its bounds. */ if (data->start_item) { goo_canvas_item_get_bounds (data->start_item, &data->start_bounds); return; } /* Otherwise try to get the currently focused widget in the window. */ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (canvas)); bounds = &data->start_bounds; if (toplevel && GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget) { focus_widget = GTK_WINDOW (toplevel)->focus_widget; /* Translate the allocation to be relative to the GooCanvas. Skip ancestor widgets as the coords won't help. */ if (!gtk_widget_is_ancestor (GTK_WIDGET (canvas), focus_widget) && gtk_widget_translate_coordinates (focus_widget, GTK_WIDGET (canvas), 0, 0, &focus_widget_x, &focus_widget_y)) { /* Translate into device units. */ bounds->x1 = focus_widget_x; bounds->y1 = focus_widget_y; bounds->x2 = focus_widget_x + focus_widget->allocation.width; bounds->y2 = focus_widget_y + focus_widget->allocation.height; goo_canvas_convert_from_window_pixels (canvas, &bounds->x1, &bounds->y1); goo_canvas_convert_from_window_pixels (canvas, &bounds->x2, &bounds->y2); return; } } /* As a last resort, we guess a starting position based on the direction. */ allocation = >K_WIDGET (canvas)->allocation; switch (data->direction) { case GTK_DIR_DOWN: case GTK_DIR_RIGHT: /* Start from top-left. */ bounds->x1 = 0.0; bounds->y1 = 0.0; break; case GTK_DIR_UP: /* Start from bottom-left. */ bounds->x1 = 0.0; bounds->y1 = allocation->height; break; case GTK_DIR_LEFT: /* Start from top-right. */ bounds->x1 = allocation->width; bounds->y1 = 0.0; break; case GTK_DIR_TAB_FORWARD: bounds->y1 = 0.0; if (data->text_direction == GTK_TEXT_DIR_RTL) /* Start from top-right. */ bounds->x1 = allocation->width; else /* Start from top-left. */ bounds->x1 = 0.0; break; case GTK_DIR_TAB_BACKWARD: bounds->y1 = allocation->height; if (data->text_direction == GTK_TEXT_DIR_RTL) /* Start from bottom-left. */ bounds->x1 = 0.0; else /* Start from bottom-right. */ bounds->x1 = allocation->width; break; } goo_canvas_convert_from_window_pixels (canvas, &bounds->x1, &bounds->y1); bounds->x2 = bounds->x1; bounds->y2 = bounds->y1; } /* Check if the given item is a better candidate for the focus than the current best one in the data struct. */ static gboolean goo_canvas_focus_check_is_best (GooCanvas *canvas, GooCanvasItem *item, GooCanvasFocusData *data) { gdouble center_x, center_y; gdouble abs_x_offset = 0.0, abs_y_offset = 0.0; data->current_score = 0.0; goo_canvas_item_get_bounds (item, &data->current_bounds); center_x = (data->current_bounds.x1 + data->current_bounds.x2) / 2.0; center_y = (data->current_bounds.y1 + data->current_bounds.y2) / 2.0; /* Calculate the offsets of the center of this item from the center of the current focus item or widget. */ data->current_x_offset = center_x - data->start_center_x; data->current_y_offset = center_y - data->start_center_y; /* If the item overlaps the current one at all we use 0 as the offset. */ if (data->current_bounds.x1 > data->start_bounds.x2 || data->current_bounds.x2 < data->start_bounds.x2) abs_x_offset = fabs (data->current_x_offset); if (data->current_bounds.y1 > data->start_bounds.y2 || data->current_bounds.y2 < data->start_bounds.y2) abs_y_offset = fabs (data->current_y_offset); /* FIXME: I'm still not sure about the score calculations here. There are still a few odd jumps when using keyboard focus navigation. */ switch (data->direction) { case GTK_DIR_UP: /* If the y offset is > 0 we can discard this item. */ if (data->current_y_offset >= 0 || abs_x_offset > abs_y_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_x_offset * 2 + abs_y_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_DOWN: /* If the y offset is < 0 we can discard this item. */ if (data->current_y_offset <= 0 || abs_x_offset > abs_y_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_x_offset /** 2*/ + abs_y_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_LEFT: /* If the x offset is > 0 we can discard this item. */ if (data->current_x_offset >= 0 || abs_y_offset > abs_x_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_y_offset * 2 + abs_x_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_RIGHT: /* If the x offset is < 0 we can discard this item. */ if (data->current_x_offset <= 0 || abs_y_offset > abs_x_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_y_offset * 2 + abs_x_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_TAB_BACKWARD: /* We need to handle this differently depending on text direction. */ if (data->text_direction == GTK_TEXT_DIR_RTL) { /* If the y offset is > 0, or it is 0 and the x offset > 0 we can discard this item. */ if (data->current_y_offset > 0 || (data->current_y_offset == 0 && data->current_x_offset < 0)) return FALSE; /* If the y offset is > the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset > data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the largest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset < data->best_x_offset) return TRUE; } else { /* If the y offset is > 0, or it is 0 and the x offset > 0 we can discard this item. */ if (data->current_y_offset > 0 || (data->current_y_offset == 0 && data->current_x_offset > 0)) return FALSE; /* If the y offset is > the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset > data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the largest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset > data->best_x_offset) return TRUE; } break; case GTK_DIR_TAB_FORWARD: /* We need to handle this differently depending on text direction. */ if (data->text_direction == GTK_TEXT_DIR_RTL) { /* If the y offset is < 0, or it is 0 and the x offset > 0 we can discard this item. */ if (data->current_y_offset < 0 || (data->current_y_offset == 0 && data->current_x_offset > 0)) return FALSE; /* If the y offset is < the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset < data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the largest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset > data->best_x_offset) return TRUE; } else { /* If the y offset is < 0, or it is 0 and the x offset < 0 we can discard this item. */ if (data->current_y_offset < 0 || (data->current_y_offset == 0 && data->current_x_offset < 0)) return FALSE; /* If the y offset is < the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset < data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the smallest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset < data->best_x_offset) return TRUE; } break; } return FALSE; } /* Recursively look for the next best item in the desired direction. */ static void goo_canvas_focus_recurse (GooCanvas *canvas, GooCanvasItem *item, GooCanvasFocusData *data) { GooCanvasItem *child; gboolean can_focus = FALSE, is_best; gint n_children, i; /* If the item is not a possible candidate, just return. */ is_best = goo_canvas_focus_check_is_best (canvas, item, data); if (is_best && goo_canvas_item_is_visible (item)) { /* Check if the item can take the focus. */ if (GOO_IS_CANVAS_WIDGET (item)) { /* We have to assume that widget items can take focus, since any of their descendants may take the focus. */ if (((GooCanvasWidget*) item)->widget) can_focus = TRUE; } else { g_object_get (item, "can-focus", &can_focus, NULL); } /* If the item can take the focus itself, and it isn't the current focus item, save its score and return. (If it is a container it takes precedence over its children). */ if (can_focus && item != data->start_item) { data->best_item = item; data->best_x_offset = data->current_x_offset; data->best_y_offset = data->current_y_offset; data->best_score = data->current_score; return; } } /* If the item is a container, check the children recursively. */ n_children = goo_canvas_item_get_n_children (item); if (n_children) { /* Check if we can skip the entire group. */ switch (data->direction) { case GTK_DIR_UP: /* If the group is below the bottom of the current focused item we can skip it. */ if (data->current_bounds.y1 > data->start_bounds.y2) return; break; case GTK_DIR_DOWN: /* If the group is above the top of the current focused item we can skip it. */ if (data->current_bounds.y2 < data->start_bounds.y1) return; break; case GTK_DIR_LEFT: /* If the group is to the right of the current focused item we can skip it. */ if (data->current_bounds.x1 > data->start_bounds.x2) return; break; case GTK_DIR_RIGHT: /* If the group is to the left of the current focused item we can skip it. */ if (data->current_bounds.x2 < data->start_bounds.x1) return; break; default: break; } for (i = 0; i < n_children; i++) { child = goo_canvas_item_get_child (item, i); goo_canvas_focus_recurse (canvas, child, data); } } } /* FIXME: We could add support for a focus chain, like GtkContainer. */ static gboolean goo_canvas_focus (GtkWidget *widget, GtkDirectionType direction) { GooCanvas *canvas; GooCanvasFocusData data; GtkWidget *old_focus_child; gboolean found_item; gint try; g_return_val_if_fail (GOO_IS_CANVAS (widget), FALSE); canvas = GOO_CANVAS (widget); /* If keyboard navigation has been turned off for the canvas, return FALSE.*/ if (!GTK_WIDGET_CAN_FOCUS (canvas)) return FALSE; /* If a child widget has the focus, try moving the focus within that. */ old_focus_child = GTK_CONTAINER (canvas)->focus_child; if (old_focus_child && gtk_widget_child_focus (old_focus_child, direction)) return TRUE; data.direction = direction; data.text_direction = gtk_widget_get_direction (widget); data.start_item = NULL; #if GTK_CHECK_VERSION (2, 19, 6) if (gtk_widget_has_focus (GTK_WIDGET (canvas))) #else if (GTK_WIDGET_HAS_FOCUS (canvas)) #endif data.start_item = canvas->focused_item; else if (old_focus_child && GOO_IS_CANVAS_WIDGET (old_focus_child)) data.start_item = g_object_get_data (G_OBJECT (old_focus_child), "goo-canvas-item"); /* Keep looping until we find an item to focus or we fail. I've added a limit on the number of tries just in case we get into an infinite loop. */ for (try = 1; try < 1000; try++) { /* Get the bounds of the currently focused item or widget. */ goo_canvas_get_start_bounds (canvas, &data); data.start_center_x = (data.start_bounds.x1 + data.start_bounds.x2) / 2.0; data.start_center_y = (data.start_bounds.y1 + data.start_bounds.y2) / 2.0; data.best_item = NULL; /* Recursively look for the next best item in the desired direction. */ goo_canvas_focus_recurse (canvas, canvas->root_item, &data); /* If we found an item to focus, grab the focus and return TRUE. */ if (!data.best_item) break; if (GOO_IS_CANVAS_WIDGET (data.best_item)) { found_item = gtk_widget_child_focus (((GooCanvasWidget*) data.best_item)->widget, direction); } else { found_item = TRUE; goo_canvas_grab_focus (canvas, data.best_item); } if (found_item) { goo_canvas_scroll_to_item (canvas, data.best_item); return TRUE; } /* Try again from the last item tried. */ data.start_item = data.best_item; } return FALSE; } /** * goo_canvas_register_widget_item: * @canvas: a #GooCanvas. * @witem: a #GooCanvasWidget item. * * This function should only be used by #GooCanvasWidget and subclass * implementations. * * It registers a widget item with the canvas, so that the canvas can do the * necessary actions to move and resize the widget as needed. **/ void goo_canvas_register_widget_item (GooCanvas *canvas, GooCanvasWidget *witem) { g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_WIDGET (witem)); canvas->widget_items = g_list_append (canvas->widget_items, witem); } /** * goo_canvas_unregister_widget_item: * @canvas: a #GooCanvas. * @witem: a #GooCanvasWidget item. * * This function should only be used by #GooCanvasWidget and subclass * implementations. * * It unregisters a widget item from the canvas, when the item is no longer in * the canvas. **/ void goo_canvas_unregister_widget_item (GooCanvas *canvas, GooCanvasWidget *witem) { GList *tmp_list; GooCanvasWidget *tmp_witem; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_WIDGET (witem)); tmp_list = canvas->widget_items; while (tmp_list) { tmp_witem = tmp_list->data; if (tmp_witem == witem) break; tmp_list = tmp_list->next; } if (tmp_list) { canvas->widget_items = g_list_remove_link (canvas->widget_items, tmp_list); g_list_free_1 (tmp_list); } } static void goo_canvas_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { GooCanvas *canvas; GList *tmp_list; GooCanvasWidget *witem; g_return_if_fail (GOO_IS_CANVAS (container)); g_return_if_fail (callback != NULL); canvas = GOO_CANVAS (container); tmp_list = canvas->widget_items; while (tmp_list) { witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget) (* callback) (witem->widget, callback_data); } } static void goo_canvas_remove (GtkContainer *container, GtkWidget *widget) { GooCanvas *canvas; GList *tmp_list; GooCanvasWidget *witem; GooCanvasItem *parent; gint child_num; g_return_if_fail (GOO_IS_CANVAS (container)); canvas = GOO_CANVAS (container); tmp_list = canvas->widget_items; while (tmp_list) { witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget == widget) { parent = goo_canvas_item_get_parent ((GooCanvasItem*) witem); child_num = goo_canvas_item_find_child (parent, (GooCanvasItem*) witem); goo_canvas_item_remove_child (parent, child_num); break; } } } static gboolean goo_canvas_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip) { GooCanvas *canvas = (GooCanvas*) widget; GooCanvasItem *item = canvas->pointer_item, *parent; gdouble item_x = x, item_y = y; gboolean tip_set = FALSE, has_transform; cairo_matrix_t transform; if (!item) return FALSE; /* Convert from pixels to the item's coordinate space. */ goo_canvas_convert_from_pixels (canvas, &item_x, &item_y); goo_canvas_convert_to_item_space (canvas, item, &item_x, &item_y); for (;;) { g_signal_emit_by_name (item, "query-tooltip", item_x, item_y, keyboard_tip, tooltip, &tip_set); if (tip_set) return TRUE; parent = goo_canvas_item_get_parent (item); if (!parent) break; /* Convert x & y to the parent's coordinate space. */ has_transform = goo_canvas_item_get_transform_for_child (parent, item, &transform); if (has_transform) cairo_matrix_transform_point (&transform, &item_x, &item_y); item = parent; } /* We call the parent method in case the canvas itself has a tooltip set. */ return GTK_WIDGET_CLASS (goo_canvas_parent_class)->query_tooltip (widget, x, y, keyboard_tip, tooltip); } goocanvas-1.0.0/src/goocanvasgrid.h0000644000076400007640000001143511412723611014211 00000000000000/* * GooCanvas. Copyright (C) 2005-8 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgrid.h - a grid item. */ #ifndef __GOO_CANVAS_GRID_H__ #define __GOO_CANVAS_GRID_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasGridData GooCanvasGridData; struct _GooCanvasGridData { /* The area that the grid covers. */ gdouble x, y, width, height; /* The distance between grid lines. */ gdouble x_step, y_step; /* The offset before the first grid line. */ gdouble x_offset, y_offset; /* The widths of the grid lines, or -ve to use item's stroke width. */ gdouble horz_grid_line_width, vert_grid_line_width; /* The color/pattern for the grid lines, or NULL to use the stroke color. */ cairo_pattern_t *horz_grid_line_pattern, *vert_grid_line_pattern; /* The width of the border around the grid, or -1 for no border. */ gdouble border_width; /* The color/pattern for the border, or NULL to use the stroke color. */ cairo_pattern_t *border_pattern; /* If the horizontal and vertical grid lines should be shown. */ guint show_horz_grid_lines : 1; guint show_vert_grid_lines : 1; /* If vertical grid lines are drawn on top. */ guint vert_grid_lines_on_top : 1; }; #define GOO_TYPE_CANVAS_GRID (goo_canvas_grid_get_type ()) #define GOO_CANVAS_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GRID, GooCanvasGrid)) #define GOO_CANVAS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GRID, GooCanvasGridClass)) #define GOO_IS_CANVAS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GRID)) #define GOO_IS_CANVAS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GRID)) #define GOO_CANVAS_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GRID, GooCanvasGridClass)) typedef struct _GooCanvasGrid GooCanvasGrid; typedef struct _GooCanvasGridClass GooCanvasGridClass; /** * GooCanvasGrid * * The #GooCanvasGrid-struct struct contains private data only. */ struct _GooCanvasGrid { GooCanvasItemSimple parent_object; GooCanvasGridData *grid_data; }; struct _GooCanvasGridClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_grid_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_grid_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); #define GOO_TYPE_CANVAS_GRID_MODEL (goo_canvas_grid_model_get_type ()) #define GOO_CANVAS_GRID_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GRID_MODEL, GooCanvasGridModel)) #define GOO_CANVAS_GRID_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GRID_MODEL, GooCanvasGridModelClass)) #define GOO_IS_CANVAS_GRID_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GRID_MODEL)) #define GOO_IS_CANVAS_GRID_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GRID_MODEL)) #define GOO_CANVAS_GRID_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GRID_MODEL, GooCanvasGridModelClass)) typedef struct _GooCanvasGridModel GooCanvasGridModel; typedef struct _GooCanvasGridModelClass GooCanvasGridModelClass; /** * GooCanvasGridModel * * The #GooCanvasGridModel-struct struct contains private data only. */ struct _GooCanvasGridModel { GooCanvasItemModelSimple parent_object; GooCanvasGridData grid_data; }; struct _GooCanvasGridModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_grid_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_grid_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); G_END_DECLS #endif /* __GOO_CANVAS_GRID_H__ */ goocanvas-1.0.0/src/goocanvasellipse.h0000644000076400007640000000747011412723611014725 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasellipse.h - ellipse item. */ #ifndef __GOO_CANVAS_ELLIPSE_H__ #define __GOO_CANVAS_ELLIPSE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasEllipseData GooCanvasEllipseData; struct _GooCanvasEllipseData { gdouble center_x, center_y, radius_x, radius_y; }; #define GOO_TYPE_CANVAS_ELLIPSE (goo_canvas_ellipse_get_type ()) #define GOO_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ELLIPSE, GooCanvasEllipse)) #define GOO_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ELLIPSE, GooCanvasEllipseClass)) #define GOO_IS_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ELLIPSE)) #define GOO_IS_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ELLIPSE)) #define GOO_CANVAS_ELLIPSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ELLIPSE, GooCanvasEllipseClass)) typedef struct _GooCanvasEllipse GooCanvasEllipse; typedef struct _GooCanvasEllipseClass GooCanvasEllipseClass; /** * GooCanvasEllipse * * The #GooCanvasEllipse-struct struct contains private data only. */ struct _GooCanvasEllipse { GooCanvasItemSimple parent_object; GooCanvasEllipseData *ellipse_data; }; struct _GooCanvasEllipseClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_ellipse_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_ellipse_new (GooCanvasItem *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); #define GOO_TYPE_CANVAS_ELLIPSE_MODEL (goo_canvas_ellipse_model_get_type ()) #define GOO_CANVAS_ELLIPSE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ELLIPSE_MODEL, GooCanvasEllipseModel)) #define GOO_CANVAS_ELLIPSE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ELLIPSE_MODEL, GooCanvasEllipseModelClass)) #define GOO_IS_CANVAS_ELLIPSE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ELLIPSE_MODEL)) #define GOO_IS_CANVAS_ELLIPSE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ELLIPSE_MODEL)) #define GOO_CANVAS_ELLIPSE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ELLIPSE_MODEL, GooCanvasEllipseModelClass)) typedef struct _GooCanvasEllipseModel GooCanvasEllipseModel; typedef struct _GooCanvasEllipseModelClass GooCanvasEllipseModelClass; /** * GooCanvasEllipseModel * * The #GooCanvasEllipseModel-struct struct contains private data only. */ struct _GooCanvasEllipseModel { GooCanvasItemModelSimple parent_object; GooCanvasEllipseData ellipse_data; }; struct _GooCanvasEllipseModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_ellipse_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_ellipse_model_new (GooCanvasItemModel *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); G_END_DECLS #endif /* __GOO_CANVAS_ELLIPSE_H__ */ goocanvas-1.0.0/src/goocanvastable.c0000644000076400007640000031460111412723611014347 00000000000000/* * GooCanvas. Copyright (C) 2005-7 Damon Chaplin. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * Copyright (C) 1997-2000 the GTK+ team. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastable.c - table item. A lot of this code has been ported from * the GtkTable widget. */ /** * SECTION:goocanvastable * @Title: GooCanvasTable * @Short_Description: a table container to layout items. * * #GooCanvasTable is a table container used to lay out other canvas items. * It is used in a similar way to how the GtkTable widget is used to lay out * GTK+ widgets. * * Items are added to the table using the normal methods, then * goo_canvas_item_set_child_properties() is used to specify how each child * item is to be positioned within the table (i.e. which row and column it is * in, how much padding it should have and whether it should expand or * shrink). * * #GooCanvasTable is a subclass of #GooCanvasItemSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasTable will affect * all children of the #GooCanvasTable (unless the children override the * property setting). * * #GooCanvasTable implements the #GooCanvasItem interface, so you can use * the #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(), and the properties such as "visibility" and * "pointer-events". * * To create a #GooCanvasTable use goo_canvas_table_new(). * * To get or set the properties of an existing #GooCanvasTable, use * g_object_get() and g_object_set(). */ #include #include #include #include #include #include "goocanvastable.h" #include "goocanvas.h" enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_ROW_SPACING, PROP_COLUMN_SPACING, PROP_HOMOGENEOUS_ROWS, PROP_HOMOGENEOUS_COLUMNS, PROP_X_BORDER_SPACING, PROP_Y_BORDER_SPACING, PROP_VERT_GRID_LINE_WIDTH, PROP_HORZ_GRID_LINE_WIDTH }; enum { CHILD_PROP_0, CHILD_PROP_LEFT_PADDING, CHILD_PROP_RIGHT_PADDING, CHILD_PROP_TOP_PADDING, CHILD_PROP_BOTTOM_PADDING, CHILD_PROP_X_ALIGN, CHILD_PROP_Y_ALIGN, CHILD_PROP_ROW, CHILD_PROP_COLUMN, CHILD_PROP_ROWS, CHILD_PROP_COLUMNS, CHILD_PROP_X_EXPAND, CHILD_PROP_X_FILL, CHILD_PROP_X_SHRINK, CHILD_PROP_Y_EXPAND, CHILD_PROP_Y_FILL, CHILD_PROP_Y_SHRINK }; #define HORZ 0 #define VERT 1 typedef enum { GOO_CANVAS_TABLE_CHILD_EXPAND = 1 << 0, GOO_CANVAS_TABLE_CHILD_FILL = 1 << 1, GOO_CANVAS_TABLE_CHILD_SHRINK = 1 << 2 } GooCanvasTableChildFlags; /* This is used in the GooCanvasTableData children GArray to keep the child properties for each of the children. */ typedef struct _GooCanvasTableChild GooCanvasTableChild; struct _GooCanvasTableChild { gdouble position[2]; /* Translation offset in table. */ gdouble start_pad[2], end_pad[2]; gdouble align[2]; guint16 start[2], size[2]; /* Start row/col & num rows/cols. */ guint8 flags[2]; /* GooCanvasTableChildFlags. */ }; typedef struct _GooCanvasTableDimensionLayoutData GooCanvasTableDimensionLayoutData; struct _GooCanvasTableDimensionLayoutData { /* This is the actual spacing for after the row or column, including the grid line width. It is set in goo_canvas_table_init_layout_data(). */ gdouble spacing; /* Stores the grid line visibilty for the grid lines to the right or bottom of this row/column, respectivel, for each cell in the other dimension. */ guint32 *grid_line_visibility; /* The requisition is calculated in goo_canvas_table_size_request_pass[123]*/ gdouble requisition; /* The allocation is initialized in goo_canvas_table_size_allocate_init() and calculated in goo_canvas_table_size_allocate_pass1(). */ gdouble allocation; /* The row or column start and end positions are calculated in goo_canvas_table_size_allocate_pass2(). */ gdouble start; gdouble end; /* These flags are initialized in goo_canvas_table_init_layout_data() and set in goo_canvas_table_size_request_init(). */ guint need_expand : 1; guint need_shrink : 1; guint expand : 1; guint shrink : 1; guint empty : 1; }; typedef struct _GooCanvasTableChildLayoutData GooCanvasTableChildLayoutData; struct _GooCanvasTableChildLayoutData { gdouble requested_position[2]; gdouble requested_size[2]; gdouble start_pad[2], end_pad[2]; }; /* Convenience macros to set/unset/check bit-flags. */ #define GOO_CANVAS_TABLE_SET_GRID_LINE_VISIBILITY(dim, x, y) \ ((dim)[(x)].grid_line_visibility[(y)/32] |= (1 << ((y) % 32))) #define GOO_CANVAS_TABLE_UNSET_GRID_LINE_VISIBILITY(dim, x, y) \ ((dim)[(x)].grid_line_visibility[(y)/32] &= ~(1 << ((y) % 32))) #define GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(dim, x, y) \ ((dim)[(x)].grid_line_visibility[(y)/32] & (1 << ((y) % 32))) /* The children array is only kept around while doing the layout. It gets freed in goo_canvas_table_allocate_area(). */ struct _GooCanvasTableLayoutData { GooCanvasTableDimensionLayoutData *dldata[2]; GooCanvasTableChildLayoutData *children; /* Position of the table */ gdouble x; gdouble y; /* This is TRUE if we are rounding everything to the nearest integer. */ gboolean integer_layout; /* This is the border width used, possibly rounded to an integer. */ gdouble border_width; /* The actual property value */ gdouble prop_grid_line_width[2]; /* The grid line width in both directions (rounded for integer layout). */ gdouble grid_line_width[2]; /* This is the actual spacing between the uppermost, bottommost, leftmost and rightmost cells from the widget border. This is the border spacing for that dimension. */ gdouble border_spacing[2]; /* These are in the table's coordinate space. */ gdouble natural_size[2]; gdouble requested_size[2]; gdouble allocated_size[2]; /* This is the last width for which we have calculated the requested heights. It is initialized to -1 in goo_canvas_table_init_layout_data() and checked/set in goo_canvas_table_update_requested_heights(). */ gdouble last_width; }; static GooCanvasItemIface *goo_canvas_table_parent_iface; static void item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_table_finalize (GObject *object); static void goo_canvas_table_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_table_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_table_init_layout_data (GooCanvasTable *table); static void goo_canvas_table_free_layout_data (GooCanvasTableData *table_data); G_DEFINE_TYPE_WITH_CODE (GooCanvasTable, goo_canvas_table, GOO_TYPE_CANVAS_GROUP, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, item_interface_init)) typedef void (*InstallChildPropertyFunc) (GObjectClass*, guint, GParamSpec*); static void goo_canvas_table_install_common_properties (GObjectClass *gobject_class, InstallChildPropertyFunc install_child_property) { /* Override from GooCanvasGroup */ g_object_class_override_property (gobject_class, PROP_X, "x"); g_object_class_override_property (gobject_class, PROP_Y, "y"); g_object_class_override_property (gobject_class, PROP_WIDTH, "width"); g_object_class_override_property (gobject_class, PROP_HEIGHT, "height"); /* FIXME: Support setting individual row/col spacing. */ g_object_class_install_property (gobject_class, PROP_ROW_SPACING, g_param_spec_double ("row-spacing", _("Row Spacing"), _("The default space between rows"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_COLUMN_SPACING, g_param_spec_double ("column-spacing", _("Column Spacing"), _("The default space between columns"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HOMOGENEOUS_ROWS, g_param_spec_boolean ("homogeneous-rows", _("Homogenous Rows"), _("If all rows are the same height"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HOMOGENEOUS_COLUMNS, g_param_spec_boolean ("homogeneous-columns", _("Homogenous Columns"), _("If all columns are the same width"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X_BORDER_SPACING, g_param_spec_double("x-border-spacing", _("X Border Spacing"), _("The amount of spacing between the lefmost and rightmost cells and the border grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y_BORDER_SPACING, g_param_spec_double("y-border-spacing", _("Y Border Spacing"), _("The amount of spacing between the topmost and bottommost cells and the border grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_WIDTH, g_param_spec_double("horz-grid-line-width", _("Horizontal Grid Line Width"), _("The width of the grid line to draw between rows"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_WIDTH, g_param_spec_double("vert-grid-line-width", _("Vertical Grid Line Width"), _("The width of the grid line to draw between columns"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); /* * Child properties. */ install_child_property (gobject_class, CHILD_PROP_LEFT_PADDING, g_param_spec_double ("left-padding", _("Left Padding"), _("Extra space to add to the left of the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_RIGHT_PADDING, g_param_spec_double ("right-padding", _("Right Padding"), _("Extra space to add to the right of the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_TOP_PADDING, g_param_spec_double ("top-padding", _("Top Padding"), _("Extra space to add above the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_BOTTOM_PADDING, g_param_spec_double ("bottom-padding", _("Bottom Padding"), _("Extra space to add below the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_ALIGN, g_param_spec_double ("x-align", _("X Align"), _("The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned"), 0.0, 1.0, 0.5, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_ALIGN, g_param_spec_double ("y-align", _("Y Align"), _("The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned"), 0.0, 1.0, 0.5, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_ROW, g_param_spec_uint ("row", _("Row"), _("The row to place the item in"), 0, 65535, 0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_COLUMN, g_param_spec_uint ("column", _("Column"), _("The column to place the item in"), 0, 65535, 0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_ROWS, g_param_spec_uint ("rows", _("Rows"), _("The number of rows that the item spans"), 0, 65535, 1, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_COLUMNS, g_param_spec_uint ("columns", _("Columns"), _("The number of columns that the item spans"), 0, 65535, 1, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_EXPAND, g_param_spec_boolean ("x-expand", _("X Expand"), _("If the item expands horizontally as the table expands"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_FILL, g_param_spec_boolean ("x-fill", _("X Fill"), _("If the item fills all horizontal allocated space"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_SHRINK, g_param_spec_boolean ("x-shrink", _("X Shrink"), _("If the item can shrink smaller than its requested size horizontally"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_EXPAND, g_param_spec_boolean ("y-expand", _("Y Expand"), _("If the item expands vertically as the table expands"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_FILL, g_param_spec_boolean ("y-fill", _("Y Fill"), _("If the item fills all vertical allocated space"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_SHRINK, g_param_spec_boolean ("y-shrink", _("Y Shrink"), _("If the item can shrink smaller than its requested size vertically"), FALSE, G_PARAM_READWRITE)); } static void goo_canvas_table_class_init (GooCanvasTableClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; goo_canvas_table_parent_iface = g_type_interface_peek (goo_canvas_table_parent_class, GOO_TYPE_CANVAS_ITEM); gobject_class->finalize = goo_canvas_table_finalize; gobject_class->get_property = goo_canvas_table_get_property; gobject_class->set_property = goo_canvas_table_set_property; goo_canvas_table_install_common_properties (gobject_class, goo_canvas_item_class_install_child_property); } /* This initializes the common table data. */ static void goo_canvas_table_init_data (GooCanvasTableData *table_data) { gint d; table_data->width = -1.0; table_data->height = -1.0; for (d = 0; d < 2; d++) { table_data->dimensions[d].size = 0; table_data->dimensions[d].default_spacing = 0.0; table_data->dimensions[d].spacings = NULL; table_data->dimensions[d].homogeneous = FALSE; } table_data->border_width = 0.0; table_data->children = g_array_new (0, 0, sizeof (GooCanvasTableChild)); table_data->layout_data = g_slice_new (GooCanvasTableLayoutData); table_data->layout_data->x = 0.0; table_data->layout_data->y = 0.0; table_data->layout_data->children = NULL; for (d = 0; d < 2; d++) { table_data->layout_data->dldata[d] = NULL; table_data->layout_data->prop_grid_line_width[d] = 0.0; table_data->layout_data->grid_line_width[d] = 0.0; table_data->layout_data->border_spacing[d] = 0.0; } } /* This frees the contents of the table data, but not the struct itself. */ static void goo_canvas_table_free_data (GooCanvasTableData *table_data) { gint d; g_array_free (table_data->children, TRUE); for (d = 0; d < 2; d++) { g_free (table_data->dimensions[d].spacings); table_data->dimensions[d].spacings = NULL; } goo_canvas_table_free_layout_data (table_data); } static void goo_canvas_table_init (GooCanvasTable *table) { table->table_data = g_slice_new0 (GooCanvasTableData); goo_canvas_table_init_data (table->table_data); } /** * goo_canvas_table_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new table item. * * * * Here's an example showing how to create a table with a square, a circle and * a triangle in it: * * * GooCanvasItem *table, *square, *circle, *triangle; * * table = goo_canvas_table_new (root, * "row-spacing", 4.0, * "column-spacing", 4.0, * NULL); * goo_canvas_item_translate (table, 400, 200); * * square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0, * "fill-color", "red", * NULL); * goo_canvas_item_set_child_properties (table, square, * "row", 0, * "column", 0, * NULL); * * circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0, * "fill-color", "blue", * NULL); * goo_canvas_item_set_child_properties (table, circle, * "row", 0, * "column", 1, * NULL); * * triangle = goo_canvas_polyline_new (table, TRUE, 3, * 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, * "fill-color", "yellow", * NULL); * goo_canvas_item_set_child_properties (table, triangle, * "row", 0, * "column", 2, * NULL); * * * Returns: a new table item. **/ GooCanvasItem* goo_canvas_table_new (GooCanvasItem *parent, ...) { GooCanvasItem *item; va_list var_args; const char *first_property; item = g_object_new (GOO_TYPE_CANVAS_TABLE, NULL); va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (item), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_table_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasTable *table = (GooCanvasTable*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { goo_canvas_table_free_data (table->table_data); g_slice_free (GooCanvasTableData, table->table_data); } table->table_data = NULL; G_OBJECT_CLASS (goo_canvas_table_parent_class)->finalize (object); } static void goo_canvas_table_get_common_property (GObject *object, GooCanvasTableData *table_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, table_data->layout_data->x); break; case PROP_Y: g_value_set_double (value, table_data->layout_data->y); break; case PROP_WIDTH: g_value_set_double (value, table_data->width); break; case PROP_HEIGHT: g_value_set_double (value, table_data->height); break; case PROP_ROW_SPACING: g_value_set_double (value, table_data->dimensions[VERT].default_spacing); break; case PROP_COLUMN_SPACING: g_value_set_double (value, table_data->dimensions[HORZ].default_spacing); break; case PROP_HOMOGENEOUS_ROWS: g_value_set_boolean (value, table_data->dimensions[VERT].homogeneous); break; case PROP_HOMOGENEOUS_COLUMNS: g_value_set_boolean (value, table_data->dimensions[HORZ].homogeneous); break; case PROP_X_BORDER_SPACING: g_value_set_double (value, table_data->layout_data->border_spacing[HORZ]); break; case PROP_Y_BORDER_SPACING: g_value_set_double (value, table_data->layout_data->border_spacing[VERT]); break; case PROP_HORZ_GRID_LINE_WIDTH: g_value_set_double (value, table_data->layout_data->prop_grid_line_width[HORZ]); break; case PROP_VERT_GRID_LINE_WIDTH: g_value_set_double (value, table_data->layout_data->prop_grid_line_width[VERT]); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_table_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasTable *table = (GooCanvasTable*) object; goo_canvas_table_get_common_property (object, table->table_data, prop_id, value, pspec); } static gboolean goo_canvas_table_set_common_property (GObject *object, GooCanvasTableData *table_data, guint prop_id, const GValue *value, GParamSpec *pspec) { gboolean recompute_bounds = TRUE; switch (prop_id) { case PROP_X: table_data->layout_data->x = g_value_get_double (value); break; case PROP_Y: table_data->layout_data->y = g_value_get_double (value); break; case PROP_WIDTH: table_data->width = g_value_get_double (value); break; case PROP_HEIGHT: table_data->height = g_value_get_double (value); break; case PROP_ROW_SPACING: table_data->dimensions[VERT].default_spacing = g_value_get_double (value); break; case PROP_COLUMN_SPACING: table_data->dimensions[HORZ].default_spacing = g_value_get_double (value); break; case PROP_HOMOGENEOUS_ROWS: table_data->dimensions[VERT].homogeneous = g_value_get_boolean (value); break; case PROP_HOMOGENEOUS_COLUMNS: table_data->dimensions[HORZ].homogeneous = g_value_get_boolean (value); break; case PROP_X_BORDER_SPACING: table_data->layout_data->border_spacing[HORZ] = g_value_get_double (value); break; case PROP_Y_BORDER_SPACING: table_data->layout_data->border_spacing[VERT] = g_value_get_double (value); break; case PROP_HORZ_GRID_LINE_WIDTH: table_data->layout_data->prop_grid_line_width[HORZ] = g_value_get_double (value); break; case PROP_VERT_GRID_LINE_WIDTH: table_data->layout_data->prop_grid_line_width[VERT] = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } return recompute_bounds; } static void goo_canvas_table_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasTable *table = (GooCanvasTable*) object; gboolean recompute_bounds; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } recompute_bounds = goo_canvas_table_set_common_property (object, table->table_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, recompute_bounds); } static void goo_canvas_table_update_dimensions (GooCanvasTableData *table_data, GooCanvasTableChild *table_child) { GooCanvasTableLayoutData *layout_data; gint d, size[2], i; layout_data = table_data->layout_data; size[0] = table_child->start[0] + table_child->size[0]; size[1] = table_child->start[1] + table_child->size[1]; for (d = 0; d < 2; d++) { if (size[d] > table_data->dimensions[d].size) { /* Resize the spacings array and the layout data array. */ table_data->dimensions[d].spacings = g_realloc (table_data->dimensions[d].spacings, size[d] * sizeof (gdouble)); layout_data->dldata[d] = g_renew (GooCanvasTableDimensionLayoutData, layout_data->dldata[d], size[d]); /* Initialize new spacings to -1.0 so the default is used, and set the new grid_line_visibility arrays to NULL. */ for (i = table_data->dimensions[d].size; i < size[d]; i++) { table_data->dimensions[d].spacings[i] = -1.0; layout_data->dldata[d][i].grid_line_visibility = NULL; } } } table_data->dimensions[0].size = MAX (size[0], table_data->dimensions[0].size); table_data->dimensions[1].size = MAX (size[1], table_data->dimensions[1].size); } /* Sets or unsets grid line visibility for a given child */ static void goo_canvas_update_grid_line_visibility (GooCanvasTableData *table_data) { GooCanvasTableLayoutData *layout_data; GooCanvasTableChild *table_child; guint32 grid_line_size; gint d, d2, child_num, i, j; layout_data = table_data->layout_data; for (d = 0; d < 2; d++) { /* This is the opposite dimension. */ d2 = 1 - d; /* The amount of guint32s we need to store grid line visibility for a particular row or column. In case of vertical grid lines we store the grid lines (right to) a particular column for each row. Therefore we need one bit for each row. This is also why this depends on dimensions[1-d] instead of dimensions[d]. */ grid_line_size = ((table_data->dimensions[d2].size + 31) / 32); /* Allocate or reallocate the grid_line_visibility arrays and initialize all grid lines to visible (by setting to the arrays to all 0xFF). */ for (i = 0; i + 1 < table_data->dimensions[d].size; i++) { layout_data->dldata[d][i].grid_line_visibility = g_realloc (layout_data->dldata[d][i].grid_line_visibility, grid_line_size * sizeof (guint32)); memset (layout_data->dldata[d][i].grid_line_visibility, 0xff, grid_line_size * sizeof (guint32)); } /* Remove lines for each child spanning multiple rows/colmuns */ for (child_num = 0; child_num < table_data->children->len; child_num++) { table_child = &g_array_index (table_data->children, GooCanvasTableChild, child_num); /* Foreach cell the child is spanning */ for (i = table_child->start[d]; i < table_child->start[d] + table_child->size[d] - 1; i++) { /* Iterate through occupied cells in the other dimension */ for (j = table_child->start[d2]; j < table_child->start[d2] + table_child->size[d2]; j++) { GOO_CANVAS_TABLE_UNSET_GRID_LINE_VISIBILITY (layout_data->dldata[d], i, j); } } } } } static void goo_canvas_table_add_child_internal (GooCanvasTableData *table_data, gint position) { GooCanvasTableChild table_child; gint d; /* Initialize a table child struct. */ for (d = 0; d < 2; d++) { table_child.start_pad[d] = 0.0; table_child.end_pad[d] = 0.0; table_child.align[d] = 0.5; table_child.start[d] = 0; table_child.size[d] = 1; /* Unlike GtkTable our children do not expand & fill by default, as that makes more sense with the builtin simple items. */ table_child.flags[d] = 0; } if (position < 0) position = table_data->children->len; g_array_insert_val (table_data->children, position, table_child); goo_canvas_table_update_dimensions (table_data, &table_child); } static void goo_canvas_table_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasTable *table = (GooCanvasTable*) item; if (!simple->model) goo_canvas_table_add_child_internal (table->table_data, position); /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->add_child (item, child, position); } static void goo_canvas_table_move_child_internal (GooCanvasTableData *table_data, gint old_position, gint new_position) { GooCanvasTableChild *table_child, tmp_child; /* Copy the child temporarily. */ table_child = &g_array_index (table_data->children, GooCanvasTableChild, old_position); tmp_child = *table_child; /* Move the array data up or down. */ if (new_position > old_position) { /* Move the items down one place. */ g_memmove (table_child, &g_array_index (table_data->children, GooCanvasTableChild, old_position + 1), sizeof (GooCanvasTableChild) * (new_position - old_position)); } else { /* Move the items up one place. */ g_memmove (&g_array_index (table_data->children, GooCanvasTableChild, new_position + 1), &g_array_index (table_data->children, GooCanvasTableChild, new_position), sizeof (GooCanvasTableChild) * (old_position - new_position)); } /* Copy the child into its new position. */ table_child = &g_array_index (table_data->children, GooCanvasTableChild, new_position); *table_child = tmp_child; } static void goo_canvas_table_move_child (GooCanvasItem *item, gint old_position, gint new_position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasTable *table = (GooCanvasTable*) item; if (!simple->model) goo_canvas_table_move_child_internal (table->table_data, old_position, new_position); /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->move_child (item, old_position, new_position); } static void goo_canvas_table_remove_child (GooCanvasItem *item, gint child_num) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; g_return_if_fail (child_num < group->items->len); if (!simple->model) g_array_remove_index (table->table_data->children, child_num); /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->remove_child (item, child_num); } static void goo_canvas_table_get_common_child_property (GObject *object, GooCanvasTableChild *table_child, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case CHILD_PROP_LEFT_PADDING: g_value_set_double (value, table_child->start_pad[HORZ]); break; case CHILD_PROP_RIGHT_PADDING: g_value_set_double (value, table_child->end_pad[HORZ]); break; case CHILD_PROP_TOP_PADDING: g_value_set_double (value, table_child->start_pad[VERT]); break; case CHILD_PROP_BOTTOM_PADDING: g_value_set_double (value, table_child->end_pad[VERT]); break; case CHILD_PROP_X_ALIGN: g_value_set_double (value, table_child->align[HORZ]); break; case CHILD_PROP_Y_ALIGN: g_value_set_double (value, table_child->align[VERT]); break; case CHILD_PROP_ROW: g_value_set_uint (value, table_child->start[VERT]); break; case CHILD_PROP_COLUMN: g_value_set_uint (value, table_child->start[HORZ]); break; case CHILD_PROP_ROWS: g_value_set_uint (value, table_child->size[VERT]); break; case CHILD_PROP_COLUMNS: g_value_set_uint (value, table_child->size[HORZ]); break; case CHILD_PROP_X_EXPAND: g_value_set_boolean (value, table_child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_EXPAND); break; case CHILD_PROP_X_FILL: g_value_set_boolean (value, table_child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_FILL); break; case CHILD_PROP_X_SHRINK: g_value_set_boolean (value, table_child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_SHRINK); break; case CHILD_PROP_Y_EXPAND: g_value_set_boolean (value, table_child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_EXPAND); break; case CHILD_PROP_Y_FILL: g_value_set_boolean (value, table_child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_FILL); break; case CHILD_PROP_Y_SHRINK: g_value_set_boolean (value, table_child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_SHRINK); break; default: G_OBJECT_WARN_INVALID_PSPEC ((object), "child property id", (property_id), (pspec)); break; } } static void goo_canvas_table_get_child_property (GooCanvasItem *item, GooCanvasItem *child, guint property_id, GValue *value, GParamSpec *pspec) { GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < group->items->len; child_num++) { if (group->items->pdata[child_num] == child) { table_child = &g_array_index (table->table_data->children, GooCanvasTableChild, child_num); goo_canvas_table_get_common_child_property ((GObject*) table, table_child, property_id, value, pspec); break; } } } static void goo_canvas_table_set_common_child_property (GObject *object, GooCanvasTableData *table_data, GooCanvasTableChild *table_child, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case CHILD_PROP_LEFT_PADDING: table_child->start_pad[HORZ] = g_value_get_double (value); break; case CHILD_PROP_RIGHT_PADDING: table_child->end_pad[HORZ] = g_value_get_double (value); break; case CHILD_PROP_TOP_PADDING: table_child->start_pad[VERT] = g_value_get_double (value); break; case CHILD_PROP_BOTTOM_PADDING: table_child->end_pad[VERT] = g_value_get_double (value); break; case CHILD_PROP_X_ALIGN: table_child->align[HORZ] = g_value_get_double (value); break; case CHILD_PROP_Y_ALIGN: table_child->align[VERT] = g_value_get_double (value); break; case CHILD_PROP_ROW: table_child->start[VERT] = g_value_get_uint (value); break; case CHILD_PROP_COLUMN: table_child->start[HORZ] = g_value_get_uint (value); break; case CHILD_PROP_ROWS: table_child->size[VERT] = g_value_get_uint (value); break; case CHILD_PROP_COLUMNS: table_child->size[HORZ] = g_value_get_uint (value); break; case CHILD_PROP_X_EXPAND: if (g_value_get_boolean (value)) table_child->flags[HORZ] |= GOO_CANVAS_TABLE_CHILD_EXPAND; else table_child->flags[HORZ] &= ~GOO_CANVAS_TABLE_CHILD_EXPAND; break; case CHILD_PROP_X_FILL: if (g_value_get_boolean (value)) table_child->flags[HORZ] |= GOO_CANVAS_TABLE_CHILD_FILL; else table_child->flags[HORZ] &= ~GOO_CANVAS_TABLE_CHILD_FILL; break; case CHILD_PROP_X_SHRINK: if (g_value_get_boolean (value)) table_child->flags[HORZ] |= GOO_CANVAS_TABLE_CHILD_SHRINK; else table_child->flags[HORZ] &= ~GOO_CANVAS_TABLE_CHILD_SHRINK; break; case CHILD_PROP_Y_EXPAND: if (g_value_get_boolean (value)) table_child->flags[VERT] |= GOO_CANVAS_TABLE_CHILD_EXPAND; else table_child->flags[VERT] &= ~GOO_CANVAS_TABLE_CHILD_EXPAND; break; case CHILD_PROP_Y_FILL: if (g_value_get_boolean (value)) table_child->flags[VERT] |= GOO_CANVAS_TABLE_CHILD_FILL; else table_child->flags[VERT] &= ~GOO_CANVAS_TABLE_CHILD_FILL; break; case CHILD_PROP_Y_SHRINK: if (g_value_get_boolean (value)) table_child->flags[VERT] |= GOO_CANVAS_TABLE_CHILD_SHRINK; else table_child->flags[VERT] &= ~GOO_CANVAS_TABLE_CHILD_SHRINK; break; default: G_OBJECT_WARN_INVALID_PSPEC ((object), "child property id", (property_id), (pspec)); break; } goo_canvas_table_update_dimensions (table_data, table_child); } static void goo_canvas_table_set_child_property (GooCanvasItem *item, GooCanvasItem *child, guint property_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < group->items->len; child_num++) { if (group->items->pdata[child_num] == child) { table_child = &g_array_index (table->table_data->children, GooCanvasTableChild, child_num); goo_canvas_table_set_common_child_property ((GObject*) table, table->table_data, table_child, property_id, value, pspec); break; } } goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_table_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; /* If our table_data was allocated, free it. */ if (!simple->model) { goo_canvas_table_free_data (table->table_data); g_slice_free (GooCanvasTableData, table->table_data); } /* Now use the new model's table_data instead. */ table->table_data = &tmodel->table_data; /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->set_model (item, model); } /* * Size requisition/allocation code. */ static void goo_canvas_table_free_layout_data (GooCanvasTableData *table_data) { gint i; if (table_data->layout_data) { for (i = 0; i < table_data->dimensions[VERT].size; i++) g_free (table_data->layout_data->dldata[VERT][i].grid_line_visibility); for (i = 0; i < table_data->dimensions[HORZ].size; i++) g_free (table_data->layout_data->dldata[HORZ][i].grid_line_visibility); g_free (table_data->layout_data->dldata[HORZ]); g_free (table_data->layout_data->dldata[VERT]); g_free (table_data->layout_data->children); g_slice_free (GooCanvasTableLayoutData, table_data->layout_data); table_data->layout_data = NULL; } } /* This allocates the layout data, and initializes the row and column data. */ static void goo_canvas_table_init_layout_data (GooCanvasTable *table) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) table; GooCanvasTableData *table_data = table->table_data; GooCanvasTableDimension *dimension; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata; gint d, i; layout_data->children = g_new (GooCanvasTableChildLayoutData, table_data->children->len); layout_data->last_width = -1; /* If we are not yet added to a canvas, integer layout is irrelevant anyway. We still need the layout_data for private fields, such as border spacing and grid line visibility. */ if (simple->canvas) layout_data->integer_layout = simple->canvas->integer_layout; else layout_data->integer_layout = FALSE; layout_data->border_width = table_data->border_width; if (layout_data->integer_layout) layout_data->border_width = floor (layout_data->border_width + 0.5); layout_data->grid_line_width[0] = layout_data->prop_grid_line_width[0]; layout_data->grid_line_width[1] = layout_data->prop_grid_line_width[1]; if (layout_data->integer_layout) { layout_data->grid_line_width[0] = floor (layout_data->grid_line_width[0] + 0.5); layout_data->grid_line_width[1] = floor (layout_data->grid_line_width[1] + 0.5); } for (d = 0; d < 2; d++) { dimension = &table_data->dimensions[d]; /* Already allocated in goo_canvas_table_update_dimensions() */ /*layout_data->dldata[d] = g_renew (GooCanvasTableDimensionLayoutData, layout_data->dldata[d], dimension->size);*/ dldata = layout_data->dldata[d]; for (i = 0; i < dimension->size; i++) { /* Calculate the actual spacings. If -ve use the default. */ if (dimension->spacings[i] > 0) dldata[i].spacing = dimension->spacings[i]; else dldata[i].spacing = dimension->default_spacing; /* Add grid line widths to spacing */ dldata[i].spacing += layout_data->prop_grid_line_width[1-d]; /* In integer layout mode, round spacings to the nearest integer. */ if (layout_data->integer_layout) dldata[i].spacing = floor (dldata[i].spacing + 0.5); dldata[i].need_expand = FALSE; dldata[i].need_shrink = TRUE; dldata[i].expand = FALSE; dldata[i].shrink = TRUE; dldata[i].empty = TRUE; } } /* Update grid line visibility */ goo_canvas_update_grid_line_visibility (table_data); } /* This gets the requested size of all child items, and sets the expand, shrink and empty flags for each row and column. It should only be called once in the entire size_request/allocate procedure and nothing should change the values it sets (except the requested height of children may change after calling get_requested_height() on them). */ static void goo_canvas_table_size_request_init (GooCanvasTable *table, cairo_t *cr) { GooCanvasGroup *group = (GooCanvasGroup*) table; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension; GooCanvasTableDimensionLayoutData *dldata; GooCanvasTableChild *child; GooCanvasItem *child_item; GooCanvasBounds bounds; gboolean allocate, has_expand, has_shrink; gint i, j, d, start, end; guint8 flags; for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); child_item = group->items->pdata[i]; /* Children will return FALSE if they don't need space allocated. */ allocate = goo_canvas_item_get_requested_area (child_item, cr, &bounds); /* Remember the requested position and size of the child. */ layout_data->children[i].requested_position[HORZ] = bounds.x1; layout_data->children[i].requested_position[VERT] = bounds.y1; if (!allocate) { layout_data->children[i].requested_size[HORZ] = -1.0; layout_data->children[i].requested_size[VERT] = -1.0; continue; } layout_data->children[i].requested_size[HORZ] = bounds.x2 - bounds.x1; layout_data->children[i].requested_size[VERT] = bounds.y2 - bounds.y1; layout_data->children[i].start_pad[HORZ] = child->start_pad[HORZ]; layout_data->children[i].end_pad[HORZ] = child->end_pad[HORZ]; layout_data->children[i].start_pad[VERT] = child->start_pad[VERT]; layout_data->children[i].end_pad[VERT] = child->end_pad[VERT]; if (layout_data->integer_layout) { layout_data->children[i].requested_size[HORZ] = ceil (layout_data->children[i].requested_size[HORZ]); layout_data->children[i].requested_size[VERT] = ceil (layout_data->children[i].requested_size[VERT]); layout_data->children[i].start_pad[HORZ] = floor (layout_data->children[i].start_pad[HORZ] + 0.5); layout_data->children[i].end_pad[HORZ] = floor (layout_data->children[i].end_pad[HORZ] + 0.5); layout_data->children[i].start_pad[VERT] = floor (layout_data->children[i].start_pad[VERT] + 0.5); layout_data->children[i].end_pad[VERT] = floor (layout_data->children[i].end_pad[VERT] + 0.5); } /* Set the expand, shrink & empty flags in the GooCanvasTableDimensionLayoutData for the row/column, if the item only spans 1 row/column. */ for (d = 0; d < 2; d++) { dldata = layout_data->dldata[d]; start = child->start[d]; flags = child->flags[d]; if (child->size[d] == 1) { if (flags & GOO_CANVAS_TABLE_CHILD_EXPAND) dldata[start].expand = TRUE; if (!(flags & GOO_CANVAS_TABLE_CHILD_SHRINK)) dldata[start].shrink = FALSE; dldata[start].empty = FALSE; } } } /* Now handle children that span more than one row or column. */ for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); if (layout_data->children[i].requested_size[HORZ] < 0.0) continue; for (d = 0; d < 2; d++) { dldata = layout_data->dldata[d]; start = child->start[d]; end = start + child->size[d] - 1; flags = child->flags[d]; if (child->size[d] != 1) { has_expand = FALSE; has_shrink = TRUE; for (j = start; j <= end; j++) { dldata[j].empty = FALSE; if (dldata[j].expand) has_expand = TRUE; if (!dldata[j].shrink) has_shrink = FALSE; } /* If the child expands, but none of the rows/columns already has expand set, we set need_expand for all of them. */ if (!has_expand && (flags & GOO_CANVAS_TABLE_CHILD_EXPAND)) { for (j = start; j <= end; j++) dldata[j].need_expand = TRUE; } /* If the child doesn't shrink, but all of the rows/columns have shrink set, we set need_shrink to FALSE for all of them. */ if (has_shrink && !(flags & GOO_CANVAS_TABLE_CHILD_SHRINK)) { for (j = start; j <= end; j++) dldata[j].need_shrink = FALSE; } } } } /* Now set the final expand, shrink & empty flags. They shouldn't be changed after this point. */ for (d = 0; d < 2; d++) { dimension = &table_data->dimensions[d]; dldata = layout_data->dldata[d]; for (i = 0; i < dimension->size; i++) { if (dldata[i].empty) { dldata[i].expand = FALSE; dldata[i].shrink = FALSE; } else { if (dldata[i].need_expand) dldata[i].expand = TRUE; if (!dldata[i].need_shrink) dldata[i].shrink = FALSE; } } } } /* This calculates the initial size request for each row & column, which is the maximum size of all items that are in that row or column. (It skips items that span more than one row or column.) */ static void goo_canvas_table_size_request_pass1 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableDimension *dimension = &table_data->dimensions[d]; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata = layout_data->dldata[d]; GooCanvasTableChild *child; gdouble requested_size; gint i, start; for (i = 0; i < dimension->size; i++) dldata[i].requisition = 0.0; for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); requested_size = layout_data->children[i].requested_size[d]; /* Child needs allocation & spans a single row or column. */ if (requested_size >= 0.0 && child->size[d] == 1) { requested_size += layout_data->children[i].start_pad[d] + layout_data->children[i].end_pad[d]; start = child->start[d]; dldata[start].requisition = MAX (dldata[start].requisition, requested_size); } } } /* This ensures that homogeneous tables have all rows/columns the same size. Note that it is called once after items in a single row/column have been calculated, and then again after items spanning several rows/columns have been calculated. */ static void goo_canvas_table_size_request_pass2 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata = layout_data->dldata[d]; gdouble max_size = 0.0; gint i; if (table_data->dimensions[d].homogeneous) { /* Calculate the maximum row or column size. */ for (i = 0; i < table_data->dimensions[d].size; i++) max_size = MAX (max_size, dldata[i].requisition); /* Use the maximum size for all rows or columns. */ for (i = 0; i < table_data->dimensions[d].size; i++) dldata[i].requisition = max_size; } } /* This handles items that span more than one row or column, by making sure there is enough space for them and expanding the row/column size request if needed. */ static void goo_canvas_table_size_request_pass3 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata; GooCanvasTableChild *child; gint i, j; for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); if (layout_data->children[i].requested_size[HORZ] <= 0.0) continue; /* Child spans multiple rows/columns. */ if (child->size[d] != 1) { gint start = child->start[d]; gint end = start + child->size[d] - 1; gdouble total_space = 0.0, space_needed; dldata = layout_data->dldata[d]; /* Check if there is already enough space for the child. */ for (j = start; j <= end; j++) { total_space += dldata[j].requisition; if (j < end) total_space += dldata[j].spacing; } /* If we need to request more space for this child to fill its requisition, then divide up the needed space amongst the columns it spans, favoring expandable columns if any. */ space_needed = layout_data->children[i].requested_size[d] + layout_data->children[i].start_pad[d] + layout_data->children[i].end_pad[d]; if (total_space < space_needed) { gint n_expand = 0; gboolean force_expand = FALSE; gdouble expand = space_needed - total_space; gdouble extra; for (j = start; j <= end; j++) { if (dldata[j].expand) n_expand++; } if (n_expand == 0) { n_expand = child->size[d]; force_expand = TRUE; } if (layout_data->integer_layout) { for (j = start; j <= end; j++) { if (force_expand || dldata[j].expand) { extra = floor (expand / n_expand + 0.5); dldata[j].requisition += extra; expand -= extra; n_expand--; } } } else { extra = expand / n_expand; for (j = start; j <= end; j++) { if (force_expand || dldata[j].expand) dldata[j].requisition += extra; } } } } } } static void goo_canvas_table_size_allocate_init (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension = &table_data->dimensions[d]; GooCanvasTableDimensionLayoutData *dldata = layout_data->dldata[d]; gint i; /* Set the initial allocation, by copying over the requisition. Also set the final expand & shrink flags. */ for (i = 0; i < dimension->size; i++) dldata[i].allocation = dldata[i].requisition; } static void goo_canvas_table_size_allocate_pass1 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension; GooCanvasTableDimensionLayoutData *dldata; gdouble total_size, size_to_allocate, natural_size, extra, old_extra; gint i, nexpand, nshrink; /* If we were allocated more space than we requested * then we have to expand any expandable rows and columns * to fill in the extra space. */ dimension = &table_data->dimensions[d]; dldata = layout_data->dldata[d]; natural_size = 0; nexpand = 0; nshrink = 0; for (i = 0; i < dimension->size; i++) { natural_size += dldata[i].requisition; if (dldata[i].expand) nexpand += 1; if (dldata[i].shrink && dldata[i].allocation > 0.0) nshrink += 1; } for (i = 0; i + 1 < dimension->size; i++) natural_size += dldata[i].spacing; /* Note: natural_size does not contain without border width and border spacing here. */ /* total_size is the size available for allocating widgets. We always allocate space for border_width, but for right/bottom border_spacing only if all children can be allocated without being shrunk. */ if (layout_data->allocated_size[d] < layout_data->border_width * 2.0 + layout_data->border_spacing[d] + layout_data->grid_line_width[1-d]) total_size = 0; else if (layout_data->allocated_size[d] < layout_data->border_width * 2.0 + layout_data->border_spacing[d] + layout_data->grid_line_width[1-d] + natural_size) total_size = layout_data->allocated_size[d] - layout_data->border_width * 2.0 - layout_data->border_spacing[d] - layout_data->grid_line_width[1-d]; else if (layout_data->allocated_size[d] < layout_data->border_width * 2.0 + (layout_data->border_spacing[d] + layout_data->grid_line_width[1-d]) * 2.0 + natural_size) total_size = natural_size; else total_size = layout_data->allocated_size[d] - layout_data->border_width * 2.0 - (layout_data->border_spacing[d] + layout_data->grid_line_width[1-d])* 2.0; if (dimension->homogeneous) { /* If the table is homogeneous in this dimension we check if any of the children expand, or if there are no children, or if we were allocated less space than we requested and any children shrink. If so, we divide up all the allocated space. */ if (nexpand || table_data->children->len == 0 || (natural_size > total_size && nshrink)) { size_to_allocate = total_size; for (i = 0; i + 1 < dimension->size; i++) size_to_allocate -= dldata[i].spacing; if (layout_data->integer_layout) { gint n_elements = dimension->size; for (i = 0; i < dimension->size; i++) { dldata[i].allocation = floor (size_to_allocate / n_elements + 0.5); size_to_allocate -= dldata[i].allocation; n_elements--; } } else { size_to_allocate /= dimension->size; for (i = 0; i < dimension->size; i++) dldata[i].allocation = size_to_allocate; } } } else { /* Check to see if we were allocated more width than we requested. */ if ((natural_size < total_size) && (nexpand >= 1)) { if (layout_data->integer_layout) { gdouble expand = total_size - natural_size; for (i = 0; i < dimension->size; i++) { if (dldata[i].expand) { extra = floor (expand / nexpand + 0.5); dldata[i].allocation += extra; expand -= extra; nexpand--; } } } else { extra = (total_size - natural_size) / nexpand; for (i = 0; i < dimension->size; i++) { if (dldata[i].expand) dldata[i].allocation += extra; } } } /* Check to see if we were allocated less width than we requested, * then shrink until we fit the size give. */ if (natural_size > total_size) { gint total_nshrink = nshrink; extra = natural_size - total_size; while (total_nshrink > 0 && extra > 0) { nshrink = total_nshrink; old_extra = extra; for (i = 0; i < dimension->size; i++) { if (dldata[i].shrink && dldata[i].allocation > 0.0) { gdouble old_allocation = dldata[i].allocation; gdouble shrink_amount = extra / nshrink; gdouble new_allocation; if (layout_data->integer_layout) shrink_amount = floor (shrink_amount + 0.5); new_allocation = old_allocation - shrink_amount; dldata[i].allocation = MAX (0.0, new_allocation); extra -= old_allocation - dldata[i].allocation; nshrink -= 1; if (dldata[i].allocation <= 0.0) total_nshrink -= 1; } } if (extra >= old_extra) break; } } } } /* Calculates the start and end position of each row/column. */ static void goo_canvas_table_size_allocate_pass2 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension; GooCanvasTableDimensionLayoutData *dldata; gdouble pos; gint i; dimension = &table_data->dimensions[d]; dldata = layout_data->dldata[d]; pos = layout_data->border_width + layout_data->border_spacing[d] + layout_data->grid_line_width[1-d]; for (i = 0; i < dimension->size; i++) { dldata[i].start = pos; pos += dldata[i].allocation; dldata[i].end = pos; pos += dldata[i].spacing; #if 0 g_print ("%s %i: %g - %g\n", d ? "Row" : "Column", i, dldata[i].start, dldata[i].end); #endif } } /* This does the actual allocation of each child, calculating its size and position according to the rows & columns it spans. */ static void goo_canvas_table_size_allocate_pass3 (GooCanvasTable *table, cairo_t *cr, gdouble table_x_offset, gdouble table_y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) table; GooCanvasGroup *group = (GooCanvasGroup*) table; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; GooCanvasTableChild *child; GooCanvasItem *child_item; GooCanvasTableChildLayoutData *child_data; GooCanvasBounds requested_area, allocated_area; GtkTextDirection direction = GTK_TEXT_DIR_NONE; gint start_column, end_column, start_row, end_row, i; gdouble x, y, max_width, max_height, width, height; gdouble requested_width, requested_height; gdouble x_offset, y_offset; if (simple->canvas) direction = gtk_widget_get_direction (GTK_WIDGET (simple->canvas)); for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); child_item = group->items->pdata[i]; child_data = &layout_data->children[i]; requested_width = child_data->requested_size[HORZ]; requested_height = child_data->requested_size[VERT]; if (requested_width <= 0.0) continue; start_column = child->start[HORZ]; end_column = child->start[HORZ] + child->size[HORZ] - 1; x = columns[start_column].start + layout_data->children[i].start_pad[HORZ]; max_width = columns[end_column].end - layout_data->children[i].end_pad[HORZ] - x; start_row = child->start[VERT]; end_row = child->start[VERT] + child->size[VERT] - 1; y = rows[start_row].start + layout_data->children[i].start_pad[VERT]; max_height = rows[end_row].end - layout_data->children[i].end_pad[VERT] - y; width = max_width = MAX (0.0, max_width); height = max_height = MAX (0.0, max_height); if (!(child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_FILL)) { width = MIN (max_width, requested_width); x += (max_width - width) * child->align[HORZ]; if (layout_data->integer_layout) x = floor (x + 0.5); } if (!(child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_FILL)) { height = MIN (max_height, requested_height); y += (max_height - height) * child->align[VERT]; if (layout_data->integer_layout) y = floor (y + 0.5); } if (direction == GTK_TEXT_DIR_RTL) x = layout_data->allocated_size[HORZ] - width - x; requested_area.x1 = layout_data->children[i].requested_position[HORZ]; requested_area.y1 = layout_data->children[i].requested_position[VERT]; requested_area.x2 = requested_area.x1 + requested_width; requested_area.y2 = requested_area.y1 + requested_height; allocated_area.x1 = x; allocated_area.y1 = y; allocated_area.x2 = allocated_area.x1 + width; allocated_area.y2 = allocated_area.y1 + height; /* Calculate how much we will have to translate the child by. */ child->position[HORZ] = allocated_area.x1 - requested_area.x1; child->position[VERT] = allocated_area.y1 - requested_area.y1; /* Translate the cairo context so the item's user space is correct. */ cairo_translate (cr, child->position[HORZ], child->position[VERT]); x_offset = allocated_area.x1 - requested_area.x1; y_offset = allocated_area.y1 - requested_area.y1; cairo_user_to_device_distance (cr, &x_offset, &y_offset); x_offset += table_x_offset; y_offset += table_y_offset; goo_canvas_item_allocate_area (child_item, cr, &requested_area, &allocated_area, x_offset, y_offset); cairo_translate (cr, -child->position[HORZ], -child->position[VERT]); } } static void goo_canvas_table_update_requested_heights (GooCanvasItem *item, cairo_t *cr) { GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; GooCanvasTableChild *child; GooCanvasItem *child_item; GooCanvasTableChildLayoutData *child_data; gint start_column, end_column, i, row, end; gdouble x, max_width, width, requested_width, requested_height, height = 0.0; /* Just return if we've already calculated requested heights for this exact width. */ if (layout_data->last_width == layout_data->allocated_size[HORZ]) return; layout_data->last_width = layout_data->allocated_size[HORZ]; /* First calculate the allocations for each column. */ goo_canvas_table_size_allocate_init (table, HORZ); goo_canvas_table_size_allocate_pass1 (table, HORZ); goo_canvas_table_size_allocate_pass2 (table, HORZ); /* Now check if any child changes height based on their allocated width. */ for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); child_item = group->items->pdata[i]; child_data = &layout_data->children[i]; requested_width = child_data->requested_size[HORZ]; /* Skip children that won't be allocated. */ if (requested_width <= 0.0) continue; start_column = child->start[HORZ]; end_column = child->start[HORZ] + child->size[HORZ] - 1; x = columns[start_column].start + layout_data->children[i].start_pad[HORZ]; max_width = columns[end_column].end - layout_data->children[i].end_pad[HORZ] - x; width = max_width = MAX (0.0, max_width); if (!(child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_FILL)) width = MIN (max_width, requested_width); requested_height = goo_canvas_item_get_requested_height (child_item, cr, width); if (requested_height >= 0.0) child_data->requested_size[VERT] = requested_height; } /* Now recalculate the requested heights of each row. */ goo_canvas_table_size_request_pass1 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); goo_canvas_table_size_request_pass3 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); end = table_data->dimensions[VERT].size - 1; for (row = 0; row <= end; row++) { height += rows[row].requisition; if (row < end) height += rows[row].spacing; } height += (layout_data->border_width + layout_data->border_spacing[VERT] + layout_data->grid_line_width[HORZ]) * 2.0; layout_data->natural_size[VERT] = height; } /* Returns FALSE if item shouldn't be allocated. */ static gboolean goo_canvas_table_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows, *columns; gdouble width = 0.0, height = 0.0; gint row, column, end; /* Request a redraw of the existing bounds */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); /* We reset the bounds to 0, just in case we are hidden or aren't allocated any area. */ simple->bounds.x1 = simple->bounds.x2 = 0.0; simple->bounds.y1 = simple->bounds.y2 = 0.0; simple->need_update = FALSE; goo_canvas_item_simple_check_style (simple); if (simple_data->visibility == GOO_CANVAS_ITEM_HIDDEN) return FALSE; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Initialize the layout data, get the requested sizes of all children, and set the expand, shrink and empty flags. */ goo_canvas_table_init_layout_data (table); goo_canvas_table_size_request_init (table, cr); /* Calculate the requested width of the table. */ goo_canvas_table_size_request_pass1 (table, HORZ); goo_canvas_table_size_request_pass2 (table, HORZ); goo_canvas_table_size_request_pass3 (table, HORZ); goo_canvas_table_size_request_pass2 (table, HORZ); rows = layout_data->dldata[VERT]; columns = layout_data->dldata[HORZ]; end = table_data->dimensions[HORZ].size - 1; for (column = 0; column <= end; column++) { width += columns[column].requisition; if (column < end) width += columns[column].spacing; } width += (layout_data->border_width + layout_data->border_spacing[HORZ] + layout_data->grid_line_width[VERT]) * 2.0; /* Save the natural size, so we know if we have to clip children. */ layout_data->natural_size[HORZ] = width; /* If the width has been set, that overrides the calculations. */ if (table_data->width > 0.0) width = table_data->width; layout_data->requested_size[HORZ] = width; layout_data->allocated_size[HORZ] = width; /* Update the requested heights, based on the requested column widths. */ goo_canvas_table_update_requested_heights (item, cr); goo_canvas_table_size_request_pass1 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); goo_canvas_table_size_request_pass3 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); end = table_data->dimensions[VERT].size - 1; for (row = 0; row <= end; row++) { height += rows[row].requisition; if (row < end) height += rows[row].spacing; } height += (layout_data->border_width + layout_data->border_spacing[VERT] + layout_data->grid_line_width[HORZ]) * 2.0; /* Save the natural size, so we know if we have to clip children. */ layout_data->natural_size[VERT] = height; /* If the height has been set, that overrides the calculations. */ if (table_data->height > 0.0) height = table_data->height; layout_data->requested_size[VERT] = height; /* Copy the user bounds to the requested area. */ requested_area->x1 = requested_area->y1 = 0.0; requested_area->x2 = width; requested_area->y2 = height; /* Convert to the parent's coordinate space. */ goo_canvas_item_simple_user_bounds_to_parent (simple, cr, requested_area); cairo_restore (cr); return TRUE; } static gdouble goo_canvas_table_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; gdouble allocated_width = width, height; /* If we have a transformation besides a simple scale & translation, just return -1 as we can't adjust the height in that case. */ if (simple_data->transform && (simple_data->transform->xy != 0.0 || simple_data->transform->yx != 0.0)) return -1; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Convert the width from the parent's coordinate space. Note that we only need to support a simple scale operation here. */ if (simple_data->transform) allocated_width /= simple_data->transform->xx; layout_data->allocated_size[HORZ] = allocated_width; if (layout_data->integer_layout) layout_data->allocated_size[HORZ] = floor (layout_data->allocated_size[HORZ]); goo_canvas_table_update_requested_heights (item, cr); cairo_restore (cr); /* Convert to the parent's coordinate space. As above, we only need to support a simple scale operation here. */ height = layout_data->natural_size[VERT]; if (simple_data->transform) height *= simple_data->transform->yy; /* Return the new requested height of the table. */ return height; } static void goo_canvas_table_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; gdouble requested_width, requested_height, allocated_width, allocated_height; gdouble width_proportion, height_proportion, min_proportion; requested_width = requested_area->x2 - requested_area->x1; requested_height = requested_area->y2 - requested_area->y1; allocated_width = allocated_area->x2 - allocated_area->x1; allocated_height = allocated_area->y2 - allocated_area->y1; /* Calculate what proportion of our requested size we were allocated. */ width_proportion = allocated_width / requested_width; height_proportion = allocated_height / requested_height; /* If the table is rotated we have to scale it to make sure it fits in the allocated area. */ if (simple_data->transform && (simple_data->transform->xy != 0.0 || simple_data->transform->yx != 0.0)) { /* Calculate the minimum proportion, which we'll use to scale our original width & height requests. */ min_proportion = MIN (width_proportion, height_proportion); layout_data->allocated_size[HORZ] = layout_data->requested_size[HORZ] * min_proportion; layout_data->allocated_size[VERT] = layout_data->requested_size[VERT] * min_proportion; } else { /* If the table isn't rotated we can just scale according to the allocated proportions. */ layout_data->allocated_size[HORZ] = layout_data->requested_size[HORZ] * width_proportion; layout_data->allocated_size[VERT] = layout_data->requested_size[VERT] * height_proportion; } if (layout_data->integer_layout) { layout_data->allocated_size[HORZ] = floor (layout_data->requested_size[HORZ]); layout_data->allocated_size[VERT] = floor (layout_data->requested_size[VERT]); } /* We have to remove the translation that our parent is giving us while we update the size requests, otherwise child items' bounds will include the translation which we result in incorrect bounds after allocation. */ cairo_save (cr); cairo_translate (cr, -(allocated_area->x1 - requested_area->x1), -(allocated_area->y1 - requested_area->y1)); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); goo_canvas_table_update_requested_heights (item, cr); cairo_restore (cr); cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Calculate the table's bounds. */ simple->bounds.x1 = simple->bounds.y1 = 0.0; simple->bounds.x2 = layout_data->allocated_size[HORZ]; simple->bounds.y2 = layout_data->allocated_size[VERT]; goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); goo_canvas_table_size_allocate_init (table, VERT); goo_canvas_table_size_allocate_pass1 (table, VERT); goo_canvas_table_size_allocate_pass2 (table, VERT); goo_canvas_table_size_allocate_pass3 (table, cr, x_offset, y_offset); /* We free the children array but keep the dimension layout data, since we may need that for clipping children. */ g_free (layout_data->children); layout_data->children = NULL; cairo_restore (cr); goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); } static void goo_canvas_table_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasBounds tmp_bounds; if (entire_tree || simple->need_update) { simple->need_update = FALSE; simple->need_entire_subtree_update = FALSE; goo_canvas_item_simple_check_style (simple); /* We just allocate exactly what is requested. */ if (goo_canvas_table_get_requested_area (item, cr, &tmp_bounds)) { goo_canvas_table_allocate_area (item, cr, &tmp_bounds, &tmp_bounds, 0, 0); } } *bounds = simple->bounds; } static void goo_canvas_table_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasStyle *style = simple_data->style; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; gdouble vert_grid_line_width = layout_data->grid_line_width[VERT]; gdouble horz_grid_line_width = layout_data->grid_line_width[HORZ]; GArray *children = table_data->children; GooCanvasTableChild *table_child; GooCanvasItem *child; gboolean check_clip = FALSE, clip; gint start_column, end_column, start_row, end_row, i, j; gdouble x, y, end_x, end_y, clip_width, clip_height; gdouble frame_width, frame_height; gdouble line_start, line_end; gdouble spacing, half_spacing_before, half_spacing_after; gboolean old_grid_line_visibility, cur_grid_line_visibility; GtkTextDirection direction = GTK_TEXT_DIR_NONE; /* Skip the item if the bounds don't intersect the expose rectangle. */ if (simple->bounds.x1 > bounds->x2 || simple->bounds.x2 < bounds->x1 || simple->bounds.y1 > bounds->y2 || simple->bounds.y2 < bounds->y1) return; /* Check if the item should be visible. */ if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) return; if (simple->canvas) direction = gtk_widget_get_direction (GTK_WIDGET (simple->canvas)); /* Paint all the items in the group. */ cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Clip with the table's clip path, if it is set. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_clip (cr); } /* Check if the table was allocated less space than it requested, in which case we may need to clip children. */ if (layout_data->allocated_size[HORZ] < layout_data->natural_size[HORZ] || layout_data->allocated_size[VERT] < layout_data->natural_size[VERT]) check_clip = TRUE; /* frame_width/frame_height is the size of the table we draw the grid lines around. This normally is the allocated size, except when we are shrunk in which case we use the natural size. The grid will be clipped in that case. */ frame_width = MAX (layout_data->allocated_size[HORZ], layout_data->natural_size[HORZ]); frame_height = MAX (layout_data->allocated_size[VERT], layout_data->natural_size[VERT]); /* Draw border and grid lines */ if (check_clip) { cairo_rectangle (cr, layout_data->border_width, layout_data->border_width, layout_data->allocated_size[HORZ] - 2*layout_data->border_width, layout_data->allocated_size[VERT] - 2*layout_data->border_width); cairo_clip (cr); } /* Save current line width, line cap etc. for drawing items after having drawn grid lines */ cairo_save (cr); /* Fill the table, if desired. */ if (goo_canvas_style_set_fill_options (style, cr)) { cairo_rectangle (cr, layout_data->border_width + vert_grid_line_width, layout_data->border_width + horz_grid_line_width, layout_data->allocated_size[HORZ] - 2 * (layout_data->border_width + vert_grid_line_width), layout_data->allocated_size[VERT] - 2 * (layout_data->border_width + horz_grid_line_width)); cairo_fill (cr); } /* We use the style for the stroke color, but the line cap style and line width are overridden here. */ goo_canvas_style_set_stroke_options (style, cr); cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); /* Horizontal grid lines */ if (horz_grid_line_width > 0.0) { cairo_set_line_width (cr, horz_grid_line_width); /* Outer lines */ line_start = layout_data->border_width; line_end = frame_width - layout_data->border_width; cairo_move_to (cr, line_start, layout_data->border_width + horz_grid_line_width/2); cairo_rel_line_to (cr, line_end - line_start, 0); cairo_move_to (cr, line_start, frame_height - layout_data->border_width - horz_grid_line_width/2); cairo_rel_line_to (cr, line_end - line_start, 0); /* Inner lines. Make sure we don't do overlapping drawing operations, so we could easily draw alpha transparent borders */ for (i = 0; i + 1 < table_data->dimensions[VERT].size; i++) { for (j = 0; j < table_data->dimensions[HORZ].size; j++) { cur_grid_line_visibility = GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], i, j); if (cur_grid_line_visibility) { spacing = (columns[j].spacing - vert_grid_line_width); half_spacing_before = spacing / 2.0; if (simple->canvas->integer_layout) half_spacing_before = floor (half_spacing_before); half_spacing_after = spacing - half_spacing_before; if (j == 0) line_start = layout_data->border_width + vert_grid_line_width; else if (old_grid_line_visibility) line_start = columns[j].start - half_spacing_after; else line_start = columns[j-1].end + half_spacing_before; half_spacing_after = (columns[j].spacing - vert_grid_line_width)/2.0; if (simple->canvas->integer_layout) half_spacing_after = ceil (half_spacing_after); if (j == table_data->dimensions[HORZ].size - 1) line_end = frame_width - layout_data->border_width - vert_grid_line_width; else line_end = columns[j + 1].start - half_spacing_after; cairo_move_to (cr, line_start, rows[i].end + rows[i].spacing/2.0); cairo_rel_line_to (cr, line_end - line_start, 0); } old_grid_line_visibility = cur_grid_line_visibility; } } cairo_stroke (cr); } /* Vertical grid lines */ if (vert_grid_line_width > 0.0) { cairo_set_line_width (cr, vert_grid_line_width); /* Outer lines */ line_start = layout_data->border_width + horz_grid_line_width; line_end = frame_height - layout_data->border_width - horz_grid_line_width; cairo_move_to (cr, layout_data->border_width + vert_grid_line_width/2, line_start); cairo_rel_line_to (cr, 0, line_end - line_start); cairo_move_to (cr, frame_width - layout_data->border_width - vert_grid_line_width/2, line_start); cairo_rel_line_to (cr, 0, line_end - line_start); /* Inner lines. Make sure we don't do overlapping drawing operations, so we could easily draw alpha transparent borders. We need to take additionally care that we don't cross already drawn horizontal lines. */ for (i = 0; i + 1 < table_data->dimensions[HORZ].size; i++) { for (j = 0; j < table_data->dimensions[VERT].size; j++) { cur_grid_line_visibility = GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[HORZ], i, j); if (cur_grid_line_visibility) { spacing = (rows[j].spacing - horz_grid_line_width); half_spacing_before = spacing / 2.0; if (simple->canvas->integer_layout) half_spacing_before = floor (half_spacing_before); half_spacing_after = spacing - half_spacing_before; if (j == 0) line_start = layout_data->border_width + horz_grid_line_width; else if (old_grid_line_visibility) line_start = rows[j].start - half_spacing_after; else /* Don't draw top part if already drawn by horizontal grid line */ if (GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j-1, i) || GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j-1, i+1)) line_start = rows[j].start - half_spacing_after; else line_start = rows[j-1].end + half_spacing_before; half_spacing_before = half_spacing_after = (rows[j].spacing - horz_grid_line_width)/2.0; if (simple->canvas->integer_layout) { half_spacing_before = floor (half_spacing_before); half_spacing_after = ceil (half_spacing_after); } if (j == table_data->dimensions[VERT].size - 1) line_end = frame_height - layout_data->border_width - horz_grid_line_width; else /* Don't draw bottom part if already drawn by horizontal grid line */ if (GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j, i) || GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j, i+1)) line_end = rows[j].end + half_spacing_before; else line_end = rows[j + 1].start - half_spacing_after; cairo_move_to (cr, columns[i].end + columns[i].spacing/2.0, line_start); cairo_rel_line_to (cr, 0, line_end - line_start); } old_grid_line_visibility = cur_grid_line_visibility; } } cairo_stroke (cr); } cairo_restore (cr); for (i = 0; i < group->items->len; i++) { child = group->items->pdata[i]; table_child = &g_array_index (children, GooCanvasTableChild, i); clip = FALSE; /* Clip the child to make sure it doesn't go outside its area. */ if (check_clip) { /* Calculate the position of the child and how much space it has. */ start_column = table_child->start[HORZ]; end_column = table_child->start[HORZ] + table_child->size[HORZ] - 1; x = columns[start_column].start + table_child->start_pad[HORZ]; end_x = columns[end_column].end - table_child->end_pad[HORZ]; start_row = table_child->start[VERT]; end_row = table_child->start[VERT] + table_child->size[VERT] - 1; y = rows[start_row].start + table_child->start_pad[VERT]; end_y = rows[end_row].end - table_child->end_pad[VERT]; if (simple->canvas->integer_layout) { x = floor (x + 0.5); end_x = floor (end_x + 0.5); y = floor (y + 0.5); end_y = floor (end_y + 0.5); } /* Make sure it doesn't go outside the table's allocated size. */ end_x = MIN (end_x, layout_data->allocated_size[HORZ]); end_y = MIN (end_y, layout_data->allocated_size[VERT]); /* Only try to paint the child if it has some allocated space. */ if (end_x <= x || end_y <= y) continue; /* Check if any of the rows/columns the child is in can shrink. */ for (j = start_column; j <= end_column; j++) if (columns[j].shrink) clip = TRUE; for (j = start_row; j <= end_row; j++) if (rows[j].shrink) clip = TRUE; /* Only clip the child if it may have been shrunk. */ if (clip) { clip_width = end_x - x; clip_height = end_y - y; if (direction == GTK_TEXT_DIR_RTL) x = layout_data->allocated_size[HORZ] - clip_width - x; cairo_save (cr); cairo_rectangle (cr, x, y, clip_width, clip_height); cairo_clip (cr); } } cairo_translate (cr, table_child->position[HORZ], table_child->position[VERT]); goo_canvas_item_paint (child, cr, bounds, scale); cairo_translate (cr, -table_child->position[HORZ], -table_child->position[VERT]); if (clip) cairo_restore (cr); } cairo_restore (cr); } static GList* goo_canvas_table_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_visible, GList *found_items) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; GArray *children = table_data->children; GooCanvasTableChild *table_child; GooCanvasItem *child; gboolean visible = parent_visible, check_clip = FALSE; double user_x = x, user_y = y; gint start_column, end_column, start_row, end_row, i; gdouble start_x, end_x, start_y, end_y; if (simple->need_update) goo_canvas_item_ensure_updated (item); /* Skip the item if the point isn't in the item's bounds. */ if (simple->bounds.x1 > x || simple->bounds.x2 < x || simple->bounds.y1 > y || simple->bounds.y2 < y) return found_items; if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) visible = FALSE; /* Check if the group should receive events. */ if (is_pointer_event && (simple_data->pointer_events == GOO_CANVAS_EVENTS_NONE || ((simple_data->pointer_events & GOO_CANVAS_EVENTS_VISIBLE_MASK) && !visible))) return found_items; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); cairo_device_to_user (cr, &user_x, &user_y); /* If the table has a clip path, check if the point is inside it. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); if (!cairo_in_fill (cr, user_x, user_y)) { cairo_restore (cr); return found_items; } } /* Check if the table was allocated less space than it requested, in which case we may need to clip children. */ if (layout_data->allocated_size[HORZ] < layout_data->natural_size[HORZ] || layout_data->allocated_size[VERT] < layout_data->natural_size[VERT]) check_clip = TRUE; /* Step up from the bottom of the children to the top, adding any items found to the start of the list. */ for (i = 0; i < group->items->len; i++) { child = group->items->pdata[i]; table_child = &g_array_index (children, GooCanvasTableChild, i); /* If the child may have been clipped, check the point is in the child's allocated area. */ if (check_clip) { /* Calculate the position of the child and how much space it has. */ start_column = table_child->start[HORZ]; end_column = table_child->start[HORZ] + table_child->size[HORZ] - 1; start_x = columns[start_column].start + table_child->start_pad[HORZ]; end_x = columns[end_column].end - table_child->end_pad[HORZ]; start_row = table_child->start[VERT]; end_row = table_child->start[VERT] + table_child->size[VERT] - 1; start_y = rows[start_row].start + table_child->start_pad[VERT]; end_y = rows[end_row].end - table_child->end_pad[VERT]; if (simple->canvas->integer_layout) { start_x = floor (start_x + 0.5); end_x = floor (end_x + 0.5); start_y = floor (start_y + 0.5); end_y = floor (end_y + 0.5); } if (user_x < start_x || user_x > end_x || user_y < start_y || user_y > end_y) continue; } cairo_translate (cr, table_child->position[HORZ], table_child->position[VERT]); found_items = goo_canvas_item_get_items_at (child, x, y, cr, is_pointer_event, visible, found_items); cairo_translate (cr, -table_child->position[HORZ], -table_child->position[VERT]); } cairo_restore (cr); return found_items; } gboolean goo_canvas_table_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableChild *table_child; gboolean has_transform = FALSE; gint child_num; if (simple->simple_data->transform) { *transform = *simple->simple_data->transform; has_transform = TRUE; } else { cairo_matrix_init_identity (transform); } for (child_num = 0; child_num < group->items->len; child_num++) { if (group->items->pdata[child_num] == child) { table_child = &g_array_index (table->table_data->children, GooCanvasTableChild, child_num); cairo_matrix_translate (transform, table_child->position[HORZ], table_child->position[VERT]); has_transform = TRUE; break; } } return has_transform; } static void item_interface_init (GooCanvasItemIface *iface) { iface->add_child = goo_canvas_table_add_child; iface->move_child = goo_canvas_table_move_child; iface->remove_child = goo_canvas_table_remove_child; iface->get_child_property = goo_canvas_table_get_child_property; iface->set_child_property = goo_canvas_table_set_child_property; iface->get_transform_for_child = goo_canvas_table_get_transform_for_child; iface->update = goo_canvas_table_update; iface->get_requested_area = goo_canvas_table_get_requested_area; iface->get_requested_height = goo_canvas_table_get_requested_height; iface->allocate_area = goo_canvas_table_allocate_area; iface->paint = goo_canvas_table_paint; iface->get_items_at = goo_canvas_table_get_items_at; iface->set_model = goo_canvas_table_set_model; } /** * SECTION:goocanvastablemodel * @Title: GooCanvasTableModel * @Short_Description: a model for a table container to layout items. * * #GooCanvasTableModel is a model for a table container used to lay out other * canvas items. It is used in a similar way to how the GtkTable widget is used * to lay out GTK+ widgets. * * Item models are added to the table using the normal methods, then * goo_canvas_item_model_set_child_properties() is used to specify how each * child item is to be positioned within the table (i.e. which row and column * it is in, how much padding it should have and whether it should expand or * shrink). * * #GooCanvasTableModel is a subclass of #GooCanvasItemModelSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasTableModel will * affect all children of the #GooCanvasTableModel (unless the children * override the property setting). * * #GooCanvasTableModel implements the #GooCanvasItemModel interface, so you * can use the #GooCanvasItemModel functions such as * goo_canvas_item_model_raise() and goo_canvas_item_rotate(), and the * properties such as "visibility" and "pointer-events". * * To create a #GooCanvasTableModel use goo_canvas_table_model_new(). * * To get or set the properties of an existing #GooCanvasTableModel, use * g_object_get() and g_object_set(). */ static GooCanvasItemModelIface *goo_canvas_table_model_parent_iface; static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_table_model_finalize (GObject *object); static void goo_canvas_table_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_table_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasTableModel, goo_canvas_table_model, GOO_TYPE_CANVAS_GROUP_MODEL, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_table_model_class_init (GooCanvasTableModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; goo_canvas_table_model_parent_iface = g_type_interface_peek (goo_canvas_table_model_parent_class, GOO_TYPE_CANVAS_ITEM_MODEL); gobject_class->finalize = goo_canvas_table_model_finalize; gobject_class->get_property = goo_canvas_table_model_get_property; gobject_class->set_property = goo_canvas_table_model_set_property; goo_canvas_table_install_common_properties (gobject_class, goo_canvas_item_model_class_install_child_property); } static void goo_canvas_table_model_init (GooCanvasTableModel *tmodel) { goo_canvas_table_init_data (&tmodel->table_data); } /** * goo_canvas_table_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new table model. * * * * Here's an example showing how to create a table with a square, a circle and * a triangle in it: * * * GooCanvasItemModel *table, *square, *circle, *triangle; * * table = goo_canvas_table_model_new (root, * "row-spacing", 4.0, * "column-spacing", 4.0, * NULL); * goo_canvas_item_model_translate (table, 400, 200); * * square = goo_canvas_rect_model_new (table, 0.0, 0.0, 50.0, 50.0, * "fill-color", "red", * NULL); * goo_canvas_item_model_set_child_properties (table, square, * "row", 0, * "column", 0, * NULL); * * circle = goo_canvas_ellipse_model_new (table, 0.0, 0.0, 25.0, 25.0, * "fill-color", "blue", * NULL); * goo_canvas_item_model_set_child_properties (table, circle, * "row", 0, * "column", 1, * NULL); * * triangle = goo_canvas_polyline_model_new (table, TRUE, 3, * 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, * "fill-color", "yellow", * NULL); * goo_canvas_item_model_set_child_properties (table, triangle, * "row", 0, * "column", 2, * NULL); * * * Returns: a new table model. **/ GooCanvasItemModel* goo_canvas_table_model_new (GooCanvasItemModel *parent, ...) { GooCanvasItemModel *model; va_list var_args; const char *first_property; model = g_object_new (GOO_TYPE_CANVAS_TABLE_MODEL, NULL); va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (model), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_table_model_finalize (GObject *object) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) object; goo_canvas_table_free_data (&tmodel->table_data); G_OBJECT_CLASS (goo_canvas_table_model_parent_class)->finalize (object); } static void goo_canvas_table_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasTableModel *emodel = (GooCanvasTableModel*) object; goo_canvas_table_get_common_property (object, &emodel->table_data, prop_id, value, pspec); } static void goo_canvas_table_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasTableModel *emodel = (GooCanvasTableModel*) object; gboolean recompute_bounds; recompute_bounds = goo_canvas_table_set_common_property (object, &emodel->table_data, prop_id, value, pspec); g_signal_emit_by_name (emodel, "changed", recompute_bounds); } static void goo_canvas_table_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; goo_canvas_table_add_child_internal (&tmodel->table_data, position); /* Let the parent GooCanvasGroupModel code do the rest. */ goo_canvas_table_model_parent_iface->add_child (model, child, position); } static void goo_canvas_table_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; goo_canvas_table_move_child_internal (&tmodel->table_data, old_position, new_position); /* Let the parent GooCanvasGroupModel code do the rest. */ goo_canvas_table_model_parent_iface->move_child (model, old_position, new_position); } static void goo_canvas_table_model_remove_child (GooCanvasItemModel *model, gint child_num) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; g_array_remove_index (tmodel->table_data.children, child_num); /* Let the parent GooCanvasGroupModel code do the rest. */ goo_canvas_table_model_parent_iface->remove_child (model, child_num); } static void goo_canvas_table_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, guint property_id, GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < gmodel->children->len; child_num++) { if (gmodel->children->pdata[child_num] == child) { table_child = &g_array_index (tmodel->table_data.children, GooCanvasTableChild, child_num); goo_canvas_table_get_common_child_property ((GObject*) tmodel, table_child, property_id, value, pspec); break; } } } static void goo_canvas_table_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, guint property_id, const GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < gmodel->children->len; child_num++) { if (gmodel->children->pdata[child_num] == child) { table_child = &g_array_index (tmodel->table_data.children, GooCanvasTableChild, child_num); goo_canvas_table_set_common_child_property ((GObject*) tmodel, &tmodel->table_data, table_child, property_id, value, pspec); break; } } g_signal_emit_by_name (tmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_table_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = goo_canvas_table_new (NULL, NULL); /* Note that we set the canvas before the model, since we may need the canvas to create any child items. */ goo_canvas_item_set_canvas (item, canvas); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->add_child = goo_canvas_table_model_add_child; iface->move_child = goo_canvas_table_model_move_child; iface->remove_child = goo_canvas_table_model_remove_child; iface->get_child_property = goo_canvas_table_model_get_child_property; iface->set_child_property = goo_canvas_table_model_set_child_property; iface->create_item = goo_canvas_table_model_create_item; } goocanvas-1.0.0/src/goocanvastext.h0000644000076400007640000001006711412723611014250 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastext.h - text item. */ #ifndef __GOO_CANVAS_TEXT_H__ #define __GOO_CANVAS_TEXT_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasTextData GooCanvasTextData; struct _GooCanvasTextData { gchar *text; gdouble x, y, width; guint use_markup : 1; guint anchor : 5; /* GtkAnchorType */ guint alignment : 3; /* PangoAlignment */ guint ellipsize : 3; /* PangoEllipsizeMode */ guint wrap : 3; /* PangoWrapMode */ }; #define GOO_TYPE_CANVAS_TEXT (goo_canvas_text_get_type ()) #define GOO_CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TEXT, GooCanvasText)) #define GOO_CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TEXT, GooCanvasTextClass)) #define GOO_IS_CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TEXT)) #define GOO_IS_CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TEXT)) #define GOO_CANVAS_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TEXT, GooCanvasTextClass)) typedef struct _GooCanvasText GooCanvasText; typedef struct _GooCanvasTextClass GooCanvasTextClass; /** * GooCanvasText * * The #GooCanvasText-struct struct contains private data only. */ struct _GooCanvasText { GooCanvasItemSimple parent; GooCanvasTextData *text_data; gdouble layout_width; }; struct _GooCanvasTextClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_text_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_text_new (GooCanvasItem *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); void goo_canvas_text_get_natural_extents (GooCanvasText *text, PangoRectangle *ink_rect, PangoRectangle *logical_rect); #define GOO_TYPE_CANVAS_TEXT_MODEL (goo_canvas_text_model_get_type ()) #define GOO_CANVAS_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModel)) #define GOO_CANVAS_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModelClass)) #define GOO_IS_CANVAS_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TEXT_MODEL)) #define GOO_IS_CANVAS_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TEXT_MODEL)) #define GOO_CANVAS_TEXT_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModelClass)) typedef struct _GooCanvasTextModel GooCanvasTextModel; typedef struct _GooCanvasTextModelClass GooCanvasTextModelClass; /** * GooCanvasTextModel * * The #GooCanvasTextModel-struct struct contains private data only. */ struct _GooCanvasTextModel { GooCanvasItemModelSimple parent_object; GooCanvasTextData text_data; }; struct _GooCanvasTextModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_text_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_text_model_new (GooCanvasItemModel *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); G_END_DECLS #endif /* __GOO_CANVAS_TEXT_H__ */ goocanvas-1.0.0/src/goocanvas.h0000644000076400007640000002640511412723611013346 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvas.h - the main canvas widget. */ #ifndef __GOO_CANVAS_H__ #define __GOO_CANVAS_H__ #include #include #include #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS #define GOO_TYPE_CANVAS (goo_canvas_get_type ()) #define GOO_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS, GooCanvas)) #define GOO_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS, GooCanvasClass)) #define GOO_IS_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS)) #define GOO_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS)) #define GOO_CANVAS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS, GooCanvasClass)) typedef struct _GooCanvasClass GooCanvasClass; /** * GooCanvas * * The #GooCanvas-struct struct contains private data only. */ struct _GooCanvas { GtkContainer container; /* The model for the root item, in model/view mode. */ GooCanvasItemModel *root_item_model; /* The root canvas item. */ GooCanvasItem *root_item; /* The bounds of the canvas, in canvas units (not pixels). */ GooCanvasBounds bounds; /* The scale/zoom factors of the canvas. */ gdouble scale_x, scale_y; /* The minimum of scale_x and scale_y, to compare with items' visibility thresholds. */ gdouble scale; /* Where the canvas is anchored (where it is displayed when it is smaller than the entire window). */ GtkAnchorType anchor; /* Idle handler ID, for processing updates. */ guint idle_id; /* This is TRUE if some item in the canvas needs an update. */ guint need_update : 1; /* This is TRUE if all items in the canvas need to be updated. */ guint need_entire_subtree_update : 1; /* This is TRUE if all layout should be done to the nearest integer. */ guint integer_layout : 1; /* This is TRUE if the bounds are calculated automatically, using the bounds of all the items in the canvas. */ guint automatic_bounds : 1; /* This is TRUE if the automatic bounds are calculated from the origin. */ guint bounds_from_origin : 1; /* This is TRUE if the background is cleared before painting the canvas. */ guint clear_background : 1; /* This is TRUE if the canvas is completely redrawn when scrolled. It is useful when there are sticky items to reduce flicker, but is slower. */ guint redraw_when_scrolled : 1; /* If the canvas hasn't received the initial expose event yet. */ guint before_initial_expose : 1; /* This is the padding around the automatic bounds. */ gdouble bounds_padding; /* The item that the mouse is over. */ GooCanvasItem *pointer_item; /* The item that has the pointer grab, or NULL. */ GooCanvasItem *pointer_grab_item; /* This is the item that the grab was started from. When the grab ends we synthesize enter/leave notify events from this item. */ GooCanvasItem *pointer_grab_initial_item; /* This is the mouse button that started an implicit pointer grab. When the same button is released the implicit grab ends. */ guint pointer_grab_button; /* The item that has the keyboard focus, or NULL. */ GooCanvasItem *focused_item; /* The item that has the keyboard grab, or NULL. */ GooCanvasItem *keyboard_grab_item; /* The synthesized event used for sending enter-notify and leave-notify events to items. */ GdkEventCrossing crossing_event; /* The main canvas window, which gets scrolled around. */ GdkWindow *canvas_window; /* The offsets of the canvas within the canvas window, in pixels. These are used when the canvas is smaller than the window size and the anchor is not NORTH_WEST. */ gint canvas_x_offset; gint canvas_y_offset; /* The adjustments used for scrolling. */ GtkAdjustment *hadjustment; GtkAdjustment *vadjustment; /* Freezes any movement of the canvas window, until thawed. This is used when we need to set both adjustments and don't want it to scroll twice. */ gint freeze_count; /* A window temporarily mapped above the canvas to stop X from scrolling the contents unnecessarily (i.e. when we zoom in/out). */ GdkWindow *tmp_window; /* A hash table mapping canvas item models to canvas items. */ GHashTable *model_to_item; /* The units of the canvas, which applies to all item coords. */ GtkUnit units; /* The horizontal and vertical resolution of the display, in dots per inch. This is only needed when units other than pixels are used. */ gdouble resolution_x, resolution_y; /* The multiplers to convert from device units to pixels, taking into account the canvas scale, the units setting and the display resolution. */ gdouble device_to_pixels_x, device_to_pixels_y; /* The list of child widgets (using GooCanvasWidget items). */ GList *widget_items; }; /** * GooCanvasClass * @create_item: a virtual method that subclasses may override to create custom * canvas items for item models. * @item_created: signal emitted when a new canvas item has been created. * Applications can connect to this to setup signal handlers for the new item. * * The #GooCanvasClass-struct struct contains one virtual method that * subclasses may override. */ struct _GooCanvasClass { /*< private >*/ GtkContainerClass parent_class; void (* set_scroll_adjustments) (GooCanvas *canvas, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment); /* Virtual methods. */ /*< public >*/ GooCanvasItem* (* create_item) (GooCanvas *canvas, GooCanvasItemModel *model); /* Signals. */ void (* item_created) (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); void (*_goo_canvas_reserved5) (void); void (*_goo_canvas_reserved6) (void); void (*_goo_canvas_reserved7) (void); void (*_goo_canvas_reserved8) (void); }; GType goo_canvas_get_type (void) G_GNUC_CONST; GtkWidget* goo_canvas_new (void); GooCanvasItem* goo_canvas_get_root_item (GooCanvas *canvas); void goo_canvas_set_root_item (GooCanvas *canvas, GooCanvasItem *item); GooCanvasItemModel* goo_canvas_get_root_item_model (GooCanvas *canvas); void goo_canvas_set_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_static_root_item (GooCanvas *canvas); void goo_canvas_set_static_root_item (GooCanvas *canvas, GooCanvasItem *item); GooCanvasItemModel* goo_canvas_get_static_root_item_model (GooCanvas *canvas); void goo_canvas_set_static_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_item (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_item_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); GList* goo_canvas_get_items_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); GList* goo_canvas_get_items_in_area(GooCanvas *canvas, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers); gdouble goo_canvas_get_scale (GooCanvas *canvas); void goo_canvas_set_scale (GooCanvas *canvas, gdouble scale); void goo_canvas_get_bounds (GooCanvas *canvas, gdouble *left, gdouble *top, gdouble *right, gdouble *bottom); void goo_canvas_set_bounds (GooCanvas *canvas, gdouble left, gdouble top, gdouble right, gdouble bottom); void goo_canvas_scroll_to (GooCanvas *canvas, gdouble left, gdouble top); void goo_canvas_grab_focus (GooCanvas *canvas, GooCanvasItem *item); void goo_canvas_render (GooCanvas *canvas, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); /* * Coordinate conversion. */ void goo_canvas_convert_to_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); void goo_canvas_convert_from_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); void goo_canvas_convert_to_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); void goo_canvas_convert_from_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); void goo_canvas_convert_bounds_to_item_space (GooCanvas *canvas, GooCanvasItem *item, GooCanvasBounds *bounds); /* * Pointer/keyboard grabbing & ungrabbing. */ GdkGrabStatus goo_canvas_pointer_grab (GooCanvas *canvas, GooCanvasItem *item, GdkEventMask event_mask, GdkCursor *cursor, guint32 time); void goo_canvas_pointer_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); GdkGrabStatus goo_canvas_keyboard_grab (GooCanvas *canvas, GooCanvasItem *item, gboolean owner_events, guint32 time); void goo_canvas_keyboard_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); /* * Internal functions, mainly for canvas subclasses and item implementations. */ cairo_t* goo_canvas_create_cairo_context (GooCanvas *canvas); GooCanvasItem* goo_canvas_create_item (GooCanvas *canvas, GooCanvasItemModel *model); void goo_canvas_unregister_item (GooCanvas *canvas, GooCanvasItemModel *model); void goo_canvas_update (GooCanvas *canvas); void goo_canvas_request_update (GooCanvas *canvas); void goo_canvas_request_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds); void goo_canvas_request_item_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds, gboolean is_static); gdouble goo_canvas_get_default_line_width (GooCanvas *canvas); void goo_canvas_register_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); void goo_canvas_unregister_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); G_END_DECLS #endif /* __GOO_CANVAS_H__ */ goocanvas-1.0.0/install-sh0000755000076400007640000003253711310245766012444 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.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 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 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 trap '(exit $?); exit' 1 2 13 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 starting with `-'. 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 # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # 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 -z "$d" && 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: goocanvas-1.0.0/NEWS0000644000076400007640000002044311512577564011140 00000000000000 GooCanvas 1.0.0 (Jan 10 2011) =============== o Added "alpha" property to GooCanvasImage to set opacity. o Allow setting clip path to NULL to reset it. o Allow setting line dash to NULL to reset it. o Handle RTL direction better in GooCanvasTable. o Fixed GooCanvasGroup bug - use the correct scale argument in paint. o Fixed GooCanvasPolyline bug - update arrows when line width changes. o Fixed static items bug - don't clip incorrectly. o Improved performance a bit when creating lots of items. GooCanvas 0.15 (Jun 29 2009) ============== o Fixed a bug that caused a hang when using GooCanvasWidget with accessibility support turned on. o Added "scale-to-fit" property to GooCanvasImage, to scale the image to the "width" and "height" settings, instead of just clipping. GooCanvas 0.14 (Mar 15 2009) ============== o Added support for tooltips (this means we need GTK+ 2.12). (Note that there is a GTK+ bug which will cause problems with tooltips on a large canvas. See bug #573294.) o Added "x", "y", "width" and "height" properties to items that didn't have them. o Fixed bug in goo_canvas_convert_from_item_space(). o Added "scroll-event" signal to GooCanvasItem. GooCanvas 0.13 (Nov 30 2008) ============== o New GooCanvasGrid item for drawing grids on the canvas. o Support for static items that don't move as the canvas is zoomed and scrolled (this is a bit experimental). o Font hinting is not turned off any more - this means smaller text should be more readable. Hopefully it doesn't affect text layout. o Fixed a few GooCanvasTable drawing bugs. o Fixed GooCanvasText drawing, when align is set. o Fixed GooCanvasPolyline is_item_at() code, so the fill isn't tested. o Added "animation-finished" signals to GooCanvasItem & Model. GooCanvas 0.12 (Sep 21 2008) ============== o Fixed redraws of tables after updates. o Fixed problems compiling with libtool 2.2. GooCanvas 0.11 (Sep 9 2008) ============== o Use the tables' fill and stroke colors to paint its grid and background. o Emit "children_changed" ATK signal when child items added/removed. o Fixed bug when clipping the entire canvas. o Got rid of the XXX_DISABLE_DEPRECATED compilation flags. GooCanvas 0.10 (Apr 27 2008) ============== o Added support for a border and grid lines to GooCanvasTable, with "horz-grid-line-width", "vert-grid-line-width", "x-border-spacing" and "y-border-spacing" properties. o Added "clear-background" property to GooCanvas, to allow subclasses to paint their own background if desired. o Fixed crash when rendering a GooCanvasTable that hasn't been updated. o Fixed possible infinite loop in GooCanvasTable layout. o Added goo_canvas_text_get_natural_extents() to get the natural extents of the text. o Made "stroke-color-rgba" and "fill-color-rgba" properties read/write. o Added goo_canvas_item_get_simple_transform() and goo_canvas_item_model_get_simple_transform(), which do the opposite of the set_simple_transform() functions. o Improved documentation on general architecture and creating new items. GooCanvas 0.9 (Aug 13 2007) ============= o Added "scale-x" and "scale-y" properties to GooCanvas, so the horizontal and vertical scale can be set independently. o Added "integer-layout" property to GooCanvas, so all layout can be done to the nearest integer (useful for widgets). o Added "automatic-bounds", "bounds-from-origin" and "bounds-padding" properties, used to calculate the canvas bounds automatically. o Added "wrap" property to GooCanvasText, to specify how to wrap text. o Added demo code to show how to create very large items. o Reduced flicker when scrolling. o Fixed crash when changing a GooCanvasPathModel. o Fixed crash in animation code. o Fixed bug that meant the canvas wasn't redrawn properly when the bounds were changed. o Fixed problem when calculating item sizes before the canvas is realized. o Fixed problems calculating bounds of items with empty fills or strokes. GooCanvas 0.8 (Apr 3 2007) ============= o Added support for "width-for-height" layout - items whose requested height changes according to their allocated width (typically text items). o Added "background-color" and "background-color-rgb" properties to GooCanvas. o Added "ellipsize" property to GooCanvasText. o Added goo_canvas_item_remove() and goo_canvas_item_model_remove() convenience functions to remove an item or model from the canvas. o Fixed bug removing widget items. o Fixed bug which meant that the fill pattern couldn't be reset to NULL. o Fixed the item event signals, so that returning TRUE from a handler stops the signal emission. o Added a few things that will be needed to support tooltips, when GTK+ 2.12 is available. (Though I don't want to depend on GTK+ 2.12 yet.) o Added "const" to arguments, where appropriate. GooCanvas 0.7 (Feb 27 2007) ============= o Added goo_canvas_get_items_at() and goo_canvas_get_items_in_area() to get all the items at a given point or in a given area. o Use CAIRO_ANTIALIAS_GRAY as the default antialiasing mode, since that is what is recommended by cairo for unhinted text. o Added "hint-metrics" style property, so people can use hinted text if they want to (though they shouldn't change the canvas scale in that case, as the bounds of the text item may become incorrect). o Unref all objects in dispose methods rather than finalize, to help bindings. o Remove embedded widgets properly. o Clip GooCanvasTable children if needed. o Set the clip path in goo_canvas_render() if needed. o Use the ink rects & the logical rects to calculate the text item bounds. o Copied GTK+ build stuff for generating goocanvasmarshal.[hc] and goocanvasenumtypes.[hc], so hopefully it is easier to build on Windows. o Fixed a few other minor bugs. GooCanvas 0.6 (Feb 17 2007) ============= o Major rewrite to make the model optional, so people can choose to have either a simple canvas or a model/view canvas. The standard items can be used in either scenario. o Added support for cascading style properties (things like fill color, stroke width, font etc.). Properties use a GQuark for a unique identifier, and a GValue for the property value, so they are very flexible. o Added GooCanvasTable item to layout child items. o Made it much easier to create new items, by subclassing GooCanvasItemSimple which handles most of the work. See demo/demo-item.c for a simple item. o Added support for different units - pixels, points, inches or millimeters, and allow setting of vertical and horizontal resolution (dpi). o Added workaround for cairo's 16-bit limit, to support large canvases. o Added demo/scalability-demo which creates 100,000 items over a large canvas. It takes a few seconds to create all the items, but once created it seems to work fast enough. o Improved the animation code, supporting relative or absolute values for the x, y, scale and rotation. o Added "clip-path" and "clip-fill-rule" to specify a clip path for an item. GooCanvas 0.5 (Oct 10 2006) ============= o This was just a development release previewing the new optional model-view rewrite. GooCanvas 0.4 (Aug 24 2006) ============= o Many minor changes to support the PyGooCanvas python bindings. o Added goo_canvas_view_get_item_view() to get views of particular items, to make it easier to setup signal handlers for simple canvases. (See demo/simple-demo.c for a demo of this.) o Support transforms on item views as well as on items. GooCanvas 0.3 (Apr 24 2006) ============= o New GooCanvasPath item (similar to SVG path element). o Accessibility support. o Keyboard focus navigation. o API documentation. o Convenience functions for coordinate conversions. o Smooth scrolling & zooming. o Zoom-independent text layout. o Render part or all of canvas to a cairo_t, for ps/pdf output. o New "visibility" and "visibility-threshold" properties for items. o New "pointer-events" property specifying which parts of items get events. GooCanvas 0.2 (Dec 5 2005) ============= o Affine transformations for all items. o Event handling, including support for pointer grabs. o Support for simple animation. o Finished port of FooCanvas demo, and added test for pointer grabs. GooCanvas 0.1 (Nov 17 2005) ============= o Basic items working. o Model/view split. o Interfaces for items & views.