aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-09-29 04:48:22 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-09-29 04:48:22 +0000
commit4a791ebe744d1a6048ee98291b2443f527d492aa (patch)
tree889653c370536441f2d69568e420715f3ce1202b
parente4d5d4702d8859b69119f8dfb6e06827d9992da0 (diff)
downloadlcd4linux-4a791ebe744d1a6048ee98291b2443f527d492aa.tar.gz
[lcd4linux @ 2006-09-29 04:48:21 by reinelt]
image widget uses properties now; new property 'reload' git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@722 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--aclocal.m4133
-rwxr-xr-xconfigure206
-rw-r--r--drv_generic_graphic.c11
-rw-r--r--evaluator.c11
-rw-r--r--plugin_iconv.c9
-rw-r--r--widget_image.c182
-rw-r--r--widget_image.h24
-rw-r--r--widget_text.c14
8 files changed, 350 insertions, 240 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 90cba1c..0bd7b2f 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -224,8 +224,8 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
-# lib-link.m4 serial 6 (gettext-0.14.3)
-dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+# lib-link.m4 serial 8 (gettext-0.15)
+dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -352,6 +352,7 @@ dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl By default, look in $includedir and $libdir.
@@ -374,7 +375,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
])
else
additional_includedir="$withval/include"
- additional_libdir="$withval/lib"
+ additional_libdir="$withval/$acl_libdirstem"
fi
fi
])
@@ -474,7 +475,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
- if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@@ -560,8 +561,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Assume the include files are nearby.
additional_includedir=
case "$found_dir" in
- */lib | */lib/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
additional_includedir="$basedir/include"
;;
esac
@@ -622,9 +623,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/lib"; then
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
haveit=
- if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -778,7 +779,83 @@ AC_DEFUN([AC_LIB_APPENDTOVAR],
done
])
-# lib-prefix.m4 serial 4 (gettext-0.14.2)
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+ AC_REQUIRE([AC_LIB_RPATH])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ $1=
+ if test "$enable_rpath" != no; then
+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode directories into the resulting
+ dnl binary.
+ rpathdirs=
+ next=
+ for opt in $2; do
+ if test -n "$next"; then
+ dir="$next"
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next=
+ else
+ case $opt in
+ -L) next=yes ;;
+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next= ;;
+ *) next= ;;
+ esac
+ fi
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n ""$3""; then
+ dnl libtool is used for linking. Use -R options.
+ for dir in $rpathdirs; do
+ $1="${$1}${$1:+ }-R$dir"
+ done
+ else
+ dnl The linker is used for linking directly.
+ if test -n "$hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user
+ dnl must pass all path elements in one option.
+ alldirs=
+ for dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="${$1}${$1:+ }$flag"
+ done
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([$1])
+])
+
+# lib-prefix.m4 serial 5 (gettext-0.15)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -804,6 +881,7 @@ AC_DEFUN([AC_LIB_PREFIX],
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
@@ -825,7 +903,7 @@ AC_DEFUN([AC_LIB_PREFIX],
])
else
additional_includedir="$withval/include"
- additional_libdir="$withval/lib"
+ additional_libdir="$withval/$acl_libdirstem"
fi
fi
])
@@ -867,7 +945,7 @@ AC_DEFUN([AC_LIB_PREFIX],
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/lib"; then
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
@@ -877,7 +955,7 @@ AC_DEFUN([AC_LIB_PREFIX],
fi
done
if test -z "$haveit"; then
- if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
@@ -932,6 +1010,37 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
prefix="$acl_save_prefix"
])
+dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
+dnl the basename of the libdir, either "lib" or "lib64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64. The current
+ dnl practice is that on a system supporting 32-bit and 64-bit instruction
+ dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+ dnl libraries go under $prefix/lib. We determine the compiler's default
+ dnl mode by looking at the compiler's library search path. If at least
+ dnl of its elements ends in /lib64 or points to a directory whose absolute
+ dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+ dnl default, namely "lib".
+ acl_libdirstem=lib
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+])
+
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
diff --git a/configure b/configure
index e3a6bf6..901f686 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for LCD4Linux 0.10.1-CVS.
+# Generated by GNU Autoconf 2.60a for LCD4Linux 0.10.1-CVS.
#
# Report bugs to <lcd4linux-users@lists.sourceforge.net>.
#
@@ -567,36 +567,36 @@ ac_unique_file="lcd4linux.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
-#if HAVE_STDINT_H
+#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
@@ -1417,7 +1417,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
LCD4Linux configure 0.10.1-CVS
-generated by GNU Autoconf 2.60
+generated by GNU Autoconf 2.60a
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -1431,7 +1431,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by LCD4Linux $as_me 0.10.1-CVS, which was
-generated by GNU Autoconf 2.60. Invocation command line was
+generated by GNU Autoconf 2.60a. Invocation command line was
$ $0 $@
@@ -2654,7 +2654,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
# 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
+for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
@@ -2682,6 +2682,12 @@ done
test "$ac_cv_exeext" = no && ac_cv_exeext=
else
+ ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -2693,8 +2699,6 @@ See \`config.log' for more details." >&2;}
fi
ac_exeext=$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
@@ -3906,7 +3910,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_m_log=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -4534,7 +4538,7 @@ echo "${ECHO_T}Please note that some screen refreshs may fail" >&6; }
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6; }
ncurses_version=unknown
cat > conftest.$ac_ext <<EOF
-#line 4537 "configure"
+#line 4541 "configure"
#include "confdefs.h"
#ifdef RENAMED_NCURSES
#include <curses.h>
@@ -4737,7 +4741,7 @@ if test "$ac_x_libraries" = no; then
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS=$LIBS
- LIBS="-lXt $LIBS"
+ LIBS="-lX11 $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -4799,7 +4803,7 @@ for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
do
# Don't even attempt the hair of trying to link an X program!
for ac_extension in a so sl; do
- if test -r "$ac_dir/libXt.$ac_extension"; then
+ if test -r "$ac_dir/libX11.$ac_extension"; then
ac_x_libraries=$ac_dir
break 2
fi
@@ -4807,7 +4811,7 @@ do
done
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi # $ac_x_libraries = no
@@ -4862,12 +4866,12 @@ else
X_LIBS="$X_LIBS -L$x_libraries"
# For Solaris; some versions of Sun CC require a space after -R and
# others require no space. Words are not sufficient . . . .
- case `(uname -sr) 2>/dev/null` in
- "SunOS 5"*)
- { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+ { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; }
- ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
- cat >conftest.$ac_ext <<_ACEOF
+ ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+ ac_xsave_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4916,23 +4920,15 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_R_nospace=yes
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ X_LIBS="$X_LIBS -R$x_libraries"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_R_nospace=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test $ac_R_nospace = yes; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- X_LIBS="$X_LIBS -R$x_libraries"
- else
LIBS="$ac_xsave_LIBS -R $x_libraries"
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4981,27 +4977,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_R_space=yes
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ X_LIBS="$X_LIBS -R $x_libraries"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_R_space=no
+ { echo "$as_me:$LINENO: result: neither works" >&5
+echo "${ECHO_T}neither works" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
- if test $ac_R_space = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- X_LIBS="$X_LIBS -R $x_libraries"
- else
- { echo "$as_me:$LINENO: result: neither works" >&5
-echo "${ECHO_T}neither works" >&6; }
- fi
- fi
- LIBS=$ac_xsave_LIBS
- esac
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_c_werror_flag=$ac_xsave_c_werror_flag
+ LIBS=$ac_xsave_LIBS
fi
# Check for system-dependent libraries X programs must link with.
@@ -5147,7 +5141,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dnet_dnet_ntoa=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -5229,7 +5223,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_dnet_stub_dnet_ntoa=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -5242,7 +5236,7 @@ fi
fi
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS="$ac_xsave_LIBS"
@@ -5346,7 +5340,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_gethostbyname=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
@@ -5424,7 +5418,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_nsl_gethostbyname=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -5506,7 +5500,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_bsd_gethostbyname=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -5618,7 +5612,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_connect=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
@@ -5696,7 +5690,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_socket_connect=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -5801,7 +5795,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_remove=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
@@ -5879,7 +5873,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_posix_remove=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -5984,7 +5978,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_shmat=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
@@ -6062,7 +6056,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_ipc_shmat=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -6155,7 +6149,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_ICE_IceConnectionNumber=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -9038,6 +9032,26 @@ fi
+ acl_libdirstem=lib
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+
+
+
@@ -9078,7 +9092,7 @@ if test "${with_libiconv_prefix+set}" = set; then
else
additional_includedir="$withval/include"
- additional_libdir="$withval/lib"
+ additional_libdir="$withval/$acl_libdirstem"
fi
fi
@@ -9176,7 +9190,7 @@ fi
if test "X$found_dir" != "X"; then
LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
if test "X$found_so" != "X"; then
- if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
else
haveit=
@@ -9241,8 +9255,8 @@ fi
fi
additional_includedir=
case "$found_dir" in
- */lib | */lib/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
additional_includedir="$basedir/include"
;;
esac
@@ -9291,9 +9305,9 @@ fi
case "$dep" in
-L*)
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
- if test "X$additional_libdir" != "X/usr/lib"; then
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
haveit=
- if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -9518,7 +9532,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
@@ -9584,7 +9598,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS="$am_save_LIBS"
fi
@@ -10176,7 +10190,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_mpd_mpd_connect=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -10449,7 +10463,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_mysqlclient_mysql_init=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -10947,7 +10961,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext
if test "${ac_cv_search_opendir+set}" = set; then
break
@@ -11047,7 +11061,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext
if test "${ac_cv_search_opendir+set}" = set; then
break
@@ -11973,10 +11987,10 @@ main ()
#ifndef __cplusplus
/* Ultrix mips cc rejects this. */
typedef int charset[2];
- const charset x;
+ const charset cs;
/* SunOS 4.1.1 cc rejects this. */
- char const *const *ccp;
- char **p;
+ char const *const *pcpcc;
+ char **ppc;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
@@ -11985,11 +11999,11 @@ main ()
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
- ccp = &g + (g ? g-g : 0);
+ pcpcc = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
- ++ccp;
- p = (char**) ccp;
- ccp = (char const *const *) p;
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
@@ -12016,7 +12030,7 @@ main ()
const int foo = 10;
if (!foo) return 0;
}
- return !x[0] && !zero.x;
+ return !cs[0] && !zero.x;
#endif
;
@@ -12735,7 +12749,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_error_at_line=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5
@@ -13015,7 +13029,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
ac_res=`eval echo '${'$as_ac_var'}'`
@@ -13128,7 +13142,7 @@ cat >>conftest.$ac_ext <<_ACEOF
/* Thanks to Paul Eggert for this test. */
$ac_includes_default
#include <sys/wait.h>
-#if HAVE_VFORK_H
+#ifdef HAVE_VFORK_H
# include <vfork.h>
#endif
/* On some sparc systems, changes by the child to local and incoming
@@ -13673,7 +13687,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
ac_res=`eval echo '${'$as_ac_var'}'`
@@ -13757,7 +13771,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_intl_strftime=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -13954,7 +13968,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_pow=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5
@@ -14032,7 +14046,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_m_pow=no
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
@@ -14166,7 +14180,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
ac_res=`eval echo '${'$as_ac_var'}'`
@@ -14581,7 +14595,7 @@ exec 6>&1
# values after options handling.
ac_log="
This file was extended by LCD4Linux $as_me 0.10.1-CVS, which was
-generated by GNU Autoconf 2.60. Invocation command line was
+generated by GNU Autoconf 2.60a. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -14610,7 +14624,7 @@ current configuration.
Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
- -V, --version print version number, then exit
+ -V, --version print version number and configuration settings, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
@@ -14634,7 +14648,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
LCD4Linux config.status 0.10.1-CVS
-configured by $0, generated by GNU Autoconf 2.60,
+configured by $0, generated by GNU Autoconf 2.60a,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Copyright (C) 2006 Free Software Foundation, Inc.
diff --git a/drv_generic_graphic.c b/drv_generic_graphic.c
index 746c7c8..a677647 100644
--- a/drv_generic_graphic.c
+++ b/drv_generic_graphic.c
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_graphic.c,v 1.34 2006/08/14 19:24:22 harbaum Exp $
+/* $Id: drv_generic_graphic.c,v 1.35 2006/09/29 04:48:22 reinelt Exp $
*
* generic driver helper for graphic displays
*
@@ -23,6 +23,9 @@
*
*
* $Log: drv_generic_graphic.c,v $
+ * Revision 1.35 2006/09/29 04:48:22 reinelt
+ * image widget uses properties now; new property 'reload'
+ *
* Revision 1.34 2006/08/14 19:24:22 harbaum
* Umlaut support, added KVV HTTP-User-Agent
*
@@ -186,6 +189,7 @@
#include "plugin.h"
#include "layout.h"
#include "widget.h"
+#include "property.h"
#include "widget_text.h"
#include "widget_icon.h"
#include "widget_bar.h"
@@ -194,7 +198,6 @@
#include "drv.h"
#include "drv_generic.h"
#include "drv_generic_graphic.h"
-#include "property.h"
#include "font_6x8.h"
#include "font_6x8_bold.h"
@@ -630,6 +633,7 @@ int drv_generic_graphic_image_draw(WIDGET * W)
WIDGET_IMAGE *Image = W->data;
int layer, row, col, width, height;
int x, y;
+ int visible;
layer = W->layer;
row = W->row;
@@ -652,10 +656,11 @@ int drv_generic_graphic_image_draw(WIDGET * W)
drv_generic_graphic_resizeFB(row + height, col + width);
/* render image */
+ visible = P2N(&Image->visible);
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
int i = (row + y) * LCOLS + col + x;
- if (Image->visible) {
+ if (visible) {
drv_generic_graphic_FB[layer][i] = Image->bitmap[y * width + x];
} else {
drv_generic_graphic_FB[layer][i] = BG_COL;
diff --git a/evaluator.c b/evaluator.c
index 6cff61c..421b077 100644
--- a/evaluator.c
+++ b/evaluator.c
@@ -1,4 +1,4 @@
-/* $Id: evaluator.c,v 1.32 2006/09/14 04:08:54 reinelt Exp $
+/* $Id: evaluator.c,v 1.33 2006/09/29 04:48:22 reinelt Exp $
*
* expression evaluation
*
@@ -23,6 +23,9 @@
*
*
* $Log: evaluator.c,v $
+ * Revision 1.33 2006/09/29 04:48:22 reinelt
+ * image widget uses properties now; new property 'reload'
+ *
* Revision 1.32 2006/09/14 04:08:54 reinelt
* variables use a static list, no realloc, linear search
*
@@ -482,7 +485,7 @@ static VARIABLE *FindVariable(const char *name)
unsigned int i;
for (i = 0; i < nVariable; i++) {
- if (strcmp (name, Variable[i].name) == 0) {
+ if (strcmp(name, Variable[i].name) == 0) {
return &Variable[i];
}
}
@@ -500,11 +503,11 @@ int SetVariable(const char *name, RESULT * value)
return 1;
}
- if (nVariable >= sizeof(Variable)/sizeof(Variable[0])) {
+ if (nVariable >= sizeof(Variable) / sizeof(Variable[0])) {
error("Evaluator: cannot set variable <%s>: out of slots", name);
return -1;
}
-
+
nVariable++;
Variable[nVariable - 1].name = strdup(name);
Variable[nVariable - 1].value = NULL;
diff --git a/plugin_iconv.c b/plugin_iconv.c
index b55e562..2eaac6e 100644
--- a/plugin_iconv.c
+++ b/plugin_iconv.c
@@ -1,4 +1,4 @@
-/* $Id: plugin_iconv.c,v 1.2 2006/09/15 19:06:47 entropy Exp $
+/* $Id: plugin_iconv.c,v 1.3 2006/09/29 04:48:22 reinelt Exp $
*
* iconv charset conversion plugin
*
@@ -23,6 +23,9 @@
*
*
* $Log: plugin_iconv.c,v $
+ * Revision 1.3 2006/09/29 04:48:22 reinelt
+ * image widget uses properties now; new property 'reload'
+ *
* Revision 1.2 2006/09/15 19:06:47 entropy
* debug spam reduced, comment typo fixed
*
@@ -61,7 +64,7 @@
/* iconv function, convert charsets */
/* valid "to" and "from" charsets can be listed by running "iconv --list" from a shell */
-/* utf16 & utf32 encodings won't work, as they contain null bytes, confusing strlen */
+/* utf16 & utf32 encodings won't work, as they contain null bytes, confusing strlen */
static void my_iconv(RESULT * result, RESULT * charset_from, RESULT * charset_to, RESULT * arg)
{
char *source;
@@ -86,7 +89,7 @@ static void my_iconv(RESULT * result, RESULT * charset_from, RESULT * charset_to
if (cd != (iconv_t) (-1)) {
do {
-
+
/* quite spammy: debug("plugin_iconv: calling iconv with %ld,[%s]/%ld,%ld", cd, source, source_left, dest_left); */
if (iconv(cd, &source, &source_left, &dest_pos, &dest_left) == (size_t) (-1)) {
switch (errno) {
diff --git a/widget_image.c b/widget_image.c
index cba52d7..93efa88 100644
--- a/widget_image.c
+++ b/widget_image.c
@@ -1,4 +1,4 @@
-/* $Id: widget_image.c,v 1.11 2006/09/28 04:08:33 reinelt Exp $
+/* $Id: widget_image.c,v 1.12 2006/09/29 04:48:22 reinelt Exp $
*
* image widget handling
*
@@ -21,6 +21,9 @@
*
*
* $Log: widget_image.c,v $
+ * Revision 1.12 2006/09/29 04:48:22 reinelt
+ * image widget uses properties now; new property 'reload'
+ *
* Revision 1.11 2006/09/28 04:08:33 reinelt
* image widget memory leaks fixed (thanks to Magne Tørresen)
*
@@ -73,15 +76,6 @@
#include <ctype.h>
#include <errno.h>
-#include "debug.h"
-#include "cfg.h"
-#include "qprintf.h"
-#include "evaluator.h"
-#include "timer.h"
-#include "widget.h"
-#include "widget_image.h"
-#include "rgb.h"
-
#ifdef HAVE_GD_GD_H
#include <gd/gd.h>
#else
@@ -98,6 +92,16 @@
#error "cannot compile image widget"
#endif
+#include "debug.h"
+#include "cfg.h"
+#include "qprintf.h"
+#include "evaluator.h"
+#include "property.h"
+#include "timer.h"
+#include "widget.h"
+#include "widget_image.h"
+#include "rgb.h"
+
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
@@ -106,38 +110,54 @@
static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
{
int x, y;
- FILE *fd;
- gdImagePtr gdImage = NULL;
+ int inverted;
+ gdImagePtr gdImage;
/* clear bitmap */
if (Image->bitmap) {
int i;
for (i = 0; i < Image->height * Image->width; i++) {
- RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
+ RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
Image->bitmap[i] = empty;
}
}
-
- if (Image->file == NULL || Image->file[0] == '\0') {
- error("Warning: Image %s has no file", Name);
- return;
- }
-
- fd = fopen(Image->file, "rb");
- if (fd == NULL) {
- error("Warning: Image %s: fopen(%s) failed: %s", Name, Image->file, strerror(errno));
- return;
- }
-
- gdImage = gdImageCreateFromPng(fd);
- fclose(fd);
-
- if (fd == NULL) {
- error("Warning: Image %s: CreateFromPng(%s) failed!", Name, Image->file);
- return;
+
+ /* reload image only on first call or on explicit reload request */
+ if (Image->gdImage == NULL || P2N(&Image->reload)) {
+
+ char *file;
+ FILE *fd;
+
+ /* free previous image */
+ if (Image->gdImage) {
+ gdImageDestroy(Image->gdImage);
+ Image->gdImage = NULL;
+ }
+
+ file = P2S(&Image->file);
+ if (file == NULL || file[0] == '\0') {
+ error("Warning: Image %s has no file", Name);
+ return;
+ }
+
+ fd = fopen(file, "rb");
+ if (fd == NULL) {
+ error("Warning: Image %s: fopen(%s) failed: %s", Name, file, strerror(errno));
+ return;
+ }
+
+ Image->gdImage = gdImageCreateFromPng(fd);
+ fclose(fd);
+
+ if (Image->gdImage == NULL) {
+ error("Warning: Image %s: CreateFromPng(%s) failed!", Name, file);
+ return;
+ }
+
}
/* maybe resize bitmap */
+ gdImage = Image->gdImage;
if (gdImage->sx > Image->width) {
Image->width = gdImage->sx;
free(Image->bitmap);
@@ -156,13 +176,15 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
return;
}
for (i = 0; i < Image->height * Image->width; i++) {
- RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
+ RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
Image->bitmap[i] = empty;
}
}
-
+
+
/* finally really render it */
- if (Image->visible) {
+ inverted = P2N(&Image->inverted);
+ if (P2N(&Image->visible)) {
for (x = 0; x < gdImage->sx; x++) {
for (y = 0; y < gdImage->sy; y++) {
int p = gdImageGetTrueColorPixel(gdImage, x, y);
@@ -174,7 +196,7 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
/* GD's alpha is 0 (opaque) to 127 (tranparanet) */
/* our alpha is 0 (transparent) to 255 (opaque) */
Image->bitmap[i].A = (a == 127) ? 0 : 255 - 2 * a;
- if (Image->inverted) {
+ if (inverted) {
Image->bitmap[i].R = 255 - Image->bitmap[i].R;
Image->bitmap[i].G = 255 - Image->bitmap[i].G;
Image->bitmap[i].B = 255 - Image->bitmap[i].B;
@@ -182,10 +204,6 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
}
}
}
-
- /* free image */
- gdImageDestroy(gdImage);
-
}
@@ -193,45 +211,16 @@ static void widget_image_update(void *Self)
{
WIDGET *W = (WIDGET *) Self;
WIDGET_IMAGE *Image = W->data;
- RESULT result = { 0, 0, 0, NULL };
/* process the parent only */
if (W->parent == NULL) {
- /* evaluate expressions */
- free(Image->file);
- Image->file = NULL;
-
- if (Image->file_tree != NULL) {
- Eval(Image->file_tree, &result);
- Image->file = strdup(R2S(&result));
- DelResult(&result);
- }
-
- Image->update = 0;
- if (Image->update_tree != NULL) {
- Eval(Image->update_tree, &result);
- Image->update = R2N(&result);
- if (Image->update < 0)
- Image->update = 0;
- DelResult(&result);
- }
-
- Image->visible = 1;
- if (Image->visible_tree != NULL) {
- Eval(Image->visible_tree, &result);
- Image->visible = R2N(&result);
- Image->visible = Image->visible > 0;
- DelResult(&result);
- }
-
- Image->inverted = 0;
- if (Image->inverted_tree != NULL) {
- Eval(Image->inverted_tree, &result);
- Image->inverted = R2N(&result);
- Image->inverted = Image->inverted > 0;
- DelResult(&result);
- }
+ /* evaluate properties */
+ property_eval(&Image->file);
+ property_eval(&Image->update);
+ property_eval(&Image->reload);
+ property_eval(&Image->visible);
+ property_eval(&Image->inverted);
/* render image into bitmap */
widget_image_render(W->name, Image);
@@ -243,8 +232,8 @@ static void widget_image_update(void *Self)
W->class->draw(W);
/* add a new one-shot timer */
- if (Image->update > 0) {
- timer_add(widget_image_update, Self, Image->update, 1);
+ if (P2N(&Image->update) > 0) {
+ timer_add(widget_image_update, Self, P2N(&Image->update), 1);
}
}
@@ -271,28 +260,13 @@ int widget_image_init(WIDGET * Self)
Image->width = 0;
Image->height = 0;
Image->bitmap = NULL;
- Image->file = NULL;
-
- /* get raw expressions (we evaluate them ourselves) */
- Image->file_expr = cfg_get_raw(section, "file", NULL);
- Image->update_expr = cfg_get_raw(section, "update", NULL);
- Image->visible_expr = cfg_get_raw(section, "visible", NULL);
- Image->inverted_expr = cfg_get_raw(section, "inverted", NULL);
-
- /* sanity checks */
- if (Image->file_expr == NULL || *Image->file_expr == '\0') {
- error("Warning: Image %s has no file", Self->name);
- }
- if (Image->update_expr == NULL || *Image->update_expr == '\0') {
- error("Image %s has no update, using '100'", Self->name);
- Image->update_expr = "100";
- }
- /* compile'em */
- Compile(Image->file_expr, &Image->file_tree);
- Compile(Image->update_expr, &Image->update_tree);
- Compile(Image->visible_expr, &Image->visible_tree);
- Compile(Image->inverted_expr, &Image->inverted_tree);
+ /* load properties */
+ property_load(section, "file", NULL, &Image->file);
+ property_load(section, "update", "100", &Image->update);
+ property_load(section, "reload", "0", &Image->reload);
+ property_load(section, "visible", "1", &Image->visible);
+ property_load(section, "inverted", "0", &Image->inverted);
free(section);
Self->data = Image;
@@ -318,12 +292,16 @@ int widget_image_quit(WIDGET * Self)
if (Self->parent == NULL) {
if (Self->data) {
WIDGET_IMAGE *Image = Self->data;
+ if (Image->gdImage) {
+ gdImageDestroy(Image->gdImage);
+ Image->gdImage = NULL;
+ }
free(Image->bitmap);
- free(Image->file);
- DelTree(Image->file_tree);
- DelTree(Image->update_tree);
- DelTree(Image->visible_tree);
- DelTree(Image->inverted_tree);
+ property_free(&Image->file);
+ property_free(&Image->update);
+ property_free(&Image->reload);
+ property_free(&Image->visible);
+ property_free(&Image->inverted);
free(Self->data);
Self->data = NULL;
}
diff --git a/widget_image.h b/widget_image.h
index 96c25eb..963438b 100644
--- a/widget_image.h
+++ b/widget_image.h
@@ -1,4 +1,4 @@
-/* $Id: widget_image.h,v 1.4 2006/04/09 14:17:50 reinelt Exp $
+/* $Id: widget_image.h,v 1.5 2006/09/29 04:48:22 reinelt Exp $
*
* image widget handling
*
@@ -23,6 +23,9 @@
*
*
* $Log: widget_image.h,v $
+ * Revision 1.5 2006/09/29 04:48:22 reinelt
+ * image widget uses properties now; new property 'reload'
+ *
* Revision 1.4 2006/04/09 14:17:50 reinelt
* autoconf/library fixes, image and graphic display inversion
*
@@ -41,23 +44,18 @@
#ifndef _WIDGET_IMAGE_H_
#define _WIDGET_IMAGE_H_
+#include "property.h"
#include "rgb.h"
typedef struct WIDGET_IMAGE {
+ void *gdImage; /* raw gd image */
RGBA *bitmap; /* image bitmap */
int width, height; /* size of the image */
- char *file_expr; /* expression for image filename */
- void *file_tree; /* pre-compiled expression for image filename */
- char *file; /* evaluated filename */
- char *update_expr; /* expression for update interval */
- void *update_tree; /* pre-compiled expression for update interval */
- int update; /* update interval (msec) */
- char *visible_expr; /* expression for visibility */
- void *visible_tree; /* pre-compiled expression for visibility */
- int visible; /* image visible? */
- char *inverted_expr; /* expression for inversion */
- void *inverted_tree; /* pre-compiled expression for inversion */
- int inverted; /* image inverted? */
+ PROPERTY file; /* image filename */
+ PROPERTY update; /* update interval */
+ PROPERTY reload; /* reload image on update? */
+ PROPERTY visible; /* image visible? */
+ PROPERTY inverted; /* image inverted? */
} WIDGET_IMAGE;
extern WIDGET_CLASS Widget_Image;
diff --git a/widget_text.c b/widget_text.c
index 3b4f52e..fff8fd7 100644
--- a/widget_text.c
+++ b/widget_text.c
@@ -1,4 +1,4 @@
-/* $Id: widget_text.c,v 1.28 2006/09/13 05:33:39 reinelt Exp $
+/* $Id: widget_text.c,v 1.29 2006/09/29 04:48:22 reinelt Exp $
*
* simple text widget handling
*
@@ -21,6 +21,9 @@
*
*
* $Log: widget_text.c,v $
+ * Revision 1.29 2006/09/29 04:48:22 reinelt
+ * image widget uses properties now; new property 'reload'
+ *
* Revision 1.28 2006/09/13 05:33:39 reinelt
* plugin_file: return empty string if file cannot be read; widget_text: load property as 'string', not as variable (triggered an ugly bug with variable list reallocated)
*
@@ -322,8 +325,7 @@ void widget_text_update(void *Self)
/* did the formatted string change? */
if (T->string == NULL || strcmp(T->string, string) != 0) {
update++;
- if (T->string)
- free(T->string);
+ free(T->string);
T->string = string;
} else {
free(string);
@@ -439,10 +441,8 @@ int widget_text_quit(WIDGET * Self)
property_free(&Text->value);
property_free(&Text->postfix);
property_free(&Text->style);
- if (Text->string)
- free(Text->string);
- if (Text->buffer)
- free(Text->buffer);
+ free(Text->string);
+ free(Text->buffer);
free(Self->data);
Self->data = NULL;
}