gtimer-2.0.0/aclocal.m40000644000175000017500000011616411353237102015054 0ustar cknudsencknudsen# generated automatically by aclocal 1.10.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 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. # 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.63],, [m4_warning([this file was generated for autoconf 2.63. 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'.])]) # Configure paths for GTK+ # Owen Taylor 1997-2001 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, dnl pass to pkg-config dnl AC_DEFUN([AM_PATH_GTK_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) pkg_config_args=gtk+-2.0 for module in . $4 do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl dnl Now check if the installed GTK+ is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) # 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.10' 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.10.2], [], [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.10.2])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 # 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 8 # 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 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 # 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 # 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 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 case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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 4 # _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 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 13 # 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.60])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) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP 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 ]) ]) # 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 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 install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 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 3 # 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 done .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 # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi 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 # 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_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 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # 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 # 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_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_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 gtimer-2.0.0/annotate.c0000644000175000017500000001255311353237102015166 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 17-Aug-2008 Support UTF-8 using GTK+ 2.x * 18-Mar-1999 Internationalization * 16-May-1999 Added support for GTK 1.0. * 10-May-1998 Removed ifdef for GTK versions before 1.0.0 * 02-Apr-1998 Fixed bug that caused garbage to appear at the * end of annotations. * 18-Mar-1998 Added calls to gtk_window_set_wmclass so the windows * behave better for window managers. * 15-Mar-1998 Created * ****************************************************************************/ #include #include #if HAVE_UNISTD_H #include #endif #if HAVE_STRING_H #include #endif #include #include #include #include #include "project.h" #include "task.h" #include "gtimer.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif extern char *taskdir; extern GtkWidget *status; typedef struct { TaskData *taskdata; GtkWidget *window; GtkWidget *text; } AnnotateData; static void ok_callback ( widget, data ) GtkWidget *widget; gpointer data; { AnnotateData *td = (AnnotateData *) data; int len; GtkTextBuffer *buffer; GtkTextIter start, end; gchar *text; /* Add annotation to task */ if ( td->taskdata ) { buffer = gtk_text_view_get_buffer(td->text); gtk_text_buffer_get_bounds(buffer, &start, &end); text = gtk_text_buffer_get_text(buffer, &start, &end, FALSE); if (strlen(text)) taskAddAnnotation (td->taskdata->task, taskdir, (char *) text ); free(text); showMessage ( gettext("Annotation added") ); } gtk_grab_remove ( td->window ); gtk_widget_destroy ( td->window ); free ( td ); } static void cancel_callback ( widget, data ) GtkWidget *widget; gpointer data; { AnnotateData *td = (AnnotateData *) data; gtk_grab_remove ( td->window ); gtk_widget_destroy ( td->window ); free ( td ); } /* ** Create the add annotation window. */ GtkWidget *create_annotate_window ( taskdata ) TaskData *taskdata; { GtkWidget *annotate_window; GtkWidget *label, *ok_button, *cancel_button, *hbox; GtkStyle *style; AnnotateData *td; char *str, msg[100]; if ( taskdata == NULL ) return ( NULL ); td = (AnnotateData *) malloc ( sizeof ( AnnotateData ) ); td->taskdata = taskdata; td->window = annotate_window = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( td->window ), "GTimer", "gtimer" ); sprintf ( msg, "GTimer: %s", gettext("Add Annotation") ); gtk_window_set_title (GTK_WINDOW (annotate_window), msg ); gtk_window_position ( GTK_WINDOW(annotate_window), GTK_WIN_POS_MOUSE ); gtk_grab_add ( annotate_window ); gtk_widget_realize ( annotate_window ); hbox = gtk_hbox_new ( TRUE, 5 ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (annotate_window)->vbox ), hbox, FALSE, FALSE, 5 ); str = (char *) malloc ( strlen ( taskdata->task->name ) + 100 ); sprintf ( str, "%s\n%s", gettext("Enter annotation for"), taskdata->task->name ); label = gtk_label_new ( str ); free ( str ); gtk_box_pack_start ( GTK_BOX ( hbox ), label, FALSE, FALSE, 5 ); gtk_widget_show ( label ); gtk_widget_show ( hbox ); td->text = gtk_text_view_new(); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(td->text), GTK_WRAP_WORD_CHAR); gtk_widget_set_usize ( td->text, 340, 50 ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (annotate_window)->vbox ), td->text, TRUE, TRUE, 5 ); gtk_widget_show ( td->text ); /* add command buttons */ /*tooltips = gtk_tooltips_new ();*/ ok_button = gtk_button_new_with_label ( gettext("Ok") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (annotate_window)->action_area), ok_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (ok_button), "clicked", GTK_SIGNAL_FUNC (ok_callback), td); GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); gtk_widget_grab_default (ok_button); gtk_widget_show (ok_button); /*gtk_tooltips_set_tips (tooltips, ok_button, "Save this task" );*/ cancel_button = gtk_button_new_with_label ( gettext("Cancel") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (annotate_window)->action_area), cancel_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_callback), td); gtk_widget_show (cancel_button); /*gtk_tooltips_set_tips (tooltips, cancel_button, "Edit the selected task" );*/ gtk_widget_show (annotate_window); return ( annotate_window ); } gtimer-2.0.0/AUTHORS0000644000175000017500000000076211353237102014260 0ustar cknudsencknudsenCraig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com Also patches contributes by (in no particular order): Michal Vitecek Matt Martin Zach Beane ObiTuarY Thomas Epperly Pavel Vávra Translations contributed by: es: Carlos Fernandez cz: David Sauer Pavel Vávra gtimer-2.0.0/ChangeLog0000644000175000017500000003445111353526603014773 0ustar cknudsencknudsenRelease 2.0.0 (27 Mar 2010) + Fix crash on viewing change log window + Update to GTK 2.0 (Patch from Pavel Vavra) + Inclusion or a large series of Debian patches: Russ Allbery Sat, 26 Jul 2008 12:46:27 -0700 * Add a desktop file and icon, courtesy of Ubuntu. Thanks, Nathan Handler. (Closes: #492498, LP: #248346) * Reference the icon in the menu file as well. * Fix the doc-base section (remove the Applications prefix). * Use filter instead of findstring to parse DEB_BUILD_OPTIONS. * Update standards version to 3.8.0. - Add README.source explaining the dbs system. Russ Allbery Sat, 29 Dec 2007 16:45:57 -0800 * Fix segfault when displaying HTML reports introduced by the patch to make the browser configurable. Thanks to Chad Skeeters for the patch. * Change menu section to Applications/Project Management per the new menu policy. * Add a Homepage control field. * Update standards version to 3.7.3. * Wrap Build-Depends for readability. Russ Allbery Sat, 20 May 2006 22:31:51 -0700 * Choosing revert after an idle was subtracting time from all instances of that task, not just the running one. Fixed. Thanks to Ricardo Lopes Pereira for the report. (Closes: #366762) * Always pass the host and build types to configure. Russ Allbery Mon, 27 Feb 2006 00:37:01 -0800 * Fix a segfault on daily reports when tasks have annotations and annotation data is requested. (Closes: #350711) * Add a Last Year report. Thanks, Bruno Gravato. (Closes: #353046) * Don't compress the contrib scripts. * Add the build-indep and binary-indep targets. * Clean up stamp file handling in debian/rules. Russ Allbery Sat, 3 Dec 2005 11:12:33 -0800 * Providing binary-indep in debian/rules is required by Policy even if there are no arch-independent packages. Whoops. * Mark install target as phony in debian/rules. Russ Allbery Mon, 3 Oct 2005 15:52:11 -0700 * Add README.Debian explaining how to get started and describing the user-visible changes relative to stock GTimer. * Add an explicit packaging copyright and license statement. * Update the FSF address in copyright. Russ Allbery Fri, 15 Jul 2005 23:41:44 -0700 * Build-depend on libxss-dev instead of xlibs-static-dev for the X transition. * Add a -weekstart command-line option to set the first day of the week for weekly reports. (Closes: #307634) * Use the user's locale for weekday names as well. * Default to sensible-browser rather than x-www-browser and separate that patch out from the patch to make the browser configurable. * Fix the erroneous change to open modes in 10_57969-printpipe.patch so that 22_276011-reportmode.patch is no longer necessary. * 21_193517-oneMinIncr.diff subsumes 10_40450-32bitism.patch, so drop the latter. * Add history log entries at the top of the affected files in each patch rather than adding comments at the location of the change, with the exception of the Debian-specific change to turn off checks for newer versions. * Build with debugging symbols by default and support noopt. * Remove some bits from debian/rules that weren't being used. Russ Allbery Wed, 29 Jun 2005 18:21:16 -0700 * Only change the configured window size on exit if the call to get the window size succeeds, rather than changing it to some random value off the stack. Partially fixes #309779. Russ Allbery Fri, 20 May 2005 10:05:56 -0700 * Revert and Resume now only revert times on the timers that were running, rather than all timers that had time for that day. Fixes a bug introduced in the last release. Thanks to Jamm!n Wheeler for the report. (Closes: #309937) Russ Allbery Mon, 18 Apr 2005 02:00:11 -0700 * Specify a file mode when saving reports. (Closes: #276011) * Add a dialog box to configure the browser, which allows us to stop suggesting Netscape. Default to x-www-browser in the absence of any configuration. (Closes: #38052, #138840) * Revert and Resume after an idle now really back up to before the idle, not just when the dialog box is displayed. Revert now makes sure GTimer knows it has stopped. (Closes: #282052, #64175) * Avoid memory clobber when saving projects that caused long-term instability. Thanks, Ove Kaaven. (Closes: #201091) * Don't depend on libc6-dev. * Depend on xlibs-static-dev instead of xlibs-dev as libXss.a is the only bit of X we call directly. libgtk will pull in the rest. * Quote strings properly in the menu entry. * Improve the long description of the package. * Update debhelper compatibility to V4. * Add a watch file. * General reformatting and cleanup of the Debian control files. Martin Hicks Fri, 2 Jan 2004 17:27:00 -0500 * Add a callback to allow clearing of the paste buffer. Partial Close: Bug#193517 * More increment and decrement shortcut keys and one minute increment and decrement. Finishes up: Bug#193517 * Dates in the report should now follow the user's Locale. Closes: Bug#204322 * Moving files seems to break dbs so i removed the patch called 10_87440-rename_cz_to_cs.patch and replaced it with a small patch to debian/rules sent by Chad Walstrom. * Updated to required debhelper >= 3.0.0 Chad Walstrom Fri, 9 May 2003 19:19:32 -0500 * Switch to DBS build process, separated individual fixes in the "patches" directory. Should be easier to send patches upstream. * Moved po/cz.po to po/cs.po. Closes: Bug#87740 * Shortcutted the version_timeout_handler() function to bypass version checking. Closes: Bug#109329 Chad C. Walstrom Fri, 23 Feb 2001 01:07:18 -0600 * Changed 'Recommends:' field in the control file to 'Suggests:' so we can keep the package in main. * Added 'Build-Depends' field in debian/control Chad C. Walstrom Thu, 22 Feb 2001 00:57:20 -0600 * Added netscape to the 'Recommends:' field of the control file. This software has hard-coded the use of netscape as the viewer of the HTML report, unfortunately. Chad C. Walstrom Thu, 22 Feb 2001 00:14:49 -0600 * Reapplied fix for 32-bit-isms noted earlier by David. Closes: Bug#40450 Wichert Akkerman Sun, 20 Feb 2000 15:22:43 +0100 * Fix unsafe /tmp usage with patch from BTS. Closes: Bug#57969 David Huggins-Daines Tue, 29 Jun 1999 14:15:10 -0400 * Fixed a bug which would cause the main window to never be shown (on Alpha at least). * Fixed some (probably harmless) 32-bit-isms. * Fixed the menu entry. 19 Mar 2003: - Release 1.1.6 + Fixed bug that would sometimes cause annotations to be truncated. + Added cut/copy/paste in new "Edit" menu. Use can store time in the cut/paste buffer: User can cut all time from selected task for current day. (Ctrl-X) User can decrement time from selected task for current day. Paste will apply stored in the cut/paste buffer to the currently selected task. + Added -resume command line option. This will start time all tasks that were being timed when the application exited last. + Projects are now associated with a project. The project is now the first column in the main window. + Added option to round minutes to nearest minute, 5 minutes, etc in reports window + Added small css stylesheet to report html output. + Added "Last Two Weeks", "This Week & Last Week" reports + Reread gtkrc if -dir option is supplied + Modified http function to use "Host:" required by web sites that used virtual hosts, like www.cknudsen.com. Also improved error handling a little bit. + Fixed font setting of text reports to properly use fixed-width font. + Increased default size of report text window. + Added link to GTimer home page in Help menu. 09 Mar 2000: - Release 1.1.5 + Improved idle handling. The task list is no longer re-sorted when selecting "Revert." Added a new "Resume" option that will toss out the idle time but keep timing whatever tasks are being timed. + Added tool to check for new version. The app will automatically check for a new version every 30 days. + Added ability to view ChangeLog from Help menu 04 May 1999: - Release 1.1.4 + Oops. Fixed typo is task menu pulldown that said "seconds" instead of "minutes." 03 May 1999: - Release 1.1.3 + Fixed bug where \n chars could be included at the end of a task name + Fixed bug where adding new tasks messes up the hide/unhide stuff + Fixed bug where -nosplash would cause the main window to not remember the correct window size. + Added support for the X screen saver extension so idle detection will now sense keyboard events instead of just mouse events + Added support for I18N but need translators! + Made some windows transient (for GTK+ 1.1/1.2 only) instead of all toplevels + Made animated clock optional + Made toolbar optional + Allowed main menus to be tearoffs (for GTK+ 1.1/1.2 only) + Added -start option allowing you to specify one or more tasks to start timing when the app starts + Added support for -version and -help options + Added missing install-sh file to distribution + Added FAQ.html to distribution + Added portions of a Win32 port patch 17 Mar 1999: - Release 1.1.2 + Added autoconf (configure) support + Added back support for GTK 1.0 (and still works with GTK 1.1/1.2) 24 Feb 1999: - Release 1.1.1 + Added task unhide function to along with the hide function (added in a previous release). + Added support for accelerator keys. (Thanks to Matt Martin for the original code.) + Fixed support for double-clicking to switch to timing only the newly selected task (GTK 1.1 problem). + Fixed support for the task pulldown menu available by right-clicking on a task in the main window (GTK 1.1 problem). 04 Feb 1999: - Release 1.1.0 + Now requires GTK 1.1.X + Remembers width/height of main window as well as width of each column in the task list of the main window. + Double-click on a task to stop timing all other tasks and begin timing the selected task + Fixed bug for "last month" reports when run in January. 10 May 1998: - Release 0.98 + Added #ifdef for an API change in 1.0.1 thanks Stephen Robert Norris (srn@flibble.psrg.cs.usyd.edu.AU) + Oops. Forgot to include xextras.c in the distribution. 10 May 1998: - Release 0.97 + Added idle detect. Enabled/Disabled from the "Options" pulldown menu. Will prompt user after 5 minutes of no mouse movements. (Would be nice to watch keyboard, too... maybe that's next.) + Added autosave. Enabled/Disabled from the "Options" pulldown menu. Will save every 15 minutes (if changes are made and the idle detection window is not up.) + Set the application's icon from within the application. There's a different icon depending on whether or not any tasks are being timed. + Added handler for X I/O errors. Data is now saved on X I/O errors (like xkill). + Fixed vertical resize problem on main window (status bar). 06 April 1998: - Release 0.96 + Added support for HTML reports (requires 'netscape' somewhere in your path) + Save configuration on exit (sort mode, etc.) + Added print option from reports + Enabled word wrap on annotation entry (required GTK-0.99.9) + Enabled word wrap on report display (required GTK-0.99.9) + Added total time for the day at the bottom of the main window + Updated toolbar icons (reduced number of colors for better use on 8-bit displays: should use only 28 colors other than b&w) + Fixed bug that caused gargbage characters to appear at the end of some annotations (just use vi to clean up the .ann files of this has happened to you) + Added a brief man page + Set default for new tasks names as "Unnamed Task" and set focus to the text entry widget + Added a splash screen on app startup (can be disabled with -nosplash argument) 24 March 1998: - Release 0.95 + Sort tasks by clicking on column headers. + Added support for multiline annotations. + Replaced label widget with text widget in the report display window. (This allows for X copy/paste). + Added "Annotate" to Task pulldown menu. + Fixed various memory leaks/bugs. + Fixed 0.94 bug where stop button tried to start timing the selected task. + Fixed all weekdays showing up as "Mon" in some reports. + Set application class to "GTimer.gtimer". This should help with window managers (such as WindowMaker). + Added icon in toolbar for editing task names. + Added icon in toolbar for adding new tasks. 18 March 1998: - Release 0.94 + Renamed application "GTimer" from "TaskTimer" after being notified that "TaskTimer" is a registered trademark of Time/Systems International. + Added support for annotations that can be displayed in reports. + Used a memory debugging library to remove some memory leaks. + Added pulldown menus for right mouse click on a task. [Code provided by Zach Beane (xach@mint.net)] + Double click on a task to edit the task. [Code provided by Zach Beane (xach@mint.net)] + Changed font in report window to be fixed size for better display. 13 March 1998: - Release 0.93 + Rearranged UI: Added "Task" and "Report" pulldown menus and toolbar with icons. + Added saving of reports to a file. + Reports now use H:MM:SS time rather than H:MM. + Updated confirm and error icons. + Fixed handling of date change at midnight. 10 March 1998: - Bugfix release 0.91 + comment out tooltips so it will compile on GTK-0.99.5 + Create ~/.gtimer if it does not exist (Thanks Zach Beane ) 09 March 1998: - Initial Release 0.90 gtimer-2.0.0/changelog.c0000644000175000017500000001121211353250351015274 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Display the ChangeLog * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com/ * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 13-May-1999 Created * ****************************************************************************/ #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #ifdef HAVE_LIBINTL_H #include #else #define gettext(a) a #endif #include "project.h" #include "task.h" #include "gtimer.h" #include "changelog.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif extern GdkPixmap *appicon2; extern GdkPixmap *appicon2_mask; static GtkWidget *changelog_window = NULL; static void changelog_ok_callback ( GtkWidget *widget, gpointer data ) { gtk_widget_hide ( changelog_window ); } static gboolean changelog_X_callback ( GtkWidget *widget, gpointer data ) { changelog_ok_callback( widget, data ); return (TRUE); // do NOT continue destroying window } /* ** Create the window. */ static void create_changelog_window () { /*GtkTooltips *tooltips;*/ GtkWidget *hbox, *textarea, *vscrollbar, *button; GtkWidget *vbox, *textview, *swindow, *ok_button; // PV: + GtkTextBuffer *txbuf; // PV: + int txlen; // PV: + GtkStyle *style; char msg[100]; changelog_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_wmclass ( GTK_WINDOW ( changelog_window ), "GTimer", "gtimer" ); sprintf ( msg, "GTimer: %s", gettext ("Change Log") ); gtk_window_set_title (GTK_WINDOW (changelog_window), msg ); gtk_window_set_position ( GTK_WINDOW(changelog_window), GTK_WIN_POS_MOUSE ); gtk_widget_realize ( changelog_window ); gdk_window_set_icon ( GTK_WIDGET ( changelog_window )->window, NULL, appicon2, appicon2_mask ); vbox = gtk_vbox_new ( FALSE, 2 ); gtk_container_add ( GTK_CONTAINER (changelog_window), vbox); hbox = gtk_hbox_new ( FALSE, 2 ); gtk_box_pack_start ( GTK_BOX ( vbox ), hbox, FALSE, FALSE, 2 ); swindow = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start ( GTK_BOX(vbox), swindow, TRUE, TRUE, 0); // style = gtk_style_new (); // PV: - /* gdk_font_unref ( style->font ); style->font = gdk_font_load ( "-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*" ); if ( style->font == NULL ) style->font = gdk_font_load ( "fixed" ); */ // gtk_widget_push_style ( style ); txbuf = gtk_text_buffer_new(NULL); txlen = strlen(changelog_text); gtk_text_buffer_set_text (GTK_TEXT_BUFFER(txbuf), changelog_text, txlen); textview = gtk_text_view_new_with_buffer(txbuf); gtk_text_view_set_editable(GTK_TEXT_VIEW(textview),0); gtk_container_add (GTK_CONTAINER (swindow), textview); ok_button = gtk_button_new_with_label(gettext("Ok")); gtk_box_pack_start(GTK_BOX(vbox), ok_button, FALSE, FALSE, 0); g_signal_connect(G_OBJECT(ok_button), "clicked", G_CALLBACK (changelog_ok_callback), NULL); g_signal_connect(G_OBJECT(changelog_window), "delete-event", G_CALLBACK (changelog_X_callback), NULL); // gtk_widget_show (button); gtk_window_set_default_size ( changelog_window, 600, 600 ); /*gdk_window_resize ( GTK_WIDGET ( changelog_window )->window, 600, 400 );*/ gtk_widget_show (changelog_window); gtk_widget_show_all(changelog_window); GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); gtk_widget_grab_default (ok_button); } void display_changelog () { if ( changelog_window == NULL ) create_changelog_window (); else gtk_widget_show (changelog_window); } gtimer-2.0.0/changelog.h0000644000175000017500000004046211353520330015307 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@radix.net * See accompanying file "COPYING". * * 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 * * Description: * This file is generated AUTOMATICALLY from ./txt2h.pl. * DO NOT EDIT THIS FILE!!!! * ****************************************************************************/ static char *changelog_text = "\ Release 2.0.0 (27 Mar 2010)\n\ + Fix crash on viewing change log window\n\ + Update to GTK 1.2 (Patch from Pavel Vavra)\n\ + Inclusion or a large series of Debian patches:\n\ Russ Allbery Sat, 26 Jul 2008 12:46:27 -0700\n\ * Add a desktop file and icon, courtesy of Ubuntu. Thanks, Nathan\n\ Handler. (Closes: #492498, LP: #248346)\n\ * Reference the icon in the menu file as well.\n\ * Fix the doc-base section (remove the Applications prefix).\n\ * Use filter instead of findstring to parse DEB_BUILD_OPTIONS.\n\ * Update standards version to 3.8.0.\n\ - Add README.source explaining the dbs system.\n\ \n\ Russ Allbery Sat, 29 Dec 2007 16:45:57 -0800\n\ * Fix segfault when displaying HTML reports introduced by the patch to\n\ make the browser configurable. Thanks to Chad Skeeters for the\n\ patch.\n\ * Change menu section to Applications/Project Management per the new\n\ menu policy.\n\ * Add a Homepage control field.\n\ * Update standards version to 3.7.3.\n\ * Wrap Build-Depends for readability.\n\ \n\ Russ Allbery Sat, 20 May 2006 22:31:51 -0700\n\ * Choosing revert after an idle was subtracting time from all instances\n\ of that task, not just the running one. Fixed. Thanks to Ricardo\n\ Lopes Pereira for the report. (Closes: #366762)\n\ * Always pass the host and build types to configure.\n\ \n\ Russ Allbery Mon, 27 Feb 2006 00:37:01 -0800\n\ * Fix a segfault on daily reports when tasks have annotations and\n\ annotation data is requested. (Closes: #350711)\n\ * Add a Last Year report. Thanks, Bruno Gravato. (Closes: #353046)\n\ * Don't compress the contrib scripts.\n\ * Add the build-indep and binary-indep targets.\n\ * Clean up stamp file handling in debian/rules.\n\ \n\ Russ Allbery Sat, 3 Dec 2005 11:12:33 -0800\n\ * Providing binary-indep in debian/rules is required by Policy even if\n\ there are no arch-independent packages. Whoops.\n\ * Mark install target as phony in debian/rules.\n\ \n\ Russ Allbery Mon, 3 Oct 2005 15:52:11 -0700\n\ * Add README.Debian explaining how to get started and describing the\n\ user-visible changes relative to stock GTimer.\n\ * Add an explicit packaging copyright and license statement.\n\ * Update the FSF address in copyright.\n\ \n\ Russ Allbery Fri, 15 Jul 2005 23:41:44 -0700\n\ * Build-depend on libxss-dev instead of xlibs-static-dev for the X\n\ transition.\n\ * Add a -weekstart command-line option to set the first day of the week\n\ for weekly reports. (Closes: #307634)\n\ * Use the user's locale for weekday names as well.\n\ * Default to sensible-browser rather than x-www-browser and separate\n\ that patch out from the patch to make the browser configurable.\n\ * Fix the erroneous change to open modes in 10_57969-printpipe.patch so\n\ that 22_276011-reportmode.patch is no longer necessary.\n\ * 21_193517-oneMinIncr.diff subsumes 10_40450-32bitism.patch, so drop\n\ the latter.\n\ * Add history log entries at the top of the affected files in each patch\n\ rather than adding comments at the location of the change, with the\n\ exception of the Debian-specific change to turn off checks for newer\n\ versions.\n\ * Build with debugging symbols by default and support noopt.\n\ * Remove some bits from debian/rules that weren't being used.\n\ \n\ Russ Allbery Wed, 29 Jun 2005 18:21:16 -0700\n\ * Only change the configured window size on exit if the call to get the\n\ window size succeeds, rather than changing it to some random value off\n\ the stack. Partially fixes #309779.\n\ \n\ Russ Allbery Fri, 20 May 2005 10:05:56 -0700\n\ * Revert and Resume now only revert times on the timers that were\n\ running, rather than all timers that had time for that day. Fixes a\n\ bug introduced in the last release. Thanks to Jamm!n Wheeler for the\n\ report. (Closes: #309937)\n\ \n\ Russ Allbery Mon, 18 Apr 2005 02:00:11 -0700\n\ * Specify a file mode when saving reports. (Closes: #276011)\n\ * Add a dialog box to configure the browser, which allows us to stop\n\ suggesting Netscape. Default to x-www-browser in the absence of any\n\ configuration. (Closes: #38052, #138840)\n\ * Revert and Resume after an idle now really back up to before the idle,\n\ not just when the dialog box is displayed. Revert now makes sure\n\ GTimer knows it has stopped. (Closes: #282052, #64175)\n\ * Avoid memory clobber when saving projects that caused long-term\n\ instability. Thanks, Ove Kaaven. (Closes: #201091)\n\ * Don't depend on libc6-dev.\n\ * Depend on xlibs-static-dev instead of xlibs-dev as libXss.a is the\n\ only bit of X we call directly. libgtk will pull in the rest.\n\ * Quote strings properly in the menu entry.\n\ * Improve the long description of the package.\n\ * Update debhelper compatibility to V4.\n\ * Add a watch file.\n\ * General reformatting and cleanup of the Debian control files.\n\ \n\ Martin Hicks Fri, 2 Jan 2004 17:27:00 -0500\n\ * Add a callback to allow clearing of the paste buffer.\n\ Partial Close: Bug#193517\n\ * More increment and decrement shortcut keys and one\n\ minute increment and decrement. Finishes up: Bug#193517\n\ * Dates in the report should now follow the user's Locale.\n\ Closes: Bug#204322\n\ * Moving files seems to break dbs so i removed the patch\n\ called 10_87440-rename_cz_to_cs.patch and replaced it with\n\ a small patch to debian/rules sent by Chad Walstrom.\n\ * Updated to required debhelper >= 3.0.0\n\ \n\ Chad Walstrom Fri, 9 May 2003 19:19:32 -0500\n\ * Switch to DBS build process, separated individual fixes in the \"patches\"\n\ directory. Should be easier to send patches upstream.\n\ * Moved po/cz.po to po/cs.po. Closes: Bug#87740\n\ * Shortcutted the version_timeout_handler() function to bypass version\n\ checking. Closes: Bug#109329\n\ \n\ Chad C. Walstrom Fri, 23 Feb 2001 01:07:18 -0600\n\ * Changed 'Recommends:' field in the control file to 'Suggests:' so\n\ we can keep the package in main.\n\ * Added 'Build-Depends' field in debian/control\n\ \n\ Chad C. Walstrom Thu, 22 Feb 2001 00:57:20 -0600\n\ * Added netscape to the 'Recommends:' field of the control file.\n\ This software has hard-coded the use of netscape as the viewer of\n\ the HTML report, unfortunately.\n\ \n\ Chad C. Walstrom Thu, 22 Feb 2001 00:14:49 -0600\n\ * Reapplied fix for 32-bit-isms noted earlier by David. Closes: Bug#40450\n\ \n\ Wichert Akkerman Sun, 20 Feb 2000 15:22:43 +0100\n\ * Fix unsafe /tmp usage with patch from BTS. Closes: Bug#57969\n\ \n\ David Huggins-Daines Tue, 29 Jun 1999 14:15:10 -0400\n\ * Fixed a bug which would cause the main window to never be shown (on\n\ Alpha at least).\n\ * Fixed some (probably harmless) 32-bit-isms.\n\ * Fixed the menu entry.\n\ \n\ 19 Mar 2003:\n\ - Release 1.1.6\n\ + Fixed bug that would sometimes cause annotations to be truncated.\n\ + Added cut/copy/paste in new \"Edit\" menu.\n\ Use can store time in the cut/paste buffer:\n\ User can cut all time from selected task for current day. (Ctrl-X)\n\ User can decrement time from selected task for current day.\n\ Paste will apply stored in the cut/paste buffer to the currently\n\ selected task.\n\ + Added -resume command line option. This will start time all tasks\n\ that were being timed when the application exited last.\n\ + Projects are now associated with a project. The project is now the\n\ first column in the main window.\n\ + Added option to round minutes to nearest minute, 5 minutes, etc\n\ in reports window\n\ + Added small css stylesheet to report html output.\n\ + Added \"Last Two Weeks\", \"This Week & Last Week\" reports\n\ + Reread gtkrc if -dir option is supplied\n\ + Modified http function to use \"Host:\" required by web sites\n\ that used virtual hosts, like www.cknudsen.com. Also improved\n\ error handling a little bit.\n\ + Fixed font setting of text reports to properly use fixed-width font.\n\ + Increased default size of report text window.\n\ + Added link to GTimer home page in Help menu.\n\ 09 Mar 2000:\n\ - Release 1.1.5\n\ + Improved idle handling. The task list is no longer re-sorted when\n\ selecting \"Revert.\" Added a new \"Resume\" option that will toss\n\ out the idle time but keep timing whatever tasks are being timed.\n\ + Added tool to check for new version. The app will automatically\n\ check for a new version every 30 days.\n\ + Added ability to view ChangeLog from Help menu\n\ 04 May 1999:\n\ - Release 1.1.4\n\ + Oops. Fixed typo is task menu pulldown that said \"seconds\" instead\n\ of \"minutes.\"\n\ 03 May 1999:\n\ - Release 1.1.3\n\ + Fixed bug where \\n chars could be included at the end of a task name\n\ + Fixed bug where adding new tasks messes up the hide/unhide stuff\n\ + Fixed bug where -nosplash would cause the main window\n\ to not remember the correct window size.\n\ + Added support for the X screen saver extension so idle detection\n\ will now sense keyboard events instead of just mouse events\n\ + Added support for I18N but need translators!\n\ + Made some windows transient (for GTK+ 1.1/1.2 only) instead of\n\ all toplevels\n\ + Made animated clock optional\n\ + Made toolbar optional\n\ + Allowed main menus to be tearoffs (for GTK+ 1.1/1.2 only)\n\ + Added -start option allowing you to specify one or more tasks\n\ to start timing when the app starts\n\ + Added support for -version and -help options\n\ + Added missing install-sh file to distribution\n\ + Added FAQ.html to distribution\n\ + Added portions of a Win32 port patch\n\ 17 Mar 1999:\n\ - Release 1.1.2\n\ + Added autoconf (configure) support\n\ + Added back support for GTK 1.0 (and still works with GTK 1.1/1.2)\n\ 24 Feb 1999:\n\ - Release 1.1.1\n\ + Added task unhide function to along with the hide function (added\n\ in a previous release).\n\ + Added support for accelerator keys. (Thanks to Matt Martin\n\ for the original code.)\n\ + Fixed support for double-clicking to switch to timing only\n\ the newly selected task (GTK 1.1 problem).\n\ + Fixed support for the task pulldown menu available by right-clicking\n\ on a task in the main window (GTK 1.1 problem).\n\ 04 Feb 1999:\n\ - Release 1.1.0\n\ + Now requires GTK 1.1.X\n\ + Remembers width/height of main window as well as width of each\n\ column in the task list of the main window.\n\ + Double-click on a task to stop timing all other tasks and begin\n\ timing the selected task\n\ + Fixed bug for \"last month\" reports when run in January.\n\ 10 May 1998:\n\ - Release 0.98\n\ + Added #ifdef for an API change in 1.0.1\n\ thanks Stephen Robert Norris (srn@flibble.psrg.cs.usyd.edu.AU)\n\ + Oops. Forgot to include xextras.c in the distribution.\n\ 10 May 1998:\n\ - Release 0.97\n\ + Added idle detect. Enabled/Disabled from the \"Options\" pulldown\n\ menu. Will prompt user after 5 minutes of no mouse movements.\n\ (Would be nice to watch keyboard, too... maybe that's next.)\n\ + Added autosave. Enabled/Disabled from the \"Options\" pulldown menu.\n\ Will save every 15 minutes (if changes are made and the idle\n\ detection window is not up.)\n\ + Set the application's icon from within the application. There's\n\ a different icon depending on whether or not any tasks are being\n\ timed.\n\ + Added handler for X I/O errors. Data is now saved on X I/O\n\ errors (like xkill).\n\ + Fixed vertical resize problem on main window (status bar).\n\ 06 April 1998:\n\ - Release 0.96\n\ + Added support for HTML reports (requires 'netscape' somewhere in\n\ your path)\n\ + Save configuration on exit (sort mode, etc.)\n\ + Added print option from reports\n\ + Enabled word wrap on annotation entry (required GTK-0.99.9)\n\ + Enabled word wrap on report display (required GTK-0.99.9)\n\ + Added total time for the day at the bottom of the main window\n\ + Updated toolbar icons (reduced number of colors for better use\n\ on 8-bit displays: should use only 28 colors other than b&w)\n\ + Fixed bug that caused gargbage characters to appear at the end of\n\ some annotations (just use vi to clean up the .ann files of this\n\ has happened to you)\n\ + Added a brief man page\n\ + Set default for new tasks names as \"Unnamed Task\" and set focus\n\ to the text entry widget\n\ + Added a splash screen on app startup (can be disabled with\n\ -nosplash argument)\n\ 24 March 1998:\n\ - Release 0.95\n\ + Sort tasks by clicking on column headers.\n\ + Added support for multiline annotations.\n\ + Replaced label widget with text widget in the report display\n\ window. (This allows for X copy/paste).\n\ + Added \"Annotate\" to Task pulldown menu.\n\ + Fixed various memory leaks/bugs.\n\ + Fixed 0.94 bug where stop button tried to start timing the\n\ selected task.\n\ + Fixed all weekdays showing up as \"Mon\" in some reports.\n\ + Set application class to \"GTimer.gtimer\". This should help with\n\ window managers (such as WindowMaker).\n\ + Added icon in toolbar for editing task names.\n\ + Added icon in toolbar for adding new tasks.\n\ 18 March 1998:\n\ - Release 0.94\n\ + Renamed application \"GTimer\" from \"TaskTimer\" after being notified\n\ that \"TaskTimer\" is a registered trademark of Time/Systems\n\ International.\n\ + Added support for annotations that can be displayed in reports.\n\ + Used a memory debugging library to remove some memory leaks.\n\ + Added pulldown menus for right mouse click on a task.\n\ [Code provided by Zach Beane (xach@mint.net)]\n\ + Double click on a task to edit the task.\n\ [Code provided by Zach Beane (xach@mint.net)]\n\ + Changed font in report window to be fixed size for better display.\n\ 13 March 1998:\n\ - Release 0.93\n\ + Rearranged UI: Added \"Task\" and \"Report\" pulldown menus and toolbar\n\ with icons.\n\ + Added saving of reports to a file.\n\ + Reports now use H:MM:SS time rather than H:MM.\n\ + Updated confirm and error icons.\n\ + Fixed handling of date change at midnight.\n\ 10 March 1998:\n\ - Bugfix release 0.91\n\ + comment out tooltips so it will compile on GTK-0.99.5\n\ + Create ~/.gtimer if it does not exist\n\ (Thanks Zach Beane )\n\ 09 March 1998:\n\ - Initial Release 0.90\n\ "; gtimer-2.0.0/config.c0000644000175000017500000001437011353237102014621 0ustar cknudsencknudsen/* * Copyright (C) 1999 Craig Knudsen * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com/ * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 04-Apr-98 Created * ****************************************************************************/ #include #include #include #include #if HAVE_UNISTD_H #include #endif #include #if HAVE_STRING_H #include #endif #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif #define CONFIG_DEFAULTS #include "config.h" #define MAX_ATTR 256 #define MAX_LEN 1024 /* ** Local variables. */ static char *attrnames[MAX_ATTR]; /* attribute names */ static char *attrvalues[MAX_ATTR]; /* attribute values */ static int num_attr = 0; /* no. of attributes in above arrays */ static int modified = 0; /* modified since read from file */ static char *my_strtok ( #ifndef _NO_PROTO char *ptr1, char *tok #endif ); /* ** Read all the attributes in the specified file. */ int configReadAttributes ( path ) char *path; { int loop, old; char *text = NULL, *ptr; struct stat buf; int fd; modified = 0; for ( loop = 0; loop < num_attr; loop++ ) { free ( attrnames[loop] ); free ( attrvalues[loop] ); } num_attr = 0; for ( loop = 0; default_config[loop]; loop += 2 ) { attrnames[num_attr] = (char *) malloc ( strlen ( default_config[loop] ) + 1 ); strcpy ( attrnames[num_attr], default_config[loop] ); attrvalues[num_attr] = (char *) malloc ( strlen ( default_config[loop+1] ) + 1 ); strcpy ( attrvalues[num_attr], default_config[loop+1] ); num_attr++; } if ( stat ( path, &buf ) != 0 ) return ( -1 ); fd = open ( path, O_RDONLY ); if ( fd >= 0 ) { text = (char *) malloc ( buf.st_size + 1 ); read ( fd, text, buf.st_size ); text[buf.st_size] = '\0'; close ( fd ); ptr = my_strtok ( text, "\n" ); while ( ptr ) { for ( old = -1, loop = 0; loop < num_attr; loop++ ) { if ( strcmp ( attrnames[loop], ptr ) == 0 ) { old = loop; break; } } if ( old >= 0 ) { ptr = my_strtok ( NULL, "\n" ); if ( ! ptr ) break; free ( attrvalues[old] ); attrvalues[old] = (char *) malloc ( strlen ( ptr ) + 1 ); strcpy ( attrvalues[old], ptr ); } else { attrnames[num_attr] = (char *) malloc ( strlen ( ptr ) + 1 ); strcpy ( attrnames[num_attr], ptr ); ptr = my_strtok ( NULL, "\n" ); if ( ! ptr ) break; attrvalues[num_attr] = (char *) malloc ( strlen ( ptr ) + 1 ); strcpy ( attrvalues[num_attr], ptr ); num_attr++; } ptr = my_strtok ( NULL, "\n" ); } } else { return ( -1 ); } if ( text ) free ( text ); return ( 0 ); } /* ** Get the value for a specified attribute. */ int configGetAttribute ( attribute, value ) char *attribute; char **value; { int loop; for ( loop = 0; loop < num_attr; loop++ ) { if ( strcmp ( attrnames[loop], attribute ) == 0 ) { *value = attrvalues[loop]; return ( 0 ); } } return ( -1 ); } /* ** Get a value in int form. */ int configGetAttributeInt ( attribute, value ) char *attribute; int *value; { char *ptr; int ret; ret = configGetAttribute ( attribute, &ptr ); if ( ret == 0 ) { *value = atoi ( ptr ); return 0; } else return -1; } /* ** Set the value for a specified attribute. */ int configSetAttribute ( attribute, value ) char *attribute; char *value; { int loop; modified = 1; for ( loop = 0; loop < num_attr; loop++ ) { if ( strcmp ( attrnames[loop], attribute ) == 0 ) { free ( attrvalues[loop] ); attrvalues[loop] = (char *) malloc ( strlen ( value ) + 1 ); strcpy ( attrvalues[loop], value ); return ( 0 ); } } /* ** Attribute does not exits. Add it. */ attrnames[num_attr] = (char *) malloc ( strlen ( attribute ) + 1 ); strcpy ( attrnames[num_attr], attribute ); attrvalues[num_attr] = (char *) malloc ( strlen ( value ) + 1 ); strcpy ( attrvalues[num_attr], value ); num_attr++; return ( 0 ); } /* ** Set the value for a specified attribute. */ int configSetAttributeInt ( attribute, value ) char *attribute; int value; { char temp[50]; sprintf ( temp, "%d", value ); return ( configSetAttribute ( attribute, temp ) ); } /* ** Save the attributes in memory to the specified file. */ int configSaveAttributes ( attrfile ) char *attrfile; { FILE *fp; int loop; fp = fopen ( attrfile, "w" ); if ( ! fp ) { return ( -1 ); } for ( loop = 0; loop < num_attr; loop++ ) { fprintf ( fp, "%s\n%s\n", attrnames[loop], attrvalues[loop] ); } fclose ( fp ); modified = 0; return ( 0 ); } /* ** Tell the caller if changes have been made since last read/save. */ int configModified () { return ( modified ); } /* ** Clear out all values. */ void configClear () { int loop; for ( loop = 0; loop < num_attr; loop++ ) { free ( attrnames[loop] ); free ( attrvalues[loop] ); } num_attr = 0; modified = 1; } static char *my_strtok ( ptr1, tok ) char *ptr1; char *tok; { static char *last; char *p; if ( ! ptr1 ) ptr1 = last; else last = ptr1; if ( ! ptr1 ) return ( NULL ); for ( p = ptr1; *p != '\0'; p++ ) { if ( strncmp ( p, tok, strlen ( tok ) ) == 0 ) { *p = '\0'; last = p + strlen ( tok ); return ( ptr1 ); } } last = NULL; return ( ptr1 ); } gtimer-2.0.0/config.h0000644000175000017500000000626111353237102014626 0ustar cknudsencknudsen/* * Copyright (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 17-Apr-2005 Added configurability of the browser. (Russ Allbery) * 04-Apr-98 Created * (Code stolen from another project/program I wrote.) * ****************************************************************************/ #ifndef _CONFIG_H #define _CONFIG_H /* config file parameters */ #define CONFIG_DEFAULT_FILE ".gtimerrc" #define CONFIG_VERSION "version" #define CONFIG_SORT "sort" #define CONFIG_SORT_FORWARD "sort-dir" #define CONFIG_PRINT "print" #define CONFIG_IDLE "idle" #define CONFIG_IDLE_ON "idle-on" #define CONFIG_TOOLBAR_STATUS "toolbar-status" #define CONFIG_AUTOSAVE "autosave" #define CONFIG_ANIMATE "animate" #define CONFIG_USE_PROJECTS "use-projects" #define CONFIG_MAIN_WINDOW_WIDTH "win_width" #define CONFIG_MAIN_WINDOW_HEIGHT "win_height" #define CONFIG_MAIN_WINDOW_PROJECT_WIDTH "list_project_width" #define CONFIG_MAIN_WINDOW_TASK_WIDTH "list_task_width" #define CONFIG_MAIN_WINDOW_TODAY_WIDTH "list_today_width" #define CONFIG_MAIN_WINDOW_TOTAL_WIDTH "list_total_width" #define CONFIG_NEXT_VERSION_CHECK "next_version_check" #define CONFIG_LAST_TIMED_TASKS "timed_tasks" #define CONFIG_BROWSER "browser" /* default values */ #ifdef CONFIG_DEFAULTS static char *default_config[] = { CONFIG_SORT, "0", CONFIG_SORT_FORWARD, "1", CONFIG_PRINT, "lpr", CONFIG_IDLE, "300", CONFIG_IDLE_ON, "1", CONFIG_AUTOSAVE, "1", CONFIG_ANIMATE, "1", CONFIG_USE_PROJECTS, "1", CONFIG_TOOLBAR_STATUS, "1", CONFIG_MAIN_WINDOW_WIDTH, "500", CONFIG_MAIN_WINDOW_HEIGHT, "400", CONFIG_NEXT_VERSION_CHECK, "0", /* rra 2005-07-15: Changed to sensible-browser for Debian. */ CONFIG_BROWSER, "sensible-browser", NULL, }; #endif int configReadAttributes ( #ifndef _NO_PROTO char *attrfile #endif ); int configGetAttribute ( #ifndef _NO_PROTO char *attribute, char **value #endif ); int configGetAttributeInt ( #ifndef _NO_PROTO char *attribute, int *value #endif ); int configSetAttribute ( #ifndef _NO_PROTO char *attribute, char *value #endif ); int configSetAttributeInt ( #ifndef _NO_PROTO char *attribute, int value #endif ); int configSaveAttributes ( #ifndef _NO_PROTO char *attrfile #endif ); int configModified (); void configClear (); #endif /* _CONFIG_H */ gtimer-2.0.0/configure0000755000175000017500000051376511353243534015141 0ustar cknudsencknudsen#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for gtimer 1.1.7. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 # PATH needs CR # 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_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 if (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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. 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 # Name of the executable. 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 { (exit 1); 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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=: 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 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='gtimer' PACKAGE_TARNAME='gtimer' PACKAGE_VERSION='1.1.7' PACKAGE_STRING='gtimer 1.1.7' PACKAGE_BUGREPORT='' ac_unique_file="main.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='LTLIBOBJS LIBOBJS UIFLAGS UILIBS GTK_LIBS GTK_CFLAGS PKG_CONFIG 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 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_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_gtktest enable_shm ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # 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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $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_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } 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 gtimer 1.1.7 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/gtimer] --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 _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of gtimer 1.1.7:";; 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] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-gtktest do not try to compile and run a test GTK+ program --disable-ssext disable usage of ScreenSaver extension 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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 gtimer configure 1.1.7 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 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 gtimer $as_me 1.1.7, which was generated by GNU Autoconf 2.63. 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) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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:$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= ;; #( *) $as_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'; { (exit 1); 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 # 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 # 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 -r "$ac_site_file"; then { $as_echo "$as_me:$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. if test -f "$cache_file"; then { $as_echo "$as_me:$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:$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:$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:$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:$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:$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:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } 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:$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:$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:$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 # 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_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$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` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:$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 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. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$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:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } 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='gtimer' VERSION='1.1.7' 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"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # 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:$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:$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:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$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:$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" # 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 -' 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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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" 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$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 # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:$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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:$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 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 case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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:$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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } 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:$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 fcntl.h sys/time.h sys/types unistd.h string.h libintl.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 # Check whether --enable-gtktest was given. if test "${enable_gtktest+set}" = set; then enableval=$enable_gtktest; else enable_gtktest=yes fi pkg_config_args=gtk+-2.0 for module in . do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" # 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:$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:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=2.4.0 { $as_echo "$as_me:$LINENO: checking for GTK+ - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK+ - version >= $min_gtk_version... " >&6; } if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" rm -f conf.gtktest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) no_gtk=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then { $as_echo "$as_me:$LINENO: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5 $as_echo "yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6; } : else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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 echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" { { $as_echo "$as_me:$LINENO: error: No GTK found. Set the path right or install it." >&5 $as_echo "$as_me: error: No GTK found. Set the path right or install it." >&2;} { (exit 1); exit 1; }; } fi rm -f conf.gtktest ssext=yes # Check whether --enable-shm was given. if test "${enable_shm+set}" = set; then enableval=$enable_shm; ssext=$enableval else ssext=yes fi if test "$ssext" = yes; then { $as_echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXss" >&5 $as_echo_n "checking for XScreenSaverQueryInfo in -lXss... " >&6; } if test "${ac_cv_lib_Xss_XScreenSaverQueryInfo+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXss $GTK_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 XScreenSaverQueryInfo (); int main () { return XScreenSaverQueryInfo (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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_cv_lib_Xss_XScreenSaverQueryInfo=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xss_XScreenSaverQueryInfo=no fi rm -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 $as_echo "$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6; } if test "x$ac_cv_lib_Xss_XScreenSaverQueryInfo" = x""yes; then GTK_LIBS="-lXss -lXext $GTK_LIBS" ok=yes cat >>confdefs.h <<\_ACEOF #define HAVE_SCREEN_SAVER_EXT 1 _ACEOF else ok=no fi fi UILIBS=$GTK_LIBS UIFLAGS="$GTK_CFLAGS $GTK_VERSION_FLAGS" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$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= ;; #( *) $as_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:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } 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:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_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 # PATH needs CR # 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_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 if (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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. 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 # Name of the executable. 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 { (exit 1); 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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=: 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 # 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 gtimer $as_me 1.1.7, which was generated by GNU Autoconf 2.63. 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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, 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 Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ gtimer config.status 1.1.7 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 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 ;; --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 CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --he | --h | --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_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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" _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 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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_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 '{ (exit 1); 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_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # 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=' ' 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _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" eval set X " :F $CONFIG_FILES :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_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[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_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$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:$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_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } 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:$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_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } 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:$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_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :C) { $as_echo "$as_me:$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 case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # 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 || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi gtimer-2.0.0/configure.ac0000644000175000017500000000247411353237102015500 0ustar cknudsencknudsendnl Process this file with autoconf to produce a configure script. AC_INIT(gtimer,1.1.7) AC_CONFIG_SRCDIR(main.c) AM_INIT_AUTOMAKE dnl Checks for programs. AC_PROG_CC dnl Checks for header files. dnl AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types unistd.h string.h libintl.h) dnl ALL_LINGUAS="fr" dnl ud_GNU_GETTEXT dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) AM_PATH_GTK_2_0(2.4.0,,AC_MSG_ERROR(No GTK found. Set the path right or install it.)) dnl #if test "x$GTK_MAJOR_VERSION" = "x1" -a "x$GTK_MAJOR_VERSION" = "x0"; then dnl # echo "Configure found an old version of GTK. While gtimer will still work fine," dnl # echo "it would be best to upgrade it." dnl # AC_DEFINE(GTK_VERSION_20) dnl #fi dnl ScreenSaver extension support ssext=yes AC_ARG_ENABLE(shm, [ --disable-ssext disable usage of ScreenSaver extension], ssext=$enableval, ssext=yes) if test "$ssext" = yes; then AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [GTK_LIBS="-lXss -lXext $GTK_LIBS" ok=yes AC_DEFINE(HAVE_SCREEN_SAVER_EXT)], ok=no, $GTK_LIBS) fi UILIBS=$GTK_LIBS UIFLAGS="$GTK_CFLAGS $GTK_VERSION_FLAGS" AC_SUBST(UILIBS) AC_SUBST(UIFLAGS) AC_OUTPUT(Makefile) dnl AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], dnl [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) gtimer-2.0.0/configure.in0000644000175000017500000000267211353237102015523 0ustar cknudsencknudsendnl Process this file with autoconf to produce a configure script. AC_INIT(main.c) dnl PACKAGE=gtimer dnl VERSION=1.1.1 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION") dnl AC_SUBST(PACKAGE) dnl AC_SUBST(VERSION) AM_INIT_AUTOMAKE(gtimer,1.1.2) dnl Checks for programs. AC_PROG_CC dnl Checks for header files. dnl AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types unistd.h string.h libintl.h) dnl ALL_LINGUAS="fr" dnl ud_GNU_GETTEXT dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) AM_PATH_GTK(1.0.0,,AC_MSG_ERROR(No GTK found. Set the path right or install it.)) if test "x$GTK_MAJOR_VERSION" = "x1" -a "x$GTK_MAJOR_VERSION" = "x0"; then echo "Configure found an old version of GTK. While gtimer will still work fine," echo "it would be best to upgrade it." AC_DEFINE(GTK_VERSION_10) fi dnl ScreenSaver extension support ssext=yes AC_ARG_ENABLE(shm, [ --disable-ssext disable usage of ScreenSaver extension], ssext=$enableval, ssext=yes) if test "$ssext" = yes; then AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [GTK_LIBS="-lXss -lXext $GTK_LIBS" ok=yes AC_DEFINE(HAVE_SCREEN_SAVER_EXT)], ok=no, $GTK_LIBS) fi UILIBS=$GTK_LIBS UIFLAGS="$GTK_CFLAGS $GTK_VERSION_FLAGS" AC_SUBST(UILIBS) AC_SUBST(UIFLAGS) AC_OUTPUT(Makefile) dnl AC_OUTPUT([Makefile intl/Makefile po/Makefile.in], dnl [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) gtimer-2.0.0/confirm.c0000644000175000017500000002102411353237102015003 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 09-Mar-2000 Added optional third button for confirm windows. * 07-Mar-2000 Added create_confirm_toplevel () * 25-Mar-1999 Added use of gtk_window_set_transient_for() for * GTK 1.1 or later. * 18-Mar-1998 Added calls to gtk_window_set_wmclass so the windows * behave better for window managers. * 16-Mar-1998 Changed application/about icon. * 03-Mar-1998 Created * ****************************************************************************/ #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #include "project.h" #include "task.h" #include "gtimer.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif /* icons */ #include "icons/error.xpm" #include "icons/confirm.xpm" #include "icons/about.xpm" extern GtkWidget *main_window; static GdkPixmap *error_icon = NULL, *confirm_icon = NULL, *gtimer_icon = NULL; static GdkBitmap *error_mask, *confirm_mask, *gtimer_mask; typedef struct { char *callback_data; GtkWidget *window; void (*ok_callback)(); void (*cancel_callback)(); void (*third_callback)(); } ConfirmData; static void confirm_ok_callback ( widget, data ) GtkWidget *widget; gpointer data; { ConfirmData *cd = (ConfirmData *) data; gtk_grab_remove ( cd->window ); if ( cd->ok_callback ) cd->ok_callback ( widget, (gpointer)cd->callback_data ); gtk_widget_destroy ( cd->window ); free ( cd ); } static void confirm_cancel_callback ( widget, data ) GtkWidget *widget; gpointer data; { ConfirmData *cd = (ConfirmData *) data; gtk_grab_remove ( cd->window ); if ( cd->cancel_callback ) cd->cancel_callback ( widget, (gpointer)cd->callback_data ); gtk_widget_destroy ( cd->window ); free ( cd ); } static void confirm_third_callback ( widget, data ) GtkWidget *widget; gpointer data; { ConfirmData *cd = (ConfirmData *) data; gtk_grab_remove ( cd->window ); if ( cd->third_callback ) cd->third_callback ( widget, (gpointer)cd->callback_data ); gtk_widget_destroy ( cd->window ); free ( cd ); } /* ** Create the confirm window. */ static GtkWidget *create_window ( type, is_modal, title, text, ok_text, cancel_text, third_text, ok_callback, cancel_callback, third_callback, callback_data ) enum_confirm_type type; int is_modal; char *title; char *text; char *ok_text, *cancel_text, *third_text; void (*ok_callback)(); void (*cancel_callback)(); void (*third_callback)(); char *callback_data; { GtkWidget *window; /*GtkWidget *vbox, *hbox, *table;*/ GtkWidget *table; GtkWidget *pixmap, *label, *ok_button, *cancel_button, *third_button; ConfirmData *cd; GdkPixmap *icon = NULL, *mask = NULL; char *title2; cd = (ConfirmData *) malloc ( sizeof ( ConfirmData ) ); cd->callback_data = callback_data; cd->ok_callback = ok_callback; cd->cancel_callback = cancel_callback; cd->third_callback = third_callback; cd->window = window = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( cd->window ), "GTimer", "gtimer" ); title2 = (char *) malloc ( strlen ( title ) + 10 ); sprintf ( title2, "GTimer: %s", title ); gtk_window_set_title (GTK_WINDOW (window), title2 ); free ( title2 ); gtk_window_position ( GTK_WINDOW(window), GTK_WIN_POS_MOUSE ); gtk_grab_add ( window ); gtk_widget_realize ( window ); #if OLD_GTK #else if ( is_modal ) gtk_window_set_transient_for ( GTK_WINDOW ( window ), GTK_WINDOW ( main_window ) ); #endif table = gtk_table_new (1, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 8); gtk_container_border_width (GTK_CONTAINER (table), 6); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (window)->vbox ), table, TRUE, TRUE, 5 ); /* Add pixmap */ switch ( type ) { case CONFIRM_ABOUT: if ( gtimer_icon == NULL ) gtimer_icon = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( window )->window, >imer_mask, &window->style->white, about_xpm ); icon = gtimer_icon; mask = gtimer_mask; break; case CONFIRM_ERROR: case CONFIRM_WARNING: if ( error_icon == NULL ) error_icon = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( window )->window, &error_mask, &window->style->white, error_xpm ); icon = error_icon; mask = error_mask; break; case CONFIRM_CONFIRM: if ( confirm_icon == NULL ) confirm_icon = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( window )->window, &confirm_mask, &window->style->white, confirm_xpm ); icon = confirm_icon; mask = confirm_mask; break; case CONFIRM_MESSAGE: break; } if ( icon ) { pixmap = gtk_pixmap_new ( icon, mask ); gtk_misc_set_alignment (GTK_MISC (pixmap), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), pixmap, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show ( pixmap ); } /* Add message */ label = gtk_label_new ( text ); gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 0, 1); gtk_widget_show ( label ); gtk_widget_show ( table ); /* add command buttons */ if ( ok_text ) { ok_button = gtk_button_new_with_label ( ok_text ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), ok_button, FALSE, FALSE, 10); gtk_signal_connect (GTK_OBJECT (ok_button), "clicked", GTK_SIGNAL_FUNC (confirm_ok_callback), cd); GTK_WIDGET_SET_FLAGS ( ok_button, GTK_CAN_DEFAULT ); gtk_widget_grab_default ( ok_button ); gtk_widget_show (ok_button); } if ( cancel_text ) { cancel_button = gtk_button_new_with_label ( cancel_text ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), cancel_button, FALSE, FALSE, 10); gtk_signal_connect (GTK_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (confirm_cancel_callback), cd); if ( ! ok_text ) { GTK_WIDGET_SET_FLAGS ( cancel_button, GTK_CAN_DEFAULT ); gtk_widget_grab_default ( cancel_button ); } gtk_widget_show (cancel_button); } if ( third_text ) { third_button = gtk_button_new_with_label ( third_text ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), third_button, FALSE, FALSE, 10); if ( confirm_third_callback != NULL ) gtk_signal_connect (GTK_OBJECT (third_button), "clicked", GTK_SIGNAL_FUNC (confirm_third_callback), cd); gtk_widget_show (third_button); } gtk_widget_show (window); return ( window ); } /* ** Create a toplevel confirm window. */ GtkWidget *create_confirm_toplevel ( type, title, text, ok_text, cancel_text, third_text, ok_callback, cancel_callback, third_callback, callback_data ) enum_confirm_type type; char *title; char *text; char *ok_text, *cancel_text, *third_text; void (*ok_callback)(); void (*cancel_callback)(); void (*third_callback)(); char *callback_data; { return create_window ( type, FALSE, title, text, ok_text, cancel_text, third_text, ok_callback, cancel_callback, third_callback, callback_data ); } /* ** Create a modal confirm window. */ GtkWidget *create_confirm_window ( type, title, text, ok_text, cancel_text, third_text, ok_callback, cancel_callback, third_callback, callback_data ) enum_confirm_type type; char *title; char *text; char *ok_text, *cancel_text, *third_text; void (*ok_callback)(); void (*cancel_callback)(); void (*third_callback)(); char *callback_data; { return create_window ( type, TRUE, title, text, ok_text, cancel_text, third_text, ok_callback, cancel_callback, third_callback, callback_data ); } gtimer-2.0.0/contrib/exportKarm.pl0000644000175000017500000000774511353237102017351 0ustar cknudsencknudsen#!/usr/bin/perl # # Export GTimer data to Karm format. # # The Karm file is typically: # ~/.kde/share/apps/karm/karmdata.txt # # History: # 13-Mar-2003 cknudsen@cknudsen.com # Created # ############################################################################# $gtimer_dir = $ENV{'HOME'} . "/.gtimer"; $verbose = 0; $output_file = $ENV{'HOME'} . "/.kde/share/apps/karm/karmdata.txt"; for ( $i = 0; $i < @ARGV; $i++ ) { if ( $ARGV[$i] eq "-dir" ) { if ( -d $ARGV[++$i] ) { $gtimer_dir = $ARGV[$i]; } else { die "Must supply valid directory with -dir option\n"; } } elsif ( $ARGV[$i] eq "-o" || $ARGV[$i] eq "-output" ) { $output_file = $ARGV[++$i]; } elsif ( $ARGV[$i] eq "-verbose" || $ARGV[$i] eq "-v" ) { $verbose++; } } # Read in all GTimer data print "Reading GTimer data file...\n" if ( $verbose ); opendir ( DIR, $gtimer_dir ) || die "Error opening $gtimer_dir"; @files = readdir ( DIR ); closedir ( DIR ); @taskfiles = grep ( /^\d+\.task$/, @files ); @projectfiles = grep ( /^\d+\.project$/, @files ); $NO_PROJECT = '999999'; %project_names = (); foreach $f ( @projectfiles ) { print "Reading $gtimer_dir/$f\n" if ( $verbose ); open ( F, "$gtimer_dir/$f" ) || die "Error reading $gtimer_dir/$f"; if ( $f =~ /^(\d+).project$/ ) { $projectId = $1; $name = "Unnamed Project $projectId"; while ( ) { chop; if ( /^Name:\s+/ ) { $name = $'; } } close ( F ); $key = sprintf ( "%06d", $projectId ); $project_names{$key} = $name; } } $key = sprintf ( "%06d", $NO_PROJECT ); $project_names{$key} = "Misc."; printf "Done reading projects.\n" if ( $verbose ); %tasks = (); foreach $f ( @taskfiles ) { print "Reading $gtimer_dir/$f\n" if ( $verbose ); open ( F, "$gtimer_dir/$f" ) || die "Error reading $gtimer_dir/$f"; if ( $f =~ /^(\d+).task$/ ) { $taskId = $1; $name = "Unnamed Task $taskId"; $total_time = 0; undef ( $projectId ); while ( ) { chop; if ( /^Name:\s+/ ) { $name = $'; } elsif ( /^Project:\s+(\d+)/ ) { $projectId = $1; } elsif ( /^(\d+)\s(\d+)$/ ) { $date = $1; # ignore since karm doesn't use dates $seconds = $2; $total_time += $seconds; } } close ( F ); $task_names{$taskId} = $name; $task_totals{$taskId} = $total_time; $task_projects{$taskId} = $projectId; $key = sprintf ( "%06d", $projectId ); if ( defined ( $project_tasks{$key} ) ) { $project_tasks{$key} .= "," . $taskId; } else { $project_tasks{$key} = $taskId; } } } printf "Done reading tasks.\n" if ( $verbose ); # First, save a copy of the existing karm file to a backup ( $mday, $mon, $year ) = ( localtime(time) )[3,4,5]; if ( -f $output_file ) { $backup = sprintf ( "%s.%02d-%02d-%04d", $output_file, $mon + 1, $mday, $year + 1900 ); if ( -f $backup ) { for ( $i = 1; -f "$backup.$i"; $i++ ) { } $backup = $backup . "." . $i; } printf "Backup: %s\n", $backup; printf ( "Moving existing file: %s -> %s\n", $output_file, $backup ) if ( $verbose ); system ( "mv $output_file $backup" ); } # Write output file print "Writing output file: $output_file\n" if ( $verbose ); open ( F, ">$output_file" ) || die "Error writing $output_file"; print F "# Karm save data\n"; foreach $projectId ( sort keys ( %project_tasks ) ) { if ( ! defined ( $project_names{$projectId} ) ) { print STDERR "Data error: could not find project name for $projectId\n"; $project_names{$projectId} = "Unnamed Project"; } @tasks = split ( /,/, $project_tasks{$projectId} ); $task_out = ""; $time_total = 0; foreach $t ( @tasks ) { $time_total += $task_totals{$t}; $minutes = $task_totals{$t} / 60; $task_out .= sprintf "2\t%d\t%s\n", $minutes, $task_names{$t}; } $minutes = $time_total / 60; printf F "1\t%d\t%s\n", $minutes, $project_names{$projectId}; printf "Writing project: %s\n", $project_names{$projectId} if ( $verbose ); print F $task_out; } close ( F ); exit ( 0 ); gtimer-2.0.0/contrib/exportSQL.pl0000644000175000017500000002003211353237102017076 0ustar cknudsencknudsen#!/usr/bin/perl # # Export GTimer data to SQL. # # Usage: # To generate the SQL for creating the tables: # ./exportSQL.pl -create # # To create SQL to add all data # ./exportSQL.pl # # To create SQL to add all data and replace existing data # in the database. # ./exportSQL.pl # # It is assumed you have the following table structure. # project table with fields: # - project id (INT) # - project name (VARCHAR) # task table with fields: # - project id (INT) # - task id (INT) # - task (VARCHAR) # task_time with fields: # - task id (INT) # - date in YYYYMMDD format (INT) # - seconds (INT) # task_note with fields: # - task id # - date in YYYYMMDD format (INT) # - time in HHMMSS format (INT) # - text of note (VARCHAR) # # GTimer does not put limits on the length of the text strings, so # make the VARCHAR sizes big enough. # # History: # 14-Mar-2003 cknudsen@cknudsen.com # Created # ############################################################################# # definition of project table @project_table = ( "PROJECTS", # Table name "PROJECT_ID", # fields... "PROJECT_NAME", ); # definition of task table @task_table = ( "TASKS", # Table name "PROJECT_ID", # fields... "TASK_ID", "TASK_NAME", ); # definition of task time table @task_time_table = ( "TASK_TIME", # Table name "TASK_ID", # fields... "TASK_DATE", "NUM_SECONDS", ); # definition of task notes table @task_notes_table = ( "TASK_NOTES", # Table name "TASK_ID", # fields... "NOTE_DATE", "NOTE_TIME", "NOTE_TEXT", ); $gtimer_dir = $ENV{'HOME'} . "/.gtimer"; for ( $i = 0; $i < @ARGV; $i++ ) { if ( $ARGV[$i] eq "-dir" ) { if ( -d $ARGV[++$i] ) { $gtimer_dir = $ARGV[$i]; } else { die "Must supply valid directory with -dir option\n"; } } elsif ( $ARGV[$i] eq "-o" || $ARGV[$i] eq "-output" ) { $output_file = $ARGV[++$i]; } elsif ( $ARGV[$i] eq "-create" ) { $do_create++; } } # Just remove all single quotes since that is the safest/easiest sub sqlQuote { my ( $instr ) = @_; $instr =~ s/'//g; return ( "'" . $instr . "'" ); } if ( defined ( $output_file ) ) { open ( F, ">$output_file" ) || die "Error writing $output_file"; select ( F ); } if ( defined ( $do_create ) ) { print< ) { chop; if ( /^Name:\s+/ ) { $name = $'; } } close ( F ); $key = sprintf ( "%06d", $projectId ); $project_names{$key} = $name; } } $key = sprintf ( "%06d", $NO_PROJECT ); $project_names{$key} = "Misc."; printf STDOUT "Done reading projects.\n" if ( $verbose ); %tasks = (); foreach $f ( @taskfiles ) { print STDOUT "Reading $gtimer_dir/$f\n" if ( $verbose ); open ( F, "$gtimer_dir/$f" ) || die "Error reading $gtimer_dir/$f"; if ( $f =~ /^(\d+).task$/ ) { $taskId = $1; $name = "Unnamed Task $taskId"; $total_time = 0; undef ( $projectId ); while ( ) { chop; if ( /^Name:\s+/ ) { $name = $'; } elsif ( /^Project:\s+(\d+)/ ) { $projectId = $1; } elsif ( /^(\d+)\s(\d+)$/ ) { $timestamp = $1; $seconds = $2; ( $mday, $mon, $year ) = ( localtime ( $timestamp ) )[3,4,5]; $date = sprintf ( "%04d%02d%02d", $year + 1900, $mon + 1, $mday ); $entry = sprintf ( "%d %d %d", $taskId, $timestamp, $seconds ); push ( @time_entries, $entry ); } } close ( F ); $task_names{$taskId} = $name; $task_totals{$taskId} = $total_time; $task_projects{$taskId} = $projectId; $key = sprintf ( "%06d", $projectId ); $tasks{$taskId} = 1; if ( defined ( $project_tasks{$key} ) ) { $project_tasks{$key} .= "," . $taskId; } else { $project_tasks{$key} = $taskId; } } } printf STDOUT "Done reading tasks.\n" if ( $verbose ); @notes = (); foreach $f ( @notefiles ) { print STDOUT "Reading $gtimer_dir/$f\n" if ( $verbose ); open ( F, "$gtimer_dir/$f" ) || die "Error reading $gtimer_dir/$f"; if ( $f =~ /^(\d+).ann$/ ) { $taskId = $1; while ( ) { chop; if ( /^(\d+)\s+/ ) { $timestamp = $1; $note = $'; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($timestamp); $date = sprintf ( "%04d%02d%02d", $year + 1900, $mon + 1, $mday ); $time = sprintf ( "%02d%02d%02d", $hour, $min, $sec ); $entry = sprintf ( "%d %d %d %s", $taskId, $date, $time, $note ); push ( @notes, $entry ); } } close ( F ); } } $key = sprintf ( "%06d", $NO_PROJECT ); # First, save a copy of the existing karm file to a backup ( $mday, $mon, $year ) = ( localtime(time) )[3,4,5]; if ( -f $output_file ) { $backup = sprintf ( "%s.%02d-%02d-%04d", $output_file, $mon + 1, $mday, $year + 1900 ); if ( -f $backup ) { for ( $i = 1; -f "$backup.$i"; $i++ ) { } $backup = $backup . "." . $i; } printf "Backup: %s\n", $backup; printf STDOUT ( "Moving existing file: %s -> %s\n", $output_file, $backup ) if ( $verbose ); system ( "mv $output_file $backup" ); } # Write output file print STDOUT "Writing output file: $output_file\n" if ( $verbose && defined ( $output_file ) ); if ( defined ( $output_file ) ) { open ( F, ">$output_file" ) || die "Error writing $output_file"; select ( F ); } foreach $projectId ( sort keys ( %project_tasks ) ) { if ( ! defined ( $project_names{$projectId} ) ) { print STDERR "Data error: could not find project name for $projectId\n"; $project_names{$projectId} = "Unnamed Project"; } print "INSERT INTO $project_table[0] " . "( $project_table[1], $project_table[2] ) VALUES " . "( " . int($projectId) . ", " . &sqlQuote ( $project_names{$projectId} ) . " );\n\n"; } foreach $taskId ( sort keys ( %tasks ) ) { if ( ! defined ( $task_names{$taskId} ) ) { print STDERR "Data error: could not find task name for $taskId\n"; $task_names{$taskId} = "Unnamed Task"; } print "INSERT INTO $task_table[0] " . "( $task_table[1], $task_table[2], $task_table[3] ) VALUES " . "( $task_projects{$taskId}, " . int($taskId) . ", " . &sqlQuote ( $task_names{$taskId} ) . " );\n\n"; } foreach $entry ( sort ( @time_entries ) ) { ( $id, $date, $secs ) = split ( / /, $entry ); print "INSERT INTO $task_time_table[0] " . "( $task_time_table[1], $task_time_table[2], $task_time_table[3] ) VALUES " . "( $id, $date, $secs );\n\n"; } foreach $entry ( sort ( @notes ) ) { ( $id, $date, $time, $note ) = split ( / /, $entry, 4 ); print "INSERT INTO $task_notes_table[0] " . "( $task_notes_table[1], $task_notes_table[2], $task_notes_table[3], $task_notes_table[4] ) VALUES " . "( $id, $date, $time, " . &sqlQuote ( $note ) . " );\n\n"; } if ( defined ( $output_file ) ) { close ( F ); } exit ( 0 ); gtimer-2.0.0/contrib/gtimer_report.pl0000644000175000017500000003014011353237102020060 0ustar cknudsencknudsen#!/usr/local/bin/perl # # Perl-based report generator for GTimer. # Author: Craig Knudsen # # Comments: # The data files should always be up-to-date since the application # automatically saves data every 5 minutes (unless the app thinks # you're idle). # # Usage: # gtimer_report.pl # [-task XX] # [-today|-thisweek|-lastweek|-thismonth|-lastmonth|-thisyear] # [-daily|-weekly|-monthly] # options: # -today include data for today # -thisweek include data for this week # -lastweek include data for last week # -thismonth include data for this month # -thisyear include data for this year # -lastmonth include data for last month # -daily generate a report by day (default) # -weekly generate a report by week # -monthly generate a report by month # -task name include the specified task. the task name must # match exactly except for case. the default is # to include all tasks if this option is not # specified. this option can be used more than once # on the command line. # -dir dirname specifiy an alternate GTimer data directory # -annotations include annotations (will disable hours unless # the -hours option is also specified) # -hours include hours (default) # # Examples: # To generate a weekly status report for last week: # gtimer_report.pl -annotations -weekly -lastweek # To generate a report of hours worked for each day this month: # gtimer_report.pl -thismonth # To generate a report of all hours spent this year on task "GTimer" # on both a daily and monthly basis: # gtimer_report.pl -thisyear -daily -monthly -task "GTimer" # # Not yet implemented: # HTML output # Yearly reports # # History: # 08-Dec-1999 Fixed bug that was not including last task in # all reports. (Thanks Richard Kilgore) # 05-May-1999 Created # ############################################################################ $RANGE_TODAY = 1; $RANGE_THIS_WEEK = 2; $RANGE_LAST_WEEK = 3; $RANGE_THIS_MONTH = 4; $RANGE_LAST_MONTH = 5; $RANGE_THIS_YEAR = 6; $RANGE_LAST_YEAR = 7; @weekdays = ( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ); @month_days = ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); @lmonth_days = ( 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); $data_dir = "$ENV{HOME}/.gtimer"; $all_tasks = 1; $annotations = 0; $hours = 1; $range = $RANGE_THIS_WEEK; $midnight_offset = 0; # # Calculate a weekday from a given date # sub calc_weekday { my ( $m, $d, $y ) = @_; # month is 1-12 my ( $wday, @d, @w ); @w = ( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ); $y += 1900 if ( $y < 1900 ); @d = (0,3,2,5,0,3,5,1,4,6,2,4); $y-- if $m < 3; $wday = ($y+int($y/4)-int($y/100)+int($y/400)+$d[$m-1]+$d) % 7; $w[$wday]; } sub load_tasks { my ( $line, $i, $name, $date, $time, $day, $mon, $year ); $i = 0; while ( -f "$data_dir/$i.task" ) { undef ( $name ); # read time data open ( TASK, "$data_dir/$i.task" ) || die "Error opening $data_dir/$i.task: $!"; while ( ) { chop; if ( /Name:\s*/ ) { $name = $'; if ( defined ( %named_tasks ) && ! defined ( $named_tasks{"\U$name"} ) ) { undef ( $name ); last; } } elsif ( /^(\d\d\d\d\d\d\d\d) (\d+)$/ ) { $date = $1; $time = $2; $hours{$i . ":" . $date} = $time; } } close ( TASK ); if ( defined ( $name ) ) { $tasks[$i] = $name; $task_names{$name} = $i; } # read annotations if ( defined ( $name ) && $annotations && -f "$data_dir/$i.ann" ) { open ( ANN, "$data_dir/$i.ann" || die "Error opening $data_dir/$i.ann: $!" ); while ( ) { chop; ( $date, $line ) = split ( / /, $_, 2 ); $date -= $midnight_offset; ( $day, $mon, $year ) = ( localtime ( $date ) )[3,4,5]; $date = sprintf "%04d%02d%02d", 1900 + $year, $mon + 1, $day; $annotations{$i . ":" . $date} = $line; } close ( ANN ); } $last_task = $i; $i++; } } # handle options for ( $i = 0; $i < @ARGV; $i++ ) { if ( $ARGV[$i] eq "-daily" || $ARGV[$i] eq "-d" ) { $daily = 2; } elsif ( $ARGV[$i] eq "-weekly" || $ARGV[$i] eq "-w" ) { $weekly = 1; $daily = 0 if ( $daily == 1 ); } elsif ( $ARGV[$i] eq "-monthly" || $ARGV[$i] eq "-m" ) { $monthly = 1; $daily = 0 if ( $daily == 1 ); } elsif ( $ARGV[$i] eq "-yearly" || $ARGV[$i] eq "-y" ) { $yearly = 1; $daily = 0 if ( $daily == 1 ); } elsif ( $ARGV[$i] eq "-today" ) { $range = $RANGE_TODAY; } elsif ( $ARGV[$i] eq "-thisweek" ) { $range = $RANGE_THIS_WEEK; } elsif ( $ARGV[$i] eq "-lastweek" ) { $range = $RANGE_LAST_WEEK; } elsif ( $ARGV[$i] eq "-thismonth" ) { $range = $RANGE_THIS_MONTH; } elsif ( $ARGV[$i] eq "-lastmonth" ) { $range = $RANGE_LAST_MONTH; } elsif ( $ARGV[$i] eq "-thisyear" ) { $range = $RANGE_THIS_YEAR; } elsif ( $ARGV[$i] eq "-lastyear" ) { $range = $RANGE_LAST_YEAR; } elsif ( $ARGV[$i] eq "-hours" ) { $hours = 2; } elsif ( $ARGV[$i] eq "-annotations" || $ARGV[$i] eq "-a" ) { $annotations = 1; $hours = 0 if ( $hours == 1 ); } elsif ( $ARGV[$i] eq "-dir" || $ARGV[$i] eq "-d" ) { $data_dir = $ARGV[++$i]; die "No such data directory \"$data_dir\"\n" if ( ! -d $data_dir ); } elsif ( $ARGV[$i] eq "-task" || $ARGV[$i] eq "-t" ) { $t = "\U$ARGV[++$i]"; $named_tasks{$t} = 1; } } # get midnight offset if ( open ( F, "$data_dir/.gtimerrc" ) ) { while ( ) { if ( /^midnight-offset/ ) { chop ( $midnight_offset = ); last; } } close ( F ); } &load_tasks; # generate report if ( $range == $RANGE_THIS_WEEK ) { ( $wday ) = ( localtime ( time ) )[6]; $sunday = time - ( 3600 * 24 * $wday ); $startdate = $sunday; $enddate = time; } elsif ( $range == $RANGE_LAST_WEEK ) { ( $wday ) = ( localtime ( time ) )[6]; $sunday = time - ( 3600 * 24 * ( $wday + 7 ) ); $startdate = $sunday; $enddate = $sunday + ( 3600 * 24 * 6 ); } elsif ( $range == $RANGE_THIS_MONTH ) { ( $day ) = ( localtime ( time ) )[3]; $startdate = time - ( 3600 * 24 * ( $day - 1 ) ); $enddate = time; } elsif ( $range == $RANGE_LAST_MONTH ) { ( $day, $mon, $year ) = ( localtime ( time ) )[3,4,5]; $startdate = time - ( 3600 * 24 * ( $day - 1 ) ); $mon--; if ( $mon == -1 ) { $mon = 11; $year--; } if ( $year % 4 == 0 ) { $days_last_month = $month_days[$mon]; } else { $days_last_month = $lmonth_days[$mon]; } $enddate = $startdate - ( 3600 * 24 ); $startdate -= ( $days_last_month * 24 * 3600 ); } elsif ( $range == $RANGE_THIS_YEAR ) { ( $yday ) = ( localtime ( time ) )[7]; $startdate = time - ( 3600 * 24 * ( $yday - 1 ) ); $enddate = time; } elsif ( $range == $RANGE_LAST_YEAR ) { ( $yday ) = ( localtime ( time ) )[7]; $enddate = time - ( 3600 * 24 * ( $yday + 1 ) ); ( $yday ) = ( localtime ( $enddate ) )[7]; $startdate = $enddate - ( 3600 * 24 * ( $yday ) ); } # -- debug stuff -- ( $day, $mon, $year, $wday ) = ( localtime ( $startdate ) )[3,4,5,6]; printf "Date Range: %d/%d/%d %s to ", $mon + 1, $day, $year + 1900, $weekdays[$wday]; ( $day, $mon, $year, $wday ) = ( localtime ( $enddate ) )[3,4,5,6]; printf "%d/%d/%d %s\n", $mon + 1, $day, $year + 1900, $weekdays[$wday]; for ( $date = $startdate; $date <= $enddate; $date += ( 24 * 3600 ) ) { ( $day, $mon, $year, $wday ) = ( localtime ( $date ) )[3,4,5,6]; $datestr = sprintf "%04d%02d%02d", $year + 1900, $mon + 1, $day; $day = sprintf "\n%02d/%02d/%04d %s\n", $mon + 1, $day, $year + 1900, $weekdays[$wday]; $daily_total = 0; $first_day_of_week = $date if ( ! defined ( $first_day_of_week ) ); $last_day_of_week = $date; $first_day_of_month = $date if ( ! defined ( $first_day_of_month ) ); $last_day_of_month = $date; for ( $i = 0; $i <= $last_task; $i++ ) { if ( defined ( $hours{$i . ":" . $datestr} ) || defined ( $annotations{$i . ":" . $datestr} ) ) { if ( $hours && defined ( $hours{$i . ":" . $datestr} ) ) { $time = $hours{$i . ":" . $datestr}; $hrs = $time / 3600; $mins = ( $time % 3600 ) / 60; $secs = $time % 60; $daily_out .= sprintf "%3d:%02d:%02d - %s\n", $hrs, $mins, $secs, $tasks[$i]; } if ( defined ( $annotations{$i . ":" . $datestr} ) ) { if ( ! $hours ) { $daily_out .= "$tasks[$i]\n"; } @lines = split ( /\r/, $annotations{$i . ":" . $datestr} ); foreach $l ( @lines ) { if ( $hours ) { $daily_out .= sprintf " %s\n", $l; $weekly_annotations[$i] .= sprintf " %s\n", $l; $monthly_annotations[$i] .= sprintf " %s\n", $l; } else { $daily_out .= sprintf " %s\n", $l; $weekly_annotations[$i] .= sprintf " %s\n", $l; $monthly_annotations[$i] .= sprintf " %s\n", $l; } } } $daily_total += $time; $weekly_hours[$i] += $time; $monthly_hours[$i] += $time; } } if ( $daily_out ne "" && $daily ) { print "$day\n-------------------------------------\n"; print $daily_out; if ( $hours ) { print "---------\n"; $hrs = $daily_total / 3600; $mins = ( $daily_total % 3600 ) / 60; $secs = $daily_total % 60; printf "%3d:%02d:%02d - %s\n", $hrs, $mins, $secs, "Total"; } $daily_out = ""; } if ( defined ( @weekly_hours ) && $weekly && ( $wday == 6 || $date == $enddate ) ) { ( $day, $mon, $year, $wday ) = ( localtime ( $first_day_of_week ) )[3,4,5,6]; printf "\nWeek %02d/%02d/%04d %s to ", $mon + 1, $day, $year + 1900, $weekdays[$wday]; ( $day, $mon, $year, $wday ) = ( localtime ( $last_day_of_week ) )[3,4,5,6]; printf "%02d/%02d/%04d %s\n", $mon + 1, $day, $year + 1900, $weekdays[$wday]; print "-------------------------------------\n"; $total = 0; for ( $i = 0; $i <= $last_task; $i++ ) { if ( $weekly_hours[$i] != 0 || $weekly_annotations[$i] ne "" ) { if ( $hours ) { $total += $weekly_hours[$i]; $hrs = $weekly_hours[$i] / 3600; $mins = ( $weekly_hours[$i] % 3600 ) / 60; $secs = $weekly_hours[$i] % 60; printf "%3d:%02d:%02d - %s\n", $hrs, $mins, $secs, $tasks[$i]; } elsif ( $weekly_annotations[$i] ne "" ) { print "$tasks[$i]\n"; } if ( $weekly_annotations[$i] ne "" ) { print $weekly_annotations[$i]; } } } if ( $total && $hours ) { $hrs = $total / 3600; $mins = ( $total % 3600 ) / 60; $secs = $total % 60; print "---------\n"; printf "%3d:%02d:%02d - %s\n", $hrs, $mins, $secs, "Total"; } undef ( @weekly_hours ); undef ( @weekly_annotations ); undef ( $first_day_of_week ); } ( $day, $mon, $year ) = ( localtime ( $date ) )[3,4,5]; if ( $year % 4 == 0 ) { $ldom = $lmonth_days[$mon]; } else { $ldom = $month_days[$mon]; } if ( defined ( @monthly_hours ) && $monthly && ( $day == $ldom || $date == $enddate ) ) { ( $day, $mon, $year, $wday ) = ( localtime ( $first_day_of_month ) )[3,4,5,6]; printf "\nMonth %02d/%04d\n", $mon + 1, $year + 1900; print "-------------------------------------\n"; $total = 0; for ( $i = 0; $i <= $last_task; $i++ ) { if ( $monthly_hours[$i] != 0 || $monthly_annotations[$i] ne "" ) { if ( $hours ) { $total += $monthly_hours[$i]; $hrs = $monthly_hours[$i] / 3600; $mins = ( $monthly_hours[$i] % 3600 ) / 60; $secs = $monthly_hours[$i] % 60; printf "%3d:%02d:%02d - %s\n", $hrs, $mins, $secs, $tasks[$i]; } elsif ( $monthly_annotations[$i] ne "" ) { print "$tasks[$i]\n"; } if ( $monthly_annotations[$i] ne "" ) { print $monthly_annotations[$i]; } } } if ( $total && $hours ) { $hrs = $total / 3600; $mins = ( $total % 3600 ) / 60; $secs = $total % 60; print "---------\n"; printf "%3d:%02d:%02d - %s\n", $hrs, $mins, $secs, "Total"; } undef ( @monthly_hours ); undef ( @monthly_annotations ); undef ( $first_day_of_month ); } } # bye. exit 0; gtimer-2.0.0/COPYING0000644000175000017500000004307611353237102014250 0ustar cknudsencknudsen GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. gtimer-2.0.0/custom-list.c0000644000175000017500000005242411353237102015641 0ustar cknudsencknudsen#include "custom-list.h" /* boring declarations of local functions */ static void custom_list_init (CustomList *pkg_tree); static void custom_list_class_init (CustomListClass *klass); static void custom_list_tree_model_init (GtkTreeModelIface *iface); static void custom_list_finalize (GObject *object); static GtkTreeModelFlags custom_list_get_flags (GtkTreeModel *tree_model); static gint custom_list_get_n_columns (GtkTreeModel *tree_model); static GType custom_list_get_column_type (GtkTreeModel *tree_model, gint index); static gboolean custom_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path); static GtkTreePath *custom_list_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter); static void custom_list_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value); static gboolean custom_list_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter); static gboolean custom_list_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent); static gboolean custom_list_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter); static gint custom_list_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter); static gboolean custom_list_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, gint n); static gboolean custom_list_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child); static GObjectClass *parent_class = NULL; /* GObject stuff - nothing to worry about */ /***************************************************************************** * * custom_list_get_type: here we register our new type and its interfaces * with the type system. If you want to implement * additional interfaces like GtkTreeSortable, you * will need to do it here. * *****************************************************************************/ GType custom_list_get_type (void) { static GType custom_list_type = 0; /* Some boilerplate type registration stuff */ if (custom_list_type == 0) { static const GTypeInfo custom_list_info = { sizeof (CustomListClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) custom_list_class_init, NULL, /* class finalize */ NULL, /* class_data */ sizeof (CustomList), 0, /* n_preallocs */ (GInstanceInitFunc) custom_list_init }; static const GInterfaceInfo tree_model_info = { (GInterfaceInitFunc) custom_list_tree_model_init, NULL, NULL }; /* First register the new derived type with the GObject type system */ custom_list_type = g_type_register_static (G_TYPE_OBJECT, "CustomList", &custom_list_info, (GTypeFlags)0); /* Now register our GtkTreeModel interface with the type system */ g_type_add_interface_static (custom_list_type, GTK_TYPE_TREE_MODEL, &tree_model_info); } return custom_list_type; } /***************************************************************************** * * custom_list_class_init: more boilerplate GObject/GType stuff. * Init callback for the type system, * called once when our new class is created. * *****************************************************************************/ static void custom_list_class_init (CustomListClass *klass) { GObjectClass *object_class; parent_class = (GObjectClass*) g_type_class_peek_parent (klass); object_class = (GObjectClass*) klass; object_class->finalize = custom_list_finalize; } /***************************************************************************** * * custom_list_tree_model_init: init callback for the interface registration * in custom_list_get_type. Here we override * the GtkTreeModel interface functions that * we implement. * *****************************************************************************/ static void custom_list_tree_model_init (GtkTreeModelIface *iface) { iface->get_flags = custom_list_get_flags; iface->get_n_columns = custom_list_get_n_columns; iface->get_column_type = custom_list_get_column_type; iface->get_iter = custom_list_get_iter; iface->get_path = custom_list_get_path; iface->get_value = custom_list_get_value; iface->iter_next = custom_list_iter_next; iface->iter_children = custom_list_iter_children; iface->iter_has_child = custom_list_iter_has_child; iface->iter_n_children = custom_list_iter_n_children; iface->iter_nth_child = custom_list_iter_nth_child; iface->iter_parent = custom_list_iter_parent; } /***************************************************************************** * * custom_list_init: this is called everytime a new custom list object * instance is created (we do that in custom_list_new). * Initialise the list structure's fields here. * *****************************************************************************/ static void custom_list_init (CustomList *custom_list) { custom_list->n_columns = CUSTOM_LIST_N_COLUMNS; custom_list->column_types[0] = G_TYPE_POINTER; /* CUSTOM_LIST_COL_RECORD */ custom_list->column_types[1] = G_TYPE_STRING; /* CUSTOM_LIST_COL_NAME */ // custom_list->column_types[2] = G_TYPE_UINT; /* CUSTOM_LIST_COL_YEAR_BORN */ g_assert (CUSTOM_LIST_N_COLUMNS == 2); custom_list->num_rows = 0; custom_list->rows = NULL; // custom_list->stamp = g_random_int(); /* Random int to check whether an iter belongs to our model */ } /***************************************************************************** * * custom_list_finalize: this is called just before a custom list is * destroyed. Free dynamically allocated memory here. * *****************************************************************************/ static void custom_list_finalize (GObject *object) { /* CustomList *custom_list = CUSTOM_LIST(object); */ /* free all records and free all memory used by the list */ #warning IMPLEMENT /* must chain up - finalize parent */ (* parent_class->finalize) (object); } /***************************************************************************** * * custom_list_get_flags: tells the rest of the world whether our tree model * has any special characteristics. In our case, * we have a list model (instead of a tree), and each * tree iter is valid as long as the row in question * exists, as it only contains a pointer to our struct. * *****************************************************************************/ static GtkTreeModelFlags custom_list_get_flags (GtkTreeModel *tree_model) { g_return_val_if_fail (CUSTOM_IS_LIST(tree_model), (GtkTreeModelFlags)0); return (GTK_TREE_MODEL_LIST_ONLY | GTK_TREE_MODEL_ITERS_PERSIST); } /***************************************************************************** * * custom_list_get_n_columns: tells the rest of the world how many data * columns we export via the tree model interface * *****************************************************************************/ static gint custom_list_get_n_columns (GtkTreeModel *tree_model) { g_return_val_if_fail (CUSTOM_IS_LIST(tree_model), 0); return CUSTOM_LIST(tree_model)->n_columns; } /***************************************************************************** * * custom_list_get_column_type: tells the rest of the world which type of * data an exported model column contains * *****************************************************************************/ static GType custom_list_get_column_type (GtkTreeModel *tree_model, gint index) { g_return_val_if_fail (CUSTOM_IS_LIST(tree_model), G_TYPE_INVALID); g_return_val_if_fail (index < CUSTOM_LIST(tree_model)->n_columns && index >= 0, G_TYPE_INVALID); return CUSTOM_LIST(tree_model)->column_types[index]; } /***************************************************************************** * * custom_list_get_iter: converts a tree path (physical position) into a * tree iter structure (the content of the iter * fields will only be used internally by our model). * We simply store a pointer to our CustomRecord * structure that represents that row in the tree iter. * *****************************************************************************/ static gboolean custom_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path) { CustomList *custom_list; CustomRecord *record; gint *indices, n, depth; g_assert(CUSTOM_IS_LIST(tree_model)); g_assert(path!=NULL); custom_list = CUSTOM_LIST(tree_model); indices = gtk_tree_path_get_indices(path); depth = gtk_tree_path_get_depth(path); /* we do not allow children */ g_assert(depth == 1); /* depth 1 = top level; a list only has top level nodes and no children */ n = indices[0]; /* the n-th top level row */ if ( n >= custom_list->num_rows || n < 0 ) return FALSE; record = custom_list->rows[n]; g_assert(record != NULL); g_assert(record->pos == n); /* We simply store a pointer to our custom record in the iter */ // iter->stamp = custom_list->stamp; iter->user_data = record; iter->user_data2 = NULL; /* unused */ iter->user_data3 = NULL; /* unused */ return TRUE; } /***************************************************************************** * * custom_list_get_path: converts a tree iter into a tree path (ie. the * physical position of that row in the list). * *****************************************************************************/ static GtkTreePath * custom_list_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter) { GtkTreePath *path; CustomRecord *record; CustomList *custom_list; g_return_val_if_fail (CUSTOM_IS_LIST(tree_model), NULL); g_return_val_if_fail (iter != NULL, NULL); g_return_val_if_fail (iter->user_data != NULL, NULL); custom_list = CUSTOM_LIST(tree_model); record = (CustomRecord*) iter->user_data; path = gtk_tree_path_new(); gtk_tree_path_append_index(path, record->pos); return path; } /***************************************************************************** * * custom_list_get_value: Returns a row's exported data columns * (_get_value is what gtk_tree_model_get uses) * *****************************************************************************/ static void custom_list_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value) { CustomRecord *record; CustomList *custom_list; g_return_if_fail (CUSTOM_IS_LIST (tree_model)); g_return_if_fail (iter != NULL); g_return_if_fail (column < CUSTOM_LIST(tree_model)->n_columns); g_value_init (value, CUSTOM_LIST(tree_model)->column_types[column]); custom_list = CUSTOM_LIST(tree_model); record = (CustomRecord*) iter->user_data; g_return_if_fail ( record != NULL ); if(record->pos >= custom_list->num_rows) g_return_if_reached(); switch(column) { case CUSTOM_LIST_COL_RECORD: g_value_set_pointer(value, record); break; case CUSTOM_LIST_COL_NAME: g_value_set_string(value, record->taskname); break; // case CUSTOM_LIST_COL_YEAR_BORN: // g_value_set_uint(value, record->year_born); // break; } } /***************************************************************************** * * custom_list_iter_next: Takes an iter structure and sets it to point * to the next row. * *****************************************************************************/ static gboolean custom_list_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter) { CustomRecord *record, *nextrecord; CustomList *custom_list; g_return_val_if_fail (CUSTOM_IS_LIST (tree_model), FALSE); if (iter == NULL || iter->user_data == NULL) return FALSE; custom_list = CUSTOM_LIST(tree_model); record = (CustomRecord *) iter->user_data; /* Is this the last record in the list? */ if ((record->pos + 1) >= custom_list->num_rows) return FALSE; nextrecord = custom_list->rows[(record->pos + 1)]; g_assert ( nextrecord != NULL ); g_assert ( nextrecord->pos == (record->pos + 1) ); // iter->stamp = custom_list->stamp; iter->user_data = nextrecord; return TRUE; } /***************************************************************************** * * custom_list_iter_children: Returns TRUE or FALSE depending on whether * the row specified by 'parent' has any children. * If it has children, then 'iter' is set to * point to the first child. Special case: if * 'parent' is NULL, then the first top-level * row should be returned if it exists. * *****************************************************************************/ static gboolean custom_list_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent) { CustomList *custom_list; g_return_val_if_fail (parent == NULL || parent->user_data != NULL, FALSE); /* this is a list, nodes have no children */ if (parent) return FALSE; /* parent == NULL is a special case; we need to return the first top-level row */ g_return_val_if_fail (CUSTOM_IS_LIST (tree_model), FALSE); custom_list = CUSTOM_LIST(tree_model); /* No rows => no first row */ if (custom_list->num_rows == 0) return FALSE; /* Set iter to first item in list */ // iter->stamp = custom_list->stamp; iter->user_data = custom_list->rows[0]; return TRUE; } /***************************************************************************** * * custom_list_iter_has_child: Returns TRUE or FALSE depending on whether * the row specified by 'iter' has any children. * We only have a list and thus no children. * *****************************************************************************/ static gboolean custom_list_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter) { return FALSE; } /***************************************************************************** * * custom_list_iter_n_children: Returns the number of children the row * specified by 'iter' has. This is usually 0, * as we only have a list and thus do not have * any children to any rows. A special case is * when 'iter' is NULL, in which case we need * to return the number of top-level nodes, * ie. the number of rows in our list. * *****************************************************************************/ static gint custom_list_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter) { CustomList *custom_list; g_return_val_if_fail (CUSTOM_IS_LIST (tree_model), -1); g_return_val_if_fail (iter == NULL || iter->user_data != NULL, FALSE); custom_list = CUSTOM_LIST(tree_model); /* special case: if iter == NULL, return number of top-level rows */ if (!iter) return custom_list->num_rows; return 0; /* otherwise, this is easy again for a list */ } /***************************************************************************** * * custom_list_iter_nth_child: If the row specified by 'parent' has any * children, set 'iter' to the n-th child and * return TRUE if it exists, otherwise FALSE. * A special case is when 'parent' is NULL, in * which case we need to set 'iter' to the n-th * row if it exists. * *****************************************************************************/ static gboolean custom_list_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, gint n) { CustomRecord *record; CustomList *custom_list; g_return_val_if_fail (CUSTOM_IS_LIST (tree_model), FALSE); custom_list = CUSTOM_LIST(tree_model); /* a list has only top-level rows */ if(parent) return FALSE; /* special case: if parent == NULL, set iter to n-th top-level row */ if( n >= custom_list->num_rows ) return FALSE; record = custom_list->rows[n]; g_assert( record != NULL ); g_assert( record->pos == n ); // iter->stamp = custom_list->stamp; iter->user_data = record; return TRUE; } /***************************************************************************** * * custom_list_iter_parent: Point 'iter' to the parent node of 'child'. As * we have a list and thus no children and no * parents of children, we can just return FALSE. * *****************************************************************************/ static gboolean custom_list_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child) { return FALSE; } /***************************************************************************** * * custom_list_new: This is what you use in your own code to create a * new custom list tree model for you to use. * *****************************************************************************/ CustomList * custom_list_new (void) { CustomList *newcustomlist; newcustomlist = (CustomList*) g_object_new (CUSTOM_TYPE_LIST, NULL); g_assert( newcustomlist != NULL ); return newcustomlist; } /***************************************************************************** * * custom_list_append_record: Empty lists are boring. This function can * be used in your own code to add rows to the * list. Note how we emit the "row-inserted" * signal after we have appended the row * internally, so the tree view and other * interested objects know about the new row. * *****************************************************************************/ GtkTreePath * custom_list_append_record (CustomList *custom_list, const gchar *name) { GtkTreeIter iter; GtkTreePath *path; CustomRecord *newrecord; gulong newsize; guint pos; g_return_if_fail (CUSTOM_IS_LIST(custom_list)); g_return_if_fail (name != NULL); pos = custom_list->num_rows; custom_list->num_rows++; newsize = custom_list->num_rows * sizeof(CustomRecord*); custom_list->rows = g_realloc(custom_list->rows, newsize); newrecord = g_new0(CustomRecord, 1); newrecord->taskname = g_strdup(name); newrecord->name_collate_key = g_utf8_collate_key(name,-1); /* for fast sorting, used later */ // newrecord->year_born = year_born; custom_list->rows[pos] = newrecord; newrecord->pos = pos; /* inform the tree view and other interested objects * (e.g. tree row references) that we have inserted * a new row, and where it was inserted */ path = gtk_tree_path_new(); gtk_tree_path_append_index(path, newrecord->pos); custom_list_get_iter(GTK_TREE_MODEL(custom_list), &iter, path); gtk_tree_model_row_inserted(GTK_TREE_MODEL(custom_list), path, &iter); // PV: return path; // gtk_tree_path_free(path); } gtimer-2.0.0/custom-list.h0000644000175000017500000000540111353237102015637 0ustar cknudsencknudsen#ifndef _custom_list_h_included_ #define _custom_list_h_included_ #include /* Some boilerplate GObject defines. 'klass' is used * instead of 'class', because 'class' is a C++ keyword */ #define CUSTOM_TYPE_LIST (custom_list_get_type ()) #define CUSTOM_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CUSTOM_TYPE_LIST, CustomList)) #define CUSTOM_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CUSTOM_TYPE_LIST, CustomListClass)) #define CUSTOM_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CUSTOM_TYPE_LIST)) #define CUSTOM_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CUSTOM_TYPE_LIST)) #define CUSTOM_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CUSTOM_TYPE_LIST, CustomListClass)) /* The data columns that we export via the tree model interface */ enum { CUSTOM_LIST_COL_RECORD = 0, CUSTOM_LIST_COL_NAME, // CUSTOM_LIST_COL_YEAR_BORN, CUSTOM_LIST_N_COLUMNS, } ; typedef struct _CustomRecord CustomRecord; typedef struct _CustomList CustomList; typedef struct _CustomListClass CustomListClass; /* CustomRecord: this structure represents a row */ struct _CustomRecord { /* data - you can extend this */ gchar *taskname; gchar *name_collate_key; // guint year_born; /* admin stuff used by the custom list model */ guint pos; /* pos within the array */ }; /* CustomList: this structure contains everything we need for our * model implementation. You can add extra fields to * this structure, e.g. hashtables to quickly lookup * rows or whatever else you might need, but it is * crucial that 'parent' is the first member of the * structure. */ struct _CustomList { GObject parent; /* this MUST be the first member */ guint num_rows; /* number of rows that we have */ CustomRecord **rows; /* a dynamically allocated array of pointers to * the CustomRecord structure for each row */ /* These two fields are not absolutely necessary, but they */ /* speed things up a bit in our get_value implementation */ gint n_columns; GType column_types[CUSTOM_LIST_N_COLUMNS]; // gint stamp; /* Random integer to check whether an iter belongs to our model */ }; /* CustomListClass: more boilerplate GObject stuff */ struct _CustomListClass { GObjectClass parent_class; }; GType custom_list_get_type (void); CustomList *custom_list_new (void); GtkTreePath *custom_list_append_record (CustomList *custom_list, const gchar *name); #endif /* _custom_list_h_included_ */ gtimer-2.0.0/depcomp0000644000175000017500000004224611353237102014565 0ustar cknudsencknudsen#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2006-10-15.18 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 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, 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 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 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. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$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 $1 != '--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 $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac 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. -*|$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 $1 != '--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, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; 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-end: "$" # End: gtimer-2.0.0/edit.c0000644000175000017500000004517411353237102014307 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 17-Apr-2005 Added configurability of the browser. (Russ Allbery) * 28-Feb-2003 Added project create/edit window. * 21-Feb-2003 Added project pulldown in task create/edit. * 30-Apr-1999 Fixed bug where \n chars could be included at the * end of a task name (which would screw up the task * data file format and make the task unreachable). * 25-Mar-1999 Fixed bug where adding new tasks messes up the * hide/unhide stuff * 18-Mar-1999 Internationalization * 18-Mar-1998 Added calls to gtk_window_set_wmclass so the windows * behave better for window managers. * 03-Mar-1998 Created * ****************************************************************************/ #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #include "project.h" #include "task.h" #include "gtimer.h" #include "config.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif extern TaskData **visible_tasks; extern int num_visible_tasks; extern TaskData **tasks; extern int num_tasks; extern GtkWidget *status; typedef struct { Project *p; GtkWidget *window; GtkWidget *name; } ProjectEditData; typedef struct { TaskData *taskdata; GtkWidget *window; GtkWidget *name; GtkWidget *projectMenu; } TaskEditData; typedef struct { GtkWidget *window; GtkWidget *name; } BrowserEditData; static void ok_project_callback ( widget, data ) GtkWidget *widget; gpointer data; { ProjectEditData *ed = (ProjectEditData *) data; Project *p; char *str, *ptr; GtkWidget *item = NULL; int project_updated = 0, loop; /* Update existing project */ if ( ed->p ) { str = gtk_entry_get_text ( GTK_ENTRY(ed->name) ); if ( strcmp ( str, ed->p->name ) ) { free ( ed->p->name ); /* remove trailing white space */ for ( ptr = str + strlen ( str ) - 1; isspace ( *ptr ) && ptr > str; ptr-- ) *ptr = '\0'; ed->p->name = (char *) malloc ( strlen ( str ) + 1 ); strcpy ( ed->p->name, str ); project_updated = 1; } showMessage ( gettext("Project updated") ); } /* New Project */ else { p = (Project *) malloc ( sizeof ( Project ) ); memset ( p, '\0', sizeof ( Project ) ); str = gtk_entry_get_text ( GTK_ENTRY(ed->name) ); /* remove trailing white space */ ptr = (char *) malloc ( strlen ( str ) + 1 ); strcpy ( ptr, str ); str = ptr; for ( ptr = str + strlen ( str ) - 1; isspace ( *ptr ) && ptr > str; ptr-- ) *ptr = '\0'; p = projectCreate ( str ); projectAdd ( p ); showMessage ( gettext("Project added") ); } /* redraw the task list only if we changed a project name */ if ( project_updated ) { for ( loop = 0; ed->p && loop < num_visible_tasks; loop++ ) { if ( visible_tasks[loop]->task->project_id == ed->p->number ) { visible_tasks[loop]->name_updated = 1; visible_tasks[loop]->project_name = ed->p->name; } } update_list (); } gtk_grab_remove ( ed->window ); gtk_widget_destroy ( ed->window ); free ( ed ); } static void cancel_project_callback ( widget, data ) GtkWidget *widget; gpointer data; { ProjectEditData *ed = (ProjectEditData *) data; gtk_grab_remove ( ed->window ); gtk_widget_destroy ( ed->window ); free ( ed ); } /* ** Create the add/edit project window. ** It's an add if project is NULL. */ GtkWidget *create_project_edit_window ( project ) Project *project; { GtkWidget *edit_window; GtkWidget *table; /*GtkTooltips *tooltips;*/ GtkWidget *label, *name_text, *ok_button, *cancel_button; GtkWidget *option, *option_menu, *menuitem; ProjectEditData *ed; char msg[100], *ptr = NULL; ed = (ProjectEditData *) malloc ( sizeof ( ProjectEditData ) ); memset ( ed, 0, sizeof ( ProjectEditData ) ); ed->p = project; ed->window = edit_window = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( ed->window ), "GTimer", "gtimer" ); if ( project ) sprintf ( msg, "GTimer: %s", gettext ("Edit Project") ); else sprintf ( msg, "GTimer: %s", gettext ("Add Project") ); gtk_window_set_title (GTK_WINDOW (edit_window), msg ); gtk_window_position ( GTK_WINDOW(edit_window), GTK_WIN_POS_MOUSE ); gtk_grab_add ( edit_window ); gtk_widget_realize ( edit_window ); table = gtk_table_new (1, 3, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 8); gtk_container_border_width (GTK_CONTAINER (table), 6); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (edit_window)->vbox ), table, TRUE, FALSE, 5 ); sprintf ( msg, "%s: ", gettext ( "Project name" ) ); label = gtk_label_new ( msg ); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show ( label ); ed->name = name_text = gtk_entry_new (); gtk_table_attach_defaults (GTK_TABLE (table), name_text, 1, 3, 0, 1); if ( project ) gtk_entry_set_text ( GTK_ENTRY(name_text), project->name ); else { gtk_entry_set_text ( GTK_ENTRY(name_text), gettext ("Unnamed Project") ); gtk_entry_select_region ( GTK_ENTRY(name_text), 0, strlen ( gettext ("Unnamed Project") ) ); } gtk_window_set_focus ( >K_DIALOG ( edit_window )->window, name_text ); gtk_widget_show ( name_text ); gtk_widget_show ( table ); /* add command buttons */ /*tooltips = gtk_tooltips_new ();*/ ok_button = gtk_button_new_with_label ( gettext("Ok") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (edit_window)->action_area), ok_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (ok_button), "clicked", GTK_SIGNAL_FUNC (ok_project_callback), ed); GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); gtk_widget_grab_default (ok_button); gtk_widget_show (ok_button); /*gtk_tooltips_set_tips (tooltips, ok_button, "Save this task" );*/ cancel_button = gtk_button_new_with_label ( gettext("Cancel") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (edit_window)->action_area), cancel_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_project_callback), ed); gtk_widget_show (cancel_button); /*gtk_tooltips_set_tips (tooltips, cancel_button, "Edit the selected task" );*/ /* gtk_widget_show (hbox); gtk_widget_show (vbox); */ gtk_widget_show (edit_window); return ( edit_window ); } static int getMenuSelectionIndex ( GtkWidget *w ) { int count = 0; GList *child; GtkMenuShell *menu_shell; GtkBin *bin ; menu_shell = GTK_MENU_SHELL ( gtk_option_menu_get_menu ( GTK_OPTION_MENU( w) ) ); child = menu_shell->children; while ( child ) { bin = GTK_BIN ( child->data ); if ( !bin->child ) return count; child = child->next; count++; } return ( -1 ); } static void ok_task_callback ( widget, data ) GtkWidget *widget; gpointer data; { TaskEditData *ed = (TaskEditData *) data; TaskData *td; char *str, *ptr; GtkWidget *item = NULL; Project *p = NULL, *selp = NULL; int cnt, loop, new_project_id; /* Determine project */ if ( ed->projectMenu ) { cnt = getMenuSelectionIndex ( ed->projectMenu ); for ( loop = 0, p = projectGetFirst(); p != NULL && selp == NULL; p = projectGetNext(), loop++ ) { if ( loop + 1 == cnt ) { selp = p; } } } /* Update existing task */ if ( ed->taskdata ) { str = gtk_entry_get_text ( GTK_ENTRY(ed->name) ); if ( strcmp ( str, ed->taskdata->task->name ) ) { free ( ed->taskdata->task->name ); /* remove trailing white space */ for ( ptr = str + strlen ( str ) - 1; isspace ( *ptr ) && ptr > str; ptr-- ) *ptr = '\0'; ed->taskdata->task->name = (char *) malloc ( strlen ( str ) + 1 ); strcpy ( ed->taskdata->task->name, str ); ed->taskdata->name_updated = 1; } if ( ed->projectMenu ) { new_project_id = selp ? selp->number : -1; if ( ed->taskdata->task->project_id != new_project_id ) { if ( selp == NULL ) ed->taskdata->task->project_id = -1; /* none */ else ed->taskdata->task->project_id = selp->number; ed->taskdata->name_updated = 1; ed->taskdata->project_name = selp ? selp->name : ""; } } showMessage ( gettext("Task updated") ); } /* New Task */ else { td = (TaskData *) malloc ( sizeof ( TaskData ) ); memset ( td, '\0', sizeof ( TaskData ) ); td->new_task = 1; str = gtk_entry_get_text ( GTK_ENTRY(ed->name) ); /* remove trailing white space */ ptr = (char *) malloc ( strlen ( str ) + 1 ); strcpy ( ptr, str ); str = ptr; for ( ptr = str + strlen ( str ) - 1; isspace ( *ptr ) && ptr > str; ptr-- ) *ptr = '\0'; td->task = taskCreate ( str ); taskAdd ( td->task ); tasks = (TaskData **) realloc ( tasks, ( num_tasks + 1 ) * sizeof ( TaskData * ) ); tasks[num_tasks] = td; visible_tasks = (TaskData **) realloc ( visible_tasks, ( num_visible_tasks + 1 ) * sizeof ( TaskData * ) ); visible_tasks[num_visible_tasks] = td; num_visible_tasks++; num_tasks++; new_project_id = selp ? selp->number : -1; td->task->project_id = new_project_id; td->project_name = selp ? selp->name : ""; showMessage ( gettext("Task updated") ); } gtk_grab_remove ( ed->window ); gtk_widget_destroy ( ed->window ); free ( ed ); /* redraw the task list */ update_list (); } static void cancel_task_callback ( widget, data ) GtkWidget *widget; gpointer data; { TaskEditData *ed = (TaskEditData *) data; gtk_grab_remove ( ed->window ); gtk_widget_destroy ( ed->window ); free ( ed ); } /* ** Create the add/edit window. ** It's an add if taskdata is NULL. */ GtkWidget *create_task_edit_window ( taskdata ) TaskData *taskdata; { GtkWidget *edit_window; GtkWidget *table; /*GtkTooltips *tooltips;*/ GtkWidget *label, *name_text, *ok_button, *cancel_button; GtkWidget *option, *option_menu, *menuitem; TaskEditData *ed; char msg[100], *ptr = NULL; int use_project, loop, selitem; Project *p; ed = (TaskEditData *) malloc ( sizeof ( TaskEditData ) ); memset ( ed, 0, sizeof ( TaskEditData ) ); ed->taskdata = taskdata; ed->window = edit_window = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( ed->window ), "GTimer", "gtimer" ); if ( taskdata ) sprintf ( msg, "GTimer: %s", gettext ("Edit Task") ); else sprintf ( msg, "GTimer: %s", gettext ("Add Task") ); gtk_window_set_title (GTK_WINDOW (edit_window), msg ); gtk_window_position ( GTK_WINDOW(edit_window), GTK_WIN_POS_MOUSE ); gtk_grab_add ( edit_window ); gtk_widget_realize ( edit_window ); use_project = 0; if ( configGetAttribute ( CONFIG_USE_PROJECTS, &ptr ) == 0 && ptr && ptr[0] == '1' ) use_project = 1; table = gtk_table_new (1, use_project ? 4 : 3, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 8); gtk_container_border_width (GTK_CONTAINER (table), 6); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (edit_window)->vbox ), table, TRUE, FALSE, 5 ); if ( use_project ) { sprintf ( msg, "%s: ", gettext ( "Project " ) ); label = gtk_label_new ( msg ); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show ( label ); option = gtk_option_menu_new (); gtk_widget_show ( option ); gtk_table_attach_defaults ( GTK_TABLE (table), option, 1, 3, 0, 1); option_menu = gtk_menu_new (); menuitem = gtk_menu_item_new_with_label ( "None" ); gtk_menu_append ( GTK_MENU ( option_menu ), menuitem ); gtk_widget_show ( menuitem ); selitem = 0; loop = 1; for ( p = projectGetFirst(); p != NULL; p = projectGetNext(), loop++ ) { menuitem = gtk_menu_item_new_with_label ( p->name ); gtk_menu_append ( GTK_MENU ( option_menu ), menuitem ); gtk_widget_show ( menuitem ); gtk_object_set_data ( GTK_OBJECT ( menuitem ), "Project", p ); if ( taskdata && taskdata->task->project_id == p->number ) selitem = loop; } gtk_option_menu_set_menu ( GTK_OPTION_MENU ( option ), option_menu ); if ( selitem > 0 ) gtk_option_menu_set_history ( GTK_OPTION_MENU ( option ), selitem ); ed->projectMenu = option; } sprintf ( msg, "%s: ", gettext ( "Task name" ) ); label = gtk_label_new ( msg ); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0 + use_project, 1 + use_project, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show ( label ); ed->name = name_text = gtk_entry_new (); gtk_table_attach_defaults (GTK_TABLE (table), name_text, 1, 3, 0 + use_project, 1 + use_project); if ( taskdata ) gtk_entry_set_text ( GTK_ENTRY(name_text), taskdata->task->name ); else { gtk_entry_set_text ( GTK_ENTRY(name_text), gettext ("Unnamed Task") ); gtk_entry_select_region ( GTK_ENTRY(name_text), 0, strlen ( gettext ("Unnamed Task") ) ); } gtk_window_set_focus ( >K_DIALOG ( edit_window )->window, name_text ); gtk_widget_show ( name_text ); gtk_widget_show ( table ); /* add command buttons */ /*tooltips = gtk_tooltips_new ();*/ ok_button = gtk_button_new_with_label ( gettext("Ok") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (edit_window)->action_area), ok_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (ok_button), "clicked", GTK_SIGNAL_FUNC (ok_task_callback), ed); GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); gtk_widget_grab_default (ok_button); gtk_widget_show (ok_button); /*gtk_tooltips_set_tips (tooltips, ok_button, "Save this task" );*/ cancel_button = gtk_button_new_with_label ( gettext("Cancel") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (edit_window)->action_area), cancel_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_task_callback), ed); gtk_widget_show (cancel_button); /*gtk_tooltips_set_tips (tooltips, cancel_button, "Edit the selected task" );*/ /* gtk_widget_show (hbox); gtk_widget_show (vbox); */ gtk_widget_show (edit_window); return ( edit_window ); } static void ok_browser_callback ( widget, data ) GtkWidget *widget; gpointer data; { BrowserEditData *ed = (BrowserEditData *) data; char *browser; browser = gtk_entry_get_text ( GTK_ENTRY(ed->name) ); configSetAttribute ( CONFIG_BROWSER, browser ); gtk_grab_remove ( ed->window ); gtk_widget_destroy ( ed->window ); free ( ed ); } static void cancel_browser_callback ( widget, data ) GtkWidget *widget; gpointer data; { BrowserEditData *ed = (BrowserEditData *) data; gtk_grab_remove ( ed->window ); gtk_widget_destroy ( ed->window ); free ( ed ); } /* ** Create the add/edit browser window. */ GtkWidget *create_browser_edit_window () { GtkWidget *browser_window; GtkWidget *table; GtkWidget *info, *label, *name_text, *ok_button, *cancel_button; BrowserEditData *ed; char msg[500], *browser; ed = (BrowserEditData *) malloc ( sizeof ( BrowserEditData ) ); memset ( ed, 0, sizeof ( BrowserEditData ) ); ed->window = browser_window = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( ed->window ), "GTimer", "gtimer" ); sprintf ( msg, "GTimer: %s", gettext ("Change Browser") ); gtk_window_set_title ( GTK_WINDOW ( browser_window ), msg ); gtk_window_position ( GTK_WINDOW ( browser_window ), GTK_WIN_POS_MOUSE ); gtk_grab_add ( browser_window ); gtk_widget_realize ( browser_window ); sprintf ( msg, "%s", "The string \"%s\" in this command, if present, will" " be replaced with the URL to open; otherwise, the URL will be added to" " the end of the command."); info = gtk_label_new ( msg ); gtk_label_set_line_wrap ( GTK_LABEL (info), 1 ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (browser_window)->vbox ), info, TRUE, FALSE, 5 ); table = gtk_table_new ( 1, 3, FALSE ); gtk_table_set_row_spacings ( GTK_TABLE (table), 4 ); gtk_table_set_col_spacings ( GTK_TABLE (table), 8 ); gtk_container_border_width ( GTK_CONTAINER (table), 6 ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (browser_window)->vbox ), table, TRUE, FALSE, 5 ); sprintf ( msg, "%s: ", gettext ( "Command" ) ); label = gtk_label_new ( msg ); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); ed->name = name_text = gtk_entry_new (); gtk_table_attach_defaults (GTK_TABLE (table), name_text, 1, 3, 0, 1); if ( configGetAttribute ( CONFIG_BROWSER, &browser ) == 0 ) gtk_entry_set_text ( GTK_ENTRY(name_text), browser ); else { gtk_entry_set_text ( GTK_ENTRY(name_text), "mozilla -raise -remote 'openURL(file:%s)'" ); gtk_entry_select_region ( GTK_ENTRY(name_text), 0, strlen ( "mozilla -raise -remote 'openURL(file:%s)'" ) ); } gtk_window_set_focus ( >K_DIALOG ( browser_window )->window, name_text ); ok_button = gtk_button_new_with_label ( gettext("Ok") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (browser_window)->action_area), ok_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (ok_button), "clicked", GTK_SIGNAL_FUNC (ok_browser_callback), ed); GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); gtk_widget_grab_default (ok_button); cancel_button = gtk_button_new_with_label ( gettext("Cancel") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (browser_window)->action_area), cancel_button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_browser_callback), ed); gtk_widget_show_all ( browser_window ); return ( browser_window ); } gtimer-2.0.0/FAQ.html0000644000175000017500000000717311353425643014521 0ustar cknudsencknudsen GTimer FAQ

GTimer FAQ


What versions of GTK+ will GTimer compile with?

GTimer should compile with the latest versions of GTK+ 2.X. It may also compile with older versions, but it's always recommended you get the latest version.

Can I get a pre-compiled binary?

I don't provide binaries but you can check with other sites (such as "freshmeat.net) for binaries (but beware: they may be older version of GTimer).

Can I get rid of the splash screen?

Use the -nosplash option to not display the splash screen.

Can I adjust the idle time?

There is no UI for this yet, but you can carefully edit the ~/.gtimer/.gtimerrc file and edit the line that follows idle. (It's the idle threshold in seconds.)

Can GTimer connect to a database?

GTimer currently has no way of directly communicating with a database. But, you can use the exportSQL.pl Perl script to convert GTimer data into SQL. Look in the contrib directory for exportSQL.pl and other tools.

How do I get GTimer to work in French/Spanish/Your-Language-Here?

GTimer has internationaliztion (I18N) support. You must have the GNU gettext distribution installed. You will need to translate the provided messages.po to whatever language you want. Here's an example for French:
  1. Either start with messages.po (or create your own with "xgettext *.c")
  2. Copy messages.po to the new locale (Example: "cp messages.po fr.po")
  3. Now edit the new .po file and replace the msgstr lines with the proper translated text.
  4. Now use msgfmt to build the .mo file from your .po file. (Example: "msgfmt fr.po -ogtimer.mo")
  5. Make sure your LANG environment variable is set to the proper locale.
  6. Copy the gtimer.mo file to the proper location. I'm not if this is the same place all on system. On my system, the French gtimer.po needs to be:
      /usr/share/locale/fr/LC_MESSAGES/gtimer.mo
    If you're not sure where it's looking, on Linux try using strace to see where it's looking:
      strace gtimer |& grep LC_MESSAGES
  7. Email me the translation file! I'll add it to the distribution for others to use.

Home Page: http://www.k5n.us/gtimer.php
Author: Craig Knudsen, craig@k5n.us
gtimer-2.0.0/gettext.h0000644000175000017500000002217111353237102015043 0ustar cknudsencknudsen/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. This program 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, 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ (__GNUC__ >= 3 || __GNUG__ >= 2 /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ gtimer-2.0.0/gtimer.10000644000175000017500000000476311353237102014566 0ustar cknudsencknudsen.\" .\" GTimer man page .\" Copyright (C) 1998-2003 Craig Knudsen, cknudsen@cknudsen.com .\" .\" 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; see the file COPYING. If not, write to .\" the Free Software Foundation, 59 Temple Place - Suite 330, .\" Boston, MA 02111-1307, USA. .\" .TH GTIMER 1 "Mar 19, 2003" "GTimer" "GTimer" .SH NAME gtimer \- an application for recording time spent on user-defined tasks. .SH SYNOPSIS .B gtimer [\f3\-midnight \f2offset\f1] [\f3\-weekstart \f2day\f1] [\f3\-nosplash] [\f3\-resume] [\f3\-start \f2task\f1] .SH DESCRIPTION \f3GTimer\f1 allows the user to time one or more activities. Users define tasks that can be timed. Text annotations can also be added to tasks. Reports can be generated that summarize time spent and annotations. .SH OPTIONS .TP 8 .B \-midnight \f2offset\f3 Specify the offset of midnight to use. Users can allow time spent after midnight to be recorded for the previous day. For example, the command .B gtimer -midnight 400 will not consider everything 3:59AM the previous day. .TP 8 .B \-weekstart \f2day\f3 Specify which day of the week should be considered the beginning of the week when generating reports. \f2day\f3 should be a number between 0 and 6, where 0 is Sunday. For example, the command .B gtimer -weekstart 1 will use Monday as the first day of the week for all weekly reports. The default is 0 (Sunday). .TP 8 .B \-resume Start timing any tasks that were still be timed when GTimer last exited. .TP 8 .B \-start \f2taskname\f3 Start timing the specified task immediately. This option can be used more than once on the command line. For example, you can start a tasks with: .B gtimer -start 'GTimer development' .TP 8 .B \-nosplash Do not display the splash window on startup. .RE .SH FILES .nf .ta 4i ~/.gtimer/ data storage .fi .SH SEE ALSO enscript(1), lpr(1) .SH AUTHOR Craig Knudsen GTimer WWW home page: gtimer-2.0.0/gtimer.desktop0000644000175000017500000000022011353237102016057 0ustar cknudsencknudsen[Desktop Entry] Version=1.0 Type=Application Name=GTimer Comment=GTK-based X11 task timer Exec=gtimer Icon=gtimer Categories=Utility;Clock;GTK; gtimer-2.0.0/gtimer.doc-base0000644000175000017500000000036211353237102016072 0ustar cknudsencknudsenDocument: gtimer Title: gtimer FAQ Author: Craig Knudsen Abstract: This FAQ answers questions about gtimer. Section: Project Management Format: HTML Index: /usr/share/doc/gtimer/FAQ.html Files: /usr/share/doc/gtimer/FAQ.html gtimer-2.0.0/gtimer.h0000644000175000017500000001123211353520147014646 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com http://www.cknudsen.com/ * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 09-Mar-2000 Changed release to 1.1.5 * 09-Mar-2000 Added args to confirm_create_window() * 04-May-1999 Changed release to 1.1.4 * 03-May-1999 Changed release to 1.1.3 * 17-Mar-1999 Changed release to 1.1.2 * 24-Feb-1999 Changed release to 1.1.1 * 02-Feb-1999 Changed release to 1.1.0 * 04-Jan-1999 Changed release to 0.99B * 11-Nov-1998 Added GTIMER_TASK_OPTION_HIDDEN * Changed release to 0.99 * 10-May-1998 Changed release to 0.98 * 10-May-1998 Changed release to 0.97 * 05-Apr-1998 Changed release to 0.96 * 24-Mar-1998 Changed release to 0.95 * 18-Mar-1998 Changed release to 0.94 * 13-Mar-1998 Changed release to 0.93 * 10-Mar-1998 Changed release to 0.92 * 10-Mar-1998 Changed release to 0.91 * 25-Feb-1998 Created * ****************************************************************************/ #ifndef _GTIMER_H #define _GTIMER_H /* Note: we could use "VERSION" produced from autoconf, but I like to also have the version date, so I'll just edit this by hand. */ #define GTIMER_VERSION "2.0.0" #define GTIMER_VERSION_DATE "27 Mar 2010" /*"19 Mar 2003"*/ #define GTIMER_URL "http://www.k5n.us/gtimer.php" #define GTIMER_COPYRIGHT "Copyright (C) 2000-2010 Craig Knudsen" #define GTIMER_STATUS_ID "status-update" #define GTIMER_TASK_OPTION_HIDDEN 0x0001 /* URL to check for new version */ #define GTIMER_VERSION_CHECK_SERVER "www.k5n.us" #define GTIMER_VERSION_CHECK_PORT 80 #define GTIMER_VERSION_CHECK_PATH "/gtimer_latest_version.txt" // PV: #define MAX_NUMBER_OF_ACTIONS 30 // PV: Internationalization #include "gtimeri18n.h" typedef enum { CONFIRM_ABOUT, CONFIRM_ERROR, CONFIRM_WARNING, CONFIRM_CONFIRM, CONFIRM_MESSAGE } enum_confirm_type; typedef enum { REPORT_TYPE_NONE, /* PV: + */ REPORT_TYPE_DAILY, REPORT_TYPE_WEEKLY, REPORT_TYPE_MONTHLY, REPORT_TYPE_YEARLY, REPORT_TYPE_TOTAL } report_type; typedef struct { Task *task; char *project_name; /* name of parent project */ TaskTimeEntry *todays_entry; int timer_on; time_t on_since; time_t total; /* except for today */ int name_updated; /* flag to update name on next draw */ int new_task; /* flag to add this to the clist */ char last_total[15]; time_t last_total_int; char last_today[15]; time_t last_today_int; int last_on; /* was the icon drawn last time? */ int selected; /* item is selected */ int moved; /* item was moved */ } TaskData; void save_all (); void update_list (); #ifdef __GTK_H__ #ifndef WIN32 void set_x_error_handler (); #endif GtkWidget *create_task_edit_window ( TaskData *taskdata ); GtkWidget *create_project_edit_window ( Project *project ); GtkWidget *create_annotate_window ( TaskData *taskdata ); GtkWidget *create_report_window ( report_type type ); GtkWidget *create_unhide_window ( ); void display_changelog ( ); void showMessage ( char *msg ); GtkWidget *create_confirm_window ( enum_confirm_type type, char *title, char *text, char *ok_text, char *cancel_text, char *third_text, void (*ok_callback)(), void (*cancel_callback)(), void (*third_callback)(), char *callback_data ); GtkWidget *create_confirm_toplevel ( enum_confirm_type type, char *title, char *text, char *ok_text, char *cancel_text, char *third_text, void (*ok_callback)(), void (*cancel_callback)(), void (*third_callback)(), char *callback_data ); char *get_client_path ( char *file ); #endif /* __GTK_H__ */ #ifdef GTK_MAJOR_VERSION #if ( GTK_MAJOR_VERSION < 1 ) || \ ( GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION <= 1 ) #define OLD_GTK 1 #else #define OLD_GTK 0 #endif #endif // PV: debug version // #define PV_DEBUG 1 #endif /* _GTIMER_H */ gtimer-2.0.0/gtimeri18n.h0000644000175000017500000000305211353237102015343 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com http://www.cknudsen.com/ * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 2008-08-31 Header file created */ #ifndef _GTIMER_I18N_H #define _GTIMER_I18N_H // PV: Internationalization #ifdef HAVE_LIBINTL_H # ifndef ENABLE_NLS # define ENABLE_NLS 1 # endif # define DEFAULT_TEXT_DOMAIN "gtimer" //# ifndef WIN32 //# define LOCALE_DIR "/usr/share/locale" //#warning: FIX if locale directory is different from /usr/share/locale //# endif # include "gettext.h" # include #else # define gettext(a) a # define gettext_noop(a) a #endif #endif /* _GTIMER_I18N_H */ gtimer-2.0.0/gtimer.install.in0000644000175000017500000000023611353237102016470 0ustar cknudsencknudsendebian/tmp/usr/bin/gtimer @BUILD_TREE@/contrib usr/share/doc/gtimer debian/gtimer.desktop usr/share/applications debian/gtimer.xpm usr/share/pixmaps gtimer-2.0.0/gtimer.xpm0000644000175000017500000001020611353237102015217 0ustar cknudsencknudsen/* XPM */ static char * gtimer_xpm[] = { "32 32 125 2", " c None", ". c #19314B", "+ c #2C5480", "@ c #1D3957", "# c #4E4E4E", "$ c #000000", "% c #818181", "& c #A4A4A4", "* c #AAAAAA", "= c #9F9F9F", "- c #585858", "; c #292929", "> c #505050", ", c #B1B1B1", "' c #FFFFFF", ") c #787878", "! c #4A4A4A", "~ c #272727", "{ c #969696", "] c #FAFAFA", "^ c #F4F4F4", "/ c #4F4F4F", "( c #636363", "_ c #C6C6C6", ": c #8E8E8E", "< c #434343", "[ c #26486E", "} c #333333", "| c #838383", "1 c #2F3842", "2 c #BCBCBC", "3 c #E5E5E5", "4 c #F0F0F0", "5 c #274260", "6 c #3B3B3B", "7 c #A2A2A2", "8 c #EAEAEA", "9 c #16212E", "0 c #2A4F79", "a c #1E1E1E", "b c #EDEDED", "c c #848484", "d c #171717", "e c #2E2E2E", "f c #CDCDCD", "g c #989898", "h c #14263A", "i c #454545", "j c #ACACAC", "k c #B4B4B4", "l c #192736", "m c #25466B", "n c #555555", "o c #E0E0E0", "p c #646464", "q c #5C5C5C", "r c #F6F6F6", "s c #4C4C4C", "t c #1F3B5A", "u c #284D76", "v c #363636", "w c #172D45", "x c #26496F", "y c #616161", "z c #BDBDBD", "A c #C2C2C2", "B c #7B7B7B", "C c #162B42", "D c #1D3857", "E c #686868", "F c #C4C4C4", "G c #626262", "H c #0D0D0D", "I c #6F6F6F", "J c #8A8A8A", "K c #3F4348", "L c #203954", "M c #696969", "N c #B3B3B3", "O c #676767", "P c #353535", "Q c #253950", "R c #252C34", "S c #2A2A2A", "T c #373737", "U c #202C39", "V c #203D5E", "W c #182F49", "X c #274B72", "Y c #212121", "Z c #2F3439", "` c #2D2D2D", " . c #1E2C3B", ".. c #2C2C2C", "+. c #232323", "@. c #262F3A", "#. c #282828", "$. c #1E3044", "%. c #142539", "&. c #7F7F7F", "*. c #DADADA", "=. c #EBEBEB", "-. c #565656", ";. c #323232", ">. c #0F1C2B", ",. c #303030", "'. c #717171", "). c #656565", "!. c #090909", "~. c #3C3C3C", "{. c #224264", "]. c #15283E", "^. c #091119", "/. c #393939", "(. c #0F0F0F", "_. c #3A3C3E", ":. c #212E3C", "<. c #1C3653", "[. c #213F61", "}. c #233549", "|. c #142231", "1. c #0F1D2C", "2. c #1E2731", "3. c #2B527D", "4. c #183049", " . ", " + @ ", " + + @ ", " # $ % & * * * = - $ + + + @ ", " ; > , ' ' ' ' ' ' ' ' ' ) ! + + + + @ ", " ~ { ] ' ' ' ' ' ' ' ' ' ' ' ^ / + + + + + @ ", " ( _ ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' : < [ + + + + + @ ", " } _ ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' | 1 + + + + + @ ", " - 2 3 4 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ) 5 + + + + @ ", " ! ^ 6 7 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 8 9 0 + + + @ ", " a b ' c d e f ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' g h 0 + + @ ", " i ' ' ] j $ e | ^ ' ' ' ' ' ' ' ' ' ' ' ' ' ' k l m + + @ ", " n g ' ' ' ' o p $ q o ' ' ' ' ' ' ' ' ' ' ' ' ' r s t u + @ ", " n * ' ' ' ' ' ^ q $ v , ' ' ' ' ' ' ' ' ' ' ' ' ' n w x + @ ", " y z ' ' ' ' ' ' ' A e $ 7 3 ' ' ' ' ' ' ' ' ' ' ' B C D + @ ", " E F ' ' ' ' ' ' ' ' f G H I ' ' ' ' ' ' ' ' ' ' ' J C D + @ ", " E F ' ' ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' ' ' J K L + @ ", " M N ' ' ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' ' ' O P Q + @ ", " * ' ' ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' ' ' n R D + @ ", " g ' ' ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' ' r s R D + @ ", " S ' ' ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' ' k T U V + @ ", " $ b ' ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' ' g a W X + @ ", " ! ^ ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' 8 Y Z D 0 + @ ", " - 2 ' ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' ' ) ` .m + + @ ", " ..) ' ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' ' +.` R D + + + @ ", " @._ ' ' ' ' ' ' $ $ ' ' ' ' ' ' ' : a #.$.m + + + @ ", " + 0 %.&.*.' ' ' ' $ $ ' ' ' ' =.N -.;.R $.X + + + + @ ", " + + + 0 >.,., ' ' ' '.'.' ' ' ' ).!.~.` C {.+ + + + + @ ", " + + + + + 0 m ].^.'.& * * * = /.(._.R :.<.X + + + + + + @ ", " + + + + + + + + u [.}.|.1.1.a 2.|. .$.D [.3.+ + + + + + + @ ", " + + + + + + + + + + + + X m m m m m m + + + + + + + + + + + @ ", ". @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 4."}; gtimer-2.0.0/http.c0000644000175000017500000004336511353237102014341 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 19-May-1999 Created (based on an 1995 app I wrote) * ****************************************************************************/ #include #include #include #include #include #include #include #include #ifdef AIX #include #endif #include #ifdef WIN32 #include /* winsock API */ #else #include #include /* for gethostbyaddr() */ #include #include #endif #include #include #include "project.h" #include "task.h" #include "gtimer.h" #include "tcpt.h" #include "http.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif static char *my_strtok ( #ifndef _NO_PROTO char *ptr1, char *tok #endif ); /* ** Max number of bytes to read at once. */ #define MAX_READ_SIZE 1024 /* ** Structure for states. */ typedef struct _httpRequest { sockfd connection; /* connection to server */ char *request; /* text message to send */ httpError (*read_function)(); /* read function */ #ifdef _NO_PROTO void (*callback)(); /* callback when results received */ #else void (*callback)(char *); /* callback when results received */ #endif #ifdef _NO_PROTO void (*gen_callback)(); /* callback when results received */ #else void (*gen_callback)(char *,int); /* callback when results received */ #endif int sent; /* has request been sent */ char *data_read; /* data that was read */ int data_len; /* size of above data */ int content_length; /* length according to header */ int pass; /* no. reads done */ } httpRequest; #define MAX_REQUESTS_QUEUED 2048 static char http_other_error[256]; static httpRequest *requests[MAX_REQUESTS_QUEUED]; static int num_requests = 0; static char *http_proxy = NULL; static char http_proxy_string[1024]; static int http_proxy_port; static char *user_agent () { static char ret[100]; sprintf ( ret, "GTimer/%s", GTIMER_VERSION ); return ( ret ); } /* ** Local functions. */ static char *httpTruncateHeader ( #ifndef _NO_PROTO char *text, int *len #endif ); static httpError httpReadGet ( #ifndef _NO_PROTO httpRequest *request #endif ); static httpError httpReadGetArticles ( #ifndef _NO_PROTO httpRequest *request #endif ); static httpError httpReadGetAds ( #ifndef _NO_PROTO httpRequest *request #endif ); static httpError httpReadList ( #ifndef _NO_PROTO httpRequest *request #endif ); static httpError httpReadGetUserId ( #ifndef _NO_PROTO httpRequest *request #endif ); static httpError httpReadGetSessionId ( #ifndef _NO_PROTO httpRequest *request #endif ); static httpError httpSendRequest ( #ifndef _NO_PROTO httpRequest *request #endif ); static char *encode_for_use_in_url ( #ifndef _NO_PROTO char *str #endif ); /* ** URL-encode a string ** See RFC 1738 (http://andrew2.andrew.cmu.edu/rfc/rfc1738.html) ** Caller should free result. */ static char *encode_for_use_in_url ( str ) char *str; { char *ret, *ptr1, *ptr2, *ptr3; static char unsafe_chars[] = { ' ', '{', '}', '|', '/', '\\', '^', '~', '[', ']', '`', '%', '<', '>', '"', '#', ')', '(', '\0', }; int unsafe; /* just to be safe... */ ret = (char *) malloc ( strlen ( str ) * 3 + 1 ); for ( ptr1 = str, ptr2 = ret; *ptr1 != '\0'; ptr1++ ) { unsafe = 0; /* is unsafe??? */ for ( ptr3 = unsafe_chars; *ptr3 != '\0'; ptr3++ ) { if ( *ptr3 == *ptr1 ) { unsafe = 1; break; } } /* if ( ! unsafe ) { if ( ( (unsigned int)*ptr1 < 0x80 || (unsigned int)*ptr1 > 0xFF ) || ( (unsigned int)*ptr1 >= 0x00 && (unsigned int)*ptr1 <= 0x1F ) || ( (unsigned int)*ptr1 == 0x7F ) ) unsafe = 1; } */ if ( unsafe ) { sprintf ( ptr2, "%%%02X", (unsigned int)*ptr1 ); ptr2 += 3; } else { *ptr2 = *ptr1; ptr2++; } } *ptr2 = '\0'; return ( ret ); } void httpEnableProxy ( server, port ) char *server; int port; { if ( http_proxy ) free ( http_proxy ); http_proxy = (char *) malloc ( strlen ( server ) + 1 ); strcpy ( http_proxy, server ); http_proxy_port = port; } void httpDisableProxy () { if ( http_proxy ) free ( http_proxy ); http_proxy_string[0] = '\0'; http_proxy = NULL; } /* ** Put a request onto the end of the queue. ** Current request is always reqeusts[0]. */ httpError httpEnqueueRequest ( connection, msg, read_function, callback, gen_callback ) sockfd connection; char *msg; #ifdef _NO_PROTO httpError (*read_function)(); void (*callback)(); void (*gen_callback)(); #else httpError (*read_function)(sockfd); void (*callback)(char *); void (*gen_callback)(char *,int); #endif { httpRequest *request; if ( num_requests >= MAX_REQUESTS_QUEUED - 1 ) { fprintf ( stderr, "Too many errors...\n" ); return ( HTTP_TOO_MANY_REQUESTS ); } /* put request at end of queue. */ request = (httpRequest *) malloc ( sizeof ( httpRequest ) ); memset ( request, '\0', sizeof ( httpRequest ) ); if ( msg ) { request->request = (char *) malloc ( strlen ( msg ) + 1 ); strcpy ( request->request, msg ); request->connection = connection; } else { /* NULL msg indicates no message to send */ request->request = NULL; request->sent = 1; } request->connection = connection; request->read_function = read_function; request->callback = callback; request->gen_callback = gen_callback; request->data_read = NULL; requests[num_requests++] = request; /* now send the request if this is the only request */ if ( num_requests == 1 ) { httpSendRequest ( requests[0] ); } return ( HTTP_NO_ERROR ); } /* ** Send a request to the server. ** This should not be called directly, only from httpDequeueRequest and ** httpEnqueueRequest. */ static httpError httpSendRequest ( request ) httpRequest *request; { int rval; if ( ! request->sent ) { rval = send ( request->connection, request->request, strlen ( request->request ), 0 ); request->sent = 1; if ( rval >= 0 ) return ( HTTP_NO_ERROR ); else return ( HTTP_SOCKET_ERROR ); } else return ( HTTP_NO_ERROR ); } /* ** Remove the most recent request from the queue. ** It is not an error to call this function with nothing in the queue. */ httpError httpDequeueRequest () { int loop; if ( num_requests ) { if ( requests[0]->data_read ) free ( requests[0]->data_read ); if ( requests[0]->request ) free ( requests[0]->request ); free ( requests[0] ); /* move each request up one slot */ for ( loop = 1; loop < num_requests; loop++ ) requests[loop-1] = requests[loop]; num_requests--; } if ( num_requests ) httpSendRequest ( requests[0] ); return ( HTTP_NO_ERROR ); } /* ** Calling app calls this when select() indicates data is ready to be ** read on socket. This will figure out where we left off and ** continue from there. */ httpError httpProcessRead ( connection ) sockfd connection; { int loop; int num = -1; for ( loop = 0; loop < num_requests; loop++ ) { if ( requests[loop]->connection == connection ) { num = loop; break; } } if ( num < 0 ) return ( HTTP_NO_REQUESTS ); return ( requests[loop]->read_function ( requests[loop] ) ); } /* ** Connect to an HTTP server. ** Returns socket file descriptor. ** Note that this is the one place where we must wait for a response ** that could cause things to hang a bit. */ httpError httpOpenConnection ( http_host, port, connection ) char *http_host; int port; sockfd *connection; { sockfd sock; static struct sockaddr_in server; struct hostent *hp, *gethostbyname (); tcptError ret; memset ( &server, '\0', sizeof ( struct sockaddr_in ) ); /* Verify all necessary data is available */ if ( ! http_host || ! strlen ( http_host ) ) return ( HTTP_INVALID_HOST ); if ( http_proxy ) { /* save info for next request */ sprintf ( http_proxy_string, "http://%s:%d", http_host, port ); /* now change to http proxy */ http_host = http_proxy; port = http_proxy_port; } hp = gethostbyname ( http_host ); if ( ! hp ) { return ( HTTP_HOST_LOOKUP_FAILED ); } /* Init windows winsock DLL */ if ( tcptInit () ) { return ( HTTP_SOCKET_ERROR ); } sock = socket ( AF_INET, SOCK_STREAM, 0 ); if ( sock < 0 ) { tcptCleanup (); return ( HTTP_SOCKET_ERROR ); } server.sin_family = AF_INET; memcpy ( (char *)&server.sin_addr, (char*)hp->h_addr, hp->h_length ); /* Get HTTP port (80) */ if ( port ) server.sin_port = htons ( port ); else server.sin_port = htons ( HTTP_PORT ); if ( ( ret = tcptConnect ( sock, (struct sockaddr *)&server, sizeof ( server ) ) ) ) { strcpy ( http_other_error, tcptErrorString ( ret ) ); return ( HTTP_OTHER_ERROR ); } /* success. return socket */ *connection = sock; /* Set to non-blocking */ /*ioctl ( *connection, FIONBIO, 1 );*/ return ( HTTP_NO_ERROR ); } /* ** Close the connection and remove all requests from the queue. */ httpError httpKillConnection ( connection ) sockfd connection; { int loop, newnum; /* ** Remove all requests in the queue that reference this connection. */ for ( loop = 0, newnum = 0; loop < num_requests; loop++ ) { if ( requests[loop]->connection == connection ) { /* NULL out requests we are killing */ if ( requests[loop]->data_read ) free ( requests[loop]->data_read ); if ( requests[loop]->request ) free ( requests[loop]->request ); free ( requests[loop] ); requests[loop] = NULL; } else { requests[newnum] = requests[loop]; } } for ( loop = 0, newnum = 0; loop < num_requests; loop++ ) { if ( requests[loop] && loop != newnum ) { requests[newnum] = requests[loop]; requests[loop] = NULL; newnum++; } } num_requests = newnum; closesocket ( connection ); return ( HTTP_NO_ERROR ); } /* ** Do a generic get request. */ httpError httpGet ( connection, virthost, path, qs_names, qs_values, num, callback ) sockfd connection; char *virthost; char *path; char *qs_names[]; char *qs_values[]; int num; #ifdef _NO_PROTO void (*callback)(); #else void (*callback)(char *,int); #endif { char *command, *temp, temp2[256], *ret1, *ret2; int loop; temp = (char *) malloc ( strlen ( path ) + strlen ( http_proxy_string ) + 5 ); sprintf ( temp, "GET %s%s", http_proxy_string, path ); command = (char *) malloc ( strlen ( temp ) + 2 ); strcpy ( command, temp ); free ( temp ); if ( num ) { strcat ( command, "?" ); for ( loop = 0; loop < num; loop++ ) { ret1 = encode_for_use_in_url ( qs_names[loop] ); ret2 = encode_for_use_in_url ( qs_values[loop] ); command = (char *) realloc ( command, strlen ( command ) + strlen ( ret1 ) + strlen ( ret2 ) + 3 ); if ( loop ) strcat ( command, "&" ); strcat ( command, ret1 ); strcat ( command, "=" ); strcat ( command, ret2 ); free ( ret1 ); free ( ret2 ); } } strcpy ( temp2, " HTTP/1.0\r\n" ); strcat ( temp2, "User-Agent: " ); strcat ( temp2, user_agent() ); strcat ( temp2, "\r\n" ); if ( virthost != NULL ) { strcat ( temp2, "Host: " ); strcat ( temp2, virthost ); strcat ( temp2, "\r\n" ); } strcat ( temp2, "\r\n" ); command = (char *) realloc ( command, strlen ( command ) + strlen ( temp2 ) + 1 ); strcat ( command, temp2 ); httpEnqueueRequest ( connection, command, httpReadGet, NULL, callback ); return ( HTTP_NO_ERROR ); } static int my_strncasecmp ( str1, str2, len ) char *str1, *str2; int len; { char *a1, *a2, *ptr; int ret, loop; a1 = (char *) malloc ( len + 1 ); strncpy ( a1, str1, len ); a1[len] = '\0'; a2 = (char *) malloc ( len + 1 ); strncpy ( a2, str2, len ); a2[len] = '\0'; for ( ptr = a1, loop = 0; *ptr != '\0' && loop < len; loop++, ptr++ ) *ptr = toupper ( *ptr ); for ( ptr = a2, loop = 0; *ptr != '\0' && loop < len; loop++, ptr++ ) *ptr = toupper ( *ptr ); ret = strncmp ( a1, a2, len ); free ( a1 ); free ( a2 ); return ( ret ); } static httpError httpReadGet ( request ) httpRequest *request; { int rval; char data[MAX_READ_SIZE], *alldata, *ptr; int len; memset ( data, '\0', MAX_READ_SIZE ); rval = recv ( request->connection, data, MAX_READ_SIZE, 0 ); if ( rval < 0 ) return ( HTTP_SOCKET_ERROR ); else if ( rval == 0 ) { /* we are done. */ request->gen_callback ( request->data_read, request->data_len ); request->gen_callback ( NULL, 0 ); httpDequeueRequest (); return ( HTTP_NO_ERROR ); } if ( request->data_read ) { alldata = (char *) malloc ( request->data_len + rval ); memcpy ( alldata, request->data_read, request->data_len ); memcpy ( alldata + request->data_len, data, rval ); len = request->data_len + rval; } else { alldata = (char *) malloc ( rval ); memcpy ( alldata, data, rval ); len = rval; } if ( request->data_read ) free ( request->data_read ); if ( ! request->content_length ) { request->data_read = httpTruncateHeader ( alldata, &len ); if ( request->data_read ) request->data_len = len; if ( request->data_read ) { /* complete header found (starts in alldata) */ ptr = strtok ( alldata, "\r\n" ); while ( ptr ) { if ( strncmp ( ptr, "HTTP/1.0 200", 12 ) == 0 || strncmp ( ptr, "HTTP/1.1 200", 12 ) == 0 ) { /* ok status. ignore */ } else if ( strncmp ( ptr, "HTTP/1.", 7 ) == 0 ) { /* some other status -- error */ request->gen_callback ( ptr, strlen ( ptr ) ); /* indicates error */ request->gen_callback ( NULL, 0 ); /* indicates error */ httpDequeueRequest (); free ( alldata ); return ( HTTP_HTTP_ERROR ); } else if ( my_strncasecmp ( ptr, "Content-Length:", 15 ) == 0 ) { /* specifies length of content */ request->content_length = atoi ( ptr + 15 ); break; } else { /* ignore all others.... */ } ptr = strtok ( NULL, "\r\n" ); } } } else { if ( request->content_length == len ) { /* we're done */ request->gen_callback ( alldata, len ); request->gen_callback ( NULL, 0 ); httpDequeueRequest (); free ( alldata ); return ( HTTP_HTTP_ERROR ); } } free ( alldata ); return ( HTTP_NO_ERROR ); } char *httpErrorString ( num ) httpError num; { static char msg[200]; switch ( num ) { case HTTP_NO_ERROR: return ( "No error." ); case HTTP_INVALID_HOST: return ( "Unable to resolve server name." ); case HTTP_SYSTEM_ERROR: sprintf ( msg, "System error (%d)", errno ); return ( msg ); case HTTP_SOCKET_ERROR: sprintf ( msg, "System error (%d)", errno ); return ( msg ); case HTTP_HTTP_ERROR: return ( "HTTP protocol error." ); case HTTP_NO_REQUESTS: return ( "No requests on queue." ); case HTTP_TOO_MANY_REQUESTS: return ( "Too many requests on queue." ); case HTTP_HOST_LOOKUP_FAILED: return ( "Unable to resolve server hostname" ); case HTTP_OTHER_ERROR: return ( http_other_error ); case HTTP_UNKNOWN_ERROR: default: return ( "Unknown error." ); } } /* ** Take the given text and truncate after the http header */ static char *httpTruncateHeader ( text, len ) char *text; int *len; { char *ptr; char *ret; char *end_header1 = "\n\n"; char *end_header2 = "\r\n\r\n"; int loop; int newlen; /* check to see it we've reached the end. */ if ( strlen ( text ) < 10 ) return ( NULL ); /* back up to the last separator */ for ( loop = 0, ptr = text; loop < *len; loop++, ptr++ ) { if ( strncmp ( ptr, end_header1, strlen ( end_header1 ) ) == 0 ) { /* end of http header found */ *ptr = '\0'; ptr += strlen ( end_header1 ); newlen = *len - strlen ( text ) - strlen ( end_header1 ); ret = (char *) malloc ( newlen ); memcpy ( ret, ptr, newlen ); *len = newlen; return ( ret ); } else if ( strncmp ( ptr, end_header2, strlen ( end_header2 ) ) == 0 ) { /* end of http header found */ *ptr = '\0'; ptr += strlen ( end_header2 ); newlen = *len - strlen ( text ) - strlen ( end_header2 ); ret = (char *) malloc ( newlen ); memcpy ( ret, ptr, newlen ); *len = newlen; return ( ret ); } } return ( NULL ); } static char *my_strtok ( ptr1, tok ) char *ptr1; char *tok; { static char *last; char *p; if ( ! ptr1 ) ptr1 = last; else last = ptr1; if ( ! ptr1 ) return ( NULL ); for ( p = ptr1; *p != '\0'; p++ ) { if ( strncmp ( p, tok, strlen ( tok ) ) == 0 ) { *p = '\0'; last = p + strlen ( tok ); return ( ptr1 ); } } last = NULL; return ( ptr1 ); } gtimer-2.0.0/http.h0000644000175000017500000000724111353237102014337 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Routines for using HTTP. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 19-May-1999 Stole from another project to use on GTimer :-) * 15-Aug-1995 Createdandle box to menu. * ****************************************************************************/ #ifndef _HTTP_H #define _HTTP_H #include "tcpt.h" /* provides a little portability between UNIX/Win32 */ #define HTTP_PORT 80 #define HTTP_MAX_LINE_LEN 2048 /* ** Errors */ typedef enum { HTTP_NO_ERROR = 0, /* success */ HTTP_INVALID_HOST = 1, /* invalid host specified */ HTTP_SYSTEM_ERROR = 2, /* error returned from system call */ /* error value set in errno */ HTTP_SOCKET_ERROR = 3, /* error returned from socket function */ /* winsock does not use error for errors */ HTTP_HTTP_ERROR = 4, /* error returned from server */ HTTP_NO_REQUESTS = 5, /* no requests on queue */ HTTP_TOO_MANY_REQUESTS = 6, /* too many requests queued */ HTTP_OTHER_ERROR = 7, /* other error */ HTTP_HOST_LOOKUP_FAILED = 8, /* unable to resolve name */ HTTP_UNKNOWN_ERROR = 9 /* unknown error */ } httpError; /* ** Encode text suitable for use in a URL. */ char *url_encode ( #ifndef _NO_PROTO char *str #endif ); /* ** httpErrorString - Translate a httpError value into a text string. ** If HTTP_SYSTEM_ERROR, then lookup the error using errno. If ** HTTP_SOCKET_ERROR, then use winsock to get an error value. */ char *httpErrorString ( #ifndef _NO_PROTO httpError error_num /* Error value */ #endif ); /* ** httpProcessRead - Perform what's been queued up now that data is ** ready to be read from the socket. */ httpError httpProcessRead ( #ifndef _NO_PROTO sockfd connection #endif ); /* ** httpConnect - Attempt to connect to a server. */ httpError httpOpenConnection ( #ifndef _NO_PROTO char *servername, /* in: hostname of http server */ int port, /* in: port to use (80) */ sockfd *connection /* return: socket (if successful) */ #endif ); /* ** httpKillConnnection - Just close the socket immediately. ** Also removes all requests from the queue. */ httpError httpKillConnection ( #ifndef _NO_PROTO sockfd connection /* in: connection to server */ #endif ); /* ** Enable an HTTP proxy */ void httpEnableProxy ( #ifndef _NO_PROTO char *server, int port #endif ); /* ** Disable an HTTP proxy */ void httpDisableProxy (); /* ** Generic http request */ httpError httpGet ( #ifndef _NO_PROTO sockfd connection, /* in: connection to server */ char *virthost, /* in: hostname of server */ char *path, /* in: path to CGI */ char *qs_names[], /* in: names in form */ char *qs_values[], /* in: values in form */ int num, /* in: size of above arrays */ void (*callback)(char *,int) /* in: callback to call with data */ #endif ); #endif /* _HTTP_H */ gtimer-2.0.0/icons/confirm.xpm0000644000175000017500000000367611353237102016515 0ustar cknudsencknudsen/* XPM */ static char * confirm_xpm[] = { "40 40 8 1", " s mask c none", ". c #4A4A4A4A4A4A", "X c #000000000000", "o c #7C7C7C7C7C7C", "O c #BABABABABABA", "+ c #FFFFFFFFFFFF", "@ c #6E6E6E6EFFFF", "# c #00000000FFFF", " ", " ", " .XXXXXXXX. ", " .XXX..oooo..XXX. ", " XX.O++++++++++O.XX ", " .X.O++++++++++++++O.X. ", " XX.O++++++@@@@++++++O.XX ", " X.O++++++########@+++++O.X ", " X.O++++++##########@+++++O.X ", " X.O++++++##@+++++@###++++++O.X ", " .XO++++++##@+++++++@##@++++++OX. ", " X.+++++++##+++++++++###+++++++.X ", " .XO+++++++###@+++++++###+++++++OX. ", " X.++++++++####+++++++###++++++++.X ", " XO+++++++++@#@++++++####++++++++OX ", " .X++++++++++++++++++#####+++++++++X. ", " X.+++++++++++++++++#####@+++++++++.X ", " X.+++++++++++++++++####@++++++++++.X ", " Xo++++++++++++++++#####+++++++++++oX ", " Xo++++++++++++++++####@+++++++++++oX ", " Xo+++++++++++++++#####++++++++++++oX ", " Xo+++++++++++++++####@++++++++++++oX ", " X.++++++++++++++####@+++++++++++++.X ", " X.+++++++++++++####@++++++++++++++.X ", " .X+++++++++++++###@+++++++++++++++X. ", " XO++++++++++++###+++++++++++++++OX ", " X.++++++++++++###+++++++++++++++.X ", " .XO+++++++++++###++++++++++++++OX. ", " X.++++++++++++++++++++++++++++.X ", " .XO++++++++++++++++++++++++++OX. ", " X.O++++++++++@+++++++++++++O.X ", " X.O++++++++###+++++++++++O.X ", " X.O++++++@###@+++++++++O.X ", " XX.O+++++###++++++++O.XX ", " .X.O+++++@++++++++O.X. ", " XX.O++++++++++O.XX ", " .XXX..oooo..XXX. ", " .XXXXXXXX. ", " ", " "}; gtimer-2.0.0/icons/stop.xpm0000644000175000017500000000225511353237102016035 0ustar cknudsencknudsen/* XPM */ static char * stop_xpm[] = { "30 30 6 1", " s mask c none", ". c #909090909090", "X c #616161616161", "o c #000000000000", "O c #FFFFFFFFFFFF", "+ c #FFFF00000000", " ", " .. ", " .XooooooX. ", " .oooXX..XXooo. ", " XoXOOOOOOOOOOXoX ", " .oo.OOOOOOOOOOOO.oo. ", " oXOOOOOOOOOOOOOOOOXo. ", " oXOO++OOOOOOOOOOO++OXo. ", " Xo.OO+++OOOOOOOOO+++O.oX. ", " oXOOOO+++OOOOOOO+++OOOXo. ", " .oOOoo.O+++OOOOO+++OOOOOo.. ", " oXOOO.oo.+++OOO+++OOOOOOXo. ", " oXOOOOO.oo+++O+++OOOOOOOXoX.", " oXOOOOOOO.o+++++OOOOOOOOXoX.", " .o.OOOOOOOOOO+++OOOOOOOOO.oX.", " .o.OOOOOOOOO+++++OOOOOOOO.o.X", " oXOOOOOOOO+++.+++OOOOOOOXoXX", " oXOOOOOOO+++o.O+++OOOOOOXoX.", " oXOOOOOO+++Oo.OO+++OOOOOXoX.", " .oOOOOO+++OOo.OOO+++OOOOo.X ", " oXOOO+++OOOo.OOOO+++OOXoXX ", " Xo.OO++OOOOo.OOOOO++O.oXX. ", " oXOOOOOOOOo.OOOOOOOOXoX. ", " oXOOOOOOOo.OOOOOOOXoXX ", " .oo.OOOOOOOOOOOO.oo.X. ", " .XoXOOOOOOOOOOXoXXX. ", " ..oooXX..XXooo.XX. ", " ...XooooooX.XXX. ", " ..XXX..XXXXX. ", " ...XX.... "}; gtimer-2.0.0/icons/clock5.xpm0000644000175000017500000000072011353237102016223 0ustar cknudsencknudsen/* XPM */ static char * clock5_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOOOOOOoX ", " .oOOOOOOOOOo. ", " o.OOOOOOOOO.o ", ".oOOOOOOOOOOOo.", "XoOOOOO+OOOOOoX", ".oOOOOO+OOOOOo.", " o.OOOO+OOOO.o ", " .oOOOO+OOOOo. ", " XoOOO+OOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/clock4.xpm0000644000175000017500000000072011353237102016222 0ustar cknudsencknudsen/* XPM */ static char * clock4_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOOOOOOoX ", " .oOOOOOOOOOo. ", " o.OOOOOOOOO.o ", ".oOOOOOOOOOOOo.", "XoOOOOO+OOOOOoX", ".oOOOOOO+OOOOo.", " o.OOOOOO+OO.o ", " .oOOOOOOO+Oo. ", " XoOOOOOOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/clock6.xpm0000644000175000017500000000072011353237102016224 0ustar cknudsencknudsen/* XPM */ static char * clock6_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOOOOOOoX ", " .oOOOOOOOOOo. ", " o.OOOOOOOOO.o ", ".oOOOOOOOOOOOo.", "XoOOOOO+OOOOOoX", ".oOOOO+OOOOOOo.", " o.OO+OOOOOO.o ", " .oO+OOOOOOOo. ", " XoOOOOOOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/edit.xpm0000644000175000017500000000235411353237102015775 0ustar cknudsencknudsen/* XPM */ static char * edit_xpm[] = { "30 30 9 1", " s mask c none", ". c #88884C4C2828", "X c #C3C36D6D3939", "o c #000000000000", "O c #FFFFFFFFFFFF", "+ c #C0C0A0A05858", "@ c #616161616161", "# c #A7A7A7A7A7A7", "$ c #E6E6BFBF6969", " ", " .X", " ooooooooooooooooooooooooX..", " oOOOOOOOOOOOOOOOOOOOOOOo+. ", " oO@#O@#O@#O@#@#@OO@O@#O+++ ", " oOO#OO#O#OO#OO#O#O##OO+++# ", " oOOOOOOOOOOOOOOOOOOOO$++$# ", " oO@#O@OO@@#O@#O@O@#@O+++@# ", " oO#OO##O##OO#OO#O#OO$++o@# ", " oOOOOOOOOOOOOOOOOOOO+++o@# ", " oO@O@OO#@O@#@O@#@O@+++Oo@# ", " oO@#O#OOO##O#O#OO#$++$Oo@# ", " oOOOOOOOOOOOOOOOOO+++OOo@# ", " oO@#O@#@O@#O@#O@#+++#OOo@# ", " oOO#O#O#O#O#OO##O++$O#Oo@# ", " oOOOOOOOOOOOOOOO+++OOOOo@# ", " oO@O@@#@O@#O@O@O++$@#OOo@# ", " oOO#O#OO##O##OO+++#OO##o@# ", " oOOOOOOOOOOOOO+++OO@@@@o@# ", " oO@@O@#O@#O@##++@@#@#@#o@# ", " oO#O#O#O#O#OO+++O@@#@@Oo@# ", " oOOOOOOOOOOO$++$@#@@OOOo@# ", " oO@O@O#@O#@#+++@@@@#O@Oo@# ", " oOO###OO##O+++@@O#OO##Oo@# ", " oOOOOOOOOOO++@OOOOOOOOOo@# ", " oOOOOOOOOOOOOOOOOOOOOOOo@# ", " oooooooooooooooooooooooo@# ", " @@@@@@@@@@@@@@@@@@@@@@@@# ", " ######################## ", " "}; gtimer-2.0.0/icons/gtimer.xpm0000644000175000017500000000555111353237102016341 0ustar cknudsencknudsen/* XPM */ static char * gtimer_xpm[] = { "48 48 18 1", " c None", ". c #16162B2B4242", "X c #2C2C54548080", "o c #757575757575", "O c #2D2D2D2D2D2D", "+ c #000000000000", "@ c #CFCFCFCFCFCF", "# c #FFFFFFFFFFFF", "$ c #4F4F4F4F4F4F", "% c #9F9F9F9F9F9F", "& c #21213F3F6161", "* c #D6D6D6D6D6D6", "= c #9F9F9F9FFFFF", "- c #00000000FFFF", "; c #D5D5D5D5D5D5", ": c #3F3F3F3FFFFF", "> c #0F0F0F0FFFFF", ", c #CFCFCFCFFFFF", " .", " X.", " XX.", " XXX.", " oO++++++Oo XXXX.", " o++o@######@o++o XXXXX.", " ++$##############$++ XXXXXX.", " o+@##################@+$ XXXXXXX.", " +%####################%+ XXXXXXXX.", " %+########################+o XXXXXXXXX.", " ++##########################++XXXXXXXXX.", " O$############################$OXXXXXXXX.", " %+##############################+&XXXXXXX.", " +%##o###########################%OXXXXXXX.", " %+##++@###########################+&XXXXXX.", " +*##o+++@#########################*+&XXXXX.", " @+####@+++@##################=######+.&XXXX.", " oO#####@++++@################-=#####O.&XXXX.", " +*#######o+++@###############--=####*+&&XXX.", " ;+#########@+++o##############---=####+.&XXX.", " +##########@++++@############--:-=###+..XXX.", " oO#--##-#-=-=-------------------:--=##O..&XX.", " o$#-:##:#:=-=----------:::::::-->---=#$..&XX.", " o$#--##-#-=-=:-----------------------#$..&XX.", " o$#--##-#-=-=:---------------------->#$$.&XX.", " o$#--##-#-=-=:--------------------->=#$$O&XX.", " %+#--##-#-=-=-------------------:->=##+OO&XX.", " +################+++#########--:>,###+O.&XX.", " +################+++#########--:=####+O.&XX.", " +*###############+++#########--=####*+O.&XX.", " $O###############+++#########-=#####O$O.&XX.", " +###############+++#########=######+O..XXX.", " +*##############+++###############*+O.&XXX.", " o+##############+++###############+$O.&XXX.", " +%#############+++##############%OO.&XXXX.", " %+#############+++##############+OO.&XXXX.", " o+$###########+++############$+$O.&XXXXX.", " %++###########+++############++OO.&XXXXX.", " .+##########+++###########+OOO.&XXXXXX.", " XX&+%########+++#########%+$OO.&XXXXXXX.", " XXXX&++*######+++#######$+OOO..&XXXXXXXX.", " XXXXXX&++$######+#######$++$OO..XXXXXXXXX.", " XXXXXXXX&&.++o@######@o++$OOO..&XXXXXXXXXX.", " XXXXXXXXXXX&&.OO++++++O+OOO...&XXXXXXXXXXXX.", " XXXXXXXXXXXXXX&&.....OO.....&&&XXXXXXXXXXXXX.", " XXXXXXXXXXXXXXXXXX&&&&&&&&&&XXXXXXXXXXXXXXXXX.", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", "................................................"}; gtimer-2.0.0/icons/stop_all.xpm0000644000175000017500000000226111353237102016662 0ustar cknudsencknudsen/* XPM */ static char * stop_all_xpm[] = { "30 30 6 1", " s mask c none", ". c #FFFFFFFFFFFF", "X c #FFFFC6C6D0D0", "o c #FFFF00000000", "O c #757574747676", "+ c #9F9FA2A2A6A6", " ............ ", " .XooooooooooX. ", " .XooooooooooooX. ", " .XooooooooooooooX. ", " .XooooooooooooooooX. ", " .XooooooooooooooooooX. ", " .XooooooooooooooooooooX. ", " .XooooooooooooooooooooooX. ", ".XoX..Xo......o....oo....oX. ", ".oX....X............o.....o.O ", ".o..oo.Xoo..oo..oo..o..oX.X.O+", ".o..oooooo..oo..oo..o..oX.X.O+", ".oX..ooooo..oo..oo..o..oX.X.O+", ".ooX...ooo..oo..oo..o.....o.O+", ".oooX..Xoo..oo..oo..o....oo.O+", ".ooooX..oo..oo..oo..o..oooo.O+", ".ooooo..oo..oo..oo..o..oooo.O+", ".oX.oo..oo..oo..oo..o..oooo.O+", ".oX....Xoo..oo......o..oooo.O+", ".XX...Xooo..ooo....oo..oooX.O+", " .XooooooooooooooooooooooX.OO+", " .XooooooooooooooooooooX.OO+ ", " .XooooooooooooooooooX.OO+ ", " .XooooooooooooooooX.OO+ ", " .XooooooooooooooX.OO+ ", " .XooooooooooooX.OO+ ", " .XooooooooooX.OO+ ", " ............OO+ ", " OOOOOOOOOOOO+ ", " +++++++++++ "}; gtimer-2.0.0/icons/blank_clock.xpm0000644000175000017500000000065511353237102017314 0ustar cknudsencknudsen/* XPM */ static char * blank_clock_xpm[] = { "15 15 4 1", " c #FFFFFFFFFFFF", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", " .X. ", " .ooooo. ", " Xo. .oX ", " Xo oX ", " .o o. ", " o. .o ", ".o o.", "Xo oX", ".o o.", " o. .o ", " .o o. ", " Xo oX ", " Xo. .oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/splash.xpm0000644000175000017500000007025111353237102016343 0ustar cknudsencknudsen/* XPM */ static char *splash_xpm[] = { /* width height num_colors chars_per_pixel */ " 166 166 31 1", /* colors */ ". s mask c none", "# c #d5d5d5", "a c #d4d4d4", "b c #d3d3d3", "c c #d2d2d2", "d c #d1d1d1", "e c #d0d0d0", "f c #bfbfbf", "g c #7f7f7f", "h c #cfcfcf", "i c #000000", "j c #cbcbcb", "k c #3f3f3f", "l c #ffffff", "m c #b9b9b9", "n c #adadad", "o c #a1a1a1", "p c #909090", "q c #757575", "r c #6b6b6b", "s c #5e5e5e", "t c #515151", "u c #484848", "v c #bfbfff", "w c #7f7fff", "x c #3f3fff", "y c #0000ff", "z c #00007f", "A c #3f3fbf", "B c #363636", "C c #2d2d2d", /* pixels */ "...........................................................................################...........................................................................", "....................................................................###aaaabbbbbbbbbbbbbbbbaaaa###....................................................................", "...............................................................###aabbcccccddeeeeeeeeeeeeddcccccbbaa###...............................................................", "............................................................##aabcfggggggggggggggggfhhhhhhhhhheeedcccbaa##............................................................", ".........................................................#aafggiiiiiiiiiiiiiiiiiiiiiiiiggfjjjjjhhhheedcccbaa#.........................................................", "......................................................#aggiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiggjjjjjjhhheedccbaa#......................................................", "...................................................##gkiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiikgfjjjjjjhhhedccba##...................................................", ".................................................#gkiiiiiiiiiiiiiiiggggggggggggggggiiiiiiiiiiiiiiikgfffjjjjjhhedccba#.................................................", "...............................................fkiiiiiiiiiiiiggfllllllllllllllllllllllfggiiiiiiiiiiiikffffjjjjhheeccba#...............................................", "............................................#gkiiiiiiiiiigfllllllllllllllllllllllllllllllllfgiiiiiiiiiikgffffjjjjhhedcba##............................................", "...........................................giiiiiiiiikgllllllllllllllllllllllllllllllllllllllllgkiiiiiiiiigmffffjjjhhedcba#...........................................", ".........................................giiiiiiiikgllllllllllllllllllllllllllllllllllllllllllllllgkiiiiiiiigmmfffjjjjhedcba#.........................................", ".......................................fiiiiiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllfkiiiiiiiifmmmffjjjjhedcba#.......................................", ".....................................fkiiiiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiiiikfmmmffjjjhhecca##.....................................", "....................................giiiiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiiiignmmmffjjjhhecba#....................................", "..................................fkiiiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiiikfnmmmffjjjhedcb#...................................", ".................................giiiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfkiiiiiignnmmmffjjjhecba#.................................", "................................kiiiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiiiikonnmmffjjjhecca#................................", "..............................fiiiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiiifonnmmffjjhhdcb#...............................", ".............................giiiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiiiigoonmmffjjjhecb##.............................", "............................kiiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiiikoonnmmffjjhecba#............................", "...........................kiiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiikooonmmffjjhecba#...........................", "..........................kiiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiiikpoonnmffjjhedba#..........................", ".........................kiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfkiiiikpoonnmffjjhhdca#.........................", "........................kiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiikppoonmmfjjjhdca#........................", ".......................kiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiikppoonmmffjjhdca#.......................", "......................kiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiikppoonmmffjjhdca#......................", ".....................kiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiikppoonmmffjjhdca#.....................", "....................kiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiikppoonmmffjjhdca#....................", "...................kiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiiggpoonmmffjjhdba#...................", "..................fiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiifgpoonmmffjhecba...................", ".................fiiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiiiggpoonmmfjjhecb#..................", ".................kiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiikggpoonmmfjjhecb#.................", "................kiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiigggpoonmmfjjheca#................", "...............fiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiifggpoonmmfjjhdca#...............", "...............iiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiikqgppoonmffjjhdba...............", "..............kiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiigqgppoonmffjhecb#..............", ".............fiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiifqgpponnmfjjheca#.............", "............#iiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiikrqgpponmmfjjhdba.............", "............giiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiifrqgpoonmffjjecb#............", "...........fiiiiklllllllgkfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiirqggpoonmfjjheca#...........", "...........kiiiifllllllfiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiigrqgpponmmfjjhdb#...........", "..........fiiiiglllllllliiiikfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiisrqgpoonmffjheca#..........", ".........#kiiiillllllllllkiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiigsrggpoonmfjjhdba..........", ".........fiiiiglllllllllllfiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiisrqgpponmmfjjecb#.........", "........#kiiiillllllllllllllkiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiigsrqgpoonmfjjheca.........", "........fiiiiglllllllllllllllgiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiikssrggponmmfjjecb#........", ".......#giiiilllllllllllllllllfkiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiifsrqgpoonmffjheca........", ".......#iiiiklllllllllllllllllllgiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiktsrqgponmmfjjeca#.......", "......#giiiifllllllllllllllllllllfkiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiitsrqgpponmffjhdb#.......", "......#kiiiklllllllllllllllllllllllgiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiigtsrqgponmmfjjeca#......", "......aiiiigllllllllllllllllllllllllfkiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiktsrqgpponmfjjhdb#......", ".....#giiiilllllllllllllllllllllllllllgiiiikflllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiiutsrqgponmmfjheca......", ".....#iiiikllllllllllllllllllllllllllllfkiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiigtsrqgpoonmfjjhcb#.....", "....#aiiiigllllllllllllllllllllllllllllllgiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiikutsrggponmffjhec#.....", "....#giiiillllllllllllllllllllllllllllllllfkiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiiutsrqgpoonmfjjeca#....", "....akiiiillllllllllllllllllllllllllllllllllgiiiiklllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiigtssrgpponmfjjhdb#....", "...#aiiiiglllllllllllllllllllllllllllllllllllfkiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigutsrqgponmffjheca....", "...#fiiiiflllllllllllllllllllllllllllllllllllllgiiiiklllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllvlllllllllllllllllllgiiiiutsrqgpoonmfjjeca#...", "...#giiiilllllllllllllllllllllllllllllllllllllllfkiiiiflllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllwxllllllllllllllllllliiiikutsrgpponmfjjhdb#...", "...akiiiilllllllllllllllllllllllllllllllllllllllllgiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllwyxlllllllllllllllllliiiifutsrqgponmffjheb#...", "..#biiiigllllllllllllllllllllllllllllllllllllllllllfkiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllwyyxlllllllllllllllllgiiigutsrqgpoonmfjjeca...", "..#biiiigllllllllllllllllllllllllllllllllllllllllllllkiiiiklllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllwyyyxllllllllllllllllgiiigkutsrgpponmfjjhca#..", "..afiiiiflllllllllllllllllllllllllllllllllllllllllllllfiiiiiflllllllllllllllllllllllllllllllllllllllllllllllllllllllllllwyyyyxlllllllllllllllfiiiikutsrqgponmffjhdb#..", ".#agiiiillllllllllllllllllllllllllllllllllllllllllllllllkiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllwyyyyyxllllllllllllllliiiikutsrqgponmmfjheca..", ".#bgiiiilllllllllllllllllllllllllllllllllllllllllllllllllfiiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllwyyyyyyxlllllllllllllliiiikuttsrgpoonmfjjeca..", ".#bgiiiilllllllllllllllllllllllllllllllllllllllllllllllllllkiiiiklllllllllllllllllllllllllllllllllllllllllllllllllllllllwyyyyyyyxllllllllllllliiiifkutsrgpponmfjjhca#.", ".aciiiigllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiiiflllllllllllllllllllllllllllllllllllllllllllllllllllllwyyyyyyyyxllllllllllllgiiigkutsrqgponmffjhdb#.", ".aciiiigllllllvwwwwwwwllllwwwwwwllvwwwllvwwvlwwvvwwvvwwwwwwwwwzzzzzAwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxyyyyyyyyyxlllllllllllgiiigkutsrqgponmmfjhdb#.", "#aciiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxllllllllllgiiigkutssqgpoonmfjheca.", "#bciiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxlllllllllgiiigkkutsrgpponmfjjeca.", "#bdiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxllllllllgiiigkkutsrgpponmfjjeca#", "#bdiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxlllllllgiiigBkutsrqgponmfjjhca#", "#beiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxllllllgiiigBkutsrqgponmffjhdb#", "#ceiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxlllllgiiigBkutsrqgponmffjhdb#", "acfiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyywllllgiiigBkutssqgponmmfjhdb#", "aceiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxlllllgiiigBkkutsqgpoonmfjheb#", "aceiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxllllllgiiigBkkutsrgpoonmfjhec#", "aceiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxlllllllgiiigBkkutsrgpponmfjheca", "aceiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxllllllllgiiigBkkutsrgpponmfjheca", "aceiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxlllllllllgiiigBBkutsrgpponmfjjeca", "aceiiiigllllllwyyyyyyyllllyyyyyyllwyyyllwyywlyywwyywwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyxllllllllllgiiigBBkutsrgpponmfjjeca", "aceiiiigllllllvwwwwwwwllllwwwwwwllvwwwllvwwvlwwvvwwvvwwwwwwwwwwwwwwwwwwAzzzAwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxyyyyyyyyyxlllllllllllgiiigBBkutsrgpponmfjjeca", "acekiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyyyyyyyyxlllllllllllliiiifBBkutsrgpponmfjjeca", "acegiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyyyyyyyxllllllllllllliiiiCBBkutsrgpponmfjjeca", "acegiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyyyyyyxlllllllllllllliiiiCBBkutsrgpponmfjjeca", "acegiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyyyyyxllllllllllllllfiiiiBBkkutsrgpponmfjheca", "acejiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyyyyxlllllllllllllllgiiigBBkkutsrgpponmfjheca", "acejiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyyyxllllllllllllllllgiiigBBkkutsrgpoonmfjhec#", "acejiiiiillllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyyxllllllllllllllllliiiifBBkkutsqgpoonmfjheb#", "acehgiiiillllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwyxlllllllllllllllllliiiiCBBkutssqgponmmfjhdb#", "#cehgiiiiflllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllwxllllllllllllllllllfiiiiCBBkutsrqgponmffjhdb#", "#behjiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllvlllllllllllllllllllgiiigCBBkutsrqgponmffjhdb#", "#bdhjiiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiigCBBkutsrqgponmfjjhca#", "#bdhjgiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiiCBBkkutsrgpponmfjjeca#", "#bchjfiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiikCBBkkutsrgpponmfjjeca.", "#achjjiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiigCBBkutssqgpoonmfjheca.", ".acejjkiiiillllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiiCCBBkutsrqgponmmfjhdb#.", ".acehjfiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiikCCBBkutsrqgponmffjhdb#.", ".#behjfiiiiklllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiigCBBkkutsrgpponmfjjhca#.", ".#bdhjfgiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiiCCBBkuttsrgpoonmfjjeca..", ".#achjjfiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiikCCBBkutsrqgponmmfjheca..", "..acejjfkiiiillllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiifCBBkkutsrqgponmffjhdb#..", "..#cehjfgiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiikCCBBkkutsrgpponmfjjhca#..", "..#bdhjffiiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiigCCBBkutsrqgpoonmfjjeca...", "..#achjjfgiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiCCBBkkutsrqgponmffjheb#...", "...acehjfmiiiiillllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiigCCBBkkutsrgpponmfjjhdb#...", "...#bdhjffgiiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiCCCBBkutsrqgpoonmfjjeca#...", "...#bchjjfmiiiiifllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiigCCBBkkutsrqgponmffjheca....", "....acejjfmgiiiikllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiiCCCBBkutssrgpponmfjjhdb#....", "....#bdhjffmkiiiiflllllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiifCCBBkkutsrqgpoonmfjjeca#....", "....#bchjjfmfiiiiilllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllliiiikCCCBBkuutsrggponmffjhec#.....", ".....acehjfmmkiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiifCCBBkkutsrqgpoonmfjjhcb#.....", ".....#bdhjjfmniiiiiflllllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllfiiiigCCCBBkuutsrqgponmmfjheca......", ".....#acejjfmmfiiiiilllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllliiiikCCCBBkkutsrqgpponmfjjhdb#......", "......#bdhjjfmnkiiiikllllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllllkiiiifCCCBBkuutsrqgponmmfjjeca#......", "......#acejjfmmniiiiiglllllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiigCCCBBkkutsrqgpponmffjhdb#.......", ".......acdhjffmnfiiiiifllllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllllfiiiikCCCBBBkuttsrqgponmmfjjeca#.......", ".......#acejjfmmngiiiiiflllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllfiiiiiCCCCBBkkutsrqgpoonmffjheca........", "........acdhjjfmnokiiiiklllllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllllkiiiifCCCBBkkutssrggponmmfjjecb#........", "........#acejjfmmnoiiiiikllllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllllkiiiigCCCBBBkuttsrqgpoonmfjjheca.........", ".........abdhjjfmnofiiiiiklllllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllllkiiiikCCCBBBkkutsrqgpponmmfjjecb#.........", ".........#acehjffmnofiiiiikllllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllllkiiiikCCCCBBkkutssrggpoonmfjjhdba..........", "..........#bdhjjfmmnofiiiiiklllllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllllkiiiikCCCCBBkkuttsrqgpoonmffjheca#..........", "..........#acehjffmnoofiiiiikllllllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllllllkiiiikCCCCBBBkuutsrqgpponmmfjjhdb#...........", "...........#bchjjffmnopfiiiiiklllllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllllkiiiikCCCCBBBkuutsrqggpoonmffjheca#...........", "............acdhjjfmnnopfiiiiikflllllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllllfkiiiikCCCCBBBkkutssrqgpoonmffjjecb#............", "............#acehjffmnoopfiiiiiifllllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllllfiiiiikCCCCBBBkkutssrqgpponmmfjjhdca.............", ".............#bchjjffmnoopfiiiiiiglllllllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllllllgiiiiikCCCCBBBkkutssrqgpponnmfjjheca#.............", "..............acdhjjfmmnoppfiiiiiikllllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllllkiiiiikCCCCBBBkkutssrqgppoonmffjhecb#..............", "..............#acehjjfmnnoppgkiiiiiifllllllllllllllllllllllllllllllllllgiiiglllllllllllllllllllllllllllllllllllllfiiiiiigCCCCBBBkkuttsrqgppoonmffjjhdba...............", "...............#bcehjffmnooppggiiiiiiglllllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllllgiiiiiifCCCCBBBkkuttsrqggpoonmmfjjhdca#...............", "................abdhjjffmnooppgfiiiiiiiflllllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllllfiiiiiikCCCCCBBBkkuttsrqggpoonmmfjjheca#................", "................#acdhjjffmnooppgqkiiiiiikflllllllllllllllllllllllllllllgiiigllllllllllllllllllllllllllllllllfkiiiiiigCCCCBBBBkkutssrqggpoonmmfjjhecb#.................", ".................#acehjjfmmnooppgqfiiiiiiigllllllllllllllllllllllllllllfiiiglllllllllllllllllllllllllllllllgiiiiiikfCCCCBBBkkuutssrqggpoonmmfjjhecb#..................", "..................#bcehjjfmmnooppgqrkiiiiiiiglllllllllllllllllllllllllllkiiflllllllllllllllllllllllllllllgiiiiiiigCCCCCBBBkkuutssrqggpoonmmffjhhcba#..................", "...................#bcehjjfmmnooppgqrfkiiiiiiigllllllllllllllllllllllllllllllllllllllllllllllllllllllllgiiiiiiikfCCCCBBBBkkuutssrqggpoonmmffjjhdba#...................", "....................abcehjjfmmnooppgqqrgiiiiiiiikfllllllllllllllllllllllllllllllllllllllllllllllllllfkiiiiiiiifCCCCCBBBkkkuttssrqgppoonmmffjjhdca#....................", "....................#abdhhjjfmmnooppggqrsgiiiiiiiikgllllllllllllllllllllllllllllllllllllllllllllllgkiiiiiiiigCCCCCBBBBkkuuttsrrqgppoonmmffjjhdca#.....................", ".....................#abdhhjjfmmnooppggqrrsgiiiiiiiiikgllllllllllllllllllllllllllllllllllllllllgkiiiiiiiiigCCCCCBBBBkkkuutssrqqgppoonmmffjjhdca#......................", "......................#acdhhjjffmnnooppgqqrssgkiiiiiiiiiigfllllllllllllllllllllllllllllllllfgiiiiiiiiiikgCCCCCBBBBkkkuuttssrqggppoonmmffjjhdca#.......................", ".......................#abdehjjffmnnooppggqrrssfkiiiiiiiiiiiiggfllllllllllllllllllllllfggiiiiiiiiiiiikfCCCCCBBBBkkkuuttssrrqggppoonmmfjjjhdca#........................", "........................#abcehjjffmmnoopppgqqrssttgkiiiiiiiiiiiiiiiggggggggggggggggiiiiiiiiiiiiiiikgCCCCCBBBBBkkkuuuttssrqggppoonnmmfjjhhdca#.........................", ".........................#abcehjjffmmnnooppggqrrssttugkiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiikgCCCCCBBBBBBkkkuuuttssrrqggppoonnmffjjhedca#..........................", "..........................##bcehjjjffmnnoopppggqrrsstttuggiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiggCCCCBBBBBBBkkkkuutttssrrqggppooonmmffjjhecba#...........................", "............................#acdhhjjffmmnnooppggqqrrsstttuukfggiiiiiiiiiiiiiiiiiiiiiiiiggfCCCCBBBBBBBBkkkkkuutttssrrqqggppoonnmmffjjhecba#............................", ".............................#acdehjjfffmnnoooppggqqrrsssttuuukkkkfggggggggggggggggfBBBBBBBBBBBBBBBkkkkkuuuttsssrrqqggppooonmmffjjjhecba#.............................", "..............................#abcehjjjffmmnnoooppggqqrrssstttuuuukkkkkkBBBBBBBBBBBBBBBBBBBBBBkkkkkkuuuutttsssrrqqggppooonnmmffjjhhdcb#...............................", "................................#bcdehjjfffmmnnoopppgggqrrrsssttttuuuukkkkkkkkkkBBBBBBkkkkkkkkkkuuuuttttsssrrrqgggpppoonnmmffjjjhedca#................................", ".................................#abcehjjjffmmmnnoopppgggqqrrrssssttttuuuuuukkkkkkkkkkkkkkuuuuuuttttssssrrrqqgggpppoonnmmmffjjjhecba#.................................", "..................................##bcdehjjjffmmmnnooopppgggqqrrrssssstttttttuuuuuuuuuuuutttttttsssssrrrqqgggpppooonnmmmffjjjhedcb##..................................", "....................................#abcehhjjjffmmmnnoooppppgggqqqrrrsssssssttttttttttttttsssssssrrrqqqgggppppooonnmmmffjjjhhecba#....................................", ".....................................##accehjjjjffmmmnnooooppppggggqqqrrrrrssssssssssssssssrrrrrqqqggggppppoooonnmmmffjjjjhecca##.....................................", ".......................................#abcdehjjjjffmmmnnnoooopppppgggggqqqqqrrrrrrrrrrrrqqqqqgggggpppppoooonnnmmmffjjjjhedcba#.......................................", ".........................................#abcdehjjjjfffmmmnnnoooooppppppggggggggggggggggggggggppppppooooonnnmmmfffjjjjhedcba#.........................................", "...........................................#abcdehhjjjffffmmmnnnnoooooppppppppppppppppppppppppppooooonnnnmmmffffjjjhhedcba#...........................................", "............................................##abcdehhjjjjffffmmmmnnnnoooooooooppppppppppooooooooonnnnmmmmffffjjjjhhedcba##............................................", "...............................................#abccehhhjjjjffffmmmmmnnnnnnnoooooooooooooonnnnnnnmmmmmffffjjjjjhheccba##..............................................", ".................................................#abccdehhjjjjjffffffmmmmmmmnnnnnnnnnnnnnnmmmmmmmffffffjjjjjhhedccba#.................................................", "...................................................##abccdehhhjjjjjjfffffffmmmmmmmmmmmmmmmmfffffffjjjjjjhhhedccba##...................................................", "......................................................#aabccdeehhjjjjjjjjjfffffffffffffffffffjjjjjjjjhheedccbaa#......................................................", ".........................................................#aabcccdeehhhhjjjjjjjjjjjjjjjjjjjjjjjjhhhheedcccbaa#.........................................................", "............................................................##aabcccdeeehhhhhhhhhhhhhhhhhhhhhheeedcccbaa##............................................................", "...............................................................###aabbcccccddeeeeeeeeeeeeddcccccbbaa###...............................................................", "....................................................................###aaaabbbbbbbbbbbbbbbbaaaa###....................................................................", "...........................................................................################..........................................................................." }; gtimer-2.0.0/icons/new.xpm0000644000175000017500000000240111353237102015632 0ustar cknudsencknudsen/* XPM */ static char * new_xpm[] = { "30 30 10 1", " s mask c none", ". c #FFFFFFFFFFFF", "X c #FFFFFFFF0000", "o c #A7A7A7A7A7A7", "O c #88884C4C2828", "+ c #C3C36D6D3939", "@ c #616161616161", "# c #000000000000", "$ c #C0C0A0A05858", "% c #E6E6BFBF6969", " . Xo. X ", " X XoX X O+", " ..@..###################+OO", " .X@@@Xo.................#$O ", "Xoo@@X@@oXX@o.@o@o@..@.@o.$$$ ", " .X@@@X...o..o..o.o.oo..$$$o ", " @.@X.................%$$%o ", " #XoXX@..@@o.@o.@.@o@.$$$@o ", " #XoX.oo.oo..o..o.o..%$$#@o ", " #..X................$$$#@o ", " #.@.@..o@.@o@.@o@.@$$$.#@o ", " #.@o.o...oo.o.o..o%$$%.#@o ", " #.................$$$..#@o ", " #.@o.@o@.@o.@o.@o$$$o..#@o ", " #..o.o.o.o.o..oo.$$%.o.#@o ", " #...............$$$....#@o ", " #.@.@@o@.@o.@.@.$$%@o..#@o ", " #..o.o..oo.oo..$$$o..oo#@o ", " #.............$$$..@@@@#@o ", " #.@@.@o.@o.@oo$$@@o@o@o#@o ", " #.o.o.o.o.o..$$$.@@o@@.#@o ", " #...........%$$%@o@@...#@o ", " #.@.@.o@.o@o$$$@@@@o.@.#@o ", " #..ooo..oo.$$$@@.o..oo.#@o ", " #..........$$@.........#@o ", " #......................#@o ", " ########################@o ", " @@@@@@@@@@@@@@@@@@@@@@@@o ", " oooooooooooooooooooooooo ", " "}; gtimer-2.0.0/icons/gtimer2.xpm0000644000175000017500000000540111353237102016415 0ustar cknudsencknudsen/* XPM */ static char * gtimer2_xpm[] = { "48 48 13 1", " c None", ". c #16162B2B4242", "X c #2C2C54548080", "o c #757575757575", "O c #2D2D2D2D2D2D", "+ c #000000000000", "@ c #CFCFCFCFCFCF", "# c #FFFFFFFFFFFF", "$ c #4F4F4F4F4F4F", "% c #9F9F9F9F9F9F", "& c #21213F3F6161", "* c #D6D6D6D6D6D6", "= c #D5D5D5D5D5D5", " .", " X.", " XX.", " XXX.", " oO++++++Oo XXXX.", " o++o@######@o++o XXXXX.", " ++$##############$++ XXXXXX.", " o+@##################@+$ XXXXXXX.", " +%####################%+ XXXXXXXX.", " %+########################+o XXXXXXXXX.", " ++##########################++XXXXXXXXX.", " O$############################$OXXXXXXXX.", " %+##############################+&XXXXXXX.", " +%#@o###########################%OXXXXXXX.", " %+##++@###########################+&XXXXXX.", " +*##o+++@#########################*+&XXXXX.", " @+####@+++@#########################+.&XXXX.", " oO#####@++++@#######################O.&XXXX.", " +*#######o+++@######################*+&&XXX.", " =+#########@+++o######################+.&XXX.", " +##########@++++@####################+..XXX.", " oO############o+++@###################O..&XX.", " o$#############@+++o@#################$..&XX.", " o$##############@o++o#################$..&XX.", " o$################+++#################$$.&XX.", " o$################+++#################$$O&XX.", " %+################+++#################+OO&XX.", " +################+++#################+O.&XX.", " +################+++#################+O.&XX.", " +*###############+++################*+O.&XX.", " $O###############+++################O$O.&XX.", " +###############+++################+O..XXX.", " +*##############+++###############*+O.&XXX.", " o+##############+++###############+$O.&XXX.", " +%#############+++##############%OO.&XXXX.", " %+#############+++##############+OO.&XXXX.", " o+$###########+++############$+$O.&XXXXX.", " %++###########+++############++OO.&XXXXX.", " .+##########+++###########+OOO.&XXXXXX.", " XX&+%########+++#########%+$OO.&XXXXXXX.", " XXXX&++*######+++#######$+OOO..&XXXXXXXX.", " XXXXXX&++$######+#######$++$OO..XXXXXXXXX.", " XXXXXXXX&&.++o@######@o++$OOO..&XXXXXXXXXX.", " XXXXXXXXXXX&&.OO++++++O+OOO...&XXXXXXXXXXXX.", " XXXXXXXXXXXXXX&&.....OO.....&&&XXXXXXXXXXXXX.", " XXXXXXXXXXXXXXXXXX&&&&&&&&&&XXXXXXXXXXXXXXXXX.", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", "................................................"}; gtimer-2.0.0/icons/clock3.xpm0000644000175000017500000000072011353237102016221 0ustar cknudsencknudsen/* XPM */ static char * clock3_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOOOOOOoX ", " .oOOOOOOOOOo. ", " o.OOOOOOOOO.o ", ".oOOOOOOOOOOOo.", "XoOOOOO+++++OoX", ".oOOOOOOOOOOOo.", " o.OOOOOOOOO.o ", " .oOOOOOOOOOo. ", " XoOOOOOOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/clock8.xpm0000644000175000017500000000072011353237102016226 0ustar cknudsencknudsen/* XPM */ static char * clock8_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOOOOOOoX ", " .oO+OOOOOOOo. ", " o.OO+OOOOOO.o ", ".oOOOO+OOOOOOo.", "XoOOOOO+OOOOOoX", ".oOOOOOOOOOOOo.", " o.OOOOOOOOO.o ", " .oOOOOOOOOOo. ", " XoOOOOOOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/annotate.xpm0000644000175000017500000000223411353237102016656 0ustar cknudsencknudsen/* XPM */ static char * annotate_xpm[] = { "30 30 5 1", " s mask c none", ". c #00000000BEBE", "X c #909090909090", "o c #616161616161", "O c #62626262CECE", " ", " ", " ", " .X ", " ...X ", " ...oX ", " ..o..XX ", " ..o..oX ", " O..o..OX ", " ..OoO..oX ", " O..oXX..OX ", " ..OoX O..oX ", " ..oX ..oX ", " ..OoX O..X ", " ..oX ..oX ", " O...........OX ", " .............o ", " ..ooooooooo..oX ", " ..OoXXXXXXXXO..X ", " ..oXX ..oX ", " O..oX ..OX ", " ..OoX O..oX ", " O..oXX ..OX ", " ..OoX O..oX ", " ..oXX ..oX ", " ooX ooX ", " X XX ", " ", " ", " "}; gtimer-2.0.0/icons/gtimer.gif0000644000175000017500000000123311353237102016273 0ustar cknudsencknudsenGIF89a00+B,Tuuu---OOO!?a֟??!Made with GIMP! ,00@`$dih*jD F,4d:;@(ԎEH|`ĬEQzp84{%$k 65st6|t$|np*N!lm7xd.N%G9=MbIʴ"E2.#)$ 6`;gtimer-2.0.0/icons/blank.xpm0000644000175000017500000000054611353237102016140 0ustar cknudsencknudsen/* XPM */ static char * blank_xpm[] = { "15 15 1 1", " s mask c none", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; gtimer-2.0.0/icons/about.xpm0000644000175000017500000000546011353237102016163 0ustar cknudsencknudsen/* XPM */ static char * about_xpm[] = { "48 48 15 1", " s mask c none", ". c #757575757575", "X c #2D2D2D2D2D2D", "o c #000000000000", "O c #CFCFCFCFCFCF", "+ c #FFFFFFFFFFFF", "@ c #4F4F4F4F4F4F", "# c #9F9F9F9F9F9F", "$ c #D6D6D6D6D6D6", "% c #9F9F9F9FFFFF", "& c #00000000FFFF", "* c #D5D5D5D5D5D5", "= c #3F3F3F3FFFFF", "- c #0F0F0F0FFFFF", "; c #CFCFCFCFFFFF", " ", " ", " ", " ", " .XooooooX. ", " .oo.O++++++O.oo. ", " oo@++++++++++++++@oo ", " .oO++++++++++++++++++Oo@ ", " o#++++++++++++++++++++#o ", " #o++++++++++++++++++++++++o. ", " oo++++++++++++++++++++++++++oo ", " X@++++++++++++++++++++++++++++@X ", " #o++++++++++++++++++++++++++++++o. ", " o#++.+++++++++++++++++++++++++++#X ", " #o++ooO+++++++++++++++++++++++++++o. ", " o$++.oooO+++++++++++++++++++++++++$o. ", " Oo++++OoooO++++++++++++++++++%++++++o@. ", " .X+++++OooooO++++++++++++++++&%+++++X@. ", " o$+++++++.oooO+++++++++++++++&&%++++$o.. ", " *o+++++++++Oooo.++++++++++++++&&&%++++o@. ", " o++++++++++OooooO++++++++++++&&=&%+++o@@ ", " .X++++++++++++.oooO+++++++++++&&=&&%++X.@. ", " .@+&=++=+=%&%&&&&&&&&&&=======&&-&&&%+@@@. ", " .@+&&++&+&%&%=&&&&&&&&&&&&&&&&&&&&&&&+@@@. ", " .@+&&++&+&%&%=&&&&&&&&&&&&&&&&&&&&&&-+@@@. ", " .@+&&++&+&%&%=&&&&&&&&&&&&&&&&&&&&&-%+@@X. ", " #o++++++++++++++++ooo+++++++++&&=&-%++oXX. ", " o++++++++++++++++ooo+++++++++&&=-;+++oX@. ", " o++++++++++++++++ooo+++++++++&&=%++++oX@. ", " o$+++++++++++++++ooo+++++++++&&%++++$oX@. ", " @X+++++++++++++++ooo+++++++++&%+++++X@X@. ", " o+++++++++++++++ooo+++++++++%++++++oX@@ ", " o$++++++++++++++ooo+++++++++++++++$oX@. ", " .o++++++++++++++ooo+++++++++++++++o@X@. ", " o#+++++++++++++ooo++++++++++++++#XX@. ", " #o+++++++++++++ooo++++++++++++++oXX@. ", " .o@+++++++++++ooo++++++++++++@o@X@. ", " #oo+++++++++++ooo++++++++++++ooXX@. ", " .o++++++++++ooo+++++++++++oXXX@. ", " .o#++++++++ooo+++++++++#o@XX@. ", " .oo$++++++ooo+++++++@oXXX@@. ", " .oo@++++++o+++++++@oo@XX@@ ", " ..@oo.O++++++O.oo@XXX@@. ", " ..@XXooooooXoXXX@@@. ", " ..@@@@@XX@@@@@... ", " .......... ", " ", " "}; gtimer-2.0.0/icons/clock7.xpm0000644000175000017500000000072011353237102016225 0ustar cknudsencknudsen/* XPM */ static char * clock7_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOOOOOOoX ", " .oOOOOOOOOOo. ", " o.OOOOOOOOO.o ", ".oOOOOOOOOOOOo.", "XoO+++++OOOOOoX", ".oOOOOOOOOOOOo.", " o.OOOOOOOOO.o ", " .oOOOOOOOOOo. ", " XoOOOOOOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/error.xpm0000644000175000017500000000537711353237102016211 0ustar cknudsencknudsen/* XPM */ static char * error_xpm[] = { "53 47 4 1", " s mask c none", ". c #FFFF32323232", "X c #FFFFFFFFFFFF", "o c #000000000000", " ", " ", " ... ", " ..... ", " ..... ", " ....... ", " ....... ", " ......... ", " ........... ", " ........... ", " ......X...... ", " .....XXX..... ", " ......XXX...... ", " ......XXXXX..... ", " ......XXXXX...... ", " ......XXXXXXX...... ", " .....XXXoooXXX..... ", " ......XXoooooXX...... ", " .....XXXoooooXXX..... ", " ......XXXoooooXXX...... ", " ......XXXXoooooXXXX..... ", " .....XXXXXoooooXXXXX..... ", " ......XXXXXoooooXXXXX..... ", " .....XXXXXXoooooXXXXXX..... ", " ......XXXXXXoooooXXXXXX...... ", " ......XXXXXXXoooooXXXXXXX..... ", " ......XXXXXXXoooooXXXXXXX...... ", " ......XXXXXXXXoooooXXXXXXXX..... ", " .....XXXXXXXXXoooooXXXXXXXXX..... ", " ......XXXXXXXXXoooooXXXXXXXXX..... ", " .....XXXXXXXXXXoooooXXXXXXXXXX..... ", " ......XXXXXXXXXXoooooXXXXXXXXXX...... ", " .....XXXXXXXXXXXXoooXXXXXXXXXXXX..... ", " ......XXXXXXXXXXXXXXXXXXXXXXXXXXX...... ", " ......XXXXXXXXXXXXXoooXXXXXXXXXXXXX..... ", " .....XXXXXXXXXXXXXoooooXXXXXXXXXXXXX..... ", " ......XXXXXXXXXXXXXoooooXXXXXXXXXXXXX..... ", " .....XXXXXXXXXXXXXXoooooXXXXXXXXXXXXXX..... ", " ......XXXXXXXXXXXXXXXoooXXXXXXXXXXXXXXX...... ", " .......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... ", " ............................................... ", " ................................................ ", " ................................................. ", " ................................................. ", " ............................................... ", " ", " "}; gtimer-2.0.0/icons/start.xpm0000644000175000017500000000230311353237102016177 0ustar cknudsencknudsen/* XPM */ static char * start_xpm[] = { "30 30 7 1", " s mask c none", ". c #909090909090", "X c #616161616161", "o c #000000000000", "O c #FFFFFFFFFFFF", "+ c #00000000FFFF", "@ c #8B8B8B8BFFFF", " ", " .. ", " .XooooooX. ", " .oooXX..XXooo. ", " XoXOOOOOOOOOOXoX ", " .oo.OOOOOOOOOOOO.oo. ", " oXOOOOOOOOOOOOOOOOXo. ", " oXOOOOOOOOOOOOOOOOOOXo. ", " Xo.OOOOOOOOOOOOOOOOOO.oX. ", " oXOOOOOOOOOOOOOOOOOOOOXo. ", " .oOOoo.OOOOOOOOOOO+OOOOOo.. ", " oXOOO.oo.OOOOOOOOO++OOOOXo. ", " oXOOOOO.oo.OOOOOOO++@OOOXoX.", " oXO++O+O+O+@+++++++++@OOXoX.", " .o.O++O+O+O+@++++++++++@O.oX.", " .o.O++O+O+O+@++++++++++@O.o.X", " oXO++O+O+O+@+++++++++@OOXoXX", " oXOOOOOOOOOOo.OOOO++@OOOXoX.", " oXOOOOOOOOOOo.OOOO++OOOOXoX.", " .oOOOOOOOOOOo.OOOO+OOOOOo.X ", " oXOOOOOOOOOo.OOOOOOOOOXoXX ", " Xo.OOOOOOOOo.OOOOOOOO.oXX. ", " oXOOOOOOOOo.OOOOOOOOXoX. ", " oXOOOOOOOo.OOOOOOOXoXX ", " .oo.OOOOOOOOOOOO.oo.X. ", " .XoXOOOOOOOOOOXoXXX. ", " ..oooXX..XXooo.XX. ", " ...XooooooX.XXX. ", " ..XXX..XXXXX. ", " ...XX.... "}; gtimer-2.0.0/icons/clock1.xpm0000644000175000017500000000072011353237102016217 0ustar cknudsencknudsen/* XPM */ static char * clock1_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOO+OOOoX ", " .oOOOO+OOOOo. ", " o.OOOO+OOOO.o ", ".oOOOOO+OOOOOo.", "XoOOOOO+OOOOOoX", ".oOOOOOOOOOOOo.", " o.OOOOOOOOO.o ", " .oOOOOOOOOOo. ", " XoOOOOOOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/icons/clock2.xpm0000644000175000017500000000072011353237102016220 0ustar cknudsencknudsen/* XPM */ static char * clock2_xpm[] = { "15 15 6 1", " s mask c none", ". c #D3D3D3D3D3D3", "X c #888888888888", "o c #000000000000", "O c #F8F8F8F8F8F8", "+ c #FFFF00000000", " .X. ", " .ooooo. ", " Xo.OOO.oX ", " XoOOOOOOOoX ", " .oOOOOOOO+Oo. ", " o.OOOOOO+OO.o ", ".oOOOOOO+OOOOo.", "XoOOOOO+OOOOOoX", ".oOOOOOOOOOOOo.", " o.OOOOOOOOO.o ", " .oOOOOOOOOOo. ", " XoOOOOOOOoX ", " Xo.OOO.oX ", " .ooooo. ", " .X. "}; gtimer-2.0.0/INSTALL0000644000175000017500000001722711353237102014245 0ustar cknudsencknudsenBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). 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 at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' 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. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. 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. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM 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 host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. 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. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--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. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. gtimer-2.0.0/install-sh0000755000175000017500000001273611353237102015220 0ustar cknudsencknudsen#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 gtimer-2.0.0/LICENSE0000644000175000017500000000002111353425724014212 0ustar cknudsencknudsenSee COPYING file gtimer-2.0.0/main.c0000644000175000017500000027025111353247143014310 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, craig@k5n.us, http://www.k5n.us * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 07-Aug-2008 Ver 1.1.7 - Support UTF-8 using GTK+ ver. > 2.4.0 * 15-Jul-2005 Add -weekstart to configure the first day of the * week. (Russ Allbery) * 31-May-2005 When exiting, only change the window size * configuration if gdk_window_get_size succeeds. * (Russ Allbery) * 18-Apr-2005 Fully stop timing and update the icons properly * after a reset from the idle window. * Subtract off the five minute initial period when * reverting after an idle. (Russ Allbery) * 17-Apr-2005 Added configurability of the browser. (Russ Allbery) * 02-Jan-2004 Add time increment and decrement by one minute. * Add more key shortcuts for increment/decrement. * 64-bit fixes for time changes. (Klaus Ethgen) * 02-Jan-2004 Add a callback to clear the paste buffer. (Klaus * Ethgen) * 13-Mar-2003 Added cut/copy/paste in new Edit menu. * 06-Mar-2003 Added support for -resume option which will start * timing the same task that was being timed last * time gtimer exited. * 01-Mar-2003 Added projects * 09-Mar-2000 Improved idle handling. On revert, the tasks are * no longer reloaded from the data files and the * display will not be resorted. * Added a "resume" option for idles that continues * timing but throws out all the idle time. * 21-May-1999 Moved around menu (added tools and help) * 19-May-1999 Added ability to check for new version. * This is a really COOL feature :-) * 13-May-1999 Allow users to view ChangeLog. * 13-May-1999 Added handle box to menu. * 04-May-1999 Oops. Fixed label that said "inc 5 seconds" to * say "inc 5 minutes". * 30-Apr-1999 Added support help options: -h, -help, --help * 30-Apr-1999 Added support version options: -v, -version, --version * 30-Apr-1999 Added support for -start option. * 25-Mar-1999 Made animated clock in clist optional. * 25-Mar-1999 Applied some WIN32 patches provided by * Thomas Epperly * 25-Mar-1999 Fixed bug where -nosplash would cause the main window * to not remember the correct window size. * 25-Mar-1999 Fixed bugs when using start/stop/etc. before any * tasks have been created. * 24-Mar-1999 Made toolbar optional * 24-Mar-1999 Added tearoff menus * 18-Mar-1999 Internationalization * 18-Mar-1999 Added support for X11 screen saver extension * for idle detect. (This will detect keyboard * usage rather than just mouse usage.) * 16-Mar-1999 Added back in support for GTK 1.0 via autoconf. * (Stole some of the autoconf stuff from xhippo-0.7.) * GTK 1.1/1.2 handles clist double-click events * completely different than GTK 1.0. * 24-Feb-1999 Added unhide function (finally... have had the * hide function for a while now.) * 11-Feb-1999 Modified accelerator key code. * Fixed to have task pulldown menu with right mouse * button (API changed from GTK+1.0) * 08-Feb-1999 Added changes for accelerator keys provided by * Matt Martin * 02-Feb-1999 Remember main window width & height * 21-Jan-1999 Added gtk-1.1 support (received patches from * Stephen Webb & Jim Bray). * 11-Nov-1998 Added support for hiding tasks * 13-Jul-1998 Make double-click stop timing all other tasks and * start timing the selected task. * 09-May-1998 Added autosave option * 07-May-1998 Finished idle detect option * 08-Apr-1998 Set the application icon within the application. * Display a different icon depening on whether or not * we are timing any tasks. * 06-Apr-1998 Began adding code for idle detect * 05-Apr-1998 Fixed vertical resize (status was resizing) * code submitted by Zach Beane (xach@mint.net) * 05-Apr-1998 Added splash screen. * 01-Apr-1998 Added status bar and total hours for today at * the bottom of the main window. * 18-Mar-1998 Reduce flicker in task list when changing sort * code submitted by Zach Beane (xach@mint.net) * 18-Mar-1998 Release 0.95 * 18-Mar-1998 Added calls to gtk_window_set_wmclass so the windows * behave better for window managers. * code submitted by ObiTuarY (Obituary@cybernet.be) * 17-Mar-1998 Fixed handing if $HOME is not defined. * 16-Mar-1998 Changed name to "GTimer" * updated application icon * 15-Mar-1998 Added memory debugging calls (memdebug.h). * (The memdebug library is something I wrote myself * a few years ago for another project. It keeps * track of all malloc/realloc/free calls and can * show you what's been allocated but not freed with * the md_print_all () function. Email me if you * would like this library.) * 15-Mar-1998 Added annotate icon and ability to add annotations * (dated comments) to tasks. * 13-Mar-1998 Click on column header to sort by that column. * 13-Mar-1998 Did some code redesign. Pulldown menus setup * from the TTPulldown structure. * 13-Mar-1998 Add pulldown menu for right mouse click on a task. * Added functions to add time and remove time from * a task. * 13-Mar-1998 Add pulldown menu for right mouse click on a task. * code submitted by Zach Beane (xach@mint.net) * 13-Mar-1998 Double-click on a task brings up the edit window * code submitted by Zach Beane (xach@mint.net) * 13-Mar-1998 Fixed handling of date change when time passes * midnight. * 11-Mar-1998 Rearranged UI. Added toolbar with icons. * Added "Report" to menubar. * 25-Feb-1998 Created * ****************************************************************************/ #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include #ifdef HAVE_SCREEN_SAVER_EXT #include #endif #include "project.h" #include "task.h" #include "gtimer.h" #include "config.h" #include "tcpt.h" #include "http.h" // PV: #include "custom-list.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif /* check for a new version every 30 days */ #define VERSION_CHECK_INTERVAL (3600 * 24 * 30) /* splash icon */ #include "icons/splash.xpm" /* app icons */ #include "icons/gtimer.xpm" #include "icons/gtimer2.xpm" /* timer icon */ #include "icons/clock1.xpm" #include "icons/clock2.xpm" #include "icons/clock3.xpm" #include "icons/clock4.xpm" #include "icons/clock5.xpm" #include "icons/clock6.xpm" #include "icons/clock7.xpm" #include "icons/clock8.xpm" #include "icons/blank.xpm" /* toolbar icons */ #include "icons/start.xpm" #include "icons/stop.xpm" #include "icons/stop_all.xpm" #include "icons/annotate.xpm" #include "icons/new.xpm" #include "icons/edit.xpm" GtkWidget *main_window = NULL; static GtkWidget *splash_window = NULL; static int move_to_task = -1; static GtkWidget *idle_prompt_window = NULL; static GtkWidget *option_menu_items[4]; static time_t splash_until, last_save; static int modified_since_save = 0; static int splash_seconds = 2; GtkWidget *toolbar = NULL; GtkWidget *task_list = NULL; GtkWidget *status = NULL; guint status_id = 0; static time_t lastMessageTime = 0; GtkWidget *total_label = NULL; static char total_str[20]; GdkPixmap *icons[8], *blankicon, *appicon, *appicon2; GdkBitmap *icon_masks[8], *blankicon_mask, *appicon_mask, *appicon2_mask; #if OLD_GTK #else GtkAccelGroup* mainag; #endif static sockfd connection = -1; static gint gdk_input_id = -1; static int version_check_is_auto = 0; static int cutBuffer = 0; /* Seconds from cut/copy/set-to-zero/revert/resume*/ static int messageDisplayTime = 15; /* how long to leave messages up */ typedef struct { char *name; int width; int max_width; GtkJustification justify; gboolean resizeable; GtkWidget *widget; } list_column_def; static int sort_forward = 1; static int last_sort = 0; static int rebuilding_list = 0; int today_year, today_mon, today_mday; int config_midnight_offset = 0; int config_max_idle = 0; int config_idle_enabled = 0; int config_autosave_enabled = 1; int config_toolbar_enabled = 1; int config_animate_enabled = 1; int config_autosave_interval = (60*15); /* 15 minutes */ int config_start_of_week = 0; char *taskdir = NULL; char *config_file = NULL; char *gtkrc = NULL; int selected_task = -1; int pulldown_selected_task = -1; /* task selected with right mouse button */ TaskData **tasks; int num_tasks = 0; int num_timing = 0; TaskData **visible_tasks; /* not hidden */ int num_visible_tasks; list_column_def task_list_columns[4] = { { "Project", 150, 0, GTK_JUSTIFY_LEFT, (gboolean)1, NULL }, { "Task", 150, 0, GTK_JUSTIFY_LEFT, (gboolean)1, NULL }, { "Today", 70, 70, GTK_JUSTIFY_RIGHT, (gboolean)0, NULL }, { "Total", 70, 70, GTK_JUSTIFY_RIGHT, (gboolean)0, NULL } }; /* ** Local functions */ void update_list (); static void build_list (); static void about_callback ( GtkAction *act ); static void website_callback ( GtkAction *act ); static void changelog_callback ( GtkAction *act ); static void save_callback ( GtkAction *act ); static void exit_callback ( GtkAction *act ); static void start_callback ( GtkAction *act ); static void switch_to_callback ( GtkWidget *widget, gpointer data ); static void stop_callback ( GtkAction *act ); static void stop_all_callback ( GtkAction *act ); static void task_add_callback ( GtkAction *act ); static void task_edit_callback ( GtkAction *act ); static void task_hide_callback ( GtkAction *act ); static void task_unhide_callback ( GtkAction *act ); static void task_delete_callback ( GtkAction *act ); static void task_cut_callback ( GtkAction *act ); static void task_copy_callback ( GtkAction *act ); static void task_paste_callback ( GtkAction *act ); static void task_clear_callback ( GtkAction *act ); static void increment_time_callback ( GtkWidget *widget, gpointer data ); static void decrement_time_callback ( GtkWidget *widget, gpointer data ); static void project_add_callback ( GtkAction *act ); static void project_edit_callback ( GtkAction *act ); //static void report_callback ( GtkWidget *widget, gpointer data ); static void annotate_callback ( GtkAction *act ); static void idle_reset_callback ( GtkWidget *widget, gpointer data ); static void idle_cancel_callback ( GtkWidget *widget, gpointer data ); static void idle_resume_callback ( GtkWidget *widget, gpointer data ); static void column_selected_callback ( GtkWidget *widget, int col ); static void toolbar_toggle_callback ( GtkToggleAction *act ); static void idle_toggle_callback ( GtkToggleAction *act ); static void autosave_toggle_callback ( GtkToggleAction *act ); static void animate_toggle_callback ( GtkToggleAction *act ); static void check_version_callback ( GtkAction *act ); static void set_browser_callback ( GtkAction *act ); // PV: static void shift_time_callback ( GtkAction *act ); static void report2_callback ( GtkAction *act ); /* ** Structure for defining the the pulldown menus. */ typedef struct { int label_index; void (*callback)(); gpointer data; gint acckey; GdkModifierType accmod; } TTPulldown; // PV: move main menu to GtkActionEntry Structures (see GTK+ Reference Manual, // Example 55 - 59) // globally accessible UI Manager object GtkUIManager *uimanager; // Menu Entries - because it is neccessary to translete each menu item as separate word, I decide // to assign unique prefix to each menu column and merge these prefixes to menu items. // Prefix will be hidden during translation (see function mainmenu_transalate). // Last character in prefix is '|', I hope this character never appears as a part of displayed word. // If I'll not be right in future, please change it to another character in menu and function // mainmenu_translate. // Reccomendation: It will be better _do_not_translate_ these prefixes. static const GtkActionEntry MM_NormalEntries[] = { { "FileMenu", NULL, gettext_noop("MM|_File") }, { "EditMenu", NULL, gettext_noop("MM|_Edit") }, { "OptionsMenu", NULL, gettext_noop("MM|_Options") }, { "TaskMenu", NULL, gettext_noop( "MM|_Task") }, { "ProjectMenu", NULL, gettext_noop("MM|_Project") }, { "ReportMenu", NULL, gettext_noop("MM|_Report") }, { "ToolsMenu", NULL, gettext_noop("MM|_Tools") }, { "HelpMenu", NULL, gettext_noop("MM|_Help") }, { "FM_Save", GTK_STOCK_SAVE, gettext_noop("FM|_Save"), "S", gettext_noop("Save actual state"), G_CALLBACK(save_callback) }, { "FM_Exit", GTK_STOCK_QUIT, gettext_noop("FM|_Exit"), "Q", gettext_noop("Exit program"), G_CALLBACK(exit_callback) }, { "EM_Cut", GTK_STOCK_CUT, gettext_noop("EM|C_ut Time"), "X", gettext_noop("Cut actual time from line to buffer"), G_CALLBACK(task_cut_callback) }, { "EM_Copy", GTK_STOCK_COPY, gettext_noop("EM|_Copy Time"), "C", gettext_noop("Copy actual time from line to buffer"), G_CALLBACK(task_copy_callback) }, { "EM_Paste", GTK_STOCK_PASTE, gettext_noop("EM|_Paste Time"), "V", gettext_noop("Paste actual time from buffer to actual line"), G_CALLBACK(task_paste_callback) }, { "EM_Clear", GTK_STOCK_CLEAR, gettext_noop("EM|Clear _Buffer"), NULL, gettext_noop("Clear buffer"), G_CALLBACK(task_clear_callback) }, { "OM_Browser", NULL, gettext_noop("OM|_Browser ..."), NULL, gettext_noop("Set your preferred web browser"), G_CALLBACK(set_browser_callback) }, { "TM_Start", NULL, gettext_noop("TM|_Start Timing"), "S", gettext_noop("Start timing of selected task"), G_CALLBACK(start_callback) }, { "TM_Stop", NULL, gettext_noop("TM|S_top Timing"), "X", gettext_noop("Stop timing of selected task"), G_CALLBACK(stop_callback) }, { "TM_Stopall", NULL, gettext_noop("TM|Stop A_ll Timing"), "T", gettext_noop("Stop timing of all running tasks"), G_CALLBACK(stop_all_callback) }, { "TM_New", NULL, gettext_noop("TM|_New..."), "N", gettext_noop("Create new task"), G_CALLBACK(task_add_callback) }, { "TM_Edit", NULL, gettext_noop("TM|_Edit... "), "E", gettext_noop("Edit selected task"), G_CALLBACK(task_edit_callback) }, { "TM_Annotate", NULL, gettext_noop("TM|_Annotate..."), "A", gettext_noop("Add annotation"), G_CALLBACK(annotate_callback) }, { "TM_Hide", NULL, gettext_noop("TM|_Hide"), "H", gettext_noop("Hide task"), G_CALLBACK(task_hide_callback) }, { "TM_Unhide", NULL, gettext_noop("TM|_Unhide... "), "U", gettext_noop("Unhide tasks"), G_CALLBACK(task_unhide_callback) }, { "TM_Delete", NULL, gettext_noop("TM|_Delete"), "A", gettext_noop("Add annotation"), G_CALLBACK(task_delete_callback) }, { "TM_Inc1", NULL, gettext_noop("TM|_Increment 1 minute"), "I", gettext_noop("Increment time"), G_CALLBACK(shift_time_callback) }, { "TM_Inc5", NULL, gettext_noop("TM|I_ncrement 5 minutes"), "I", gettext_noop("Increment time"), G_CALLBACK(shift_time_callback) }, { "TM_Inc30", NULL, gettext_noop("TM|In_crement 30 minute"), "I", gettext_noop("Increment time"), G_CALLBACK(shift_time_callback) }, { "TM_Dec1", NULL, gettext_noop("TM|Decrement _1 minute"), "D", gettext_noop("Decrement time"), G_CALLBACK(shift_time_callback) }, { "TM_Dec5", NULL, gettext_noop("TM|Decrement _5 minutes"), "D", gettext_noop("Decrement time"), G_CALLBACK(shift_time_callback) }, { "TM_Dec30", NULL, gettext_noop("TM|Decrement _30 minutes"), "D", gettext_noop("Decrement time"), G_CALLBACK(shift_time_callback) }, { "TM_Zero", NULL, gettext_noop("TM|Set to _Zero"), "0", gettext_noop("Clear time of selected task"), G_CALLBACK(shift_time_callback) }, { "PM_New", NULL, gettext_noop("PM|_New..."), NULL, gettext_noop("New Project"), G_CALLBACK(project_add_callback) }, { "PM_Edit", NULL, gettext_noop("PM|_Edit..."), NULL, gettext_noop("Edit Project"), G_CALLBACK(project_edit_callback) }, { "RM_Daily", NULL, gettext_noop("RM|_Daily..."), NULL, gettext_noop("Daily Report"), G_CALLBACK(report2_callback) }, { "RM_Weekly", NULL, gettext_noop("RM|_Weekly..."), NULL, gettext_noop("Weekly Report"), G_CALLBACK(report2_callback) }, { "RM_Monthly", NULL, gettext_noop("RM|_Monthly..."), NULL, gettext_noop("Monthly Report"), G_CALLBACK(report2_callback) }, { "RM_Yearly", NULL, gettext_noop("RM|_Yearly..."), NULL, gettext_noop("Yearly Report"), G_CALLBACK(report2_callback) }, { "TL_Check", NULL, gettext_noop("TL|_Check for New Version..."), NULL, gettext_noop("Keep your program updated"), G_CALLBACK(check_version_callback) }, { "HM_About", NULL, gettext_noop("HM|_About..."), NULL, gettext_noop("About"), G_CALLBACK(about_callback) }, { "HM_ViewChL", NULL, gettext_noop("HM|View _Change log..."), NULL, gettext_noop("Changelog"), G_CALLBACK(changelog_callback) }, { "HM_VisitWeb", NULL, gettext_noop("HM|Visit _Website..."), NULL, gettext_noop("Open web browser"), G_CALLBACK(website_callback) } }; /* PV: Add Toggle Entries * This structure is initialized with FALSE initial values. Before activating it will * be modified according to configuration settings. This is why this structure is not * declared as 'const' */ //static const GtkToggleActionEntry MM_ToggleEntries[] = { static GtkToggleActionEntry MM_ToggleEntries[] = { { "OM_Toolbar", NULL, gettext_noop("OM|_Toolbar"), NULL, NULL, G_CALLBACK(toolbar_toggle_callback), FALSE }, { "OM_Animate", NULL, gettext_noop("OM|_Animate"), NULL, NULL, G_CALLBACK(animate_toggle_callback), FALSE }, { "OM_Idle", NULL, gettext_noop("OM|_Idle Detect"), NULL, NULL, G_CALLBACK(idle_toggle_callback), FALSE }, { "OM_Autosave", NULL, gettext_noop("OM|Auto _Save"), NULL, NULL, G_CALLBACK(autosave_toggle_callback), FALSE }, }; // according to MM_ToggleEntries set following constants: #define MM_TOGGLE_TOOLBAR 0 #define MM_TOGGLE_ANIMATE 1 #define MM_TOGGLE_IDLE 2 #define MM_TOGGLE_AUTOSAVE 3 //PV: XML description: static const char * menustring = "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " ""; /* ** Structure for defining the toolbar */ // PV: Move it to UI manager too? Later ... typedef struct { char *label; char *tooltip_index; gchar **icon_data; void (*callback)(); GtkWidget *widget; gpointer data; } TTToolButton; #define TOOLBAR_START_BUTTON 0 #define TOOLBAR_STOP_BUTTON 1 #define TOOLBAR_STOP_ALL_BUTTON 2 TTToolButton main_toolbar[] = { { gettext_noop("Start"), gettext_noop("Start Timing the Selected Task"), start_xpm, start_callback, NULL, NULL }, { gettext_noop("Stop"), gettext_noop("Stop Timing the Selected Task"), stop_xpm, stop_callback, NULL, NULL }, { gettext_noop("Stop All"), gettext_noop("Stop Timing All Tasks"), stop_all_xpm, stop_all_callback, NULL, NULL }, { gettext_noop("Annotate"), gettext_noop("Add Annotation to Selected Task"), annotate_xpm, annotate_callback, NULL, NULL }, { gettext_noop("Add"), gettext_noop("Add New Task"), new_xpm, task_add_callback, NULL, NULL }, { gettext_noop("Edit"), gettext_noop("Edit Name of the Selected Task") , edit_xpm, task_edit_callback, NULL, NULL }, { NULL, 0, NULL, NULL, NULL, NULL } }; #ifdef WIN32 static void convert_backslash ( filename ) char *filename; { while ( *filename ){ if ( *filename == '\\' ) *filename = '/'; filename++; } } #endif /* ** Get the currently selected task. If the user has used the right mouse ** button to create a pulldown menu, then pulldown_selected_task will ** be set. This routine should called only once per callback since ** we reset the value of pulldown_selected_task. */ static int get_selected_task () { int ret; if ( pulldown_selected_task >= 0 ) { ret = pulldown_selected_task; pulldown_selected_task = -1; } else ret = selected_task; return ret; } static int my_strcasecmp ( char *str1, char *str2 ) { char *ptr1, *ptr2, *ptr; int ret; ptr1 = strdup ( str1 ); ptr2 = strdup ( str2 ); for ( ptr = ptr1; *ptr != '\0'; ptr++ ) { *ptr = toupper ( *ptr ); } for ( ptr = ptr2; *ptr != '\0'; ptr++ ) { *ptr = toupper ( *ptr ); } ret = strcmp ( ptr1, ptr2 ); free ( ptr1 ); free ( ptr2 ); return ( ret ); } /* * Sort by project id, which will put oldest projects first, newest * projects last. */ static int sort_task_by_project_id ( td1, td2 ) TaskData **td1; TaskData **td2; { TaskData *tda = *td1; TaskData *tdb = *td2; int ret; /* put tasks with no projects (-1) at the end of the list, most recent projects at the top */ if ( tda->task->project_id > tdb->task->project_id ) ret = -1; else if ( tda->task->project_id < tdb->task->project_id ) ret = 1; else ret = 0; if ( sort_forward ) return ( ret ); else return ( - ret ); } /* * Sort by project name. */ static int sort_task_by_project_name ( td1, td2 ) TaskData **td1; TaskData **td2; { TaskData *tda = *td1; TaskData *tdb = *td2; int ret; /* put tasks with no projects (-1) at the end of the list, most recent projects at the top */ if ( tda->task->project_id < 0 ) ret = -1; else if ( tdb->task->project_id < 0 ) ret = 1; else ret = my_strcasecmp ( tda->project_name, tdb->project_name ); if ( sort_forward ) return ( ret ); else return ( - ret ); } static int sort_task_by_name ( td1, td2 ) TaskData **td1; TaskData **td2; { TaskData *tda = *td1; TaskData *tdb = *td2; int ret; ret = ( my_strcasecmp ( tda->task->name, tdb->task->name ) ); if ( sort_forward ) return ( ret ); else return ( - ret ); } static int sort_task_by_id ( td1, td2 ) TaskData **td1; TaskData **td2; { TaskData *tda = *td1; TaskData *tdb = *td2; int ret; /* put most recent tasks at the top */ if ( tda->task->number > tdb->task->number ) ret = -1; else if ( tda->task->number < tdb->task->number ) ret = 1; else ret = 0; if ( sort_forward ) return ( ret ); else return ( - ret ); } static int sort_task_by_today ( td1, td2 ) TaskData **td1; TaskData **td2; { TaskData *tda = *td1; TaskData *tdb = *td2; int ret = 0; if ( tda->last_today_int > tdb->last_today_int ) ret = 1; else if ( tda->last_today_int < tdb->last_today_int ) ret = -1; else if ( tda->last_today_int == tdb->last_today_int ) ret = ( (void *)tda < (void *)td2 ); if ( sort_forward ) return ( - ret ); else return ( ret ); } static int sort_task_by_total ( td1, td2 ) TaskData **td1; TaskData **td2; { TaskData *tda = *td1; TaskData *tdb = *td2; int ret = 0; if ( tda->last_total_int > tdb->last_total_int ) ret = 1; else if ( tda->last_total_int < tdb->last_total_int ) ret = -1; else if ( tda->last_total_int == tdb->last_total_int ) ret = ( (void *)tda < (void *)td2 ); if ( sort_forward ) return ( - ret ); else return ( ret ); } /* ** Transfer all the time for tasks currently being timed into the ** Task data structure so the reports will have access to it easily. */ static void update_tasks () { int i; time_t now, diff; time ( &now ); for ( i = 0; i < num_visible_tasks; i++ ) { if ( visible_tasks[i]->timer_on ) { diff = now - visible_tasks[i]->on_since; visible_tasks[i]->todays_entry->seconds += diff; visible_tasks[i]->on_since = now; } } } /* ** Save all the tasks to their files. */ void save_all () { update_tasks (); taskSaveAll ( taskdir ); projectSaveAll ( taskdir ); time ( &last_save ); modified_since_save = 0; } /* Delete window handler */ gint delete_event ( widget, event, data ) GtkWidget *widget; GdkEvent *event; gpointer data; { save_all (); configSaveAttributes ( config_file ); #ifdef GTIMER_MEMDEBUG configClear (); #endif return ( TRUE ); } static void exit_callback ( GtkAction *act ) { gint w, h; char temp[128]; int loop; /* save task data */ save_all (); /* save window size */ w = 0; h = 0; gdk_window_get_size ( GTK_WIDGET ( main_window )->window, &w, &h ); if ( w != 0 && h != 0 ) { configSetAttributeInt ( CONFIG_MAIN_WINDOW_WIDTH, w ); configSetAttributeInt ( CONFIG_MAIN_WINDOW_HEIGHT, h ); } /* get columns widths in main window */ w = GTK_CLIST ( task_list )->column[0].width; configSetAttributeInt ( CONFIG_MAIN_WINDOW_PROJECT_WIDTH, w ); w = GTK_CLIST ( task_list )->column[1].width; configSetAttributeInt ( CONFIG_MAIN_WINDOW_TASK_WIDTH, w ); w = GTK_CLIST ( task_list )->column[2].width; configSetAttributeInt ( CONFIG_MAIN_WINDOW_TODAY_WIDTH, w ); w = GTK_CLIST ( task_list )->column[3].width; configSetAttributeInt ( CONFIG_MAIN_WINDOW_TOTAL_WIDTH, w ); /* keep track of which tasks were being timed in case the user starts up with -resume next time */ temp[0] = '\0'; for ( loop = 0; loop < num_visible_tasks; loop++ ) { if ( visible_tasks[loop]->timer_on ) { if ( strlen ( temp ) ) strcat ( temp, "," ); sprintf ( temp + strlen ( temp ), "%d", visible_tasks[loop]->task->number ); } } configSetAttribute ( CONFIG_LAST_TIMED_TASKS, temp ); /* save config settings */ configSaveAttributes ( config_file ); #ifdef GTIMER_MEMDEBUG free ( config_file ); configClear (); #endif gtk_main_quit (); } /* ** Set toolbar buttons to sensitive/insensitive based ** on our current status. */ static void update_toolbar_buttons () { if ( num_timing ) { gtk_widget_set_sensitive ( GTK_WIDGET ( main_toolbar[TOOLBAR_STOP_BUTTON].widget ), 1 ); gtk_widget_set_sensitive ( GTK_WIDGET ( main_toolbar[TOOLBAR_STOP_ALL_BUTTON].widget ), 1 ); } else { gtk_widget_set_sensitive ( GTK_WIDGET ( main_toolbar[TOOLBAR_STOP_BUTTON].widget ), 0 ); gtk_widget_set_sensitive ( GTK_WIDGET ( main_toolbar[TOOLBAR_STOP_ALL_BUTTON].widget ), 0 ); } if ( num_visible_tasks ) { gtk_widget_set_sensitive ( GTK_WIDGET ( main_toolbar[TOOLBAR_START_BUTTON].widget ), 1 ); } else { gtk_widget_set_sensitive ( GTK_WIDGET ( main_toolbar[TOOLBAR_START_BUTTON].widget ), 0 ); } } static void save_callback ( GtkAction *act ) { showMessage ( gettext("All data saved") ); save_all (); } static void about_callback ( GtkAction *act ) { char text[1024]; sprintf ( text, "GTimer\n%s\n%s: %s (%s)\n%s\nGTK %s: %d.%d.%d\n\n", GTIMER_COPYRIGHT, gettext("Version"), GTIMER_VERSION, GTIMER_VERSION_DATE, GTIMER_URL, gettext("Version"), gtk_major_version, gtk_minor_version, gtk_micro_version ); strcat ( text, gettext("Author") ); sprintf ( text + strlen ( text ), ":\nCraig Knudsen\ncraig@k5n.us\n\n" ); create_confirm_window ( CONFIRM_ABOUT, gettext("About"), text, gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } static void changelog_callback ( GtkAction *act ) { display_changelog (); } static void website_callback ( GtkAction *act ) { char *path, *command; if ( configGetAttribute ( CONFIG_BROWSER, &path ) < 0 ) path = "mozilla"; command = (char *) malloc ( strlen ( path ) + 128 ); if ( strstr ( path, "%s" ) ) sprintf ( command, path, GTIMER_URL ); else sprintf ( command, "%s %s", path, GTIMER_URL ); if ( system ( command ) != 0 ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Error communicating with browser."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } free ( command ); } static void task_add_callback ( GtkAction *act ) { create_task_edit_window ( NULL ); } static void task_edit_callback ( GtkAction *act ) { int st = get_selected_task (); if ( st < 0 || ! num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task to edit."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { create_task_edit_window ( visible_tasks[st] ); } } static void task_hide_callback ( GtkAction *act ) { TaskData *td; int i, st; st = get_selected_task (); if ( st < 0 || ! num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task to hide."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { td = visible_tasks[st]; taskSetOption ( td->task, GTIMER_TASK_OPTION_HIDDEN ); td->timer_on = 0; for ( i = st; i < num_visible_tasks; i++ ) { if ( i + 1 < num_visible_tasks ) visible_tasks[i] = visible_tasks[i + 1]; } num_visible_tasks--; update_list (); gtk_clist_remove ( GTK_CLIST ( task_list ), st ); showMessage ( gettext("Task hidden") ); } } static void task_unhide_callback ( GtkAction *act ) { int st; st = get_selected_task (); if ( num_tasks == num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("There are no hidden tasks."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { update_list (); create_unhide_window (); } } static void delete_confirm_callback ( widget, data ) GtkWidget *widget; gpointer data; { TaskData *td = (TaskData *)data; int ret, loop, tasknumber; char msg[500]; if ( ( ret = taskDelete ( td->task, taskdir ) ) ) { sprintf ( msg, "%s:\n%s", gettext("Error deleting task"), taskErrorString ( ret ) ); create_confirm_window ( CONFIRM_ERROR, gettext("Error"), msg, gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } /* delete from visible_tasks[] and the list window */ tasknumber = -1; for ( loop = 0; loop < num_visible_tasks && tasknumber < 0; loop++ ) { if ( visible_tasks[loop] == td ) tasknumber = loop; } if ( tasknumber >= 0 ) { gtk_clist_remove ( GTK_CLIST ( task_list ), tasknumber ); for ( loop = tasknumber; loop < num_visible_tasks; loop++ ) { if ( loop + 1 < num_visible_tasks ) visible_tasks[loop] = visible_tasks[loop + 1]; } } /* delete from tasks[] */ tasknumber = -1; for ( loop = 0; loop < num_tasks && tasknumber < 0; loop++ ) { if ( tasks[loop] == td ) tasknumber = loop; } if ( tasknumber >= 0 ) { for ( loop = tasknumber; loop < num_tasks; loop++ ) { if ( loop + 1 < num_tasks ) tasks[loop] = tasks[loop + 1]; } } free ( td ); num_tasks--; num_visible_tasks--; showMessage ( gettext("Task removed") ); update_list (); } static void task_delete_callback ( GtkAction *act ) { int st = get_selected_task (); if ( st < 0 || ! num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task to delete."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { create_confirm_window ( CONFIRM_CONFIRM, gettext("Delete Task?"), gettext("Are you sure you want\nto delete this task?"), gettext("Ok"), gettext("Cancel"), NULL, delete_confirm_callback, NULL, NULL, (char *)visible_tasks[st] ); } } static void start_callback ( GtkAction *act ) { TaskData *td; int st = get_selected_task (); if ( st < 0 || ! num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task to start timing."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { td = visible_tasks[st]; if ( td->timer_on ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Task is already being timed."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { td->timer_on = 1; time ( &td->on_since ); if ( td->todays_entry == NULL ) td->todays_entry = taskNewTimeEntry ( td->task, today_year, today_mon, today_mday ); update_list (); num_timing++; if ( num_timing == 1 ) gdk_window_set_icon ( GTK_WIDGET ( main_window )->window, NULL, appicon, appicon_mask ); } } update_toolbar_buttons (); } static void stop_callback ( GtkAction *act ) { TaskData *td; time_t now, diff; int st = get_selected_task (); if ( st < 0 || ! num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task to stop timing."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { td = visible_tasks[st]; if ( ! td->timer_on ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Task is not being timed."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { td->timer_on = 0; time ( &now ); diff = now - td->on_since; td->todays_entry->seconds += diff; td->on_since = 0; update_list (); num_timing--; if ( num_timing == 0 ) gdk_window_set_icon ( GTK_WIDGET ( main_window )->window, NULL, appicon2, appicon2_mask ); } } update_toolbar_buttons (); } static void annotate_callback ( GtkAction *act ) { int st = get_selected_task (); if ( st < 0 || ! num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task to annotate."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { create_annotate_window ( visible_tasks[st] ); } } static void stop_all_callback ( GtkAction *act ) { TaskData *td; time_t now, diff; int loop; get_selected_task (); /* reset pulldown task selection */ for ( loop = 0; loop < num_visible_tasks; loop++ ) { td = visible_tasks[loop]; if ( td->timer_on ) { td->timer_on = 0; time ( &now ); diff = now - td->on_since; td->todays_entry->seconds += diff; td->on_since = 0; } } if ( num_timing ) gdk_window_set_icon ( GTK_WIDGET ( main_window )->window, NULL, appicon2, appicon2_mask ); num_timing = 0; update_list (); update_toolbar_buttons (); } static void switch_to_callback ( widget, data ) GtkWidget *widget; gpointer data; { TaskData *td; time_t now, diff; int loop; int new_icon = 1; int st = get_selected_task (); for ( loop = 0; loop < num_visible_tasks; loop++ ) { td = visible_tasks[loop]; if ( td->timer_on ) { td->timer_on = 0; time ( &now ); diff = now - td->on_since; td->todays_entry->seconds += diff; td->on_since = 0; new_icon = 0; num_timing--; } } td = visible_tasks[st]; td->timer_on = 1; time ( &td->on_since ); if ( td->todays_entry == NULL ) td->todays_entry = taskNewTimeEntry ( td->task, today_year, today_mon, today_mday ); update_list (); num_timing = 1; if ( new_icon ) gdk_window_set_icon ( GTK_WIDGET ( main_window )->window, NULL, appicon, appicon_mask ); update_list (); update_toolbar_buttons (); } static void toolbar_toggle_callback ( GtkToggleAction *act ) { int active = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION( act )); if ( active ) { configSetAttributeInt ( CONFIG_TOOLBAR_STATUS, 1 ); gtk_widget_show ( toolbar ); } else { configSetAttributeInt ( CONFIG_TOOLBAR_STATUS, 0 ); gtk_widget_hide ( toolbar ); } config_toolbar_enabled = active; } static void animate_toggle_callback ( GtkToggleAction *act ) { int active = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION( act )); if ( active ) configSetAttributeInt ( CONFIG_ANIMATE, 1 ); else configSetAttributeInt ( CONFIG_ANIMATE, 0 ); config_animate_enabled = active; } static void idle_toggle_callback ( GtkToggleAction *act ) { int active = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION( act )); if ( active ) configSetAttributeInt ( CONFIG_IDLE_ON, 1 ); else configSetAttributeInt ( CONFIG_IDLE_ON, 0 ); config_idle_enabled = active; } static void autosave_toggle_callback ( GtkToggleAction *act ) { int active = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION( act )); if ( active ) configSetAttributeInt ( CONFIG_AUTOSAVE, 1 ); else configSetAttributeInt ( CONFIG_AUTOSAVE, 0 ); config_autosave_enabled = active; } static void set_browser_callback ( GtkAction *act ) { create_browser_edit_window (); } static void project_add_callback ( GtkAction *act ) { create_project_edit_window ( NULL ); } static void project_edit_callback ( GtkAction *act ) { int st = get_selected_task (); Project *p; if ( st < 0 || ! num_visible_tasks ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { if ( visible_tasks[st]->task->project_id < 0 ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("The selected task does not\nhave a project."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { p = projectGet ( visible_tasks[st]->task->project_id ); create_project_edit_window ( p ); } } } static void report2_callback ( GtkAction *act ) { // report_type rt = (report_type) data; typedef struct { gchar *name; report_type rt; } TTarray; const TTarray acts[] = { {"RM_Daily", REPORT_TYPE_DAILY}, {"RM_Weekly", REPORT_TYPE_WEEKLY}, {"RM_MOnthly", REPORT_TYPE_MONTHLY}, {"RM_Yearly", REPORT_TYPE_YEARLY} }; const gchar *aname = gtk_action_get_name(GTK_ACTION(act)); report_type rt = REPORT_TYPE_NONE ; int i; for ( i = 0 ; i <= 3 ; i++ ) { if ( !strcmp ( acts[i].name, aname ) ) { rt = acts[i].rt; break; } } if ( rt == REPORT_TYPE_NONE ) { fprintf( stderr, "Gtimer: Unknown report (%s)!\n", aname); return; } #if PV_DEBUG g_message("Report 2 cback start"); #endif update_tasks (); create_report_window ( rt ); #if PV_DEBUG g_message("Report 2 cback end"); #endif } /* * Display the time in the cutBuffer in the status area. */ static void showCutBuffer () { char temp[48]; int cb, h, m, s; cb = cutBuffer; h = cb / 3600; cb %= 3600; m = cb / 60; cb %= 60; s = cb; sprintf ( temp, "%s %02d:%02d:%02d", gettext ("Cut/Paste buffer is" ), h, m, s ); showMessage ( temp ); } static void adjust_task_time ( offset ) int offset; { TaskData *td; int st = get_selected_task (); if ( st < 0 ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected\na task to adjust the time for."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { update_tasks (); td = visible_tasks[st]; if ( td->todays_entry == NULL ) td->todays_entry = taskNewTimeEntry ( td->task, today_year, today_mon, today_mday ); if ( offset == 0 ) { /* set to zero */ cutBuffer = td->todays_entry->seconds; td->todays_entry->seconds = 0; } else if ( offset < 0 ) { /* decrement */ if ( td->todays_entry->seconds < ( 0 - offset ) ) { cutBuffer += td->todays_entry->seconds; td->todays_entry->seconds = 0; } else { cutBuffer += - offset; td->todays_entry->seconds += offset; } } else { td->todays_entry->seconds += offset; } modified_since_save = 1; update_list (); } } /* ** Revert to where we were when we first noticed that the user was idle. */ static void idle_reset_callback ( widget, data ) GtkWidget *widget; gpointer data; { int loop; int timeBeforeReset, timeAfterReset; time_t now; idle_prompt_window = NULL; time ( &now ); /* add up total time for today */ for ( timeBeforeReset = loop = 0; loop < num_tasks; loop++ ) { if ( tasks[loop]->todays_entry ) { timeBeforeReset += tasks[loop]->todays_entry->seconds; if ( tasks[loop]->timer_on ) { timeBeforeReset += ( now - tasks[loop]->on_since ); } } } taskRestoreAll (); for ( timeAfterReset = loop = 0; loop < num_tasks; loop++ ) { if ( tasks[loop]->timer_on ) { tasks[loop]->timer_on = 0; tasks[loop]->on_since = 0; num_timing--; } if ( tasks[loop]->todays_entry ) { timeAfterReset += tasks[loop]->todays_entry->seconds; } } update_list (); update_toolbar_buttons (); /* reset icon */ gdk_window_set_icon ( GTK_WIDGET ( main_window )->window, NULL, appicon2, appicon2_mask ); /* * Store however much time we just removed in the cut buffer, so the * user can Edit->Paste to apply the time to a different task */ cutBuffer = timeBeforeReset - timeAfterReset; if ( cutBuffer < 0 ) cutBuffer = 0; showCutBuffer (); } static void task_clear_callback ( GtkAction *act ) { /* set to zero */ cutBuffer = 0; showCutBuffer (); } static void idle_cancel_callback ( widget, data ) GtkWidget *widget; gpointer data; { idle_prompt_window = NULL; } /* ** Revert to the data that was last saved to file (which we did when ** we first noticed the user was idle.) and continue timing. ** Save the idle time in the cut/paste buffer. */ static void idle_resume_callback ( widget, data ) GtkWidget *widget; gpointer data; { int loop; int timeBeforeReset, timeAfterReset; time_t now; time ( &now ); idle_prompt_window = NULL; /* add up total time for today */ for ( timeBeforeReset = loop = 0; loop < num_tasks; loop++ ) { if ( tasks[loop]->todays_entry ) { timeBeforeReset += tasks[loop]->todays_entry->seconds; if ( tasks[loop]->timer_on ) { timeBeforeReset += ( now - tasks[loop]->on_since ); } } } taskRestoreAll (); for ( timeAfterReset = loop = 0; loop < num_visible_tasks; loop++ ) { if ( visible_tasks[loop]->timer_on ) time ( &visible_tasks[loop]->on_since ); if ( tasks[loop]->todays_entry ) timeAfterReset += tasks[loop]->todays_entry->seconds; } update_list (); /* * Store however much time we just removed in the cut buffer, so the * user can Edit->Paste to apply the time to a different task */ cutBuffer = timeBeforeReset - timeAfterReset; if ( cutBuffer < 0 ) cutBuffer = 0; showCutBuffer (); } static void task_cut_callback ( GtkAction *act ) { adjust_task_time ( 0 ); showCutBuffer (); } static void task_copy_callback ( GtkAction *act ) { TaskData *td; int st = get_selected_task (); cutBuffer = 0; if ( st < 0 ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected a task."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { update_tasks (); td = visible_tasks[st]; if ( td->todays_entry != NULL ) { cutBuffer = td->todays_entry->seconds; } showCutBuffer (); } } static void task_paste_callback ( GtkAction *act ) { if ( cutBuffer > 0 ) { adjust_task_time ( cutBuffer ); } /* note that we don't reset the cut buffer back to zero here. this allows them to paste more than once. */ showCutBuffer (); } static void increment_time_callback ( widget, data ) GtkWidget *widget; gpointer data; { int offset = GPOINTER_TO_INT(data); adjust_task_time ( offset ); } static void decrement_time_callback ( widget, data ) GtkWidget *widget; gpointer data; { int offset = GPOINTER_TO_INT(data); adjust_task_time ( 0 - offset ); showCutBuffer (); } static void shift_time_callback ( GtkAction *act ) { typedef struct { gchar *name; int shift; } TTarray; int time_shift; //Shift in seconds int i; const TTarray acts[] = { {"TM_Inc1", 60 }, {"TM_Inc5", 300 }, {"TM_Inc30", 1800 }, {"TM_Dec1", -60 }, {"TM_Dec5", -300 }, {"TM_Dec30",-1800 }, {"TM_Zero", 0 } }; const gchar *aname = gtk_action_get_name(GTK_ACTION(act)); time_shift = -1; for ( i = 0 ; i <= 6 ; i++ ) { // g_message( "%s x %s", acts[i].name, aname); if ( !strcmp ( acts[i].name, aname ) ) { time_shift = acts[i].shift; break; } } if ( time_shift == -1 ) { fprintf( stderr, "Gtimer: Unknown action (%s)!\n", aname); return; } #if PV_DEBUG g_message("Shift_time: %d s", time_shift); #endif adjust_task_time(time_shift); if (time_shift < 0 ) showCutBuffer(); } static void read_http_socket ( data, source, condition ) gpointer data; gint source; GdkInputCondition condition; { httpProcessRead ( connection ); } /* ** This function will be called when the HTTP data is ready. ** It could actually be called multiple times each time a read() ** completes, but since the version info is so short, this will most ** likely never happen. */ static void read_version ( data, len ) char *data; int len; /* NOT NULL-terminated! */ { char *ptr, *data2, *msg, version[30]; time_t now; char timestr[20]; if ( len == 0 ) { gdk_input_remove ( gdk_input_id ); httpKillConnection ( connection ); connection = -1; } else { data2 = (char *) malloc ( len + 1 ); strncpy ( data2, data, len ); data2[len] = '\0'; if ( strstr ( data2, "Not Found" ) != NULL || strstr ( data2, "Not found" ) != NULL || strstr ( data2, "not found" ) != NULL ) { if ( ! version_check_is_auto ) create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("This service is no longer available."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { ptr = strstr ( data2, "GTimer Version" ); if ( ptr == NULL ) { if ( ! version_check_is_auto ) create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Unable to determine available GTimer version."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { ptr += 15; /* skip over "GTimer Version" */ sprintf ( version, "%s (%s)", GTIMER_VERSION, GTIMER_VERSION_DATE ); if ( strncmp ( version, ptr, strlen ( version ) ) == 0 ) { if ( ! version_check_is_auto ) create_confirm_window ( CONFIRM_ABOUT, gettext("Version"), gettext("You have the most recent version of GTimer."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else if ( strncmp ( version, ptr, strlen ( version ) ) > 0 ) { create_confirm_window ( CONFIRM_ABOUT, gettext("Version"), gettext("Strange.... You seem to have a more recent version\nof GTimer than is available on the server."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { msg = (char *) malloc ( 200 + strlen ( ptr ) ); sprintf ( msg, "%s:\n\n%s\n%s:\n\n%s", gettext("There is a new version of GTimer available"), ptr, gettext("You can download it at"), GTIMER_URL ); create_confirm_window ( CONFIRM_ABOUT, gettext("Version"), msg, gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); free ( msg ); } } } gdk_input_remove ( gdk_input_id ); httpKillConnection ( connection ); connection = -1; } /* calcuate the next time we will need to do this check */ time ( &now ); now += VERSION_CHECK_INTERVAL; sprintf ( timestr, "%ul", (unsigned int)now ); configSetAttribute ( CONFIG_NEXT_VERSION_CHECK, timestr ); version_check_is_auto = FALSE; } static void check_version_callback ( GtkAction *act ) { httpError ret; char msg[400]; if ( connection >= 0 ) httpKillConnection ( connection ); ret = httpOpenConnection ( GTIMER_VERSION_CHECK_SERVER, GTIMER_VERSION_CHECK_PORT, &connection ); if ( ret ) { /* only report errors if the user asked for a version check */ if ( ! version_check_is_auto ) { strcpy ( msg, gettext("An error occurred while\nchecking for a new version.") ); strcat ( msg, "\n\n" ); sprintf ( msg + strlen ( msg ), "%s:\n\n%s", gettext("HTTP Error"), httpErrorString ( ret ) ); create_confirm_window ( CONFIRM_ERROR, gettext("Error"), msg, gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } version_check_is_auto = FALSE; } else { gdk_input_id = gdk_input_add ( (gint) connection, GDK_INPUT_READ, read_http_socket, NULL ); ret = httpGet ( connection, GTIMER_VERSION_CHECK_SERVER, GTIMER_VERSION_CHECK_PATH, NULL, NULL, 0, read_version ); if ( ret ) { if ( ! version_check_is_auto ) { sprintf ( msg, "%s:\n\n%s", gettext("HTTP Error"), httpErrorString ( ret ) ); create_confirm_window ( CONFIRM_ERROR, gettext("Error"), msg, gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } httpKillConnection ( connection ); gdk_input_remove ( gdk_input_id ); gdk_input_id = -1; version_check_is_auto = FALSE; } } } /* ** A generic event handler for the task pulldown menu (when created from ** a right mouse button in the task list). If the user doesn't select ** anything from the pulldown, we need to forget about which task they ** selected for the pulldown. */ static gint pulldown_event ( widget, event ) GtkWidget *widget; GdkEvent *event; { if ( event->type == GDK_UNMAP ) get_selected_task (); return ( FALSE ); } /* ** Create a pulldown menu (from the user selecting a task with the ** right mouse button); */ static GtkWidget *create_task_pulldown ( int is_main ) { return gtk_ui_manager_get_widget( uimanager, "/PopupMenu" ); } /* ** Callback for selecting the column header. ** Sort the list by the selected column. */ static void column_selected_callback ( widget, col ) GtkWidget *widget; int col; { int i; static int same_col = 0; /* * Keep track of how many times they click on the same column header. * When they do this with the project column, it will sort as follows: * 1) project id * 2) project id (reverse) * 3) project name * 4) project name (reverse) * 5) back to 1... */ if ( col == last_sort ) { same_col++; } else { same_col = 0; } if ( col == last_sort ) sort_forward = ! sort_forward; else sort_forward = 1; last_sort = col; switch ( col ) { case 0: if ( same_col % 4 < 2 ) { qsort ( visible_tasks, num_visible_tasks, sizeof ( TaskData * ), sort_task_by_project_id ); showMessage ( gettext("Sorted by project creation date") ); } else { qsort ( visible_tasks, num_visible_tasks, sizeof ( TaskData * ), sort_task_by_project_name ); showMessage ( gettext("Sorted by project name") ); } break; case 1: if ( same_col % 4 < 2 ) { qsort ( visible_tasks, num_visible_tasks, sizeof ( TaskData * ), sort_task_by_name ); showMessage ( gettext("Sorted by task name") ); } else { qsort ( visible_tasks, num_visible_tasks, sizeof ( TaskData * ), sort_task_by_id ); showMessage ( gettext("Sorted by task creation date") ); } break; case 2: qsort ( visible_tasks, num_visible_tasks, sizeof ( TaskData * ), sort_task_by_today ); showMessage ( gettext("Sorted by time for today") ); break; default: case 3: qsort ( visible_tasks, num_visible_tasks, sizeof ( TaskData * ), sort_task_by_total ); showMessage ( gettext("Sorted by total time") ); break; } rebuilding_list = 1; gtk_clist_freeze( GTK_CLIST (task_list) ); build_list (); update_list (); rebuilding_list = 0; for ( i = 0; i < num_visible_tasks; i++ ) { if ( visible_tasks[i]->selected ) gtk_clist_select_row ( GTK_CLIST (task_list), i, 0 ); } gtk_clist_thaw( GTK_CLIST (task_list) ); configSetAttributeInt ( CONFIG_SORT, col ); configSetAttributeInt ( CONFIG_SORT_FORWARD, sort_forward ); } /* ** General event handler for the task list clist widget. Catch ** right mouse button events and create the pulldown menu. */ static gint task_list_event ( widget, event ) GtkWidget *widget; GdkEvent *event; { GdkEventButton *eb; GtkWidget *menu; int row, col; if ( event->type == GDK_BUTTON_PRESS ) { eb = (GdkEventButton *)event; if ( eb->button == 3 ) { gtk_clist_get_selection_info ( GTK_CLIST ( task_list ), eb->x, eb->y, &row, &col ); pulldown_selected_task = row; menu = create_task_pulldown ( FALSE ); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, eb->time); } } return ( FALSE ); } /* ** Callback for user selecting a task (single-click, double-click, ** right-mouse, etc.) */ static gint task_selected_callback ( widget, col, row, bevent, user_data ) GtkWidget *widget; int col; int row; GdkEventButton *bevent; gpointer user_data; { int i; if ( rebuilding_list ) return ( TRUE ); for ( i = 0; i < num_visible_tasks; i++ ) visible_tasks[i]->selected = 0; selected_task = col; if ( selected_task >= 0 ) visible_tasks[selected_task]->selected = 1; if ( bevent != NULL ) { /* double-click ? */ if ( bevent->type == GDK_2BUTTON_PRESS ) switch_to_callback ( widget, user_data ); } return ( TRUE ); } /* ** PV: Main Menu translations - because of duplicated items (e.g. "New" in menu Task and Project) ** we have to know which one item is translated. Each string in menu can contain prefix in form ** . Delimiter is now hardcoded as '|' (or any character not contained ** in menu description). */ gchar *mainmenu_translate(const gchar *str, gpointer data) { gchar *retval; gchar **split; retval = gettext(str); if ( strchr(str, '|') ) { split = g_strsplit(retval,"|",2); //debug: #if PV_DEBUG printf("\nPrefix: %s", split[0]); printf("\nText : %s", split[1]); #endif retval = g_strdup(split[1]); g_strfreev(split); #if PV_DEBUG printf("\n*** Retval *** %s", retval); #endif } return retval; } /* ** Create the main window's menu bar. ** PV: For GTK 2.x --- Actions menus ** */ static GtkWidget *create_main_window_menu_bar() { GtkWidget *menu; GtkWidget *root_menu; GtkWidget *menu_item; GtkWidget *menu_bar; // int loop; // PV: GTK2 // GtkUIManager *uimanager; GtkActionGroup *actgroup; GtkAction *item; GError *err; actgroup = gtk_action_group_new("ActionMain"); // set translation domain and function gtk_action_group_set_translation_domain(GTK_ACTION_GROUP(actgroup), DEFAULT_TEXT_DOMAIN); gtk_action_group_set_translate_func(GTK_ACTION_GROUP(actgroup), mainmenu_translate, NULL, NULL); // set entries gtk_action_group_add_actions (GTK_ACTION_GROUP(actgroup), MM_NormalEntries, G_N_ELEMENTS(MM_NormalEntries), main_window); gtk_action_group_add_toggle_actions (GTK_ACTION_GROUP(actgroup), MM_ToggleEntries, G_N_ELEMENTS(MM_ToggleEntries), main_window); uimanager = gtk_ui_manager_new(); gtk_ui_manager_set_add_tearoffs(uimanager, TRUE); gtk_ui_manager_insert_action_group(GTK_UI_MANAGER(uimanager), GTK_ACTION_GROUP(actgroup), 0); mainag = gtk_ui_manager_get_accel_group (uimanager); gtk_window_add_accel_group (GTK_WINDOW(main_window), GTK_ACCEL_GROUP(mainag)); gtk_ui_manager_add_ui_from_string (uimanager, menustring, -1, &err); if (!(err == NULL)) { g_message(gettext("Building menu Failed: %s \n"), err->message); g_error_free(err); } return ( gtk_ui_manager_get_widget (uimanager, "/MainMenu") ); } static GtkWidget *create_list_column_def (num, cols) int num; list_column_def *cols; { GtkWidget *clist; GtkWidget *alignment; GtkWidget *label; int i; clist = gtk_clist_new (num); #ifdef GTK_CLIST_SET_FLAGS /* GTK 1.0.1 */ GTK_CLIST_SET_FLAGS (clist, CLIST_SHOW_TITLES); #else GTK_CLIST_SET_FLAG (clist, CLIST_SHOW_TITLES); #endif for (i = 0; i < num; i++) { gtk_clist_set_column_width (GTK_CLIST (clist), i, cols[i].width); /* gtk_clist_set_column_resizeable (GTK_CLIST (clist), i, cols[i].resizeable); gtk_clist_set_column_auto_resize (GTK_CLIST (clist), i, (gboolean)1); if ( cols[i].max_width ) gtk_clist_set_column_max_width ( GTK_CLIST (clist), i, cols[i].max_width ); */ if (cols[i].justify != GTK_JUSTIFY_LEFT) { gtk_clist_set_column_justification (GTK_CLIST (clist), i, cols[i].justify); } alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0); /*label = gtk_label_new (cols[i].name);*/ label = gtk_label_new ( gettext(cols[i].name) ); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_container_add (GTK_CONTAINER (alignment), label); gtk_widget_show (label); cols[i].widget = label; gtk_clist_set_column_widget (GTK_CLIST (clist), i, alignment); /*gtk_clist_column_title_passive ( GTK_CLIST(clist), i );*/ gtk_widget_show (alignment); } return clist; } /* ** Update the time values shown in the list. */ void update_list () { TaskData *taskdata; int i; int h, m, s; char text[100]; time_t now, diff, total, today; GdkPixmap *icon; GdkBitmap *mask; char *row[4]; int total_today = 0; char today_test[20]; char *project_name; Project *p; static char *noproject = ""; time ( &now ); if ( config_animate_enabled ) { icon = icons[now%8]; mask = icon_masks[now%8]; } else { icon = icons[0]; mask = icon_masks[0]; } /*gtk_clist_freeze ( GTK_CLIST(task_list) );*/ for ( i = 0; i < num_visible_tasks; i++ ) { taskdata = visible_tasks[i]; /* new task ? */ if ( taskdata->new_task ) { modified_since_save = 1; taskdata->new_task = 0; if ( taskdata->task->project_id > 0 ) { p = projectGet ( taskdata->task->project_id ); project_name = p->name; } else { project_name = noproject; } row[0] = project_name; row[1] = taskdata->task->name; row[2] = "00:00:00"; row[3] = "00:00:00"; gtk_clist_append ( GTK_CLIST(task_list), row ); gtk_clist_set_pixtext (GTK_CLIST (task_list), i, 0, taskdata->project_name, 2, blankicon, blankicon_mask); continue; } /* update the name ? */ if ( taskdata->name_updated || taskdata->moved ) { modified_since_save = 1; taskdata->name_updated = 0; if ( taskdata->timer_on ) { gtk_clist_set_pixtext (GTK_CLIST (task_list), i, 0, taskdata->project_name, 2, icon, mask); taskdata->last_on = 1; } else { gtk_clist_set_pixtext (GTK_CLIST (task_list), i, 0, taskdata->project_name, 2, blankicon, blankicon_mask); taskdata->last_on = 0; } } gtk_clist_set_text ( GTK_CLIST(task_list), i, 1, taskdata->task->name ); /* calc total */ total = taskdata->total; if ( taskdata->todays_entry ) total += taskdata->todays_entry->seconds; if ( taskdata->timer_on ) { time ( &now ); diff = now - taskdata->on_since; total += diff; } h = total / 3600; m = ( total - h * 3600 ) / 60; s = total % 60; sprintf ( text, "%d:%02d:%02d", h, m, s ); if ( strcmp ( text, taskdata->last_total ) || taskdata->moved ) { gtk_clist_set_text ( GTK_CLIST(task_list), i, 3, text ); strcpy ( taskdata->last_total, text ); } taskdata->last_total_int = total; today = 0; if ( taskdata->todays_entry ) today = taskdata->todays_entry->seconds; if ( taskdata->timer_on ) { time ( &now ); diff = now - taskdata->on_since; today += diff; } h = today / 3600; m = ( today - h * 3600 ) / 60; s = today % 60; sprintf ( text, "%d:%02d:%02d", h, m, s ); if ( strcmp ( text, taskdata->last_today ) || taskdata->moved ) { gtk_clist_set_text ( GTK_CLIST(task_list), i, 2, text ); strcpy ( taskdata->last_today, text ); } taskdata->last_today_int = today; /* draw the icon ? */ if ( taskdata->timer_on ) { modified_since_save = 1; gtk_clist_set_pixtext (GTK_CLIST (task_list), i, 0, taskdata->project_name, 2, icon, mask); taskdata->last_on = 1; } else if ( ! taskdata->timer_on && taskdata->last_on ) { gtk_clist_set_pixtext (GTK_CLIST (task_list), i, 0, taskdata->project_name, 2, blankicon, blankicon_mask); taskdata->last_on = 0; } taskdata->moved = 0; total_today += today; } /*gtk_clist_thaw ( GTK_CLIST(task_list) );*/ h = total_today / 3600; m = ( total_today - h * 3600 ) / 60; s = total_today % 60; sprintf ( today_test, "%s: %d:%02d:%02d", gettext("Today"), h, m, s ); if ( strcmp ( today_test, total_str ) ) { strcpy ( total_str, today_test ); gtk_label_set ( GTK_LABEL ( total_label ), total_str ); } } /* ** Create the task list. */ static void build_list () { Task *task; TaskData *taskdata; Project *p; char *project_name; char today_str[100], total_str[100]; char *row[4]; int i, j; GdkPixmap *icon; GdkBitmap *mask; time_t now; static int first = 1; GtkWidget *win; static char *noproject = ""; if ( splash_window ) win = splash_window; else win = main_window; /* gtk_clist_freeze ( GTK_CLIST(task_list) ); */ gtk_clist_clear ( GTK_CLIST(task_list) ); if ( first ) { icons[0] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[0], &win->style->white, clock1_xpm); icons[1] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[1], &win->style->white, clock2_xpm); icons[2] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[2], &win->style->white, clock3_xpm); icons[3] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[3], &win->style->white, clock4_xpm); icons[4] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[4], &win->style->white, clock5_xpm); icons[5] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[5], &win->style->white, clock6_xpm); icons[6] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[6], &win->style->white, clock7_xpm); icons[7] = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &icon_masks[7], &win->style->white, clock8_xpm); blankicon = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &blankicon_mask, &win->style->white, blank_xpm); } if ( tasks == NULL ) { tasks = (TaskData **) malloc ( taskCount() * sizeof ( TaskData * ) ); visible_tasks = (TaskData **) malloc ( taskCount() * sizeof ( TaskData * ) ); for ( i = 0, task = taskGetFirst(); task != NULL; i++, task = taskGetNext () ) { taskdata = (TaskData *) malloc ( sizeof ( TaskData ) ); memset ( taskdata, '\0', sizeof ( TaskData ) ); taskdata->task = task; taskdata->todays_entry = taskGetTimeEntry ( taskdata->task, today_year, today_mon, today_mday ); for ( j = 0; j < taskdata->task->num_entries; j++ ) { if ( taskdata->task->entries[j] != taskdata->todays_entry ) taskdata->total += taskdata->task->entries[j]->seconds; } strcpy ( taskdata->last_today, "" ); strcpy ( taskdata->last_total, "" ); taskdata->project_name = ""; if ( taskdata->task->project_id >= 0 ) { p = projectGet ( task->project_id ); if ( p != NULL ) taskdata->project_name = p->name; } tasks[num_tasks++] = taskdata; if ( ! taskOptionEnabled ( taskdata->task, GTIMER_TASK_OPTION_HIDDEN ) ) visible_tasks[num_visible_tasks++] = taskdata; } /* sort the list of tasks */ qsort ( tasks, num_tasks, sizeof ( TaskData * ), sort_task_by_name ); qsort ( visible_tasks, num_visible_tasks, sizeof ( TaskData * ), sort_task_by_name ); } time ( &now ); icon = icons[now%8]; mask = icon_masks[now%8]; for ( i = 0; i < num_visible_tasks; i++ ) { visible_tasks[i]->moved = 1; task = visible_tasks[i]->task; row[0] = noproject; if ( task->project_id >= 0 ) { p = projectGet ( task->project_id ); row[0] = p->name; } row[1] = task->name; sprintf ( today_str, "00:00:00" ); row[2] = today_str; sprintf ( total_str, "00:00:00" ); row[3] = total_str; gtk_clist_append ( GTK_CLIST(task_list), row ); if ( tasks[i]->timer_on ) gtk_clist_set_pixtext (GTK_CLIST (task_list), i, 0, visible_tasks[i]->project_name, 2, icon, mask); else gtk_clist_set_pixtext (GTK_CLIST (task_list), i, 0, visible_tasks[i]->project_name, 2, blankicon, blankicon_mask); } /* gtk_clist_thaw ( GTK_CLIST(task_list) ); */ first = 0; } /* ** Check for a new version of GTimer. ** Notice that, Unlike Xt, you don't have to add the timeout again :-) */ static gint version_timeout_handler ( gpointer data ) { time_t now; char *next_check, now_str[20]; int do_check = FALSE; /** * 2003/05/09 Chad Walstrom * Since this auto version checking is not configurable -- it can't be shut * off -- we'll just shortcut the whole process and return TRUE like a * happy camper. */ return ( TRUE ); time ( &now ); sprintf ( now_str, "%ul", (unsigned int)now ); if ( configGetAttribute ( CONFIG_NEXT_VERSION_CHECK, &next_check ) == 0 ) { if ( strcmp ( now_str, next_check ) > 0 ) { /* time for another check! */ do_check = TRUE; } } else { /* have never checked! */ do_check = TRUE; } if ( do_check ) { version_check_is_auto = TRUE; check_version_callback ( NULL ); } /* return TRUE to so this timeout happens again */ return ( TRUE ); } /* ** Handle the update. This gets called every 1 second. ** Notice that, Unlike Xt, you don't have to add the timeout again :-) */ static gint timeout_handler ( gpointer data ) { time_t now; struct tm *tm; int loop; gint w, h, x, y; static gint last_x, last_y; static time_t last_move = 0; GdkModifierType mask; char *ptr; int idle; time ( &now ); /* remove splash window ? */ if ( splash_window && now > splash_until ) { if ( GTK_IS_WIDGET ( splash_window ) ) gtk_widget_destroy ( splash_window ); splash_window = NULL; gtk_widget_show ( main_window ); if ( configGetAttributeInt ( CONFIG_MAIN_WINDOW_WIDTH, &w ) == 0 && configGetAttributeInt ( CONFIG_MAIN_WINDOW_HEIGHT, &h ) == 0 ) { gdk_window_resize ( GTK_WIDGET ( main_window )->window, w, h ); } gdk_window_set_icon ( GTK_WIDGET ( main_window )->window, NULL, appicon2, appicon2_mask ); if ( move_to_task >= 0 ) { gtk_clist_moveto ( GTK_CLIST ( task_list ), move_to_task, -1, 0.5, 0 ); move_to_task = -1; } } else { gdk_window_get_pointer ( GTK_WIDGET ( main_window )->window, &x, &y, &mask ); if ( x != last_x || y != last_y ) { last_x = x; last_y = y; last_move = now; } } /* Check to see if the date has changed. */ now -= config_midnight_offset; tm = localtime ( &now ); if ( today_mday != tm->tm_mday ) { update_tasks (); today_year = tm->tm_year + 1900; today_mon = tm->tm_mon + 1; today_mday = tm->tm_mday; for ( loop = 0; loop < num_tasks; loop++ ) { if ( tasks[loop]->todays_entry ) tasks[loop]->total += tasks[loop]->todays_entry->seconds; tasks[loop]->todays_entry = taskGetTimeEntry ( tasks[loop]->task, today_year, today_mon, today_mday ); if ( tasks[loop]->timer_on ) { if ( ! tasks[loop]->todays_entry ) tasks[loop]->todays_entry = taskNewTimeEntry ( tasks[loop]->task, today_year, today_mon, today_mday ); time ( &tasks[loop]->on_since ); } } } /* Update the list */ update_list (); /* have we been idle for too long? */ if ( num_timing && configGetAttribute ( CONFIG_IDLE, &ptr ) == 0 && ! idle_prompt_window && config_idle_enabled ) { #ifdef HAVE_SCREEN_SAVER_EXT idle = (int) get_x_idle_time ( GDK_DISPLAY() ); #else time ( &now ); idle = (int) ( now - last_move ); #endif if ( idle > config_max_idle) { /* we've been idle too long. mark time, save to file, then popup window */ update_tasks (); save_all (); for ( loop = 0; loop < num_tasks; loop++ ) { if ( tasks[loop]->timer_on ) { taskMark ( tasks[loop]->task, idle ); } else { taskMark ( tasks[loop]->task, 0 ); } } time ( &now ); now -= idle; tm = localtime ( &now ); ptr = (char *) malloc ( 500 ); sprintf ( ptr, "%s\n%d %s (%s %d:%02d)\n\n", gettext("You have been idle for"), config_max_idle / 60, gettext("minutes"), gettext("since"), tm->tm_hour, tm->tm_min ); strcat ( ptr, gettext("You may now:") ); strcat ( ptr, "\n\n" ); strcat ( ptr, gettext("Revert to back to before the idle") ); strcat ( ptr, "\n\n" ); strcat ( ptr, gettext("Continue timing, ignoring the idle") ); strcat ( ptr, "\n\n" ); strcat ( ptr, gettext("Resume timing from when the idle started") ); idle_prompt_window = create_confirm_toplevel ( CONFIRM_WARNING, gettext("Idle Detect"), ptr, gettext("Revert"), gettext("Continue"), gettext("Resume"), idle_reset_callback, idle_cancel_callback, idle_resume_callback, NULL ); free ( ptr ); } } /* autosave ? (do not autosave if idle) */ time ( &now ); if ( modified_since_save && ( now > ( last_save + config_autosave_interval ) ) && config_autosave_enabled && ( idle_prompt_window == NULL ) ) { save_all (); } /* clear message area? */ if ( lastMessageTime && ( now - lastMessageTime > messageDisplayTime ) ) { showMessage ( NULL ); /* clear msg area */ } /* return TRUE to so this timeout happens again in 1 second */ return ( TRUE ); } void create_splash_window () { GtkWidget *table, *pixmap, *label; GdkPixmap *icon; GdkBitmap *mask; char msg[500]; GtkStyle *style; splash_window = gtk_window_new ( GTK_WINDOW_TOPLEVEL ); gtk_window_set_wmclass ( GTK_WINDOW ( splash_window ), "GTimer", "gtimer" ); gtk_window_set_title ( GTK_WINDOW ( splash_window ), "GTimer" ); gtk_widget_set_usize ( splash_window, 450, 180 ); gtk_window_position ( GTK_WINDOW ( splash_window ), GTK_WIN_POS_CENTER ); gtk_widget_realize ( splash_window ); gdk_window_set_decorations ( GTK_WIDGET ( splash_window )->window, GDK_DECOR_BORDER ); table = gtk_table_new ( 2, 2, FALSE ); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 8); gtk_container_border_width (GTK_CONTAINER (table), 6); gtk_container_add ( GTK_CONTAINER ( splash_window ), table ); icon = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( splash_window )->window, &mask, &splash_window->style->white, splash_xpm ); pixmap = gtk_pixmap_new ( icon, mask ); gtk_misc_set_alignment (GTK_MISC (pixmap), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), pixmap, 0, 1, 0, 2, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show ( pixmap ); style = gtk_style_new (); sprintf ( msg, "GTimer v%s", GTIMER_VERSION ); label = gtk_label_new ( msg ); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show ( label ); sprintf ( msg, "%s\nGTK Version: %d.%d.%d\n", GTIMER_COPYRIGHT, gtk_major_version, gtk_minor_version, gtk_micro_version ); label = gtk_label_new ( msg ); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show ( label ); gtk_widget_show ( table ); gtk_widget_show ( splash_window ); time ( &splash_until ); splash_until += splash_seconds; } void create_main_window () { GtkWidget *vbox; GtkWidget *menu_bar, *toolbutton, *iconw, *table, *scroll, *handlebox; GdkPixmap *icon; GdkBitmap *mask; int loop; gint w; main_window = gtk_window_new ( GTK_WINDOW_TOPLEVEL ); gtk_window_set_wmclass( GTK_WINDOW ( main_window ), "GTimer", "gtimer" ); gtk_signal_connect ( GTK_OBJECT ( main_window ), "delete_event", GTK_SIGNAL_FUNC ( exit_callback ), NULL ); gtk_signal_connect ( GTK_OBJECT ( main_window ), "destroy", GTK_SIGNAL_FUNC ( exit_callback ), NULL ); gtk_window_set_title (GTK_WINDOW (main_window), "GTimer" ); gtk_widget_realize ( main_window ); vbox = gtk_vbox_new ( FALSE, 0 ); gtk_container_add ( GTK_CONTAINER ( main_window ), vbox ); menu_bar = create_main_window_menu_bar(); handlebox = gtk_handle_box_new (); gtk_container_add ( GTK_CONTAINER ( handlebox ), menu_bar ); gtk_widget_show ( handlebox ); gtk_box_pack_start ( GTK_BOX ( vbox ), handlebox, FALSE, FALSE, 0 ); gtk_widget_show ( menu_bar ); /* create toolbar */ toolbar = gtk_toolbar_new (); gtk_toolbar_append_space ( GTK_TOOLBAR ( toolbar ) ); gtk_box_pack_start ( GTK_BOX ( vbox ), toolbar, FALSE, FALSE, 0 ); /* toolbar_handlebox = gtk_handle_box_new (); gtk_container_add ( GTK_CONTAINER ( toolbar_handlebox ), toolbar ); gtk_widget_show ( toolbar_handlebox ); gtk_box_pack_start ( GTK_BOX ( vbox ), toolbar_handlebox, FALSE, FALSE, 0 ); */ for ( loop = 0; main_toolbar[loop].label != NULL; loop++ ) { icon = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( main_window )->window, &mask, &main_window->style->white, main_toolbar[loop].icon_data ); iconw = gtk_pixmap_new ( icon, mask ); toolbutton = gtk_toolbar_append_item ( GTK_TOOLBAR ( toolbar ), gettext ( main_toolbar[loop].label ), gettext ( main_toolbar[loop].tooltip_index ), "Private", iconw, GTK_SIGNAL_FUNC ( main_toolbar[loop].callback ), NULL ); main_toolbar[loop].widget = toolbutton; gtk_toolbar_append_space ( GTK_TOOLBAR ( toolbar ) ); gtk_widget_show ( toolbutton ); } if ( config_toolbar_enabled ) gtk_widget_show ( toolbar ); /* add in list here */ if ( configGetAttributeInt ( CONFIG_MAIN_WINDOW_PROJECT_WIDTH, &w ) == 0 ) task_list_columns[0].width = w; if ( configGetAttributeInt ( CONFIG_MAIN_WINDOW_TASK_WIDTH, &w ) == 0 ) task_list_columns[1].width = w; if ( configGetAttributeInt ( CONFIG_MAIN_WINDOW_TODAY_WIDTH, &w ) == 0 ) task_list_columns[2].width = w; if ( configGetAttributeInt ( CONFIG_MAIN_WINDOW_TOTAL_WIDTH, &w ) == 0 ) task_list_columns[3].width = w; task_list = create_list_column_def ( 4, task_list_columns ); gtk_clist_set_selection_mode (GTK_CLIST (task_list), GTK_SELECTION_BROWSE); gtk_widget_set_usize (GTK_WIDGET (task_list), 350, 150); #if OLD_GTK gtk_clist_set_policy (GTK_CLIST (task_list), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); #endif gtk_signal_connect (GTK_OBJECT (task_list), "click_column", GTK_SIGNAL_FUNC (column_selected_callback), NULL); gtk_signal_connect (GTK_OBJECT (task_list), "event", GTK_SIGNAL_FUNC (task_list_event), NULL); gtk_signal_connect_after (GTK_OBJECT (task_list), "select_row", GTK_SIGNAL_FUNC (task_selected_callback), NULL); #if OLD_GTK gtk_box_pack_start ( GTK_BOX ( vbox ), task_list, TRUE, TRUE, 0 ); #else scroll = gtk_scrolled_window_new ( NULL, NULL ); gtk_widget_set_usize (GTK_WIDGET (scroll), 400, 150); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add (GTK_CONTAINER ( scroll ), task_list ); gtk_box_pack_start ( GTK_BOX ( vbox ), scroll, TRUE, TRUE, 0 ); gtk_widget_show ( scroll ); #endif gtk_widget_show ( task_list ); /* add a status area and a place for the total time for today */ table = gtk_table_new ( 10, 1, FALSE ); gtk_box_pack_start ( GTK_BOX ( vbox ), table, FALSE, TRUE, 2 ); status = gtk_statusbar_new (); gtk_table_attach_defaults ( GTK_TABLE (table), status, 0, 9, 0, 1 ); gtk_widget_show (status); status_id = gtk_statusbar_get_context_id ( GTK_STATUSBAR ( status ), GTIMER_STATUS_ID ); total_label = gtk_label_new ( "Total: 0:00:00" ); gtk_table_attach_defaults ( GTK_TABLE (table), total_label, 9, 10, 0, 1 ); gtk_label_set_justify ( GTK_LABEL ( total_label ), GTK_JUSTIFY_RIGHT ); gtk_widget_show (total_label); gtk_widget_show (table); gtk_widget_show (vbox); } static void print_version () { /*int gtkmajor, gtkminor, gtkmicro;*/ printf ( "GTimer v%s (%s)\n", GTIMER_VERSION, GTIMER_VERSION_DATE ); /* gtkmajor = GTK_VERSION / 10000; gtkminor = ( GTK_VERSION / 100 ) % 100; gtkmicro = GTK_VERSION % 100; printf ( "%s %d.%d.%d\n", gettext ( "Compiled with GTK+" ), gtkmajor, gtkminor, gtkmicro ); */ printf ( "%s: %d.%d.%d\n", gettext ( "GTK+ runtime" ), gtk_major_version, gtk_minor_version, gtk_micro_version ); printf ( "%s: %s\n", gettext ( "Home page" ), GTIMER_URL ); printf ( "%s\n", GTIMER_COPYRIGHT ); } static void print_help () { printf ( "GTimer %s:\n", gettext ( "options" ) ); printf ( "%-20s %s\n", "-nosplash", gettext ( "don't display the splash screen" ) ); printf ( "%-20s %s\n", "-help", gettext ( "display this help info" ) ); printf ( "%-20s %s\n", "-version", gettext ( "display the version" ) ); printf ( "%-20s %s\n", "-midnight N", gettext ( "specify the midnight offset" ) ); printf ( "%-20s %s\n", "-start taskname", gettext ( "start timing the specified task" ) ); printf ( "%-20s %s\n", "-weekstart N", gettext ( "use N as the first day of weeks" ) ); } int main ( int argc, char *argv[] ) { char *home = ""; #ifndef WIN32 uid_t uid; struct passwd *passwd; #endif time_t now; struct tm *tm; int loop, loop2, offset, lastTaskNumber; char *ptr, *ptr2; struct stat buf; int display_splash = 1; int resume = 0; /* start time tasks from last exit */ GtkWidget *win; int w = 0, h = 0; #ifdef HAVE_LIBINTL_H #ifdef WIN32 char *localedir; #endif #endif char *matches[100]; int nmatches = 0, found; TaskData *td; char msg[128]; #if PV_DEBUG g_message ( "PV: DEBUG version"); #endif if ( getenv ( "HOME" ) ) { home = getenv ( "HOME" ); } #ifndef WIN32 else { uid = getuid (); passwd = getpwuid ( uid ); if ( passwd ) home = passwd->pw_dir; } #endif taskdir = (char *) malloc ( strlen ( home ) + strlen ( TASK_DIRECTORY ) + 10 ); sprintf ( taskdir, "%s/%s", home, TASK_DIRECTORY ); #ifdef WIN32 convert_backslash ( taskdir ); #endif if ( stat ( taskdir, &buf ) != 0 ) { /* check for ".tasktimer" directory for backwards compatiblity */ sprintf ( taskdir, "%s/%s", home, ".tasktimer" ); /* Note: in 2.0 it seems to be good idea to create new command-line option '--config' */ #ifdef WIN32 convert_backslash ( taskdir ); #endif if ( stat ( taskdir, &buf ) != 0 ) { sprintf ( taskdir, "%s/%s", home, TASK_DIRECTORY ); #ifdef WIN32 convert_backslash ( taskdir ); if ( _mkdir ( taskdir ) ) { #else if ( mkdir ( taskdir, 0777 ) ) { #endif fprintf ( stderr, "Error: unable to create directory %s\n", taskdir ); exit ( 1 ); } } } #ifdef HAVE_LIBINTL_H /* internationalization stuff */ setlocale ( LC_MESSAGES, "" ); #ifdef WIN32 localedir = (char *) malloc ( strlen ( taskdir ) + 8 ); sprintf ( localedir, "%s/locale", taskdir ); convert_backslash(localedir); bindtextdomain ( DEFAULT_TEXT_DOMAIN, localedir ); free ( localedir ); #else bindtextdomain(DEFAULT_TEXT_DOMAIN, LOCALEDIR); #endif // textdomain ( "gtimer" ); #endif bind_textdomain_codeset(DEFAULT_TEXT_DOMAIN, "UTF-8"); /* Init GTK */ gtk_init ( &argc, &argv ); #if OLD_GTK #else gtkrc = (char *) malloc ( strlen ( taskdir ) + strlen ( "gtkrc" ) + 2 ); sprintf ( gtkrc, "%s/%s", taskdir, "gtkrc" ); gtk_rc_parse ( gtkrc ); #endif /* Examine command line args */ for ( loop = 1; loop < argc; loop++ ) { if ( strcmp ( argv[loop], "-dir" ) == 0 ) { if ( ! argv[loop+1] ) { fprintf ( stderr, "%s: -dir %s.\n", gettext("Error"), gettext("requires an argument") ); exit ( 1 ); } taskdir = argv[++loop]; #ifdef HAVE_LIBINTL_H #ifdef WIN32 localedir = (char *) malloc ( strlen ( taskdir ) + 8 ); sprintf ( localedir, "%s/locale", taskdir ); convertbackslash(localedir); bindtextdomain ( "gtimer", localedir ); free ( localedir ); #endif #endif #if OLD_GTK #else if ( gtkrc ) free ( gtkrc ); gtkrc = (char *) malloc ( strlen ( taskdir ) + strlen ( "gtkrc" ) + 2 ); sprintf ( gtkrc, "%s/%s", taskdir, "gtkrc" ); gtk_rc_parse ( gtkrc ); #endif } else if ( strcmp ( argv[loop], "-nosplash" ) == 0 ) { display_splash = 0; } else if ( strcmp ( argv[loop], "-resume" ) == 0 ) { resume = 1; } else if ( strcmp ( argv[loop], "-midnight" ) == 0 ) { if ( ! argv[loop+1] ) { fprintf ( stderr, "%s: -midnight %s.\n", gettext("Error"), gettext("requires an argument") ); exit ( 1 ); } for ( ptr = argv[++loop]; *ptr != '\0'; ptr++ ) { if ( ! isdigit ( *ptr ) && *ptr != '-' ) { fprintf ( stderr, "%s: -midnight %s (%s %s)\n", gettext("Error"), gettext("requires a number"), gettext("not"), argv[loop] ); exit ( 1 ); } } ptr = argv[loop]; if ( *ptr == '-' ) offset = atoi ( ptr + 1 ); else offset = atoi ( ptr ); if ( offset > 2359 ) { fprintf ( stderr, "%s -midnight: %s\n", gettext("Invalid offset for"), argv[loop] ); fprintf ( stderr, "%s HHMM (<2359)\n", gettext("Format should be") ); exit ( 1 ); } config_midnight_offset = ( offset / 100 * 3600 ) + ( offset % 100 * 60 ); if ( *ptr == '-' ) config_midnight_offset *= -1; } else if ( strcmp ( argv[loop], "-weekstart" ) == 0 ) { if ( ! argv[loop+1] ) { fprintf ( stderr, "%s: -weekstart %s.\n", gettext("Error"), gettext("requires an argument") ); exit ( 1 ); } for ( ptr = argv[++loop]; *ptr != '\0'; ptr++ ) { if ( ! isdigit ( *ptr ) ) { fprintf ( stderr, "%s: -weekstart %s (%s %s)\n", gettext("Error"), gettext("requires a number"), gettext("not"), argv[loop] ); exit ( 1 ); } } config_start_of_week = atoi ( argv[loop] ); if ( config_start_of_week > 6 ) { fprintf ( stderr, "%s -weekstart: %s\n", gettext("Invalid day of week number for"), argv[loop] ); exit ( 1 ); } } else if ( strcmp ( argv[loop], "-start" ) == 0 ) { if ( nmatches < 99 ) matches[nmatches++] = argv[++loop]; } else if ( strcmp ( argv[loop], "-v" ) == 0 || strcmp ( argv[loop], "-version" ) == 0 || strcmp ( argv[loop], "--version" ) == 0 ) { print_version (); exit ( 0 ); } else if ( strcmp ( argv[loop], "-h" ) == 0 || strcmp ( argv[loop], "-help" ) == 0 || strcmp ( argv[loop], "--help" ) == 0 ) { print_version (); print_help (); exit ( 0 ); } else { fprintf ( stderr, "%s: %s\n", gettext("Ingoring unknown option"), argv[loop] ); } } /* read config values */ config_file = (char *) malloc ( strlen ( taskdir ) + strlen ( CONFIG_DEFAULT_FILE ) + 2 ); sprintf ( config_file, "%s/%s", taskdir, CONFIG_DEFAULT_FILE ); configReadAttributes ( config_file ); /* Get the toolbar setting */ configGetAttributeInt ( CONFIG_TOOLBAR_STATUS, &config_toolbar_enabled ); /* Get the animate setting */ configGetAttributeInt ( CONFIG_ANIMATE, &config_animate_enabled ); /* Get the autosave setting */ configGetAttributeInt ( CONFIG_AUTOSAVE, &config_autosave_enabled ); /* Get the idle delay */ if ( configGetAttributeInt ( CONFIG_IDLE_ON, &config_idle_enabled ) < 0 ) config_idle_enabled = 1; if ( configGetAttributeInt ( CONFIG_IDLE, &config_max_idle ) < 0 ) config_max_idle = 15 * 60; /* default */ /* PV: Set menu check boxes according to config */ if ( config_toolbar_enabled ) MM_ToggleEntries[MM_TOGGLE_TOOLBAR].is_active = TRUE; if ( config_animate_enabled ) MM_ToggleEntries[MM_TOGGLE_ANIMATE].is_active = TRUE; if ( config_autosave_enabled ) MM_ToggleEntries[MM_TOGGLE_AUTOSAVE].is_active = TRUE; if ( config_idle_enabled ) MM_ToggleEntries[MM_TOGGLE_IDLE].is_active = TRUE; /* in the future check version number and pop up license and/or ** release notes if a new version */ configSetAttribute ( CONFIG_VERSION, GTIMER_VERSION ); /* load all projects */ projectLoadAll ( taskdir ); /* load all tasks */ taskLoadAll ( taskdir ); /* Create splash window */ if ( display_splash ) create_splash_window (); /* Create window */ create_main_window (); /* move main window */ if ( configGetAttributeInt ( CONFIG_MAIN_WINDOW_WIDTH, &w ) == 0 && configGetAttributeInt ( CONFIG_MAIN_WINDOW_HEIGHT, &h ) == 0 ) { /* wait until after gtk_widget_show() to resize */ } if ( ! splash_window ) { gtk_widget_show ( main_window ); if ( w ) gdk_window_resize ( GTK_WIDGET ( main_window )->window, w, h ); } /* set application icon */ win = splash_window ? splash_window : main_window; appicon = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &appicon_mask, &win->style->white, gtimer_xpm); appicon2 = gdk_pixmap_create_from_xpm_d ( GTK_WIDGET ( win )->window, &appicon2_mask, &win->style->white, gtimer2_xpm); if ( ! splash_window ) gdk_window_set_icon ( GTK_WIDGET ( main_window )->window, NULL, num_timing ? appicon : appicon2, num_timing ? appicon_mask : appicon2_mask ); /* set the current date */ time ( &now ); now -= config_midnight_offset; tm = localtime ( &now ); today_year = tm->tm_year + 1900; today_mon = tm->tm_mon + 1; today_mday = tm->tm_mday; /* build and update the task list */ build_list (); update_list (); update_toolbar_buttons (); /* sort list like it was last time */ if ( configGetAttribute ( CONFIG_SORT, &ptr ) == 0 ) { last_sort = atoi ( ptr ); if ( configGetAttribute ( CONFIG_SORT_FORWARD, &ptr ) == 0 ) sort_forward = ! atoi ( ptr ); else sort_forward = 0; column_selected_callback ( NULL, last_sort ); } else { sort_forward = 0; column_selected_callback ( NULL, 0 ); } /* handle tasks specified with -start */ for ( loop = 0; ! resume && loop < nmatches; loop++ ) { found = 0; for ( loop2 = 0; loop2 < num_visible_tasks && ! found; loop2++ ) { td = visible_tasks[loop2]; if ( strcmp ( td->task->name, matches[loop] ) == 0 ) { found = 1; num_timing++; td->timer_on = 1; time ( &td->on_since ); if ( td->todays_entry == NULL ) td->todays_entry = taskNewTimeEntry ( td->task, today_year, today_mon, today_mday ); /* select the task */ gtk_clist_select_row ( GTK_CLIST ( task_list ), loop2, 0 ); /* make task visible */ move_to_task = loop2; if ( ! splash_window ) gtk_clist_moveto ( GTK_CLIST ( task_list ), loop2, -1, 0.5, 0 ); } } if ( ! found ) { fprintf ( stderr, "%s \"%s\" %s.\n", gettext ( "Task" ), matches[loop], gettext ( "not found" ) ); } } if ( resume && ( configGetAttribute ( CONFIG_LAST_TIMED_TASKS, &ptr ) == 0 ) ) { ptr = strdup ( ptr ); for ( ptr2 = strtok ( ptr, "," ); ptr2 != NULL; ptr2 = strtok ( NULL, "," ) ) { lastTaskNumber = atoi ( ptr2 ); for ( loop = 0; loop < num_visible_tasks; loop++ ) { td = visible_tasks[loop]; if ( td->task->number == lastTaskNumber ) { num_timing++; td->timer_on = 1; time ( &td->on_since ); if ( td->todays_entry == NULL ) td->todays_entry = taskNewTimeEntry ( td->task, today_year, today_mon, today_mday ); /* select the task */ gtk_clist_select_row ( GTK_CLIST ( task_list ), loop, 0 ); /* make task visible */ move_to_task = loop2; if ( ! splash_window ) gtk_clist_moveto ( GTK_CLIST ( task_list ), loop, -1, 0.5, 0 ); break; } } } free ( ptr ); } /* Add a timeout to update the display once a second */ gtk_timeout_add ( 1000, timeout_handler, NULL ); /* Add a timeout to check for a new version in 30 seconds (We will just check every 30 seconds to see if we should check */ gtk_timeout_add ( 30 * 1000, version_timeout_handler, NULL ); /* record time for use with autosave */ time ( &last_save ); modified_since_save = 0; /* set x error handler... */ #ifdef WIN32 set_x_error_handler (); #endif sprintf ( msg, "%s GTimer %s", gettext("Welcome to"), GTIMER_VERSION ); showMessage ( msg ); /* Loop endlessly */ gtk_main (); #ifdef GTIMER_MEMDEBUG /* memory debugging... make sure md_print_all gets linked in so we can ** call it from gdb. */ for ( loop = 0; loop < num_tasks; loop++ ) { taskFree ( tasks[loop]->task ); free ( tasks[loop] ); } free ( tasks ); free ( visible_tasks ); md_print_all (); #endif return ( 0 ); } /* * Update the message area at the bottom of the screen. * If msg == NULL, the area will be cleared. * The message will be cleared automatically after a while. */ void showMessage ( msg ) char *msg; { gtk_statusbar_push ( GTK_STATUSBAR ( status ), status_id, msg ? msg : "" ); if ( msg == NULL ) lastMessageTime = 0; else time ( &lastMessageTime ); } /* ** Determine the path to an executable using the $PATH environment ** variable. ** Return value should be freed (unless it's NULL!) */ char *get_client_path ( char *file ) { char *path; static char *path2 = "/usr/bin/X11:/usr/local/bin:/usr/bin:/opt/local/bin"; char *env; struct stat buf; char *ret, *ptr; env = getenv ( "PATH" ); if ( env ) { path = (char *) malloc ( strlen ( env ) + strlen ( path2 ) + 2 ); sprintf ( path, "%s:%s", env, path2 ); } else { path = (char *) malloc ( strlen ( path2 ) + 1 ); strcpy ( path, path2 ); } ptr = strtok ( path, ":" ); while ( ptr ) { ret = (char *) malloc ( strlen ( ptr ) + strlen ( file ) + 2 ); sprintf ( ret, "%s/%s", ptr, file ); if ( stat ( ret, &buf ) == 0 ) { /* found it */ free ( path ); return ( ret ); } ptr = strtok ( NULL, ":" ); } /* not found */ free ( path ); return ( NULL ); } gtimer-2.0.0/Makefile.am0000644000175000017500000000137711353237102015247 0ustar cknudsencknudsen# Process this file with automake to create Makefile.in bin_PROGRAMS = gtimer gtimer_SOURCES = \ annotate.c confirm.c main.c task.h config.c edit.c \ report.c unhide.c config.h changelog.c changelog.h \ gtimer.h task.c xextras.c project.h project.c \ http.c http.h tcpt.c tcpt.h custom-list.c custom-list.h \ icons/splash.xpm icons/gtimer.xpm icons/gtimer2.xpm \ icons/clock1.xpm icons/clock2.xpm icons/clock3.xpm \ icons/clock4.xpm icons/clock5.xpm icons/clock6.xpm \ icons/clock7.xpm icons/clock8.xpm icons/blank.xpm \ icons/start.xpm icons/stop.xpm icons/stop_all.xpm \ icons/annotate.xpm icons/new.xpm icons/edit.xpm AM_CPPFLAGS = \ -DLOCALEDIR=\"$(localedir)\" @UIFLAGS@ @CPPFLAGS@ gtimer_LDADD = @UILIBS@ EXTRA_DIST = gtimer.1 icons/gtimer.gif gtimer-2.0.0/Makefile.in0000644000175000017500000004536511353243534015273 0ustar cknudsencknudsen# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ # Process this file with automake to create Makefile.in VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 = : bin_PROGRAMS = gtimer$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS depcomp install-sh missing \ mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_gtimer_OBJECTS = annotate.$(OBJEXT) confirm.$(OBJEXT) \ main.$(OBJEXT) config.$(OBJEXT) edit.$(OBJEXT) \ report.$(OBJEXT) unhide.$(OBJEXT) changelog.$(OBJEXT) \ task.$(OBJEXT) xextras.$(OBJEXT) project.$(OBJEXT) \ http.$(OBJEXT) tcpt.$(OBJEXT) custom-list.$(OBJEXT) gtimer_OBJECTS = $(am_gtimer_OBJECTS) gtimer_DEPENDENCIES = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(gtimer_SOURCES) DIST_SOURCES = $(gtimer_SOURCES) ETAGS = etags CTAGS = ctags 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); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UIFLAGS = @UIFLAGS@ UILIBS = @UILIBS@ VERSION = @VERSION@ 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@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ gtimer_SOURCES = \ annotate.c confirm.c main.c task.h config.c edit.c \ report.c unhide.c config.h changelog.c changelog.h \ gtimer.h task.c xextras.c project.h project.c \ http.c http.h tcpt.c tcpt.h custom-list.c custom-list.h \ icons/splash.xpm icons/gtimer.xpm icons/gtimer2.xpm \ icons/clock1.xpm icons/clock2.xpm icons/clock3.xpm \ icons/clock4.xpm icons/clock5.xpm icons/clock6.xpm \ icons/clock7.xpm icons/clock8.xpm icons/blank.xpm \ icons/start.xpm icons/stop.xpm icons/stop_all.xpm \ icons/annotate.xpm icons/new.xpm icons/edit.xpm AM_CPPFLAGS = \ -DLOCALEDIR=\"$(localedir)\" @UIFLAGS@ @CPPFLAGS@ gtimer_LDADD = @UILIBS@ EXTRA_DIST = gtimer.1 icons/gtimer.gif all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ 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: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) gtimer$(EXEEXT): $(gtimer_OBJECTS) $(gtimer_DEPENDENCIES) @rm -f gtimer$(EXEEXT) $(LINK) $(gtimer_OBJECTS) $(gtimer_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/annotate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/changelog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confirm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom-list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/project.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/report.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unhide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xextras.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(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@ mv -f $(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) '$<'` 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) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH 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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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-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) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(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) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && 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 $(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: @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-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-compile distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-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 pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS # 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: gtimer-2.0.0/missing0000755000175000017500000002557711353237102014622 0ustar cknudsencknudsen#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # 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, 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. 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] 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 # 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). 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 $1 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 1 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-end: "$" # End: gtimer-2.0.0/mkinstalldirs0000755000175000017500000000132211353237102016007 0ustar cknudsencknudsen#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here gtimer-2.0.0/NEWS0000644000175000017500000000003411353237102013677 0ustar cknudsencknudsenSee the ChangeLog for news. gtimer-2.0.0/po/sv.po0000644000175000017500000002277511353237102014626 0ustar cknudsencknudsenmsgid "" msgstr "" "Date: 2002-12-11 10:27:14+0100\n" "From: Pontus Ullgren \n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Xgettext-Options: \n" "Files: annotate.c config.c confirm.c edit.c main.c report.c task.c tasktest.c unhide.c xextras.c\n" #: annotate.c:106 msgid "Annotation added" msgstr "Kommentar tillagd" #: annotate.c:148 msgid "Add Annotation" msgstr "Lgg till kommentar" #: annotate.c:159 msgid "Enter annotation for" msgstr "Lgg till kommentar fr" #: annotate.c:189 edit.c:218 main.c:639 main.c:660 main.c:682 main.c:714 main.c:739 main.c:790 main.c:797 main.c:814 main.c:823 main.c:853 main.c:862 main.c:893 main.c:1048 report.c:311 report.c:359 report.c:371 report.c:379 report.c:446 report.c:537 report.c:1042 report.c:1057 report.c:1091 report.c:1122 report.c:1173 report.c:1513 unhide.c:102 unhide.c:264 msgid "Ok" msgstr "Ok" #: annotate.c:200 edit.c:229 main.c:797 report.c:455 report.c:1525 unhide.c:276 msgid "Cancel" msgstr "Avbryt" #: edit.c:106 msgid "Task updated" msgstr "Uppgiften uppdaterad" #: edit.c:133 msgid "Task added" msgstr "Lagt till uppgift" #: edit.c:178 msgid "Edit Task" msgstr "Editera uppgift" #: edit.c:180 msgid "Add Task" msgstr "Lgg till en uppgift" #: edit.c:193 msgid "Task name" msgstr "Uppgiftens namn" #: edit.c:206 msgid "Unnamed Task" msgstr "Namnls" #: main.c:423 msgid "About..." msgstr "Om..." #: main.c:424 report.c:523 msgid "Save" msgstr "Spara" #: main.c:425 msgid "Exit" msgstr "Avsluta" #: main.c:426 main.c:1810 msgid "Idle Detect" msgstr "Upptck overksamhet" #: main.c:427 msgid "Toolbar" msgstr "Vertygsrad" #: main.c:428 msgid "Animate" msgstr "Animera" #: main.c:429 msgid "Auto Save" msgstr "Automat spara" #: main.c:430 msgid "Start Timing" msgstr "Starta Klockan" #: main.c:431 msgid "Stop Timing" msgstr "Stoppa Klockan" #: main.c:432 msgid "Stop All Timing" msgstr "Stoppa Alla Klockor" #: main.c:433 msgid "New..." msgstr "Ny..." #: main.c:434 msgid "Edit..." msgstr "Editera..." #: main.c:435 msgid "Annotate..." msgstr "Kommentar..." #: main.c:436 msgid "Hide" msgstr "Gmm.." #: main.c:437 msgid "Unhide..." msgstr "Vissa..." #: main.c:438 msgid "Delete" msgstr "Radera" #: main.c:439 msgid "Increment 5 seconds" msgstr "ka med 5 sekunder" #: main.c:440 msgid "Increment 30 seconds" msgstr "ka med 30 sekunder" #: main.c:441 msgid "Decrement 5 seconds" msgstr "Minska med 5 sekunder" #: main.c:442 msgid "Decrement 30 seconds" msgstr "Minska med 30 sekunder" #: main.c:443 msgid "Set to Zero" msgstr "Nollstll" #: main.c:444 msgid "Daily..." msgstr "Daglig..." #: main.c:445 msgid "Weekly..." msgstr "Veckovis..." #: main.c:446 msgid "Monthly..." msgstr "Mntlig..." #: main.c:447 msgid "Yearly..." msgstr "rlig..." #: main.c:450 msgid "Start Timing the Selected Task" msgstr "Starta klockan fr vald uppgift" #: main.c:452 msgid "Stop Timing the Selected Task" msgstr "Stoppa klockan fr vald uppgift" #: main.c:454 msgid "Stop Timing All Tasks" msgstr "Stoppa klockan fr alla uppgifter" #: main.c:456 msgid "Add Annotation to Selected Task" msgstr "Lgg till en kommentar fr vald uppgift" #: main.c:458 msgid "Add New Task" msgstr "Lgg till ny uppgift" #: main.c:460 msgid "Edit Name of the Selected Task" msgstr "ndra namn p vald uppgift" #: main.c:618 msgid "All data saved" msgstr "Alla vrden sparade" #: main.c:630 main.c:631 msgid "Version" msgstr "Version" #: main.c:633 msgid "Author" msgstr "Upphovsman" #: main.c:637 msgid "About" msgstr "Om" #: main.c:658 main.c:680 main.c:712 main.c:737 main.c:788 main.c:812 main.c:821 main.c:851 main.c:860 main.c:891 main.c:1046 main.c:2094 main.c:2124 main.c:2139 main.c:2145 report.c:308 report.c:311 report.c:358 report.c:368 report.c:371 report.c:379 report.c:1040 report.c:1056 report.c:1089 report.c:1120 report.c:1171 unhide.c:100 msgid "Error" msgstr "Fel" #: main.c:659 msgid "" "You have not selected\n" "a task to edit." msgstr "" "Du har inte valt\n" "en uppgift att editera." #: main.c:681 msgid "" "You have not selected\n" "a task to hide." msgstr "" "Du har inte valt\n" "en uppgift att gmma." #: main.c:697 msgid "Task hidden" msgstr "Uppgiften gmd" #: main.c:713 msgid "There are no hidden tasks." msgstr "Det finns inga gmmda uppgifter." #: main.c:735 msgid "Error deleting task" msgstr "Fel vid radering av uppgiften" #: main.c:774 msgid "Task removed" msgstr "Uppgift raderad" #: main.c:789 msgid "" "You have not selected\n" "a task to delete." msgstr "" "Du har inte valt\n" "en uppgift att radera." #: main.c:795 msgid "Delete Task?" msgstr "Radera uppgiften?" #: main.c:796 msgid "" "Are you sure you want\n" "to delete this task?" msgstr "" "r Du sker p att\n" "du vill radera uppgiften?" #: main.c:813 msgid "" "You have not selected\n" "a task to start timing." msgstr "" "Du har inte valt en uppgift\n" "att starta klockan fr." #: main.c:822 msgid "Task is already being timed." msgstr "Klockan r redan startad fr denna uppgift." #: main.c:852 msgid "" "You have not selected\n" "a task to stop timing." msgstr "Du har inte valt\n" "en uppgift att stoppa." #: main.c:861 msgid "Task is not being timed." msgstr "Uppgiften r inte startad." #: main.c:892 msgid "" "You have not selected\n" "a task to annotate." msgstr "" "Du har inte valt ngon\n" "uppgift att lgga till kommentar till." #: main.c:1047 msgid "" "You have not selected\n" "a task to adjust the time for." msgstr "" "Du har inte valt ngon\n" "uppgift fr tidsjustering." #: main.c:1347 msgid "File" msgstr "Arkiv" #: main.c:1381 msgid "Options" msgstr "Instllningar" #: main.c:1409 main.c:2305 msgid "Task" msgstr "Uppgift" #: main.c:1419 report.c:482 report.c:1224 report.c:1410 msgid "Report" msgstr "Rapport" #: main.c:1605 msgid "Today" msgstr "Idag" #: main.c:1805 msgid "You have been idle for" msgstr "Du har varit inaktiv" #: main.c:1806 msgid "minutes" msgstr "minuter" #: main.c:1806 msgid "since" msgstr "sedan" #: main.c:1808 msgid "" "Do you wish to revert\n" "to before the idle?" msgstr "" "Will Du terg till lgget\n" "fre inaktivitets perioden?" #: main.c:1811 msgid "Revert" msgstr "terg" #: main.c:1811 msgid "Continue Timing" msgstr "Fortstt tidtagning" #: main.c:1989 msgid "Welcome to" msgstr "Vlkommen till" #: main.c:2016 msgid "GTK+ runtime" msgstr "GTK+ runtime" #: main.c:2018 msgid "Home page" msgstr "Hemsida" #: main.c:2024 msgid "options" msgstr "instllning" #: main.c:2026 msgid "don't display the splash screen" msgstr "vissa inte start skrm" #: main.c:2028 msgid "display this help info" msgstr "vissa denna hjlp" #: main.c:2030 msgid "display the version" msgstr "vissa version" #: main.c:2032 msgid "specify the midnight offset" msgstr "specificera midnatts offset" #: main.c:2034 msgid "start timing the specified task" msgstr "starta tidtagning fr vald uppgift" #: main.c:2094 msgid "unable to create directory" msgstr "kunde inte skapa katalog" #: main.c:2124 main.c:2139 msgid "requires an argument" msgstr "mste ha ett argument" #: main.c:2145 msgid "requires a number" msgstr "mste ha numeriskt vrde" #: main.c:2146 msgid "not" msgstr "inte" #: main.c:2157 msgid "Invalid offset for" msgstr "Oknt " #: main.c:2159 msgid "Format should be" msgstr "Formatet borde vara" #: main.c:2181 msgid "Ingoring unknown option" msgstr "Ignorerar oknt val" #: main.c:2305 msgid "not found" msgstr "inte hittad" #: report.c:309 report.c:369 msgid "writing to file" msgstr "spara till fil" #: report.c:332 msgid "Save Report" msgstr "Spara rapport" #: report.c:359 msgid "You must enter a print command" msgstr "DU mste lgga till ett utskrift kommando" #: report.c:379 msgid "Error printing" msgstr "Fel vid utskrift" #: report.c:416 msgid "Print Report" msgstr "Skriv ut rapport" #: report.c:433 msgid "Print Command" msgstr "Utskrift kommando" #: report.c:530 msgid "Print" msgstr "Skriv ut" #: report.c:720 report.c:725 msgid "Total" msgstr "Totalt" #: report.c:739 report.c:746 msgid "Week" msgstr "Vecka" #: report.c:740 report.c:747 msgid "to" msgstr "till" #: report.c:814 report.c:819 msgid "Month" msgstr "Mnad" #: report.c:881 report.c:886 msgid "Year" msgstr "r" #: report.c:946 report.c:951 msgid "Totals" msgstr "Totalt" #: report.c:1041 msgid "" "Could not find \"netscape\"\n" "in your path." msgstr "Kunde inte hitta \"netscape\"\n" "i din skvg." #: report.c:1056 msgid "Error communicating with Netscape." msgstr "Fel vid kommunikation med Netscape." #: report.c:1090 unhide.c:101 msgid "You have not selected any tasks" msgstr "Du har inte valt ngon uppgift" #: report.c:1121 msgid "" "You must select either \"include hours\"\n" "or \"include annotations\"." msgstr "" "Du mste vlja anntingen \"vissa timmar\"\n" "eller \"vissa kommentarer\"" #: report.c:1172 msgid "Error opening temporary file" msgstr "Fel vid ppnande av temporr fil" #: report.c:1242 msgid "Generated by" msgstr "Genererad av" #: report.c:1257 msgid "Error reading" msgstr "Fel vid lsning" #: report.c:1438 msgid "Format: " msgstr "Format: " #: report.c:1450 msgid "Data: " msgstr "Data: " #: report.c:1464 unhide.c:209 msgid "Tasks to include:" msgstr "Uppgifter som skall ing:" #: report.c:1534 unhide.c:285 msgid "Select all" msgstr "Markera alla" #: report.c:1542 unhide.c:293 msgid "Select none" msgstr "Avmarkera alla" #: task.c:532 msgid "System Error" msgstr "System Fel" #: task.c:535 msgid "Invalid task data file format" msgstr "Felaktigt filformatet p uppgift data filen." #: task.c:537 msgid "Unknown error" msgstr "Oknt fel" #: unhide.c:203 msgid "Unhide" msgstr "Vissa" #: xextras.c:61 xextras.c:73 msgid "Received X error. See ya!" msgstr "Fel X har uppsttt. Syns!" gtimer-2.0.0/po/es.po0000644000175000017500000002442111353237102014573 0ustar cknudsencknudsenmsgid "" msgstr "" "Date: 1999-03-18 17:50:49-0500\n" "Last-Translator: Carlos Fernandez \n" "Content-Type: text/plain; charset=\n" "Xgettext-Options: \n" "Files: annotate.c config.c confirm.c edit.c main.c report.c task.c unhide.c xextras.c\n" #: annotate.c:106 msgid "Annotation added" msgstr "Nota aadida" #: annotate.c:148 msgid "Add Annotation" msgstr "Aadir Nota" #: annotate.c:159 msgid "Enter annotation for" msgstr "Entre nota para" #: annotate.c:189 edit.c:218 main.c:639 main.c:660 main.c:682 main.c:714 main.c:739 main.c:790 main.c:797 main.c:814 main.c:823 main.c:853 main.c:862 main.c:893 main.c:1048 report.c:311 report.c:359 report.c:371 report.c:379 report.c:446 report.c:537 report.c:1042 report.c:1057 report.c:1091 report.c:1122 report.c:1173 report.c:1513 unhide.c:102 unhide.c:264 msgid "Ok" msgstr "" #: annotate.c:200 edit.c:229 main.c:797 report.c:455 report.c:1525 unhide.c:276 msgid "Cancel" msgstr "Cancelar" #: edit.c:106 msgid "Task updated" msgstr "Tarea actualizada" #: edit.c:133 msgid "Task added" msgstr "Tarea aadida" #: edit.c:178 msgid "Edit Task" msgstr "Editar Tarea" #: edit.c:180 msgid "Add Task" msgstr "Aadir Tarea" #: edit.c:193 msgid "Task name" msgstr "Descripcin de la tarea" #: edit.c:206 msgid "Unnamed Task" msgstr "Tarea Annima" #: main.c:423 msgid "About..." msgstr "Acerca de..." #: main.c:424 report.c:523 msgid "Save" msgstr "Guardar" #: main.c:425 msgid "Exit" msgstr "Salir" #: main.c:426 main.c:1810 msgid "Idle Detect" msgstr "Deteccin de Inactividad" #: main.c:427 msgid "Toolbar" msgstr "Barra de tiles" #: main.c:428 msgid "Animate" msgstr "Animar" #: main.c:429 msgid "Auto Save" msgstr "Autoguardado" #: main.c:430 msgid "Start Timing" msgstr "Comenzar Cronometraje" #: main.c:431 msgid "Stop Timing" msgstr "Detener Cronometraje" #: main.c:432 msgid "Stop All Timing" msgstr "Detener Todo Cronometraje" #: main.c:433 msgid "New..." msgstr "Nuevo" #: main.c:434 msgid "Edit..." msgstr "Editar..." #: main.c:435 msgid "Annotate..." msgstr "Anotar..." #: main.c:436 msgid "Hide" msgstr "Esconder" #: main.c:437 msgid "Unhide..." msgstr "Mostrar..." #: main.c:438 msgid "Delete" msgstr "Borrar" #: main.c:439 msgid "Increment 5 seconds" msgstr "Incrementar 5 minutos" #: main.c:440 msgid "Increment 30 seconds" msgstr "Incrementar 30 minutos" #: main.c:441 msgid "Decrement 5 seconds" msgstr "Decrementar 5 minutos" #: main.c:442 msgid "Decrement 30 seconds" msgstr "Decrementar 30 minutos" #: main.c:443 msgid "Set to Zero" msgstr "Fijar a Cero" #: main.c:444 msgid "Daily..." msgstr "Diario..." #: main.c:445 msgid "Weekly..." msgstr "Semanal..." #: main.c:446 msgid "Monthly..." msgstr "Mensual..." #: main.c:447 msgid "Yearly..." msgstr "Anual..." #: main.c:450 msgid "Start Timing the Selected Task" msgstr "Comenzar Cronometraje de la Tarea Escogida" #: main.c:452 msgid "Stop Timing the Selected Task" msgstr "Detener Cronometraje de la Tarea Escogida" #: main.c:454 msgid "Stop Timing All Tasks" msgstr "Detener Cronometraje de Todas las Tareas" #: main.c:456 msgid "Add Annotation to Selected Task" msgstr "Aadir Nota a la Tarea Escogida" #: main.c:458 msgid "Add New Task" msgstr "Aadir Tarea Nueva" #: main.c:460 msgid "Edit Name of the Selected Task" msgstr "Editar Descripcin de la Tarea Escogida" #: main.c:618 msgid "All data saved" msgstr "Todos los datos guardados" #: main.c:630 main.c:631 msgid "Version" msgstr "Versin" #: main.c:633 msgid "Author" msgstr "Autor" #: main.c:637 msgid "About" msgstr "Acerca de" #: main.c:658 main.c:680 main.c:712 main.c:737 main.c:788 main.c:812 main.c:821 main.c:851 main.c:860 main.c:891 main.c:1046 main.c:2094 main.c:2124 main.c:2139 main.c:2145 report.c:308 report.c:311 report.c:358 report.c:368 report.c:371 report.c:379 report.c:1040 report.c:1056 report.c:1089 report.c:1120 report.c:1171 unhide.c:100 msgid "Error" msgstr "Error" #: main.c:659 msgid "" "You have not selected\n" "a task to edit." msgstr "No ha escogido\n" "una tarea para editar." #: main.c:681 msgid "" "You have not selected\n" "a task to hide." msgstr "No ha escogido\n" "una tarea para esconder." #: main.c:697 msgid "Task hidden" msgstr "Tarea escondida" #: main.c:713 msgid "There are no hidden tasks." msgstr "No hay tareas escondidas." #: main.c:735 msgid "Error deleting task" msgstr "Error al borrar tarea" #: main.c:774 msgid "Task removed" msgstr "Tarea removida" #: main.c:789 msgid "" "You have not selected\n" "a task to delete." msgstr "No ha escogido\n" "una tarea para borrar." #: main.c:795 msgid "Delete Task?" msgstr "Borrar la Tarea?" #: main.c:796 msgid "" "Are you sure you want\n" "to delete this task?" msgstr "Est seguro que quiere\n" "borrar esta tarea?" #: main.c:813 msgid "" "You have not selected\n" "a task to start timing." msgstr "No ha escogido una tarea\n" "para comenzar a cronometrar." #: main.c:822 msgid "Task is already being timed." msgstr "Esta tarea ya est siendo cronometrada." #: main.c:852 msgid "" "You have not selected\n" "a task to stop timing." msgstr "No ha escogido una tarea\n" "para detener su cronometraje." #: main.c:861 msgid "Task is not being timed." msgstr "Esta tarea no est siendo cronometrada." #: main.c:892 msgid "" "You have not selected\n" "a task to annotate." msgstr "No ha escogido\n" "una tarea para anotar." #: main.c:1047 msgid "" "You have not selected\n" "a task to adjust the time for." msgstr "No ha escogido una\n" "tarea para ajustarle el tiempo." #: main.c:1347 msgid "File" msgstr "Archivo" #: main.c:1381 msgid "Options" msgstr "Opciones" #: main.c:1409 main.c:2305 msgid "Task" msgstr "Tarea" #: main.c:1419 report.c:482 report.c:1224 report.c:1410 msgid "Report" msgstr "Informe" #: main.c:1605 msgid "Today" msgstr "Hoy" #: main.c:1805 msgid "You have been idle for" msgstr "Ud. ha estado inactivo por" #: main.c:1806 msgid "minutes" msgstr "minutos" #: main.c:1806 msgid "since" msgstr "desde" #: main.c:1808 msgid "" "Do you wish to revert\n" "to before the idle?" msgstr "Desea revertir a\n" "como antes de la inactividad?" #: main.c:1811 msgid "Revert" msgstr "Revertir" #: main.c:1811 msgid "Continue Timing" msgstr "Continuar Cronometraje" #: main.c:1989 msgid "Welcome to" msgstr "Bienvevenido a" #: main.c:2016 msgid "GTK+ runtime" msgstr "Ambiente de ejecucin GTK+" #: main.c:2018 msgid "Home page" msgstr "Pgina web" #: main.c:2024 msgid "options" msgstr "opciones" #: main.c:2026 msgid "don't display the splash screen" msgstr "no mostrar la imagen de bienvenida" #: main.c:2028 msgid "display this help info" msgstr "mostrar la informacin de ayuda" #: main.c:2030 msgid "display the version" msgstr "mostrar la versin" #: main.c:2032 msgid "specify the midnight offset" msgstr "Especificar desplazamiento de medianoche" #: main.c:2034 msgid "start timing the specified task" msgstr "comenzar cronometraje de la tarea escogida" #: main.c:2094 msgid "unable to create directory" msgstr "incapaz de crear directorio" #: main.c:2124 main.c:2139 msgid "requires an argument" msgstr "requiere un argumento" #: main.c:2145 msgid "requires a number" msgstr "requiere un nmero" #: main.c:2146 msgid "not" msgstr "no" #: main.c:2157 msgid "Invalid offset for" msgstr "Ajuste incorrecto para" #: main.c:2159 msgid "Format should be" msgstr "El formato debe ser" #: main.c:2181 msgid "Ingoring unknown option" msgstr "Ignorando opcin desconocida" #: main.c:2305 msgid "not found" msgstr "no fue encontrado" #: report.c:309 report.c:369 msgid "writing to file" msgstr "escribiendo a archivo" #: report.c:332 msgid "Save Report" msgstr "Guardar Informe" #: report.c:359 msgid "You must enter a print command" msgstr "Debe entrar un comando de impresin" #: report.c:379 msgid "Error printing" msgstr "Error al imprimir" #: report.c:416 msgid "Print Report" msgstr "Imprimir Informe" #: report.c:433 msgid "Print Command" msgstr "Comando de impresin" #: report.c:530 msgid "Print" msgstr "Imprimir" #: report.c:720 report.c:725 msgid "Total" msgstr "Total" #: report.c:739 report.c:746 msgid "Week" msgstr "Semana" #: report.c:740 report.c:747 msgid "to" msgstr "a" #: report.c:814 report.c:819 msgid "Month" msgstr "Mes" #: report.c:881 report.c:886 msgid "Year" msgstr "Ao" #: report.c:946 report.c:951 msgid "Totals" msgstr "Totales" #: report.c:1041 msgid "" "Could not find \"netscape\"\n" "in your path." msgstr "No se pudo encontrar a \"netscape\"\n" "en su camino de bsqueda de programas." #: report.c:1056 msgid "Error communicating with Netscape." msgstr "Error comunicando con Netscape." #: report.c:1090 unhide.c:101 msgid "You have not selected any tasks" msgstr "No ha escogido ninguna tarea" #: report.c:1121 msgid "" "You must select either \"include hours\"\n" "or \"include annotations\"." msgstr "Debe escoger \"incluir horas\"\n" "o \"incluir notas\"." #: report.c:1172 msgid "Error opening temporary file" msgstr "Error al abrir archivo temporero" #: report.c:1242 msgid "Generated by" msgstr "Generado por" #: report.c:1257 msgid "Error reading" msgstr "Error al leer" #: report.c:1438 msgid "Format: " msgstr "Formato: " #: report.c:1450 msgid "Data: " msgstr "Datos: " #: report.c:1464 unhide.c:209 msgid "Tasks to include:" msgstr "Tareas a incluir:" #: report.c:1534 unhide.c:285 msgid "Select all" msgstr "Escoger todo" #: report.c:1542 unhide.c:293 msgid "Select none" msgstr "Escoger nada" #: task.c:532 msgid "System Error" msgstr "Error del sistema" #: task.c:535 msgid "Invalid task data file format" msgstr "Formato de archivo de tareas incorrecto" #: task.c:537 msgid "Unknown error" msgstr "Error desconocido" #: unhide.c:203 msgid "Unhide" msgstr "Mostrar" #: xextras.c:61 xextras.c:73 msgid "Received X error. See ya!" msgstr "Error X recibido. Hasta luego!" # msgid "GTimer: Idle Detect" # msgstr "GTimer: Deteccin de Inactividad" # # msgid "Confirm: Delete Task" # msgstr "Confirmez: Borrar Tarea" # gtimer-2.0.0/po/messages.po0000644000175000017500000003344511353237102016001 0ustar cknudsencknudsen# 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: 2010-03-26 12:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Craig Knudsen \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: annotate.c:99 msgid "Annotation added" msgstr "" #: annotate.c:141 msgid "Add Annotation" msgstr "" #: annotate.c:152 msgid "Enter annotation for" msgstr "" #: annotate.c:172 changelog.c:133 edit.c:231 edit.c:488 edit.c:600 main.c:923 #: main.c:948 main.c:972 main.c:992 main.c:1021 main.c:1046 main.c:1094 #: main.c:1101 main.c:1116 main.c:1125 main.c:1154 main.c:1163 main.c:1193 #: main.c:1335 main.c:1343 main.c:1424 main.c:1589 main.c:1712 main.c:1720 #: main.c:1729 main.c:1734 main.c:1744 main.c:1781 main.c:1795 report.c:381 #: report.c:436 report.c:447 report.c:456 report.c:521 report.c:1316 #: report.c:1335 report.c:1391 report.c:1422 report.c:1498 report.c:1958 #: unhide.c:115 unhide.c:286 msgid "Ok" msgstr "" #: annotate.c:183 edit.c:242 edit.c:499 edit.c:608 main.c:1101 report.c:530 #: report.c:1970 unhide.c:298 msgid "Cancel" msgstr "" #: changelog.c:97 msgid "Change Log" msgstr "" #: edit.c:117 msgid "Project updated" msgstr "" #: edit.c:134 msgid "Project added" msgstr "" #: edit.c:189 main.c:406 msgid "Edit Project" msgstr "" #: edit.c:191 msgid "Add Project" msgstr "" #: edit.c:204 msgid "Project name" msgstr "" #: edit.c:218 edit.c:220 msgid "Unnamed Project" msgstr "" #: edit.c:329 edit.c:358 msgid "Task updated" msgstr "" #: edit.c:406 msgid "Edit Task" msgstr "" #: edit.c:408 msgid "Add Task" msgstr "" #: edit.c:427 msgid "Project " msgstr "" #: edit.c:460 msgid "Task name" msgstr "" #: edit.c:475 edit.c:477 msgid "Unnamed Task" msgstr "" #: edit.c:559 msgid "Change Browser" msgstr "" #: edit.c:580 msgid "Command" msgstr "" #: main.c:349 msgid "MM|_File" msgstr "" #: main.c:350 msgid "MM|_Edit" msgstr "" #: main.c:351 msgid "MM|_Options" msgstr "" #: main.c:352 msgid "MM|_Task" msgstr "" #: main.c:353 msgid "MM|_Project" msgstr "" #: main.c:354 msgid "MM|_Report" msgstr "" #: main.c:355 msgid "MM|_Tools" msgstr "" #: main.c:356 msgid "MM|_Help" msgstr "" #: main.c:357 msgid "FM|_Save" msgstr "" #: main.c:358 msgid "Save actual state" msgstr "" #: main.c:359 msgid "FM|_Exit" msgstr "" #: main.c:360 msgid "Exit program" msgstr "" #: main.c:361 msgid "EM|C_ut Time" msgstr "" #: main.c:362 msgid "Cut actual time from line to buffer" msgstr "" #: main.c:363 msgid "EM|_Copy Time" msgstr "" #: main.c:364 msgid "Copy actual time from line to buffer" msgstr "" #: main.c:365 msgid "EM|_Paste Time" msgstr "" #: main.c:366 msgid "Paste actual time from buffer to actual line" msgstr "" #: main.c:367 msgid "EM|Clear _Buffer" msgstr "" #: main.c:368 msgid "Clear buffer" msgstr "" #: main.c:369 msgid "OM|_Browser ..." msgstr "" #: main.c:370 msgid "Set your preferred web browser" msgstr "" #: main.c:371 msgid "TM|_Start Timing" msgstr "" #: main.c:372 msgid "Start timing of selected task" msgstr "" #: main.c:373 msgid "TM|S_top Timing" msgstr "" #: main.c:374 msgid "Stop timing of selected task" msgstr "" #: main.c:375 msgid "TM|Stop A_ll Timing" msgstr "" #: main.c:376 msgid "Stop timing of all running tasks" msgstr "" #: main.c:377 msgid "TM|_New..." msgstr "" #: main.c:378 msgid "Create new task" msgstr "" #: main.c:379 msgid "TM|_Edit... " msgstr "" #: main.c:380 msgid "Edit selected task" msgstr "" #: main.c:381 msgid "TM|_Annotate..." msgstr "" #: main.c:382 main.c:388 msgid "Add annotation" msgstr "" #: main.c:383 msgid "TM|_Hide" msgstr "" #: main.c:384 msgid "Hide task" msgstr "" #: main.c:385 msgid "TM|_Unhide... " msgstr "" #: main.c:386 msgid "Unhide tasks" msgstr "" #: main.c:387 msgid "TM|_Delete" msgstr "" #: main.c:389 msgid "TM|_Increment 1 minute" msgstr "" #: main.c:390 main.c:392 main.c:394 msgid "Increment time" msgstr "" #: main.c:391 msgid "TM|I_ncrement 5 minutes" msgstr "" #: main.c:393 msgid "TM|In_crement 30 minute" msgstr "" #: main.c:395 msgid "TM|Decrement _1 minute" msgstr "" #: main.c:396 main.c:398 main.c:400 msgid "Decrement time" msgstr "" #: main.c:397 msgid "TM|Decrement _5 minutes" msgstr "" #: main.c:399 msgid "TM|Decrement _30 minutes" msgstr "" #: main.c:401 msgid "TM|Set to _Zero" msgstr "" #: main.c:402 msgid "Clear time of selected task" msgstr "" #: main.c:403 msgid "PM|_New..." msgstr "" #: main.c:404 msgid "New Project" msgstr "" #: main.c:405 msgid "PM|_Edit..." msgstr "" #: main.c:407 msgid "RM|_Daily..." msgstr "" #: main.c:408 msgid "Daily Report" msgstr "" #: main.c:409 msgid "RM|_Weekly..." msgstr "" #: main.c:410 msgid "Weekly Report" msgstr "" #: main.c:411 msgid "RM|_Monthly..." msgstr "" #: main.c:412 msgid "Monthly Report" msgstr "" #: main.c:413 msgid "RM|_Yearly..." msgstr "" #: main.c:414 msgid "Yearly Report" msgstr "" #: main.c:415 msgid "TL|_Check for New Version..." msgstr "" #: main.c:416 msgid "Keep your program updated" msgstr "" #: main.c:417 msgid "HM|_About..." msgstr "" #: main.c:418 main.c:921 msgid "About" msgstr "" #: main.c:419 msgid "HM|View _Change log..." msgstr "" #: main.c:420 msgid "Changelog" msgstr "" #: main.c:421 msgid "HM|Visit _Website..." msgstr "" #: main.c:422 msgid "Open web browser" msgstr "" #: main.c:433 msgid "OM|_Toolbar" msgstr "" #: main.c:435 msgid "OM|_Animate" msgstr "" #: main.c:437 msgid "OM|_Idle Detect" msgstr "" #: main.c:439 msgid "OM|Auto _Save" msgstr "" #: main.c:555 msgid "Start" msgstr "" #: main.c:556 msgid "Start Timing the Selected Task" msgstr "" #: main.c:559 msgid "Stop" msgstr "" #: main.c:560 msgid "Stop Timing the Selected Task" msgstr "" #: main.c:563 msgid "Stop All" msgstr "" #: main.c:564 msgid "Stop Timing All Tasks" msgstr "" #: main.c:567 msgid "Annotate" msgstr "" #: main.c:568 msgid "Add Annotation to Selected Task" msgstr "" #: main.c:571 msgid "Add" msgstr "" #: main.c:572 msgid "Add New Task" msgstr "" #: main.c:575 msgid "Edit" msgstr "" #: main.c:576 msgid "Edit Name of the Selected Task" msgstr "" #: main.c:904 msgid "All data saved" msgstr "" #: main.c:914 main.c:915 main.c:1727 main.c:1732 main.c:1743 msgid "Version" msgstr "" #: main.c:917 msgid "Author" msgstr "" #: main.c:947 main.c:970 main.c:990 main.c:1019 main.c:1044 main.c:1092 #: main.c:1114 main.c:1123 main.c:1152 main.c:1161 main.c:1191 main.c:1333 #: main.c:1341 main.c:1422 main.c:1587 main.c:1710 main.c:1718 main.c:1781 #: main.c:1795 main.c:2838 main.c:2867 main.c:2873 main.c:2896 main.c:2902 #: report.c:378 report.c:381 report.c:434 report.c:444 report.c:446 #: report.c:455 report.c:1314 report.c:1334 report.c:1389 report.c:1420 #: report.c:1496 unhide.c:113 msgid "Error" msgstr "" #: main.c:947 report.c:1334 msgid "Error communicating with browser." msgstr "" #: main.c:971 msgid "" "You have not selected\n" "a task to edit." msgstr "" #: main.c:991 msgid "" "You have not selected\n" "a task to hide." msgstr "" #: main.c:1006 msgid "Task hidden" msgstr "" #: main.c:1020 msgid "There are no hidden tasks." msgstr "" #: main.c:1042 msgid "Error deleting task" msgstr "" #: main.c:1080 msgid "Task removed" msgstr "" #: main.c:1093 msgid "" "You have not selected\n" "a task to delete." msgstr "" #: main.c:1099 msgid "Delete Task?" msgstr "" #: main.c:1100 msgid "" "Are you sure you want\n" "to delete this task?" msgstr "" #: main.c:1115 msgid "" "You have not selected\n" "a task to start timing." msgstr "" #: main.c:1124 msgid "Task is already being timed." msgstr "" #: main.c:1153 msgid "" "You have not selected\n" "a task to stop timing." msgstr "" #: main.c:1162 msgid "Task is not being timed." msgstr "" #: main.c:1192 msgid "" "You have not selected\n" "a task to annotate." msgstr "" #: main.c:1334 msgid "" "You have not selected\n" "a task." msgstr "" #: main.c:1342 msgid "" "The selected task does not\n" "have a project." msgstr "" #: main.c:1410 msgid "Cut/Paste buffer is" msgstr "" #: main.c:1423 msgid "" "You have not selected\n" "a task to adjust the time for." msgstr "" #: main.c:1588 msgid "You have not selected a task." msgstr "" #: main.c:1711 msgid "This service is no longer available." msgstr "" #: main.c:1719 msgid "Unable to determine available GTimer version." msgstr "" #: main.c:1728 msgid "You have the most recent version of GTimer." msgstr "" #: main.c:1733 msgid "" "Strange.... You seem to have a more recent version\n" "of GTimer than is available on the server." msgstr "" #: main.c:1738 msgid "There is a new version of GTimer available" msgstr "" #: main.c:1740 msgid "You can download it at" msgstr "" #: main.c:1776 msgid "" "An error occurred while\n" "checking for a new version." msgstr "" #: main.c:1778 main.c:1792 msgid "HTTP Error" msgstr "" #: main.c:1871 msgid "Sorted by project creation date" msgstr "" #: main.c:1875 msgid "Sorted by project name" msgstr "" #: main.c:1882 msgid "Sorted by task name" msgstr "" #: main.c:1886 msgid "Sorted by task creation date" msgstr "" #: main.c:1892 msgid "Sorted by time for today" msgstr "" #: main.c:1898 msgid "Sorted by total time" msgstr "" #: main.c:2058 #, c-format msgid "Building menu Failed: %s \n" msgstr "" #: main.c:2234 report.c:163 msgid "Today" msgstr "" #: main.c:2492 msgid "You have been idle for" msgstr "" #: main.c:2493 msgid "minutes" msgstr "" #: main.c:2493 msgid "since" msgstr "" #: main.c:2495 msgid "You may now:" msgstr "" #: main.c:2497 msgid "Revert to back to before the idle" msgstr "" #: main.c:2499 msgid "Continue timing, ignoring the idle" msgstr "" #: main.c:2501 msgid "Resume timing from when the idle started" msgstr "" #: main.c:2503 msgid "Idle Detect" msgstr "" #: main.c:2504 msgid "Revert" msgstr "" #: main.c:2504 msgid "Continue" msgstr "" #: main.c:2504 msgid "Resume" msgstr "" #: main.c:2713 msgid "GTK+ runtime" msgstr "" #: main.c:2715 msgid "Home page" msgstr "" #: main.c:2721 msgid "options" msgstr "" #: main.c:2723 msgid "don't display the splash screen" msgstr "" #: main.c:2725 msgid "display this help info" msgstr "" #: main.c:2727 msgid "display the version" msgstr "" #: main.c:2729 msgid "specify the midnight offset" msgstr "" #: main.c:2731 msgid "start timing the specified task" msgstr "" #: main.c:2733 msgid "use N as the first day of weeks" msgstr "" #: main.c:2838 main.c:2867 main.c:2896 msgid "requires an argument" msgstr "" #: main.c:2873 main.c:2902 msgid "requires a number" msgstr "" #: main.c:2874 main.c:2903 msgid "not" msgstr "" #: main.c:2885 msgid "Invalid offset for" msgstr "" #: main.c:2887 msgid "Format should be" msgstr "" #: main.c:2910 msgid "Invalid day of week number for" msgstr "" #: main.c:2929 msgid "Ingoring unknown option" msgstr "" #: main.c:3059 msgid "Task" msgstr "" #: main.c:3059 msgid "not found" msgstr "" #: main.c:3107 msgid "Welcome to" msgstr "" #: project.c:431 msgid "System Error" msgstr "" #: project.c:434 msgid "Invalid project data file format" msgstr "" #: project.c:436 msgid "Unknown error" msgstr "" #: report.c:164 msgid "This Week" msgstr "" #: report.c:165 msgid "Last Week" msgstr "" #: report.c:166 msgid "This Week & Last Week" msgstr "" #: report.c:167 msgid "Last Two Weeks" msgstr "" #: report.c:168 msgid "This Month" msgstr "" #: report.c:169 msgid "Last Month" msgstr "" #: report.c:170 msgid "This Year" msgstr "" #: report.c:171 msgid "Last Year" msgstr "" #: report.c:178 msgid "Text" msgstr "" #: report.c:179 msgid "HTML" msgstr "" #: report.c:186 msgid "Hours worked" msgstr "" #: report.c:187 msgid "Annotations" msgstr "" #: report.c:188 msgid "Hours & Annotations" msgstr "" #: report.c:199 msgid "None" msgstr "" #: report.c:200 msgid "Minute" msgstr "" #: report.c:201 msgid "5 Minutes" msgstr "" #: report.c:202 msgid "10 Minutes" msgstr "" #: report.c:203 msgid "15 minutes" msgstr "" #: report.c:204 msgid "30 Minutes" msgstr "" #: report.c:205 msgid "Hour" msgstr "" #: report.c:379 msgid "writing to file" msgstr "" #: report.c:403 msgid "Save Report" msgstr "" #: report.c:435 msgid "You must enter a print command" msgstr "" #: report.c:445 report.c:455 msgid "Error printing" msgstr "" #: report.c:493 msgid "Print Report" msgstr "" #: report.c:508 msgid "Print Command" msgstr "" #: report.c:653 report.c:1563 report.c:1809 msgid "Report" msgstr "" #: report.c:959 report.c:964 msgid "Total" msgstr "" #: report.c:978 report.c:984 msgid "Week" msgstr "" #: report.c:979 report.c:985 msgid "to" msgstr "" #: report.c:1060 report.c:1065 msgid "Month" msgstr "" #: report.c:1136 report.c:1141 msgid "Year" msgstr "" #: report.c:1210 report.c:1215 msgid "Totals" msgstr "" #: report.c:1315 report.c:1497 msgid "Error opening temporary file" msgstr "" #: report.c:1390 unhide.c:114 msgid "You have not selected any tasks" msgstr "" #: report.c:1421 msgid "" "You must select either \"include hours\"\n" "or \"include annotations\"." msgstr "" #: report.c:1593 report.c:1598 msgid "Grand Total" msgstr "" #: report.c:1602 msgid "Generated by" msgstr "" #: report.c:1846 msgid "Format: " msgstr "" #: report.c:1858 msgid "Data: " msgstr "" #: report.c:1870 msgid "Rounding: " msgstr "" #: report.c:1890 unhide.c:226 msgid "Tasks to include:" msgstr "" #: report.c:1939 unhide.c:269 msgid "[Project] Task" msgstr "" #: report.c:1979 unhide.c:307 msgid "Select all" msgstr "" #: report.c:1987 unhide.c:315 msgid "Select none" msgstr "" #: task.c:620 #, c-format msgid "System Error (%d)" msgstr "" #: task.c:623 msgid "Invalid task data file format" msgstr "" #: task.c:625 #, c-format msgid "Unknown error (%d)" msgstr "" #: unhide.c:220 msgid "Unhide" msgstr "" #: xextras.c:57 xextras.c:69 msgid "Received X error. See ya!" msgstr "" gtimer-2.0.0/po/cs.po0000644000175000017500000004427111353237102014576 0ustar cknudsencknudsen# Czech translations for gtimer package. # Copyright (C) 2008 THE gtimer'S COPYRIGHT HOLDER # This file is distributed under the same license as the gtimer package. # Pavel Vávra , 2008. # # Based on translations of David Sauer , 1999 # msgid "" msgstr "" "Project-Id-Version: gtimer 1.1.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-09-17 23:48+0200\n" "PO-Revision-Date: 2008-09-15 22:35+0200\n" "Last-Translator: Pavel Vávra \n" "Language-Team: Czech\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: annotate.c:99 msgid "Annotation added" msgstr "Poznáka přidána" #: annotate.c:141 msgid "Add Annotation" msgstr "Přidat poznámku" #: annotate.c:152 msgid "Enter annotation for" msgstr "Zadejte poznámku pro" #: annotate.c:172 edit.c:231 edit.c:488 edit.c:600 changelog.c:128 main.c:923 #: main.c:948 main.c:972 main.c:992 main.c:1021 main.c:1046 main.c:1094 #: main.c:1101 main.c:1116 main.c:1125 main.c:1154 main.c:1163 main.c:1193 #: main.c:1335 main.c:1343 main.c:1424 main.c:1589 main.c:1712 main.c:1720 #: main.c:1729 main.c:1734 main.c:1744 main.c:1781 main.c:1795 report.c:381 #: report.c:436 report.c:447 report.c:456 report.c:521 report.c:1316 #: report.c:1335 report.c:1391 report.c:1422 report.c:1498 report.c:1958 #: unhide.c:115 unhide.c:286 msgid "Ok" msgstr "Ok" #: annotate.c:183 edit.c:242 edit.c:499 edit.c:608 main.c:1101 report.c:530 #: report.c:1970 unhide.c:298 msgid "Cancel" msgstr "Zrušit" #: edit.c:117 msgid "Project updated" msgstr "Projekt zaktualizován" #: edit.c:134 msgid "Project added" msgstr "Přidán nový projekt" #: edit.c:189 main.c:406 msgid "Edit Project" msgstr "Změna názvu projektu" #: edit.c:191 msgid "Add Project" msgstr "Přidání projektu" #: edit.c:204 msgid "Project name" msgstr "Jméno projektu" #: edit.c:218 edit.c:220 msgid "Unnamed Project" msgstr "Nepojmenovaný projekt" #: edit.c:329 edit.c:358 msgid "Task updated" msgstr "Úloha aktualizována" #: edit.c:406 msgid "Edit Task" msgstr "Změna úlohy" #: edit.c:408 msgid "Add Task" msgstr "Přidání úlohy" #: edit.c:427 msgid "Project " msgstr "Projekt " #: edit.c:460 msgid "Task name" msgstr "Jméno úlohy" #: edit.c:475 edit.c:477 msgid "Unnamed Task" msgstr "Nepojmenovaná úloha" #: edit.c:559 msgid "Change Browser" msgstr "Změna prohlížeče webu" #: edit.c:580 msgid "Command" msgstr "Příkaz" #: changelog.c:92 msgid "Change Log" msgstr "Zobrazit Change log (anglicky)" #: main.c:349 msgid "MM|_File" msgstr "MM|_Soubor" #: main.c:350 msgid "MM|_Edit" msgstr "MM|Úp_ravy" #: main.c:351 msgid "MM|_Options" msgstr "MM|_Nastavení" #: main.c:352 msgid "MM|_Task" msgstr "MM|Ú_loha" #: main.c:353 msgid "MM|_Project" msgstr "MM|_Projekt" #: main.c:354 msgid "MM|_Report" msgstr "MM|_Výkaz" #: main.c:355 msgid "MM|_Tools" msgstr "MM|Nás_troje" #: main.c:356 msgid "MM|_Help" msgstr "MM|Nápověd_a" #: main.c:357 msgid "FM|_Save" msgstr "FM|_Uložit" #: main.c:358 msgid "Save actual state" msgstr "Uložit momentální stav" #: main.c:359 msgid "FM|_Exit" msgstr "FM|U_končit" #: main.c:360 msgid "Exit program" msgstr "Ukončit program" #: main.c:361 msgid "EM|C_ut Time" msgstr "EM|_Vyjmout čas" #: main.c:362 msgid "Cut actual time from line to buffer" msgstr "Vyjmout dnešní čas z aktuální řádky do bufferu" #: main.c:363 msgid "EM|_Copy Time" msgstr "EM|_Kopírovat" #: main.c:364 msgid "Copy actual time from line to buffer" msgstr "Zkopírovat dnešní čas z aktuální řádky do bufferu" #: main.c:365 msgid "EM|_Paste Time" msgstr "EM|V_ložit čas" #: main.c:366 msgid "Paste actual time from buffer to actual line" msgstr "Přidat čas z bufferu na aktuální řádku" #: main.c:367 msgid "EM|Clear _Buffer" msgstr "EM|_Smazat buffer" #: main.c:368 msgid "Clear buffer" msgstr "Vynulovat časový buffer" #: main.c:369 msgid "OM|_Browser ..." msgstr "OM|_Prohlížeč" #: main.c:370 msgid "Set your preferred web browser" msgstr "Nastavit používaný prohlížeč www" #: main.c:371 msgid "TM|_Start Timing" msgstr "TM|_Měření" #: main.c:372 msgid "Start timing of selected task" msgstr "Zapnutí měření času vybrané úlohy" #: main.c:373 msgid "TM|S_top Timing" msgstr "TM|Zas_tavit" #: main.c:374 msgid "Stop timing of selected task" msgstr "Zastavení měření času vybrané úlohy" #: main.c:375 msgid "TM|Stop A_ll Timing" msgstr "TM|Zastavit _vše" #: main.c:376 msgid "Stop timing of all running tasks" msgstr "Zastavení měření času pro všechny úlohy" #: main.c:377 msgid "TM|_New..." msgstr "TM|_Nová..." #: main.c:378 msgid "Create new task" msgstr "Vytvořit novou úlohu" #: main.c:379 msgid "TM|_Edit... " msgstr "TM|Up_ravit..." #: main.c:380 msgid "Edit selected task" msgstr "Upravit existující úlohu" #: main.c:381 msgid "TM|_Annotate..." msgstr "TM|_Poznámka..." #: main.c:382 main.c:388 msgid "Add annotation" msgstr "Přidat poznámku" #: main.c:383 msgid "TM|_Hide" msgstr "TM|_Skrýt" #: main.c:384 msgid "Hide task" msgstr "Skrýt úlohu" #: main.c:385 msgid "TM|_Unhide... " msgstr "TM|Z_obrazit" #: main.c:386 msgid "Unhide tasks" msgstr "Zobrazit skryté úlohy" #: main.c:387 msgid "TM|_Delete" msgstr "TM|Vým_az" #: main.c:389 msgid "TM|_Increment 1 minute" msgstr "TM|Př_ičtení 1 minuty" #: main.c:390 main.c:392 main.c:394 msgid "Increment time" msgstr "Přidání času" #: main.c:391 msgid "TM|I_ncrement 5 minutes" msgstr "TM|Přičt_ení 5 minut" #: main.c:393 msgid "TM|In_crement 30 minute" msgstr "TM|Přičtení 30 min_ut" #: main.c:395 msgid "TM|Decrement _1 minute" msgstr "TM|Odečtení _1 minuty" #: main.c:396 main.c:398 main.c:400 msgid "Decrement time" msgstr "Odebrání času" #: main.c:397 msgid "TM|Decrement _5 minutes" msgstr "TM|Odečtení _5 minut" #: main.c:399 msgid "TM|Decrement _30 minutes" msgstr "TM|Odečtení _30 minut" #: main.c:401 msgid "TM|Set to _Zero" msgstr "TM|_Znulovat" #: main.c:402 msgid "Clear time of selected task" msgstr "Znulovat dnešní čas vybrané úlohy" #: main.c:403 msgid "PM|_New..." msgstr "PM|_Nový..." #: main.c:404 msgid "New Project" msgstr "Nový projekt" #: main.c:405 msgid "PM|_Edit..." msgstr "PM|Up_ravit..." #: main.c:407 msgid "RM|_Daily..." msgstr "RM|_Denní" #: main.c:408 msgid "Daily Report" msgstr "Výkaz prace po dnech" #: main.c:409 msgid "RM|_Weekly..." msgstr "RM|_Týdenní" #: main.c:410 msgid "Weekly Report" msgstr "Výkaz prace po týdnech" #: main.c:411 msgid "RM|_Monthly..." msgstr "RM|_Měsíční" #: main.c:412 msgid "Monthly Report" msgstr "Výkaz prace po měsících" #: main.c:413 msgid "RM|_Yearly..." msgstr "RM|_Roční" #: main.c:414 msgid "Yearly Report" msgstr "Roční výkaz práce" #: main.c:415 msgid "TL|_Check for New Version..." msgstr "TL|_Kontrola nové verze" #: main.c:416 msgid "Keep your program updated" msgstr "Informovat o nové verzi" #: main.c:417 msgid "HM|_About..." msgstr "HM|_O programu" #: main.c:418 main.c:921 msgid "About" msgstr "Informace o programu" #: main.c:419 msgid "HM|View _Change log..." msgstr "HM|Zobrazit _Change log" #: main.c:420 msgid "Changelog" msgstr "Zobrazit Change log (anglicky)" #: main.c:421 msgid "HM|Visit _Website..." msgstr "HM|Prohlédnout _web programu" #: main.c:422 msgid "Open web browser" msgstr "Otevřít www prohlížeč" #: main.c:433 msgid "OM|_Toolbar" msgstr "OM|_Nástroje" #: main.c:435 msgid "OM|_Animate" msgstr "OM|_Animace" #: main.c:437 msgid "OM|_Idle Detect" msgstr "OM|_Detekce neaktivity" #: main.c:439 msgid "OM|Auto _Save" msgstr "OM|Automaticky _ukládat" #: main.c:555 msgid "Start" msgstr "Start" #: main.c:556 msgid "Start Timing the Selected Task" msgstr "Zapnutí měření času vybrané úlohy" #: main.c:559 msgid "Stop" msgstr "Stop" #: main.c:560 msgid "Stop Timing the Selected Task" msgstr "Zastavení měření času vybrané úlohy" #: main.c:563 msgid "Stop All" msgstr "Stop vše" #: main.c:564 msgid "Stop Timing All Tasks" msgstr "Zastavení měření času pro všechny úlohy" #: main.c:567 msgid "Annotate" msgstr "Poznámka" #: main.c:568 msgid "Add Annotation to Selected Task" msgstr "Přidat poznámku k vybrané úloze" #: main.c:571 msgid "Add" msgstr "Úloha" #: main.c:572 msgid "Add New Task" msgstr "Nová úloha" #: main.c:575 msgid "Edit" msgstr "Změna" #: main.c:576 msgid "Edit Name of the Selected Task" msgstr "Změna názvu vybrané úlohy" #: main.c:904 msgid "All data saved" msgstr "Data jsou uložena" #: main.c:914 main.c:915 main.c:1727 main.c:1732 main.c:1743 msgid "Version" msgstr "Verze" #: main.c:917 msgid "Author" msgstr "Autor" #: main.c:947 main.c:970 main.c:990 main.c:1019 main.c:1044 main.c:1092 #: main.c:1114 main.c:1123 main.c:1152 main.c:1161 main.c:1191 main.c:1333 #: main.c:1341 main.c:1422 main.c:1587 main.c:1710 main.c:1718 main.c:1781 #: main.c:1795 main.c:2833 main.c:2862 main.c:2868 main.c:2891 main.c:2897 #: report.c:378 report.c:381 report.c:434 report.c:444 report.c:446 #: report.c:455 report.c:1314 report.c:1334 report.c:1389 report.c:1420 #: report.c:1496 unhide.c:113 msgid "Error" msgstr "Chyba" #: main.c:947 report.c:1334 msgid "Error communicating with browser." msgstr "Chyba při komunikaci s nastaveným prohlížečem." #: main.c:971 msgid "" "You have not selected\n" "a task to edit." msgstr "" "Vyberte úlohu, kterou\n" "chcete změnit." #: main.c:991 msgid "" "You have not selected\n" "a task to hide." msgstr "" "Vyberte úlohu, kterou\n" "chcete skrýt." #: main.c:1006 msgid "Task hidden" msgstr "Úloha je skryta" #: main.c:1020 msgid "There are no hidden tasks." msgstr "Žádná úloha není skryta" #: main.c:1042 msgid "Error deleting task" msgstr "Chyba při výmazu úlohy" #: main.c:1080 msgid "Task removed" msgstr "Úloha byla vymazána" #: main.c:1093 msgid "" "You have not selected\n" "a task to delete." msgstr "" "Vyberte úlohu, kterou\n" "chcete vymazat." #: main.c:1099 msgid "Delete Task?" msgstr "Vymazat úlohu?" #: main.c:1100 msgid "" "Are you sure you want\n" "to delete this task?" msgstr "" "Opravdu chcete \n" "vymazat úlohu?" #: main.c:1115 msgid "" "You have not selected\n" "a task to start timing." msgstr "" "Vyberte úlohu, kterou\n" "chcete měřit." #: main.c:1124 msgid "Task is already being timed." msgstr "Úloha je již měřena." #: main.c:1153 msgid "" "You have not selected\n" "a task to stop timing." msgstr "" "Vyberte úlohu, kterou\n" "chcete zastavit." #: main.c:1162 msgid "Task is not being timed." msgstr "Úloha neběží." #: main.c:1192 msgid "" "You have not selected\n" "a task to annotate." msgstr "" "Vyberte úlohu, ke které\n" "chcete vložit poznámku." #: main.c:1334 msgid "" "You have not selected\n" "a task." msgstr "" "Vyberte úlohu.\n" " " #: main.c:1342 msgid "" "The selected task does not\n" "have a project." msgstr "" "Vybraná úloha npatří\n" "žádnému projektu" #: main.c:1410 msgid "Cut/Paste buffer is" msgstr "Cut/Paste buffer:" #: main.c:1423 msgid "" "You have not selected\n" "a task to adjust the time for." msgstr "" #: main.c:1588 msgid "You have not selected a task." msgstr "Není vybrána úloha." #: main.c:1711 msgid "This service is no longer available." msgstr "Tato služba již nefunguje" #: main.c:1719 msgid "Unable to determine available GTimer version." msgstr "Nemohu zjistit dostupnou verzi Gtimeru" #: main.c:1728 msgid "You have the most recent version of GTimer." msgstr "Toto je aktuální verze programu." #: main.c:1733 msgid "" "Strange.... You seem to have a more recent version\n" "of GTimer than is available on the server." msgstr "" "Hmm .... to vypadá, že tato verze programu je novější,\n" "než ta, která je k dispozici na serveru." #: main.c:1738 msgid "There is a new version of GTimer available" msgstr "Již byla vydána novější verze Gtimeru" #: main.c:1740 msgid "You can download it at" msgstr "Ta je k dispozici na" #: main.c:1776 msgid "" "An error occurred while\n" "checking for a new version." msgstr "" "Během kontroly nové verze\n" "došlo k nějaké chybě ... " #: main.c:1778 main.c:1792 msgid "HTTP Error" msgstr "Chyba protokolu http" #: main.c:1871 msgid "Sorted by project creation date" msgstr "Řazeno podle času založení projektu" #: main.c:1875 msgid "Sorted by project name" msgstr "Řazeno dle jména projektu" #: main.c:1882 msgid "Sorted by task name" msgstr "Řazeno dle jména úlohy" #: main.c:1886 msgid "Sorted by task creation date" msgstr "Řazeno podle času založení úlohy" #: main.c:1892 msgid "Sorted by time for today" msgstr "Řazeno dle dnešního času" #: main.c:1898 msgid "Sorted by total time" msgstr "Řazeno dle celkového času" #: main.c:2054 #, c-format msgid "Building menu Failed: %s \n" msgstr "Chyba při tvorbě menu: %s \n" #: main.c:2230 report.c:163 msgid "Today" msgstr "Dnes" #: main.c:2488 msgid "You have been idle for" msgstr "" #: main.c:2489 msgid "minutes" msgstr "" #: main.c:2489 msgid "since" msgstr "" #: main.c:2491 msgid "You may now:" msgstr "Můžete:" #: main.c:2493 msgid "Revert to back to before the idle" msgstr "Vrátit čas na hodnotu před dobou nečinnosti" #: main.c:2495 msgid "Continue timing, ignoring the idle" msgstr "Pokračovat v načítání času, ignorovat nečinnost" #: main.c:2497 msgid "Resume timing from when the idle started" msgstr "Pokračovat v evidenci, zkrátit čas o nečinnost" #: main.c:2499 msgid "Idle Detect" msgstr "Detekce nečinnosti" #: main.c:2500 msgid "Revert" msgstr "Vrátit" #: main.c:2500 msgid "Continue" msgstr "" #: main.c:2500 msgid "Resume" msgstr "" #: main.c:2709 msgid "GTK+ runtime" msgstr "" #: main.c:2711 msgid "Home page" msgstr "Domovská stránka" #: main.c:2717 msgid "options" msgstr "" #: main.c:2719 msgid "don't display the splash screen" msgstr "nezobrazovat úvodní obrazovku" #: main.c:2721 msgid "display this help info" msgstr "zobrazit tuto informaci" #: main.c:2723 msgid "display the version" msgstr "zobrazit verzi" #: main.c:2725 msgid "specify the midnight offset" msgstr "určit posun počátku dne" #: main.c:2727 msgid "start timing the specified task" msgstr "začít načítat čas ke specifikované úloze" #: main.c:2729 msgid "use N as the first day of weeks" msgstr "" #: main.c:2833 main.c:2862 main.c:2891 msgid "requires an argument" msgstr "" #: main.c:2868 main.c:2897 msgid "requires a number" msgstr "" #: main.c:2869 main.c:2898 msgid "not" msgstr "" #: main.c:2880 msgid "Invalid offset for" msgstr "" #: main.c:2882 msgid "Format should be" msgstr "" #: main.c:2905 msgid "Invalid day of week number for" msgstr "" #: main.c:2924 msgid "Ingoring unknown option" msgstr "" #: main.c:3054 msgid "Task" msgstr "" #: main.c:3054 msgid "not found" msgstr "" #: main.c:3102 msgid "Welcome to" msgstr "" #: project.c:431 msgid "System Error" msgstr "" #: project.c:434 msgid "Invalid project data file format" msgstr "" #: project.c:436 msgid "Unknown error" msgstr "Neznámá chyba" #: report.c:164 msgid "This Week" msgstr "Tento týden" #: report.c:165 msgid "Last Week" msgstr "Minulý týden" #: report.c:166 msgid "This Week & Last Week" msgstr "Tento a minulý týden" #: report.c:167 msgid "Last Two Weeks" msgstr "Poslední dva týdny" #: report.c:168 msgid "This Month" msgstr "Tento měsíc" #: report.c:169 msgid "Last Month" msgstr "Minulý měsíc" #: report.c:170 msgid "This Year" msgstr "Tento rok" #: report.c:171 msgid "Last Year" msgstr "Minulý rok" #: report.c:178 msgid "Text" msgstr "Text" #: report.c:179 msgid "HTML" msgstr "HTML" #: report.c:186 msgid "Hours worked" msgstr "Odpracovaný čas" #: report.c:187 msgid "Annotations" msgstr "Poznámky" #: report.c:188 msgid "Hours & Annotations" msgstr "Čas s poznámkami" #: report.c:199 msgid "None" msgstr "Žádné" #: report.c:200 msgid "Minute" msgstr "na minuty" #: report.c:201 msgid "5 Minutes" msgstr "na 5 minut" #: report.c:202 msgid "10 Minutes" msgstr "na 10 minut" #: report.c:203 msgid "15 minutes" msgstr "na 15 minut" #: report.c:204 msgid "30 Minutes" msgstr "na půlhodiny" #: report.c:205 msgid "Hour" msgstr "na hodiny" #: report.c:379 msgid "writing to file" msgstr "" #: report.c:403 msgid "Save Report" msgstr "Uložit výkaz" #: report.c:435 msgid "You must enter a print command" msgstr "Musíte zadat příkaz k tisku" #: report.c:445 report.c:455 msgid "Error printing" msgstr "" #: report.c:493 msgid "Print Report" msgstr "" #: report.c:508 msgid "Print Command" msgstr "Tiskový příkaz" #: report.c:653 report.c:1563 report.c:1809 msgid "Report" msgstr "" #: report.c:959 report.c:964 msgid "Total" msgstr "Součet" #: report.c:978 report.c:984 msgid "Week" msgstr "Týden" #: report.c:979 report.c:985 msgid "to" msgstr "" #: report.c:1060 report.c:1065 msgid "Month" msgstr "Měsíc" #: report.c:1136 report.c:1141 msgid "Year" msgstr "Rok" #: report.c:1210 report.c:1215 msgid "Totals" msgstr "Celkem" #: report.c:1315 report.c:1497 msgid "Error opening temporary file" msgstr "Chyba při otvírání dočasného souboru" #: report.c:1390 unhide.c:114 msgid "You have not selected any tasks" msgstr "Nemáte vybranou žádnou úlohu" #: report.c:1421 msgid "" "You must select either \"include hours\"\n" "or \"include annotations\"." msgstr "" "Výkaz musí obsahovat alespoň jednu věc:\n" "odpracovaný čas, nebo poznámky." #: report.c:1593 report.c:1598 msgid "Grand Total" msgstr "Celkový součet" #: report.c:1602 msgid "Generated by" msgstr "Generováno:" #: report.c:1846 msgid "Format: " msgstr "Formát:" #: report.c:1858 msgid "Data: " msgstr "Data:" #: report.c:1870 msgid "Rounding: " msgstr "Zaokrouhlení:" #: report.c:1890 unhide.c:226 msgid "Tasks to include:" msgstr "Zahrnout úlohy:" #: report.c:1939 unhide.c:269 msgid "[Project] Task" msgstr "[Projekt] Úloha" #: report.c:1979 unhide.c:307 msgid "Select all" msgstr "Vybrat vše" #: report.c:1987 unhide.c:315 msgid "Select none" msgstr "Zrušit výběr" #: task.c:620 #, c-format msgid "System Error (%d)" msgstr "Systémová chyba" #: task.c:623 msgid "Invalid task data file format" msgstr "Chybný formát souboru úlohy" #: task.c:625 #, c-format msgid "Unknown error (%d)" msgstr "Neznámá chyba (%d)" #: unhide.c:220 msgid "Unhide" msgstr "Zobrazit" #: xextras.c:57 xextras.c:69 msgid "Received X error. See ya!" msgstr "Chyba X serveru. Ehm ..." gtimer-2.0.0/po/fr.po0000644000175000017500000002313211353237102014571 0ustar cknudsencknudsenmsgid "" msgstr "" "Date: 1999-03-18 17:50:49-0500\n" "From: Craig Knudsen \n" "Content-Type: text/plain; charset=\n" "Xgettext-Options: \n" "Files: annotate.c config.c confirm.c edit.c main.c report.c task.c unhide.c xextras.c\n" #: annotate.c:106 msgid "Annotation added" msgstr "Annotation ajoute" #: annotate.c:148 msgid "Add Annotation" msgstr "Ajoutez L'Annotation" #: annotate.c:159 msgid "Enter annotation for" msgstr "crivez l'annotation pour" #: annotate.c:189 edit.c:218 main.c:639 main.c:660 main.c:682 main.c:714 main.c:739 main.c:790 main.c:797 main.c:814 main.c:823 main.c:853 main.c:862 main.c:893 main.c:1048 report.c:311 report.c:359 report.c:371 report.c:379 report.c:446 report.c:537 report.c:1042 report.c:1057 report.c:1091 report.c:1122 report.c:1173 report.c:1513 unhide.c:102 unhide.c:264 msgid "Ok" msgstr "" #: annotate.c:200 edit.c:229 main.c:797 report.c:455 report.c:1525 unhide.c:276 msgid "Cancel" msgstr "Annulent" #: edit.c:106 msgid "Task updated" msgstr "Tche mise jour" #: edit.c:133 msgid "Task added" msgstr "La tche a ajout" #: edit.c:178 msgid "Edit Task" msgstr "ditez La Tche" #: edit.c:180 msgid "Add Task" msgstr "Ajoutez La Tche" #: edit.c:193 msgid "Task name" msgstr "Nom de tche" #: edit.c:206 msgid "Unnamed Task" msgstr "Anonyme Tche" #: main.c:423 msgid "About..." msgstr "Environ" #: main.c:424 report.c:523 msgid "Save" msgstr "conomiser" #: main.c:425 msgid "Exit" msgstr "Quittent" #: main.c:426 main.c:1810 msgid "Idle Detect" msgstr "Le Ralenti Dtectent" #: main.c:427 msgid "Toolbar" msgstr "" #: main.c:428 msgid "Animate" msgstr "" #: main.c:429 msgid "Auto Save" msgstr "Automatique conomiser" #: main.c:430 msgid "Start Timing" msgstr "Commencez chronomtrer" #: main.c:431 msgid "Stop Timing" msgstr "Cessez De chronomtrer" #: main.c:432 msgid "Stop All Timing" msgstr "Arrtez Toute la Synchronisation" #: main.c:433 msgid "New..." msgstr "Nouveau" #: main.c:434 msgid "Edit..." msgstr "" #: main.c:435 msgid "Annotate..." msgstr "Annotent..." #: main.c:436 msgid "Hide" msgstr "Peau" #: main.c:437 msgid "Unhide..." msgstr "Pas Peau" #: main.c:438 msgid "Delete" msgstr "Effacement" #: main.c:439 msgid "Increment 5 seconds" msgstr "Incrment 5 secondes" #: main.c:440 msgid "Increment 30 seconds" msgstr "Incrment 30 secondes" #: main.c:441 msgid "Decrement 5 seconds" msgstr "Dcroissance 5 secondes" #: main.c:442 msgid "Decrement 30 seconds" msgstr "Dcroissance 30 secondes" #: main.c:443 msgid "Set to Zero" msgstr "Placez Zro" #: main.c:444 msgid "Daily..." msgstr "Quotidien..." #: main.c:445 msgid "Weekly..." msgstr "Hebdomadaire..." #: main.c:446 msgid "Monthly..." msgstr "Mensuel..." #: main.c:447 msgid "Yearly..." msgstr "Annuellement..." #: main.c:450 msgid "Start Timing the Selected Task" msgstr "Commencez chronomtrer choisie la tche" #: main.c:452 msgid "Stop Timing the Selected Task" msgstr "Cessez de chronomtrer choisie la tche" #: main.c:454 msgid "Stop Timing All Tasks" msgstr "Cessez De chronomtrer Toutes les Tches" #: main.c:456 msgid "Add Annotation to Selected Task" msgstr "Ajoutez l'annotation choisie la tche" #: main.c:458 msgid "Add New Task" msgstr "Ajoutez La Nouvelle Tche" #: main.c:460 msgid "Edit Name of the Selected Task" msgstr "ditez le nom choisie de la tche" #: main.c:618 msgid "All data saved" msgstr "Toutes les donnes conomises" #: main.c:630 main.c:631 msgid "Version" msgstr "" #: main.c:633 msgid "Author" msgstr "Auteur" #: main.c:637 msgid "About" msgstr "Au sujet de" #: main.c:658 main.c:680 main.c:712 main.c:737 main.c:788 main.c:812 main.c:821 main.c:851 main.c:860 main.c:891 main.c:1046 main.c:2094 main.c:2124 main.c:2139 main.c:2145 report.c:308 report.c:311 report.c:358 report.c:368 report.c:371 report.c:379 report.c:1040 report.c:1056 report.c:1089 report.c:1120 report.c:1171 unhide.c:100 msgid "Error" msgstr "Erreur" #: main.c:659 msgid "" "You have not selected\n" "a task to edit." msgstr "Vous n'avez pas choisi\n" "une tche d'diter" #: main.c:681 msgid "" "You have not selected\n" "a task to hide." msgstr "Vous n'avez pas choisi une\n" "tche de se cacher." #: main.c:697 msgid "Task hidden" msgstr "Tche cache" #: main.c:713 msgid "There are no hidden tasks." msgstr "Il n'y a aucune cache tche" #: main.c:735 msgid "Error deleting task" msgstr "Tche d' effacer d'erreur" #: main.c:774 msgid "Task removed" msgstr "Tche retire" #: main.c:789 msgid "" "You have not selected\n" "a task to delete." msgstr "Vous n'avez pas choisi\n" "une tche d'effacer." #: main.c:795 msgid "Delete Task?" msgstr "" #: main.c:796 msgid "" "Are you sure you want\n" "to delete this task?" msgstr "tes-vous sr vous voulez-vous\n" "effacer cette tche?" #: main.c:813 msgid "" "You have not selected\n" "a task to start timing." msgstr "Vous n'avez pas choisi une\n" "tche de commencer chronomtrer." #: main.c:822 msgid "Task is already being timed." msgstr "La tche dj est chronomtre" #: main.c:852 msgid "" "You have not selected\n" "a task to stop timing." msgstr "Vous n'avez pas choisi une\n" "tche d'arrter le timin" #: main.c:861 msgid "Task is not being timed." msgstr "La tche n'est pas chronomtre." #: main.c:892 msgid "" "You have not selected\n" "a task to annotate." msgstr "Vous n'avez pas choisi\n" "une tche d'annoter" #: main.c:1047 msgid "" "You have not selected\n" "a task to adjust the time for." msgstr "Vous n'avez pas choisi une\n" "tche d'ajuster le temps pour" #: main.c:1347 msgid "File" msgstr "Fichier" #: main.c:1381 msgid "Options" msgstr "Options" #: main.c:1409 main.c:2305 msgid "Task" msgstr "Tche" #: main.c:1419 report.c:482 report.c:1224 report.c:1410 msgid "Report" msgstr "Enregistrent" #: main.c:1605 msgid "Today" msgstr "Aujourd'hui" #: main.c:1805 msgid "You have been idle for" msgstr "" #: main.c:1806 msgid "minutes" msgstr "minutes" #: main.c:1806 msgid "since" msgstr "depuis" #: main.c:1808 msgid "" "Do you wish to revert\n" "to before the idle?" msgstr "Souhaitez-vous retourner\n" " avant le ralenti?" #: main.c:1811 msgid "Revert" msgstr "Retournent" #: main.c:1811 msgid "Continue Timing" msgstr "Continuez De chronomtrer" #: main.c:1989 msgid "Welcome to" msgstr "Bienvenue " #: main.c:2016 msgid "GTK+ runtime" msgstr "" #: main.c:2018 msgid "Home page" msgstr "" #: main.c:2024 msgid "options" msgstr "" #: main.c:2026 msgid "don't display the splash screen" msgstr "" #: main.c:2028 msgid "display this help info" msgstr "" #: main.c:2030 msgid "display the version" msgstr "" #: main.c:2032 msgid "specify the midnight offset" msgstr "" #: main.c:2034 msgid "start timing the specified task" msgstr "" #: main.c:2094 msgid "unable to create directory" msgstr "incapable de crer le rpertoire" #: main.c:2124 main.c:2139 msgid "requires an argument" msgstr "exige un argument" #: main.c:2145 msgid "requires a number" msgstr "exige un nombre" #: main.c:2146 msgid "not" msgstr "pas" #: main.c:2157 msgid "Invalid offset for" msgstr "Dcalage incorrect pour" #: main.c:2159 msgid "Format should be" msgstr "Le format devrait tre" #: main.c:2181 msgid "Ingoring unknown option" msgstr "Option inconnue d'Ingoring" #: main.c:2305 msgid "not found" msgstr "" #: report.c:309 report.c:369 msgid "writing to file" msgstr "inscription au fichier" #: report.c:332 msgid "Save Report" msgstr "conomiser L'tat" #: report.c:359 msgid "You must enter a print command" msgstr "Vous devez crire une commande print" #: report.c:379 msgid "Error printing" msgstr "Impression des erreurs" #: report.c:416 msgid "Print Report" msgstr "tat D'Impression" #: report.c:433 msgid "Print Command" msgstr "Commande print" #: report.c:530 msgid "Print" msgstr "Print" #: report.c:720 report.c:725 msgid "Total" msgstr "Total" #: report.c:739 report.c:746 msgid "Week" msgstr "Semaine" #: report.c:740 report.c:747 msgid "to" msgstr "au" #: report.c:814 report.c:819 msgid "Month" msgstr "Mois" #: report.c:881 report.c:886 msgid "Year" msgstr "Anne" #: report.c:946 report.c:951 msgid "Totals" msgstr "Totaux" #: report.c:1041 msgid "" "Could not find \"netscape\"\n" "in your path." msgstr "N'a pas pu trouver \"netscape\"\n" "dans votre voie d'accs." #: report.c:1056 msgid "Error communicating with Netscape." msgstr "Erreur communiquant avec Netscape." #: report.c:1090 unhide.c:101 msgid "You have not selected any tasks" msgstr "Vous n'avez choisi aucune tche" #: report.c:1121 msgid "" "You must select either \"include hours\"\n" "or \"include annotations\"." msgstr "Vous devez choisir ou \"incluez heures\"\n" "ou \"incluez annotations\"." #: report.c:1172 msgid "Error opening temporary file" msgstr "Erreur ouvrant temporaire le fichier" #: report.c:1242 msgid "Generated by" msgstr "Produit par" #: report.c:1257 msgid "Error reading" msgstr "Relev d'erreurs" #: report.c:1438 msgid "Format: " msgstr "Format: " #: report.c:1450 msgid "Data: " msgstr "Donnes: " #: report.c:1464 unhide.c:209 msgid "Tasks to include:" msgstr "Tches d'inclure:" #: report.c:1534 unhide.c:285 msgid "Select all" msgstr "Choisissez tout" #: report.c:1542 unhide.c:293 msgid "Select none" msgstr "Choisi aucun" #: task.c:532 msgid "System Error" msgstr "Erreur systme" #: task.c:535 msgid "Invalid task data file format" msgstr "Format incorrect de fichier de donnes de tche" #: task.c:537 msgid "Unknown error" msgstr "Inconnue erreur" #: unhide.c:203 msgid "Unhide" msgstr "Ne cachez pas" #: xextras.c:61 xextras.c:73 msgid "Received X error. See ya!" msgstr "Erreur reue de X. Voir le ya!" # msgid "GTimer: Idle Detect" # msgstr "GTimer: Le Ralenti Dtectent" # # msgid "Confirm: Delete Task" # msgstr "Confirmez: Effacez La Tche" # gtimer-2.0.0/po/cz.po0000644000175000017500000002317611353237102014606 0ustar cknudsencknudsen# Message catalog for GTimer. # Copyright (C) YEAR Free Software Foundation, Inc. # David Sauer , 1999. # msgid "" msgstr "" "Project-Id-Version: GTimer 1.14\n" "POT-Creation-Date: 1999-05-04 21:41+0200\n" "PO-Revision-Date: 1999-05-04 20:30 +0200\n" "Last-Translator: David Sauer \n" "Language-Team: czech \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\n" "Content-Transfer-Encoding: 8-bit\n" #: annotate.c:106 msgid "Annotation added" msgstr "Poznmka pidna" #: annotate.c:148 msgid "Add Annotation" msgstr "Pidat poznmku" #: annotate.c:159 msgid "Enter annotation for" msgstr "Zadejte poznmku pro" #: annotate.c:189 edit.c:218 main.c:641 main.c:662 main.c:684 main.c:716 #: main.c:741 main.c:792 main.c:799 main.c:816 main.c:825 main.c:855 #: main.c:864 main.c:895 main.c:1050 report.c:311 report.c:359 report.c:371 #: report.c:379 report.c:446 report.c:537 report.c:1042 report.c:1057 #: report.c:1091 report.c:1122 report.c:1173 report.c:1513 unhide.c:102 #: unhide.c:264 msgid "Ok" msgstr "Ok" #: annotate.c:200 edit.c:229 main.c:799 report.c:455 report.c:1525 #: unhide.c:276 msgid "Cancel" msgstr "Zruit" #: edit.c:106 msgid "Task updated" msgstr "loha aktualizovna" #: edit.c:133 msgid "Task added" msgstr "loha pidna" #: edit.c:178 msgid "Edit Task" msgstr "Editovat lohu" #: edit.c:180 msgid "Add Task" msgstr "Pidat lohu" #: edit.c:193 msgid "Task name" msgstr "Jmno lohy" #: edit.c:206 msgid "Unnamed Task" msgstr "Nepojmenovan loha" #: main.c:425 msgid "About..." msgstr "O programu..." #: main.c:426 report.c:523 msgid "Save" msgstr "Uloit" #: main.c:427 msgid "Exit" msgstr "Konec" #: main.c:428 main.c:1812 msgid "Idle Detect" msgstr "Detekce neaktivity" #: main.c:429 msgid "Toolbar" msgstr "Nstrojov lita" #: main.c:430 msgid "Animate" msgstr "Animovat" #: main.c:431 msgid "Auto Save" msgstr "Automaticky ukldat" #: main.c:432 msgid "Start Timing" msgstr "Spustit asova" #: main.c:433 msgid "Stop Timing" msgstr "Zastavit asova" #: main.c:434 msgid "Stop All Timing" msgstr "Zastavit vechny asovae" #: main.c:435 msgid "New..." msgstr "Nov..." #: main.c:436 msgid "Edit..." msgstr "Editovat..." #: main.c:437 msgid "Annotate..." msgstr "Pidat poznmku..." #: main.c:438 msgid "Hide" msgstr "Ukrt" #: main.c:439 msgid "Unhide..." msgstr "Ukzat" #: main.c:440 msgid "Delete" msgstr "Smazat" #: main.c:441 msgid "Increment 5 minutes" msgstr "Pidat 5 minut" #: main.c:442 msgid "Increment 30 minutes" msgstr "Pidat 30 minut" #: main.c:443 msgid "Decrement 5 minutes" msgstr "Odest 5 minut" #: main.c:444 msgid "Decrement 30 minutes" msgstr "Odest 30 minut" #: main.c:445 msgid "Set to Zero" msgstr "Vynulovat" #: main.c:446 msgid "Daily..." msgstr "Denn..." #: main.c:447 msgid "Weekly..." msgstr "Tdenn..." #: main.c:448 msgid "Monthly..." msgstr "Msn..." #: main.c:449 msgid "Yearly..." msgstr "Ron..." #: main.c:452 msgid "Start Timing the Selected Task" msgstr "Spustit asova pro vybranou lohu" #: main.c:454 msgid "Stop Timing the Selected Task" msgstr "Zastavit asova pro vybranou lohu" #: main.c:456 msgid "Stop Timing All Tasks" msgstr "Ukonit asovn pro vechny lohy" #: main.c:458 msgid "Add Annotation to Selected Task" msgstr "Pidat poznmku k vybran loze" #: main.c:460 msgid "Add New Task" msgstr "Pidat novou lohu" #: main.c:462 msgid "Edit Name of the Selected Task" msgstr "Editovat jmno vybran lohy" #: main.c:620 msgid "All data saved" msgstr "Vechna data uloena" #: main.c:632 main.c:633 msgid "Version" msgstr "Verze" #: main.c:635 msgid "Author" msgstr "Autor" #: main.c:639 msgid "About" msgstr "O programu" #: main.c:660 main.c:682 main.c:714 main.c:739 main.c:790 main.c:814 #: main.c:823 main.c:853 main.c:862 main.c:893 main.c:1048 main.c:2096 #: main.c:2126 main.c:2141 main.c:2147 report.c:308 report.c:311 report.c:358 #: report.c:368 report.c:371 report.c:379 report.c:1040 report.c:1056 #: report.c:1089 report.c:1120 report.c:1171 unhide.c:100 msgid "Error" msgstr "Chyba" #: main.c:661 msgid "" "You have not selected\n" "a task to edit." msgstr "" "K editaci muste vybrat\n" " njakou lohu" #: main.c:683 msgid "" "You have not selected\n" "a task to hide." msgstr "" "Vyberte lohu, kterou\n" "chcete skrt." #: main.c:699 msgid "Task hidden" msgstr "loha ukryta" #: main.c:715 msgid "There are no hidden tasks." msgstr "dn loha nen skryta." #: main.c:737 msgid "Error deleting task" msgstr "Chyba pi vmazu lohy" #: main.c:776 msgid "Task removed" msgstr "loha odstranna" #: main.c:791 msgid "" "You have not selected\n" "a task to delete." msgstr "" "Nejprve vyberte lohu,\n" "kterou chcete smazat." #: main.c:797 msgid "Delete Task?" msgstr "Smazat lohu?" #: main.c:798 msgid "" "Are you sure you want\n" "to delete this task?" msgstr "" "Opravdu chcete smazat\n" "tuto lohu?" #: main.c:815 msgid "" "You have not selected\n" "a task to start timing." msgstr "" "Pro start asovae\n" "neprve vyberte lohu." #: main.c:824 msgid "Task is already being timed." msgstr "asova lohy ji b." #: main.c:854 msgid "" "You have not selected\n" "a task to stop timing." msgstr "" "Nejprve vyberte lohu,\n" "jej asovn chcete ukonit." #: main.c:863 msgid "Task is not being timed." msgstr "loha nen asovna." #: main.c:894 msgid "" "You have not selected\n" "a task to annotate." msgstr "" "Nejprve vyberte lohu, pro kterou\n" " chcete pidat poznmku." #: main.c:1049 msgid "" "You have not selected\n" "a task to adjust the time for." msgstr "" "Pokud chcete upravit as lohy,\n" "nejprve njakou lohu vyberte." #: main.c:1349 msgid "File" msgstr "Soubor" #: main.c:1383 msgid "Options" msgstr "Nastaven" #: main.c:1411 main.c:2307 msgid "Task" msgstr "loha" #: main.c:1421 report.c:482 report.c:1224 report.c:1410 msgid "Report" msgstr "Zprva" #: main.c:1607 msgid "Today" msgstr "Dnes" #: main.c:1807 msgid "You have been idle for" msgstr "Nic jste nenapsal(a) bhem poslednch" #: main.c:1808 msgid "minutes" msgstr "minut" #: main.c:1808 msgid "since" msgstr "od" #: main.c:1810 msgid "" "Do you wish to revert\n" "to before the idle?" msgstr "" "Chcete se vrtit do doby, ne\n" "byla peruena prce?" #: main.c:1813 msgid "Revert" msgstr "Zpt" #: main.c:1813 msgid "Continue Timing" msgstr "Pokraovat v asovn" #: main.c:1991 msgid "Welcome to" msgstr "Vtejte do programu" #: main.c:2018 msgid "GTK+ runtime" msgstr "prosted GTK+" #: main.c:2020 msgid "Home page" msgstr "Domc strnka" #: main.c:2026 msgid "options" msgstr "nastaven" #: main.c:2028 msgid "don't display the splash screen" msgstr "nezobrazovat uvtac obrazovku" #: main.c:2030 msgid "display this help info" msgstr "zobrazit tuto informaci o npovd" #: main.c:2032 msgid "display the version" msgstr "zobrazit verzi" #: main.c:2034 msgid "specify the midnight offset" msgstr "zadejte posunut plnoci" #: main.c:2036 msgid "start timing the specified task" msgstr "spustit asova pro danou lohu" #: main.c:2096 msgid "unable to create directory" msgstr "nelze vytvoit adres" #: main.c:2126 main.c:2141 msgid "requires an argument" msgstr "vyaduje argument" #: main.c:2147 msgid "requires a number" msgstr "vyaduje slo" #: main.c:2148 msgid "not" msgstr "" #: main.c:2159 msgid "Invalid offset for" msgstr "Chybn ofset pro" #: main.c:2161 msgid "Format should be" msgstr "Formt m bt" #: main.c:2183 msgid "Ingoring unknown option" msgstr "Neznm volba je ignorovna" #: main.c:2307 msgid "not found" msgstr "nenalezeno" #: report.c:309 report.c:369 msgid "writing to file" msgstr "zpis do souboru" #: report.c:332 msgid "Save Report" msgstr "Uloit zprvu" #: report.c:359 msgid "You must enter a print command" msgstr "Muste zadat pkaz pro tisk" #: report.c:379 msgid "Error printing" msgstr "Chyba pi tisku" #: report.c:416 msgid "Print Report" msgstr "Vytisknou zprvu" #: report.c:433 msgid "Print Command" msgstr "Pkaz tisku" #: report.c:530 msgid "Print" msgstr "Tisk" #: report.c:720 report.c:725 msgid "Total" msgstr "Celkem" #: report.c:739 report.c:746 msgid "Week" msgstr "Tden" #: report.c:740 report.c:747 msgid "to" msgstr "do" #: report.c:814 report.c:819 msgid "Month" msgstr "Msic" #: report.c:881 report.c:886 msgid "Year" msgstr "Rok" #: report.c:946 report.c:951 msgid "Totals" msgstr "Celkem" #: report.c:1041 msgid "" "Could not find \"netscape\"\n" "in your path." msgstr "" "V prohledvanch adresch \n" "nelze najt \"netscape\"." #: report.c:1056 msgid "Error communicating with Netscape." msgstr "Chyba pi komunikaci s netscape." #: report.c:1090 unhide.c:101 msgid "You have not selected any tasks" msgstr "Nemte vybrnu dnou lohu" #: report.c:1121 msgid "" "You must select either \"include hours\"\n" "or \"include annotations\"." msgstr "" #: report.c:1172 msgid "Error opening temporary file" msgstr "Chyba pi oteven doasnho souboru" #: report.c:1242 msgid "Generated by" msgstr "Vytvoeno programem" #: report.c:1257 msgid "Error reading" msgstr "Chyba ten" #: report.c:1438 msgid "Format: " msgstr "Formt: " #: report.c:1450 msgid "Data: " msgstr "Data: " #: report.c:1464 unhide.c:209 msgid "Tasks to include:" msgstr "Zapotvan lohy:" #: report.c:1534 unhide.c:285 msgid "Select all" msgstr "Vybrat vechny" #: report.c:1542 unhide.c:293 msgid "Select none" msgstr "Zruit cel vbr" #: task.c:532 msgid "System Error" msgstr "Chyba systmu" #: task.c:535 msgid "Invalid task data file format" msgstr "Chybn formt souboru s daty loh" #: task.c:537 msgid "Unknown error" msgstr "Neznm chyba" #: unhide.c:203 msgid "Unhide" msgstr "Ukzat" #: xextras.c:61 xextras.c:73 msgid "Received X error. See ya!" msgstr "Chyba X Window. Sbohem!" gtimer-2.0.0/project.c0000644000175000017500000002513611353237102015024 0ustar cknudsencknudsen/* * Routines for dealing with projects * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * History: * 18-Apr-2005 Fix memory clobber when saving projects. Based on * debugging work by Ove Kaaven. * 20-Feb-2003 Created * */ #include #include #include #if HAVE_UNISTD_H #include #endif #ifdef WIN32 #include #else #include #endif #include #include #include #include #include #include #include #include "project.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif // PV: Internationalization #include "gtimeri18n.h" static int num_projects = 0; static Project **projects = NULL; static int max_project = -1; static int last_number = -1; #ifdef WIN32 static int valid_name ( filename ) char *filename; { while ( *filename && isdigit ( *filename ) ) filename++; return ( ! strcmp ( filename, ".project" ) ); } #endif /* ** Add a project. */ void projectAdd ( project ) Project *project; { int loop; int new_max_project = 0; new_max_project = max_project; if ( project->number == -1 ) { for ( loop = 0; loop < max_project && project->number < 0; loop++ ) { if ( projects[loop] == NULL ) project->number = loop; } if ( project->number < 0 ) project->number = ++max_project; new_max_project = max_project; } else if ( project->number > max_project ) { new_max_project = project->number; } if ( projects == NULL ) { projects = (Project **) malloc ( sizeof ( Project * ) * ( new_max_project + 1 ) ); for ( loop = 0; loop < new_max_project; loop++ ) projects[loop] = NULL; } else projects = (Project **) realloc ( projects, sizeof ( Project * ) * ( new_max_project + 1 ) ); for ( loop = max_project + 1; loop <= new_max_project; loop++ ) projects[loop] = NULL; max_project = new_max_project; projects[project->number] = project; num_projects++; } /* ** Create a new project */ Project *projectCreate ( name ) char *name; { Project *project; project = (Project *) malloc ( sizeof ( Project ) ); memset ( project, '\0', sizeof ( Project ) ); project->name = (char *) malloc ( strlen ( name ) + 1 ); strcpy ( project->name, name ); time ( &project->created ); project->number = -1; /* not yet assigned */ return ( project ); } /* ** Delete a project. ** Must have no tasks associated with it. */ int projectDelete ( project, projectdir ) Project *project; char *projectdir; { char *path; /* TODO: make sure project has no tasks */ path = (char *) malloc ( strlen ( projectdir ) + 10 ); sprintf ( path, "%s/%d.project", projectdir, project->number ); unlink ( path ); sprintf ( path, "%s/%d.ann", projectdir, project->number ); unlink ( path ); free ( path ); projects[project->number] = NULL; num_projects--; projectFree ( project ); return ( 0 ); } /* ** Return the number of projects currently loaded. */ int projectCount () { return ( num_projects ); } /* ** Get a project by number. */ Project *projectGet ( number ) int number; { return ( projects[number] ); } /* ** Get first project. */ Project *projectGetFirst () { last_number = -1; return ( projectGetNext() ); } /* ** Get next project. */ Project *projectGetNext () { int loop; if ( ! num_projects ) return ( NULL ); for ( loop = last_number + 1; loop <= max_project; loop++ ) { if ( projects[loop] ) { last_number = loop; return ( projects[loop] ); } } return ( NULL ); } /* ** Clear all projects out of memory. */ void projectClearAll () { int loop; for ( loop = 0; loop <= max_project; loop++ ) { if ( projects[loop] ) { projectFree ( projects[loop] ); projects[loop] = 0; } } num_projects = 0; last_number = max_project = -1; } /* ** Save a project to it's project file. */ int projectSave ( project, projectdir ) Project *project; char *projectdir; { char *path; FILE *fp; int loop; path = (char *) malloc ( strlen ( projectdir ) + 20 ); sprintf ( path, "%s/%d.project", projectdir, project->number ); fp = fopen ( path, "w" ); if ( !fp ) { free ( path ); return ( PROJECT_ERROR_SYSTEM_ERROR ); } fprintf ( fp, "Format: 1.2\n" ); fprintf ( fp, "Name: %s\n", project->name ); fprintf ( fp, "Created: %u\n", (unsigned int)project->created ); fprintf ( fp, "Options: %u\n", project->options ); fclose ( fp ); free ( path ); return ( 0 ); } /* ** Save all projects */ int projectSaveAll ( projectdir ) char *projectdir; { int loop; int ret; for ( loop = 0; loop <= max_project; loop++ ) { if ( projects[loop] ) { ret = projectSave ( projects[loop], projectdir ); if ( ret ) return ( ret ); } } return ( 0 ); } /* ** Free all resources of a project. */ void projectFree ( project ) Project *project; { free ( project->name ); free ( project ); } /* ** Load a project from file. */ int projectLoad ( path, project ) char *path; Project **project; { FILE *fp; int fd; Project *newproject; char line[512], *ptr, *ptr2, temp[10], *annfile, *anntext; int len, created, number, options; struct stat buf; fp = fopen ( path, "r" ); if ( !fp ) return ( PROJECT_ERROR_SYSTEM_ERROR ); for ( ptr = path + strlen ( path ) - 1; *ptr != '/' && ptr != path; ptr-- ); if ( *ptr == '/' ) ptr++; sscanf ( ptr, "%d.project", &number ); fgets ( line, 512, fp ); len = strlen ( line ); if ( line[len-1] == '\n' ) line[len-1] = '\0'; if ( strcmp ( line, "Format: 1.0" ) && strcmp ( line, "Format: 1.1" ) && strcmp ( line, "Format: 1.2" ) ) { fclose ( fp ); return ( PROJECT_ERROR_BAD_FILE ); } newproject = (Project *) malloc ( sizeof ( Project ) ); memset ( newproject, '\0', sizeof ( Project ) ); newproject->number = number; while ( fgets ( line, 512, fp ) ) { len = strlen ( line ); if ( line[len-1] == '\n' ) line[len-1] = '\0'; if ( strncmp ( line, "Name:", 5 ) == 0 ) { ptr = line + 5; if ( *ptr == ' ' ) ptr++; newproject->name = (char *) malloc ( strlen ( ptr ) + 1 ); strcpy ( newproject->name, ptr ); } else if ( strncmp ( line, "Created:", 8 ) == 0 ) { sscanf ( line + 8, "%d", &created ); newproject->created = (time_t) created; } else if ( strncmp ( line, "Options:", 8 ) == 0 ) { sscanf ( line + 8, "%d", &options ); newproject->options = (unsigned int) options; } else { fclose ( fp ); projectFree ( newproject ); return ( PROJECT_ERROR_BAD_FILE ); } } fclose ( fp ); projectAdd ( newproject ); *project = newproject; return ( 0 ); } int projectLoadAll ( projectdir ) char *projectdir; { #ifdef WIN32 char *pattern; Project *project; long handle; struct _finddata_t fdata; pattern = malloc ( strlen ( projectdir ) + 8 ); (void) strcat ( strcpy ( pattern, projectdir ), "/*.project" ); if ( ( handle = _findfirst ( pattern, &fdata ) ) != -1 ) { char *path = malloc ( strlen ( projectdir ) + _MAX_FNAME + 2 ); char *start = path + strlen ( projectdir ) + 1; (void) strcat ( strcpy ( path, projectdir ), "/" ); do { (void) strcpy ( start, fdata.name ); if ( valid_name ( fdata.name ) && !_access ( path, 4 ) ){ projectLoad ( path, &project ); } } while ( !_findnext ( handle, &fdata ) ); _findclose ( handle ); free ( path ); } else { free ( pattern ); return ( PROJECT_ERROR_SYSTEM_ERROR ); } free ( pattern ); #else DIR *dir; struct dirent *entry; struct stat buf; char *path, *ptr; Project *project; dir = opendir ( projectdir ); if ( ! dir ) return ( PROJECT_ERROR_SYSTEM_ERROR ); while ( ( entry = readdir ( dir ) ) ) { path = (char *) malloc ( strlen ( projectdir ) + strlen ( entry->d_name ) + 2 ); sprintf ( path, "%s/%s", projectdir, entry->d_name ); if ( stat ( path, &buf ) == 0 ) { for ( ptr = entry->d_name; isdigit ( *ptr ); ptr++ ) ; if ( strcmp ( ptr, ".project" ) == 0 && S_ISREG ( buf.st_mode ) ) { /* NOTE: add catching of errors here... */ projectLoad ( path, &project ); } } free ( path ); } #endif return ( 0 ); } char *projectErrorString ( project_error ) int project_error; { static char msg[256]; switch ( project_error ) { case PROJECT_ERROR_SYSTEM_ERROR: sprintf ( msg, "%s (%d)", gettext("System Error"), errno ); return ( msg ); case PROJECT_ERROR_BAD_FILE: return ( gettext("Invalid project data file format") ); default: sprintf ( msg, "%s(%d)", gettext("Unknown error"), project_error ); return ( msg ); } } /* ** Get the options for the specified project. */ unsigned int projectGetOptions ( project ) Project *project; { return project->options; } /* ** Determine if the specified option is enabled. */ unsigned int projectOptionEnabled ( project, option ) Project *project; unsigned int option; { if ( option & project->options ) return 1; else return 0; } void projectSetOption ( project, option ) Project *project; unsigned int option; { project->options |= option; } void projectUnsetOption ( project, option ) Project *project; unsigned int option; { if ( projectOptionEnabled ( project, option ) ) project->options -= option; } #if 0 /* ** Get all annotations for the specified project on the specified day. ** NOTE: Caller must free return value. ** ??? Maybe we should take the midnight offset into consideration here ??? */ Task **ProjectGetTasks ( project, num_ret ) Project *project; int *num_ret; { Task **ret = NULL; int loop = 0; struct tm *tm; int num = 0; time_t then; ret = (Task **) malloc ( sizeof ( Task * ) * project->num_tasks ); memcpy ( ret, project->tasks, sizeof ( Task * ) * project->num_tasks ); *num_ret = project->num_tasks; return ( ret ); } #endif gtimer-2.0.0/project.h0000644000175000017500000000407711353237102015032 0ustar cknudsencknudsen/* * Definition for a project * * Copyright: * (C) 2003 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * */ #ifndef _PROJECT_H #define _PROJECT_H #define PROJECT_DIRECTORY ".gtimer" /* from $HOME */ /* Errors */ #define PROJECT_ERROR_SYSTEM_ERROR 1 /* check errno value */ #define PROJECT_ERROR_BAD_FILE 2 /* bad file format */ typedef struct { char *name; /* name of project */ time_t created; /* time created */ int number; /* unique project id number */ unsigned int options; /* app-defined bit-or options */ } Project; /* * Functions */ void projectAdd ( Project *project ); int projectSave ( Project *project, char *projectdir ); int projectSaveAll ( char *projectdir ); int projectLoad ( char *file, Project **project ); int projectLoadAll ( char *projectdir ); Project *projectCreate ( char *name ); int projectDelete ( Project *project, char *projectdir ); void projectFree (); int projectCount (); Project *projectGet ( int number ); Project *projectGetFirst (); Project *projectGetNext (); unsigned int projectOptions ( Project *project ); unsigned int projectOptionEnabled ( Project *project, unsigned int option ); void projectSetOption ( Project *project, unsigned int option ); void projectUnsetOption ( Project *project, unsigned int option ); char *projectErrorString ( int project_error ); #endif /* _PROJECT_H */ gtimer-2.0.0/README0000644000175000017500000000570211353426046014076 0ustar cknudsencknudsenGTimer v2.0.0 Copyright (C) 1998-2010 Craig Knudsen, craig@k5n.us http://www.k5n.us/gtimer.php BUILD REQUIREMENTS: -------------------------------------------------------------------------- GTK 2.8 or later It should build without issue on any UN*X that has GTK. It should also build on Windows machines that have the Windows port of GTK. Recent versions of Cygwin include GTK for Windows. I have also compiled it on Mac OS X and it works great, but you may need to install X11 (from Apple) depending on which version of OS X you have, and you will need to install GTK for Mac OS X. COMPILING: -------------------------------------------------------------------------- Use the following sequence of commands to build: ./configure make If you are monkeying around with the source and automake stuff, you may use the following commands to update the configure script. (This is not needed for the vast majority of source code changes.) aclocal automake --add-missing autoconf For more source code build documentation, see the INSTALL file. RUNNING: -------------------------------------------------------------------------- To run: ./gtimer LICENSE: -------------------------------------------------------------------------- GTimer is open source released under the GNU General Public License (GPL) Version 2. See the COPYING file for a complete copy of the license. NEW RELEASES: -------------------------------------------------------------------------- To check for new releases, try the "Tools->Check for New Version" item in the menu. USING: -------------------------------------------------------------------------- Command line options: -midnight N If you work past midnight, then use this to keep hours up until N count toward the previous day. Example: -midnight 400 All hours up until 4AM will be applied to previous day. -nosplash Do not show the splash screen on app startup. -start taskname Start timing the specified task -resume Start timing the same tasks that were on when the application last exited. -version Display the gtimer version -help Get help on usage TO DO: -------------------------------------------------------------------------- - Catch some signals (SIGINT, for example) so we can save date before exiting. GIMP does this, so it should be possible. - Show the GNU license on initial run of the app. - Online help. - Postscript output for printing rather than plain text. - Make a smaller main window (like gtcd) - Optionally store data in MySQL, Oracle, etc. instead of flat files - Add a configuration window to set things like print command, idle timeout, etc. - Export function (CSV file) - Ability to edit existing annotations HISTORY: -------------------------------------------------------------------------- See ChangeLog for development history. TRANSLATING -------------------------------------------------------------------------- See FAQ.html for instructions on how to create new translation files for use with GTimer. gtimer-2.0.0/report.c0000644000175000017500000017237311353237102014677 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 27-Feb-2006 Added "Last Year" report option. (Bruno Gravato) * 27-Feb-2006 Fix a crash in daily reports when annotations are * included. (Russ Allbery) * 15-Jul-2005 Allow the start of the week to be configured. * (Russ Allbery) * 15-Jul-2005 Honor the user's locale for weekday names. * 17-Apr-2005 Added configurability of the browser. (Russ Allbery) * 02-Jan-2004 Honor the user's locale for date display. (Colin * Phipps) * 09-Mar-2003 Avoid a temporary file when printing by using popen. * Safely create the tmeporary file for HTML reports. * Use tmpfile for formatting the reports. (CPhipps * and chewie@debian.org) * 03-Mar-2003 Added support for rounding. * 28-Feb-2003 Include project name or "none" in reports * 09-Mar-2000 Updated calls to create_confirm_window() * 25-Mar-1999 Added use of gtk_window_set_transient_for() for * GTK 1.1 or later. * 18-Mar-1999 Internationalization * 02-Feb-1999 gtk 1.1 support * 04-Jan-1999 Eek... Fixed bug for "last month" reports when * run in Jan. * 10-May-1998 Removed ifdef for GTK versions before 1.0.0 * 05-Apr-1998 Added word wrap for report display * 04-Apr-1998 Added print * 28-Mar-1998 Finished adding support for HTML. * Tell Netscape where to look for the file. * 26-Mar-1998 Added O_TRUNC option when saving to a file. * 26-Mar-1998 Added preliminary support for HTML output. * Must save to a file and open with Netscape. * 22-Mar-1998 Added config_midnight_offset as an parameter to * TaskGetAnnotationEntries. Entries after midnight * were showing up on the day after the hours were * recorded. * 20-Mar-1998 Replaced label widget with a text widget. * 18-Mar-1998 Added calls to gtk_window_set_wmclass so the windows * behave better for window managers. * 18-Mar-1998 Fixed bug where all weekdays show up as "Mon" in * reports. * 18-Mar-1998 Fixed bug where for loop went past array boundaries * and called free on invalid address. * 17-Mar-1998 Changed font in report window to be courier so * that text would line up correctly. * 17-Mar-1998 Added option of including annotations and make * including hours worked optional. * 16-Mar-1998 Removed reference to sys_errlist[] for * compatibility with glibc. * 13-Mar-1998 Use config_midnight_offset when figuring out what the * current date is. * 13-Mar-1998 Include seconds in reports * 12-Mar-1998 Remove toggle buttons for report type. Now set * by calling routine. * 10-Mar-1998 Added save to file * 10-Mar-1998 Added additional report options: * allow hours for each day to be optional * include summary for day * include summary for week * include summary for month * include days with no hours * 10-Mar-1998 Commented out all tooltips since the API is * different for GTK-0.99.3 and GTK-0.99.5. * 08-Mar-1998 Created * ****************************************************************************/ #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include #include "project.h" #include "task.h" #include "gtimer.h" #include "config.h" // PV: #include "custom-list.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif #define NO_TOOLTIPS 1 /* CSS stylesheet */ #define CSS_STYLE "\ \n" #define ONE_DAY (3600*24) static int month_days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int lmonth_days[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; extern TaskData **visible_tasks; extern int num_visible_tasks; extern int config_midnight_offset; extern int config_start_of_week; extern GtkWidget *main_window; extern GdkPixmap *appicon2; extern GdkPixmap *appicon2_mask; /* Report types */ #define REPORT_RANGE_TODAY 0 #define REPORT_RANGE_THIS_WEEK 1 #define REPORT_RANGE_LAST_WEEK 2 #define REPORT_RANGE_THIS_AND_LAST_WEEK 3 #define REPORT_RANGE_LAST_TWO_WEEKS 4 #define REPORT_RANGE_THIS_MONTH 5 #define REPORT_RANGE_LAST_MONTH 6 #define REPORT_RANGE_THIS_YEAR 7 #define REPORT_RANGE_LAST_YEAR 8 static char *time_options[] = { gettext_noop("Today"), gettext_noop("This Week"), gettext_noop("Last Week"), gettext_noop("This Week & Last Week"), gettext_noop("Last Two Weeks"), gettext_noop("This Month"), gettext_noop("Last Month"), gettext_noop("This Year"), gettext_noop("Last Year"), NULL }; /* Output types */ #define REPORT_OUTPUT_TEXT 0 #define REPORT_OUTPUT_HTML 1 /* LaTeX next? */ static char *output_options[] = { gettext_noop("Text"), gettext_noop("HTML"), NULL }; /* Data to include */ #define REPORT_DATA_HOURS 0 #define REPORT_DATA_ANNOTATIONS 1 #define REPORT_DATA_BOTH 2 static char *data_options[] = { gettext_noop("Hours worked"), gettext_noop( "Annotations"), gettext_noop("Hours & Annotations"), NULL }; /* Rounding options */ #define REPORT_ROUND_NONE 0 #define REPORT_ROUND_MINUTE 60 #define REPORT_ROUND_5_MINUTES 300 #define REPORT_ROUND_10_MINUTES 600 #define REPORT_ROUND_15_MINUTES 900 #define REPORT_ROUND_30_MINUTES 1800 #define REPORT_ROUND_HOUR 3600 static char *round_options[] = { gettext_noop("None"), gettext_noop("Minute"), gettext_noop("5 Minutes"), gettext_noop("10 Minutes"), gettext_noop("15 minutes"), gettext_noop("30 Minutes"), gettext_noop("Hour"), NULL }; static int round_values[]= { REPORT_ROUND_NONE, REPORT_ROUND_MINUTE, REPORT_ROUND_5_MINUTES, REPORT_ROUND_10_MINUTES, REPORT_ROUND_15_MINUTES, REPORT_ROUND_30_MINUTES, REPORT_ROUND_HOUR, -1 }; typedef struct { TaskData *taskdata; time_t weekly_total; time_t monthly_total; time_t yearly_total; time_t total; char *todays_annotations; char *weekly_annotations; char *monthly_annotations; char *yearly_annotations; char *total_annotations; char week_start[20]; } ReportTaskData; typedef struct { GtkWidget *window; GtkWidget *time_menu; GtkWidget *time_menu_items[9]; GtkWidget *output_menu; GtkWidget *output_menu_items[2]; GtkWidget *data_menu; GtkWidget *data_menu_items[3]; GtkWidget *round_menu; GtkWidget *round_menu_items[8]; // GtkWidget *task_list; // PV: - GtkTreeView *task_list; // PV: + TaskData **tasks; int num_tasks; // GtkWidget **list_items; // PV: - GtkTreePath **list_items; // PV: + report_type type; int include_hours; int include_annotations; } ReportData; typedef struct { GtkWidget *window; char *text; GtkWidget *filesel; GtkWidget *printwin; GtkWidget *printentry; } DisplayReportData; /* ** Append an annotation to the given pointer after we realloc some ** space for it. optionally include the date and time and indent ** all lines to make it look nice. */ static void concat_annotation ( ptr, annotation, include_date, include_time, indentation, newline ) char **ptr; TaskAnnotation *annotation; int include_date, include_time; char *indentation; char *newline; { struct tm *tm; char date_time_str[30]; char padding[30], *p; char *anntext, *newtext; int first; strcpy ( date_time_str, indentation ); tm = localtime ( &annotation->text_time ); if ( include_date ) sprintf ( date_time_str + strlen ( date_time_str ), "%02d/%02d/%02d ", tm->tm_mon + 1, tm->tm_mday, tm->tm_year % 100 ); if ( include_time ) sprintf ( date_time_str + strlen ( date_time_str ), "%02d:%02d ", tm->tm_hour, tm->tm_min ); strcpy ( padding, date_time_str ); for ( p = padding; *p != '\0'; p++ ) *p = ' '; /* make a copy of the annotation text because strtok() stomps on it */ anntext = (char *) malloc ( strlen ( annotation->text ) + 1 ); strcpy ( anntext, annotation->text ); if ( *ptr ) { newtext = (char *) malloc ( strlen ( *ptr ) + 1 ); strcpy ( newtext, *ptr ); } else { newtext = (char *) malloc ( 1 ); newtext[0] = '\0'; } first = 1; p = strtok ( anntext, "\n" ); while ( p ) { newtext = (char *) realloc ( newtext, strlen ( newtext ) + strlen ( p ) + strlen ( padding ) + 2 + strlen ( newline ) ); if ( first ) { first = 0; strcat ( newtext, date_time_str ); } else { strcat ( newtext, padding ); } strcat ( newtext, p ); strcat ( newtext, newline ); p = strtok ( NULL, "\n" ); } free ( anntext ); if ( *ptr ) free ( *ptr ); *ptr = newtext; } static void display_text_results_ok_callback ( widget, data ) GtkWidget *widget; gpointer data; { DisplayReportData *drd = (DisplayReportData *)data; gtk_grab_remove ( drd->window ); gtk_widget_destroy ( drd->window ); if ( drd->filesel ) { gtk_grab_remove ( drd->filesel ); gtk_widget_destroy ( drd->filesel ); } if ( drd->printwin ) { gtk_grab_remove ( drd->printwin ); gtk_widget_destroy ( drd->printwin ); } free ( drd->text ); free ( drd ); } static void display_text_results_save_cancel_callback ( widget, data ) GtkWidget *widget; gpointer data; { DisplayReportData *drd = (DisplayReportData *)data; gtk_grab_remove ( drd->filesel ); gtk_widget_destroy ( drd->filesel ); drd->filesel = NULL; } static void display_text_results_save_ok_callback ( widget, data ) GtkWidget *widget; gpointer data; { DisplayReportData *drd = (DisplayReportData *)data; char *file; int fd; char *msg; // PV: better: gtk_file_chooser_dialog see // http://library.gnome.org/devel/gtk/stable/GtkFileChooserDialog.html // PV: warning: assignment discards qualifiers from pointer target type file = gtk_file_selection_get_filename ( GTK_FILE_SELECTION ( drd->filesel ) ); fd = open ( file, O_WRONLY | O_CREAT | O_TRUNC, 0644 ); if ( fd <= 0 ) { msg = (char *) malloc ( strlen ( file ) + 100 ); sprintf ( msg, "%s %d %s\n%s", gettext ("Error"), errno, gettext("writing to file"), file ); create_confirm_window ( CONFIRM_ERROR, gettext("Error"), msg, gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); free ( msg ); } else { write ( fd, drd->text, strlen ( drd->text ) ); close ( fd ); gtk_grab_remove ( drd->filesel ); gtk_widget_destroy ( drd->filesel ); drd->filesel = NULL; } } static void display_text_results_save_callback ( widget, data ) GtkWidget *widget; gpointer data; { DisplayReportData *drd = (DisplayReportData *)data; char msg[100]; if ( drd->filesel ) return; sprintf ( msg, "GTimer: %s", gettext("Save Report") ); drd->filesel = gtk_file_selection_new ( msg ); gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(drd->filesel)->ok_button), "clicked", GTK_SIGNAL_FUNC (display_text_results_save_ok_callback), drd); gtk_signal_connect ( GTK_OBJECT (GTK_FILE_SELECTION(drd->filesel)->cancel_button), "clicked", GTK_SIGNAL_FUNC (display_text_results_save_cancel_callback), drd); gtk_widget_show ( drd->filesel ); } static void print_ok_callback ( widget, data ) GtkWidget *widget; gpointer data; { DisplayReportData *drd = (DisplayReportData *)data; FILE *fp = NULL; char cmd[500], *ptr, *msg; #if PV_DEBUG printf("OK(print)\n"); printf("\n****************\n%s", drd->text); #endif // PV: warning: assignment discards qualifiers from pointer target type ptr = gtk_entry_get_text ( GTK_ENTRY(drd->printentry) ); if ( ! ptr || ! strlen ( ptr ) ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You must enter a print command"), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); return; } fp = popen(ptr,"w"); if ( !fp ) { msg = (char *) malloc ( 120 ); sprintf ( msg, "%s %d %s\n%s", gettext("Error"), errno, gettext("Error printing"), strerror(errno) ); create_confirm_window ( CONFIRM_ERROR, gettext("Error"), msg, gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); free ( msg ); } else { fwrite ( drd->text, strlen ( drd->text ), sizeof(char), fp ); fclose ( fp ); if ( ferror (fp) ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Error printing"), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } else { configSetAttribute ( CONFIG_PRINT, ptr ); gtk_grab_remove ( drd->printwin ); gtk_widget_destroy ( drd->printwin ); drd->printwin = NULL; } } } static void print_cancel_callback ( widget, data ) GtkWidget *widget; gpointer data; { DisplayReportData *drd = (DisplayReportData *)data; gtk_grab_remove ( drd->printwin ); gtk_widget_destroy ( drd->printwin ); drd->printwin = NULL; } static void display_text_results_print_callback ( widget, data ) GtkWidget *widget; gpointer data; { DisplayReportData *drd = (DisplayReportData *)data; char *ptr, msg[100]; GtkWidget *hbox, *label, *button; if ( drd->printwin ) return; drd->printwin = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( drd->printwin ), "GTimer", "gtimer" ); sprintf ( msg, "GTimer: %s", gettext("Print Report") ); gtk_window_set_title (GTK_WINDOW (drd->printwin), msg ); gtk_window_position ( GTK_WINDOW(drd->printwin), GTK_WIN_POS_MOUSE ); gtk_grab_add ( drd->printwin ); gtk_widget_realize ( drd->printwin ); gdk_window_set_icon ( GTK_WIDGET ( drd->printwin )->window, NULL, appicon2, appicon2_mask ); gtk_window_set_transient_for ( GTK_WINDOW ( drd->printwin ), GTK_WINDOW ( drd->window ) ); hbox = gtk_hbox_new ( TRUE, 5 ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (drd->printwin)->vbox ), hbox, FALSE, FALSE, 5 ); sprintf ( msg, "%s: ", gettext("Print Command") ); label = gtk_label_new ( msg ); gtk_box_pack_start ( GTK_BOX ( hbox ), label, FALSE, FALSE, 5 ); gtk_widget_show ( label ); drd->printentry = gtk_entry_new (); gtk_box_pack_start ( GTK_BOX ( hbox ), drd->printentry, FALSE, FALSE, 5 ); if ( configGetAttribute ( CONFIG_PRINT, &ptr ) == 0 ) gtk_entry_set_text ( GTK_ENTRY( drd->printentry ), ptr ); gtk_widget_show ( drd->printentry ); gtk_widget_show ( hbox ); button = gtk_button_new_with_label ( gettext("Ok") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (drd->printwin)->action_area), button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (print_ok_callback), drd); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); button = gtk_button_new_with_label ( gettext("Cancel") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (drd->printwin)->action_area), button, TRUE, TRUE, 5); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (print_cancel_callback), drd); gtk_widget_show (button); gtk_widget_show ( drd->printwin ); } /* PV: static void display_text_results ( text ) * rewritten during migration to GTK2 * Thanks to Vijay Kumar B. and his tutorial * Multiline Text Editing Widget */ void find (GtkTextView *text_view, const gchar *text, GtkTextIter *iter) { GtkTextIter mstart, mend; gboolean found; GtkTextBuffer *buffer; GtkTextMark *last_pos; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); found = gtk_text_iter_forward_search (iter, text, 0, &mstart, &mend, NULL); if (found) { gtk_text_buffer_select_range (buffer, &mstart, &mend); last_pos = gtk_text_buffer_create_mark (buffer, "last_pos", &mend, FALSE); gtk_text_view_scroll_mark_onscreen (text_view, last_pos); } } typedef struct _App { GtkWidget *text_view; GtkWidget *search_entry; } App; App app; void win_destroy (void) { gtk_main_quit(); } void next_button_clicked (GtkWidget *next_button, App *app) { const gchar *text; GtkTextBuffer *buffer; GtkTextMark *last_pos; GtkTextIter iter; text = gtk_entry_get_text (GTK_ENTRY (app->search_entry)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (app->text_view)); last_pos = gtk_text_buffer_get_mark (buffer, "last_pos"); if (last_pos == NULL) return; gtk_text_buffer_get_iter_at_mark (buffer, &iter, last_pos); find (GTK_TEXT_VIEW (app->text_view), text, &iter); } void search_button_clicked (GtkWidget *search_button, App *app) { const gchar *text; GtkTextBuffer *buffer; GtkTextIter iter; text = gtk_entry_get_text (GTK_ENTRY (app->search_entry)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (app->text_view)); gtk_text_buffer_get_start_iter (buffer, &iter); find (GTK_TEXT_VIEW (app->text_view), text, &iter); } void static display_text_results ( char *text ) { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *search_button; GtkWidget *next_button; GtkWidget *swindow; // PV: additional variables and original objects GtkWidget *hbox2; GtkWidget *save_button, *print_button, *ok_button; GtkTextBuffer *txbuf; size_t txlen; DisplayReportData *drd; char msg[100]; #if PV_DEBUG g_message("Display_text_results: start"); #endif // At first copy original code drd = (DisplayReportData *) malloc ( sizeof ( DisplayReportData ) ); memset ( drd, '\0', sizeof ( DisplayReportData ) ); drd->text = text; #if PV_DEBUG g_message("Display_text_results: checkpoint 1"); #endif // ... and now create window using GTK2 logic drd->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); // g_signal_connect (G_OBJECT (drd->window), "destroy", win_destroy, NULL); // Set window attributes: sprintf ( msg, "GTimer: %s", gettext ("Report") ); gtk_window_set_title (GTK_WINDOW (drd->window), msg ); gtk_window_set_wmclass ( GTK_WINDOW ( drd->window ), "GTimer", "gtimer" ); // PV: set default size 450x300 gtk_window_set_default_size (GTK_WINDOW(drd->window), 450, 500); gtk_widget_realize ( drd->window ); gdk_window_set_icon ( GTK_WIDGET ( drd->window )->window, NULL, appicon2, appicon2_mask ); // set font? // if ( font == NULL ) { // font = gdk_font_load ( "-adobe-courier-medium-r-*-*-12-*-*-*-*-*-*-*" ); // if ( font == NULL ) // font = gdk_font_load ( "fixed" ); // } #if PV_DEBUG g_message("Display_text_results: checkpoint 2"); #endif vbox = gtk_vbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (drd->window), vbox); hbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); app.search_entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (hbox), app.search_entry, TRUE, TRUE, 0); #if PV_DEBUG g_message("Display_text_results: checkpoint 3"); #endif search_button = gtk_button_new_with_label ("Search"); gtk_box_pack_start (GTK_BOX (hbox), search_button, FALSE, FALSE, 0); g_signal_connect (G_OBJECT (search_button), "clicked", G_CALLBACK (search_button_clicked), &app); next_button = gtk_button_new_with_label ("Next"); gtk_box_pack_start (GTK_BOX (hbox), next_button, FALSE, FALSE, 0); g_signal_connect (G_OBJECT (next_button), "clicked", G_CALLBACK (next_button_clicked), &app); swindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (vbox), swindow, TRUE, TRUE, 0); #if PV_DEBUG g_message("Display_text_results: checkpoint 4"); #endif // PV: add: set text txbuf = gtk_text_buffer_new(NULL); txlen = strlen ( text ); gtk_text_buffer_set_text ( GTK_TEXT_BUFFER ( txbuf ), text, txlen ); // PV: end of set text #if PV_DEBUG g_message("Display_text_results: checkpoint 5"); #endif app.text_view = gtk_text_view_new_with_buffer (txbuf); gtk_text_view_set_editable(GTK_TEXT_VIEW(app.text_view),0); gtk_container_add (GTK_CONTAINER (swindow), app.text_view); hbox2 = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0); #if PV_DEBUG g_message("Display_text_results: checkpoint 6"); #endif save_button = gtk_button_new_with_label ("Save"); gtk_box_pack_start (GTK_BOX (hbox2), save_button, TRUE, FALSE, 0); g_signal_connect (G_OBJECT (save_button), "clicked", G_CALLBACK (display_text_results_save_callback), drd); print_button = gtk_button_new_with_label ("Print"); gtk_box_pack_start (GTK_BOX (hbox2), print_button, TRUE, FALSE, 0); g_signal_connect (G_OBJECT (print_button), "clicked", G_CALLBACK (display_text_results_print_callback), drd); ok_button = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (hbox2), ok_button, TRUE, FALSE, 0); g_signal_connect (G_OBJECT (ok_button), "clicked", G_CALLBACK (display_text_results_ok_callback), drd); #if PV_DEBUG g_message("Display_text_results: checkpoint 7"); #endif gtk_widget_show_all (drd->window); #if PV_DEBUG g_message("Display_text_results: end"); #endif } static time_t do_round ( time_in, round_incr ) time_t time_in; int round_incr; { int t, n, r; if ( round_incr == 0 ) return ( time_in ); t = (int) time_in; r = t % round_incr; t -= r; if ( r > ( round_incr / 2 ) ) t += round_incr; return ( (time_t) t ); } static time_t summarize_day ( fp, seltasks, num_seltasks, then, type, format, include_hours, include_annotations, round_incr, is_last ) FILE *fp; ReportTaskData **seltasks; int num_seltasks; time_t then; report_type type; int format; int include_hours; int include_annotations; int round_incr; int is_last; { struct tm *tm; int found = 0; int loop, loop2; int mon, mday, year, wday; TaskTimeEntry *entry; TaskAnnotation **anns; int num_anns = 0; int h, m, s, rounded; time_t ret = 0; char indentation[30]; int ncols = 0; char *newline = "\n"; char daystring[20]; switch ( format ) { case REPORT_OUTPUT_TEXT: newline = "\n"; break; case REPORT_OUTPUT_HTML: newline = "
\n"; break; } if ( include_hours ) ncols++; if ( include_annotations ) ncols++; tm = localtime ( &then ); mon = tm->tm_mon + 1; mday = tm->tm_mday; year = tm->tm_year + 1900; wday = tm->tm_wday; if ( include_hours ) strcpy ( indentation, " " ); else strcpy ( indentation, " " ); strftime ( daystring, sizeof(daystring), "%x %a", tm ); for ( loop = 0; loop < num_seltasks; loop++ ) { if ( ( seltasks[loop]->week_start[0] == '\0' ) || ( tm->tm_wday == config_start_of_week ) ) strcpy ( seltasks[loop]->week_start, daystring ); if ( include_hours ) entry = taskGetTimeEntry ( seltasks[loop]->taskdata->task, year, mon, mday ); else entry = NULL; if ( include_annotations ) { anns = TaskGetAnnotationEntries ( seltasks[loop]->taskdata->task, year, mon, mday, config_midnight_offset, &num_anns ); for ( loop2 = 0; loop2 < num_anns; loop2++ ) { if ( type == REPORT_TYPE_DAILY ) concat_annotation ( &seltasks[loop]->todays_annotations, anns[loop2], 0, 0, indentation, newline ); else if ( type == REPORT_TYPE_WEEKLY ) concat_annotation ( &seltasks[loop]->weekly_annotations, anns[loop2], 0, 0, indentation, newline ); else if ( type == REPORT_TYPE_MONTHLY ) concat_annotation ( &seltasks[loop]->monthly_annotations, anns[loop2], 0, 0, indentation, newline ); else if ( type == REPORT_TYPE_YEARLY ) concat_annotation ( &seltasks[loop]->yearly_annotations, anns[loop2], 0, 0, indentation, newline ); else if ( type == REPORT_TYPE_TOTAL ) concat_annotation ( &seltasks[loop]->total_annotations, anns[loop2], 0, 0, indentation, newline ); } if ( anns ) free ( anns ); } rounded = 0; if ( ( entry && entry->seconds ) || seltasks[loop]->todays_annotations ) { if ( entry && entry->seconds ) { rounded = do_round ( entry->seconds, round_incr ); h = rounded / 3600; m = ( rounded - h * 3600 ) / 60; s = rounded % 60; } if ( type == REPORT_TYPE_DAILY ) { if ( ! found ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "\n%s\n", daystring ); fprintf ( fp, "-------------------------------------\n" ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "", ncols + 1 ); fprintf ( fp, "\n%s\n", daystring ); fprintf ( fp, "\n" ); break; } found = 1; } if ( format == REPORT_OUTPUT_HTML ) fprintf ( fp, "" ); if ( include_hours ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%3d:%02d:%02d - [%s] %s\n", h, m, s, seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%d:%02d:%02d", h, m, s ); fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } } else { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "[%s] %s\n", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } } } if ( rounded ) { ret += rounded; /* update totals */ seltasks[loop]->weekly_total += rounded; seltasks[loop]->monthly_total += rounded; seltasks[loop]->yearly_total += rounded; seltasks[loop]->total += rounded; } if ( seltasks[loop]->todays_annotations ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%s", seltasks[loop]->todays_annotations ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s", seltasks[loop]->todays_annotations ); break; } free ( seltasks[loop]->todays_annotations ); seltasks[loop]->todays_annotations = NULL; } if ( type == REPORT_TYPE_DAILY && format == REPORT_OUTPUT_HTML ) fprintf ( fp, "\n" ); } } if ( type == REPORT_TYPE_DAILY && ret ) { h = ret / 3600; m = ( ret - h * 3600 ) / 60; s = ret % 60; switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "---------\n" ); fprintf ( fp, "%3d:%02d:%02d - %s\n", h, m, s, gettext("Total") ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%d:%02d:%02d", h, m, s ); fprintf ( fp, "%s\n", gettext("Total") ); break; } } if ( ( type == REPORT_TYPE_WEEKLY ) && ( wday == ( ( config_start_of_week + 6 ) % 7 ) || is_last ) ) { found = 0; for ( loop = 0; loop < num_seltasks; loop++ ) { if ( seltasks[loop]->weekly_total || seltasks[loop]->weekly_annotations ) { if ( ! found ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "\n%s %s %s %s\n", gettext("Week"), seltasks[loop]->week_start, gettext("to"), daystring ); fprintf ( fp, "-------------------------------------\n" ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "", ncols + 1 ); fprintf ( fp, "%s %s %s %s", gettext("Week"), seltasks[loop]->week_start, gettext("to"), daystring ); fprintf ( fp, "\n" ); break; } found = 1; } if ( include_hours ) { h = seltasks[loop]->weekly_total / 3600; m = ( seltasks[loop]->weekly_total - h * 3600 ) / 60; s = seltasks[loop]->weekly_total % 60; switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%3d:%02d:%02d - [%s] %s\n", h, m, s, seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%d:%02d:%02d", h, m, s ); fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } seltasks[loop]->weekly_total = 0; } else { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "[%s] %s\n", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } } if ( seltasks[loop]->weekly_annotations ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%s", seltasks[loop]->weekly_annotations ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s", seltasks[loop]->weekly_annotations ); break; } free ( seltasks[loop]->weekly_annotations ); seltasks[loop]->weekly_annotations = NULL; } if ( format == REPORT_OUTPUT_HTML ) fprintf ( fp, "\n" ); } } } if ( ( type == REPORT_TYPE_MONTHLY ) && ( is_last || ( ( ( tm->tm_year % 4 == 0 ) && ( lmonth_days[tm->tm_mon] == tm->tm_mday ) ) || ( ( tm->tm_year % 4 != 0 ) && ( month_days[tm->tm_mon] == tm->tm_mday ) ) ) ) ) { found = 0; for ( loop = 0; loop < num_seltasks; loop++ ) { if ( seltasks[loop]->monthly_total || seltasks[loop]->monthly_annotations ) { if ( ! found ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "\n%s %02d/%d\n", gettext("Month"), mon, year ); fprintf ( fp, "-------------------------------------\n" ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s %02d/%d", ncols + 1, gettext("Month"), mon, year ); break; } found = 1; } if ( include_hours ) { h = seltasks[loop]->monthly_total / 3600; m = ( seltasks[loop]->monthly_total - h * 3600 ) / 60; s = seltasks[loop]->monthly_total % 60; switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%3d:%02d:%02d - [%s] %s\n", h, m, s, seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%d:%02d:%02d", h, m, s ); fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } seltasks[loop]->monthly_total = 0; } else { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "[%s] %s\n", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } } if ( seltasks[loop]->monthly_annotations ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%s", seltasks[loop]->monthly_annotations ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s", seltasks[loop]->monthly_annotations ); break; } free ( seltasks[loop]->monthly_annotations ); seltasks[loop]->monthly_annotations = NULL; } if ( format == REPORT_OUTPUT_HTML ) fprintf ( fp, "\n" ); } } } if ( ( type == REPORT_TYPE_YEARLY ) && ( is_last || ( tm->tm_mon == 12 && tm->tm_mday == 31 ) ) ) { found = 0; for ( loop = 0; loop < num_seltasks; loop++ ) { if ( seltasks[loop]->yearly_total || seltasks[loop]->yearly_annotations ) { if ( ! found ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "\n%s %d\n", gettext("Year"), year ); fprintf ( fp, "-------------------------------------\n" ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s %d\n", ncols + 1, gettext("Year"), year ); break; } found = 1; } if ( include_hours ) { h = seltasks[loop]->yearly_total / 3600; m = ( seltasks[loop]->yearly_total - h * 3600 ) / 60; s = seltasks[loop]->yearly_total % 60; switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%3d:%02d:%02d - [%s] %s\n", h, m, s, seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%d:%02d:%02d", h, m, s ); fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } seltasks[loop]->yearly_total = 0; } else { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "[%s] %s\n", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } } if ( seltasks[loop]->yearly_annotations ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%s", seltasks[loop]->yearly_annotations ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s", seltasks[loop]->yearly_annotations ); break; } free ( seltasks[loop]->yearly_annotations ); seltasks[loop]->yearly_annotations = NULL; } if ( format == REPORT_OUTPUT_HTML ) fprintf ( fp, "\n" ); } } } if ( ( type == REPORT_TYPE_TOTAL ) && is_last ) { found = 0; for ( loop = 0; loop < num_seltasks; loop++ ) { if ( seltasks[loop]->yearly_total ) { if ( ! found ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "\n%s\n", gettext("Totals") ); fprintf ( fp, "-------------------------------------\n" ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s\n", ncols + 1, gettext("Totals") ); break; } found = 1; } if ( include_hours ) { h = seltasks[loop]->total / 3600; m = ( seltasks[loop]->total - h * 3600 ) / 60; s = seltasks[loop]->total % 60; switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%3d:%02d:%02d - [%s] %s\n", h, m, s, seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%d:%02d:%02d", h, m, s ); fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } seltasks[loop]->total = 0; } else { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "[%s] %s\n", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "[%s] %s", seltasks[loop]->taskdata->task->project_id < 0 ? "none" : seltasks[loop]->taskdata->project_name, seltasks[loop]->taskdata->task->name ); break; } } if ( seltasks[loop]->total_annotations ) { switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "%s", seltasks[loop]->total_annotations ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "%s", seltasks[loop]->total_annotations ); break; } free ( seltasks[loop]->total_annotations ); seltasks[loop]->total_annotations = NULL; } if ( format == REPORT_OUTPUT_HTML ) fprintf ( fp, "\n" ); } } } if ( is_last ) { for ( loop = 0; loop < num_seltasks; loop++ ) { if ( seltasks[loop]->todays_annotations ) free ( seltasks[loop]->todays_annotations ); if ( seltasks[loop]->weekly_annotations ) free ( seltasks[loop]->weekly_annotations ); if ( seltasks[loop]->monthly_annotations ) free ( seltasks[loop]->monthly_annotations ); if ( seltasks[loop]->yearly_annotations ) free ( seltasks[loop]->yearly_annotations ); if ( seltasks[loop]->total_annotations ) free ( seltasks[loop]->total_annotations ); seltasks[loop]->todays_annotations = NULL; seltasks[loop]->weekly_annotations = NULL; seltasks[loop]->monthly_annotations = NULL; seltasks[loop]->yearly_annotations = NULL; seltasks[loop]->total_annotations = NULL; } } return ( ret ); } static void display_html_results ( text ) char *text; { char *path; int fd = -1; char tempfile[L_tmpnam]; char *command; if (tmpnam(tempfile)) fd = open ( tempfile, O_WRONLY | O_CREAT | O_EXCL, 0600 ); if (fd == -1) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Error opening temporary file"), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); return; } write ( fd, text, strlen ( text ) ); close ( fd ); free ( text ); if ( configGetAttribute ( CONFIG_BROWSER, &path ) < 0 ) path = "mozilla"; command = (char *) malloc ( strlen ( path ) + 100 + L_tmpnam ); if ( strstr ( path, "%s" ) ) sprintf ( command, path, tempfile ); else sprintf ( command, "%s %s", path, tempfile ); if ( system ( command ) != 0 ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Error communicating with browser."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); } free ( command ); } static void ok_callback ( widget, data ) GtkWidget *widget; gpointer data; { ReportData *rd = (ReportData *) data; GList *selected, *item; #if PV_DEBUG volatile int loop; #else int loop; #endif ReportTaskData **seltasks; int num_selected = 0; int range = REPORT_RANGE_TODAY; int format = REPORT_OUTPUT_TEXT; int round_incr = REPORT_ROUND_NONE; FILE *fp; time_t now, time_start, time_end, time_loop, total; struct tm *tm; struct stat buf; char *text = NULL; int ret, ncols, h, m, s; size_t len; // PV: GtkTreeSelection *select; #if PV_DEBUG volatile const char *s1; volatile const char *s2; #else const char *s1, *s2; #endif // selected = GTK_LIST ( rd->task_list ) ->selection; #if PV_DEBUG g_message("Report start"); #endif select = gtk_tree_view_get_selection(GTK_TREE_VIEW(rd->task_list)); selected = gtk_tree_selection_get_selected_rows(GTK_TREE_SELECTION(select), NULL); // selected contains list of paths if ( ! selected ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected any tasks"), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); return; } /* include hours / annotations*/ for ( loop = 0; data_options[loop]; loop++ ) { if ( GTK_OPTION_MENU ( rd->data_menu ) -> menu_item == rd->data_menu_items[loop] ) { switch ( loop ) { case REPORT_DATA_HOURS: rd->include_hours = 1; rd->include_annotations = 0; break; case REPORT_DATA_ANNOTATIONS: rd->include_hours = 0; rd->include_annotations = 1; break; case REPORT_DATA_BOTH: rd->include_hours = 1; rd->include_annotations = 1; break; } } } if ( ! rd->include_hours && ! rd->include_annotations ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You must select either \"include hours\"\nor \"include annotations\"."), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); return; } #if PV_DEBUG g_message("Report CP1 -- Tasks: %d \n", rd->num_tasks); #endif /* which tasks were selected... */ seltasks = (ReportTaskData **) malloc ( sizeof ( ReportTaskData * ) * rd->num_tasks ); for ( loop = 0; loop < rd->num_tasks; loop++ ) seltasks[loop] = NULL; for ( item = selected; item != NULL; item = item->next ) { s1 = gtk_tree_path_to_string(item->data); for ( loop = 0; loop < rd->num_tasks; loop++ ) { s2 = gtk_tree_path_to_string(rd->list_items[loop]); if ( ! strcmp(s1, s2) ) { seltasks[num_selected] = (ReportTaskData *) malloc ( sizeof ( ReportTaskData ) ); memset ( seltasks[num_selected], '\0', sizeof ( ReportTaskData ) ); seltasks[num_selected++]->taskdata = rd->tasks[loop]; } } } #if PV_DEBUG g_message("Report checkpoint 2"); #endif /* which time range ? */ for ( loop = 0; time_options[loop]; loop++ ) { if ( GTK_OPTION_MENU ( rd->time_menu ) -> menu_item == rd->time_menu_items[loop] ) { range = loop; } } #if PV_DEBUG g_message("Report checkpoint 3"); #endif /* which output format */ for ( loop = 0; output_options[loop]; loop++ ) { if ( GTK_OPTION_MENU ( rd->output_menu ) -> menu_item == rd->output_menu_items[loop] ) { format = loop; } } #if PV_DEBUG g_message("Report checkpoint 4"); #endif /* which rounding ? */ for ( loop = 0; round_options[loop]; loop++ ) { if ( GTK_OPTION_MENU ( rd->round_menu ) -> menu_item == rd->round_menu_items[loop] ) { round_incr = round_values[loop]; } } #if PV_DEBUG g_message("Report checkpoint 5"); #endif gtk_grab_remove ( rd->window ); gtk_widget_destroy ( rd->window ); /* Generate the report... */ fp = tmpfile(); if ( ! fp ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("Error opening temporary file"), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); for ( loop = 0; loop < num_visible_tasks; loop++ ) free ( seltasks[loop] ); free ( seltasks ); free ( rd->tasks ); free ( rd->list_items ); free ( rd ); return; } time ( &now ); now -= config_midnight_offset; tm = localtime ( &now ); switch ( range ) { case REPORT_RANGE_TODAY: time_start = time_end = now; break; case REPORT_RANGE_LAST_WEEK: time_start = now - ONE_DAY * tm->tm_wday - ONE_DAY * 7; time_end = now - ONE_DAY * tm->tm_wday - ONE_DAY; break; case REPORT_RANGE_THIS_AND_LAST_WEEK: time_start = now - ONE_DAY * tm->tm_wday - ONE_DAY * 7; time_end = time_start + ONE_DAY * 14; break; case REPORT_RANGE_LAST_TWO_WEEKS: time_start = now - ONE_DAY * tm->tm_wday - ONE_DAY * 14; time_end = now - ONE_DAY * tm->tm_wday - ONE_DAY; break; case REPORT_RANGE_THIS_MONTH: time_start = now - ( ONE_DAY * ( tm->tm_mday - 1 ) ); time_end = now; break; case REPORT_RANGE_LAST_MONTH: if ( tm->tm_mon == 0 ) time_start = now - ( ONE_DAY * ( tm->tm_mday - 1 ) ) - ONE_DAY * 31; else if ( tm->tm_year % 4 == 0 ) time_start = now - ( ONE_DAY * ( tm->tm_mday - 1 ) ) - ONE_DAY * lmonth_days[tm->tm_mon-1]; else time_start = now - ( ONE_DAY * ( tm->tm_mday - 1 ) ) - ONE_DAY * month_days[tm->tm_mon-1]; time_end = now - ONE_DAY * tm->tm_mday; break; case REPORT_RANGE_THIS_YEAR: time_start = now - ONE_DAY * tm->tm_yday; time_end = now; break; case REPORT_RANGE_LAST_YEAR: if ( (tm->tm_year - 1) % 4 == 0 ) time_start = now - ONE_DAY * ( tm->tm_yday + 366 ); else time_start = now - ONE_DAY * ( tm->tm_yday + 365 ); time_end = now - ONE_DAY * ( tm->tm_yday + 1 ); break; default: case REPORT_RANGE_THIS_WEEK: time_start = now - ONE_DAY * tm->tm_wday; time_end = now; break; } if ( format == REPORT_OUTPUT_HTML ) { fprintf ( fp, "GTimer %s\n", gettext("Report") ); fprintf ( fp, "%s", CSS_STYLE ); fprintf ( fp, "\n" ); fprintf ( fp, "\n" ); ncols = 1; if ( rd->include_hours ) ncols++; if ( rd->include_annotations ) ncols++; } #if PV_DEBUG g_message("Report checkpoint \"total\""); #endif total = 0; for ( time_loop = time_start; time_loop <= time_end; time_loop += ONE_DAY ) { total += summarize_day ( fp, seltasks, num_selected, time_loop, rd->type, format, rd->include_hours, rd->include_annotations, round_incr, ( time_loop == time_end ) ); } h = total / 3600; m = ( total - h * 3600 ) / 60; s = total % 60; switch ( format ) { case REPORT_OUTPUT_TEXT: fprintf ( fp, "\n%s\n-------------------------------------\n", gettext("Grand Total") ); fprintf ( fp, "%3d:%02d:%02d\n", h, m, s ); break; case REPORT_OUTPUT_HTML: fprintf ( fp, "", 1 + ncols, gettext("Grand Total") ); fprintf ( fp, "", h, m, s ); fprintf ( fp, "
%s
%d:%02d:%02d


%s ", gettext("Generated by") ); fprintf ( fp, "GTimer v%s (%s).\n", GTIMER_URL, GTIMER_VERSION, GTIMER_VERSION_DATE ); fprintf ( fp, "\n" ); break; } #if PV_DEBUG g_message("Report checkpoint (total printed)"); #endif len = ftell(fp); rewind ( fp ); text = (char *) calloc ( len + 1, sizeof(char) ); fread ( text, len, sizeof(char), fp ); fclose ( fp ); switch ( format ) { case REPORT_OUTPUT_TEXT: display_text_results ( text ); break; case REPORT_OUTPUT_HTML: display_html_results ( text ); break; } #if PV_DEBUG g_message("Report checkpoint 99%"); #endif /* Free resources */ for ( loop = 0; loop < num_selected; loop++ ) free ( seltasks[loop] ); free ( seltasks ); free ( rd->tasks ); free ( rd->list_items ); free ( rd ); #if PV_DEBUG g_message("Report end"); #endif } static void cancel_callback ( widget, data ) GtkWidget *widget; gpointer data; { ReportData *rd = (ReportData *) data; gtk_grab_remove ( rd->window ); gtk_widget_destroy ( rd->window ); free ( rd->tasks ); free ( rd->list_items ); free ( rd ); } static void select_all_callback ( widget, data ) GtkWidget *widget; gpointer data; { ReportData *rd = (ReportData *) data; int loop; gtk_tree_selection_select_all ( gtk_tree_view_get_selection ( GTK_TREE_VIEW (rd->task_list) ) ) ; // for ( loop = 0; loop < rd->num_tasks; loop++ ) // gtk_list_select_item ( GTK_LIST ( rd->task_list ), loop ); } static void select_none_callback ( widget, data ) GtkWidget *widget; gpointer data; { ReportData *rd = (ReportData *) data; int loop; gtk_tree_selection_unselect_all ( gtk_tree_view_get_selection ( GTK_TREE_VIEW (rd->task_list) ) ) ; // for ( loop = 0; loop < rd->num_tasks; loop++ ) // gtk_list_unselect_item ( GTK_LIST ( rd->task_list ), loop ); } static GtkWidget *create_time_menu ( rd ) ReportData *rd; { GtkWidget *menu; int loop; menu = gtk_menu_new (); for ( loop = 0; time_options[loop]; loop++ ) { rd->time_menu_items[loop] = gtk_menu_item_new_with_label ( gettext(time_options[loop]) ); gtk_menu_append ( GTK_MENU ( menu ), rd->time_menu_items[loop] ); gtk_widget_show ( rd->time_menu_items[loop] ); } return ( menu ); } static GtkWidget *create_output_menu ( rd ) ReportData *rd; { GtkWidget *menu; int loop; menu = gtk_menu_new (); for ( loop = 0; output_options[loop]; loop++ ) { rd->output_menu_items[loop] = gtk_menu_item_new_with_label ( gettext(output_options[loop]) ); gtk_menu_append ( GTK_MENU ( menu ), rd->output_menu_items[loop] ); gtk_widget_show ( rd->output_menu_items[loop] ); } return ( menu ); } static GtkWidget *create_data_menu ( rd ) ReportData *rd; { GtkWidget *menu; int loop; menu = gtk_menu_new (); for ( loop = 0; data_options[loop]; loop++ ) { rd->data_menu_items[loop] = gtk_menu_item_new_with_label ( gettext(data_options[loop]) ); gtk_menu_append ( GTK_MENU ( menu ), rd->data_menu_items[loop] ); gtk_widget_show ( rd->data_menu_items[loop] ); } return ( menu ); } static GtkWidget *create_round_menu ( rd ) ReportData *rd; { GtkWidget *menu; int loop; menu = gtk_menu_new (); for ( loop = 0; round_options[loop]; loop++ ) { rd->round_menu_items[loop] = gtk_menu_item_new_with_label ( gettext(round_options[loop]) ); gtk_menu_append ( GTK_MENU ( menu ), rd->round_menu_items[loop] ); gtk_widget_show ( rd->round_menu_items[loop] ); } return ( menu ); } /* ** Create the report setup window. ** It's an add if taskdata is NULL. */ GtkWidget *create_report_window ( type ) report_type type; { GtkWidget *report_window; GtkWidget *table; /*GtkTooltips *tooltips;*/ GtkWidget *label, *button, *time_menu, *output_menu, *data_menu, *round_menu, *scrolled; ReportData *rd; GList *items = NULL; int loop; char msg[100], temp[512]; // PV: CustomList *customlist; // GtkWidget *select; GtkCellRenderer *renderer; GtkTreeViewColumn *col; // GtkTreePath *path; GtkTreeSelection *select; gchar *xtaskname; #if PV_DEBUG g_message("Report window: start"); #endif customlist = custom_list_new(); rd = (ReportData *) malloc ( sizeof ( ReportData ) ); #if PV_DEBUG g_message("rd: %d", (int) rd); #endif memset ( rd, '\0', sizeof ( ReportData ) ); rd->type = type; rd->window = report_window = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( rd->window ), "GTimer", "gtimer" ); sprintf ( msg, "GTimer: %s", gettext("Report") ); gtk_window_set_title (GTK_WINDOW (report_window), msg ); gtk_window_position ( GTK_WINDOW(report_window), GTK_WIN_POS_MOUSE ); gtk_grab_add ( report_window ); gtk_widget_realize ( report_window ); gdk_window_set_icon ( GTK_WIDGET ( rd->window )->window, NULL, appicon2, appicon2_mask ); #if PV_DEBUG g_message("Report window: CP 1"); #endif table = gtk_table_new ( 4, 2, FALSE ); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 8); gtk_container_border_width (GTK_CONTAINER (table), 6); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (report_window)->vbox ), table, TRUE, TRUE, 2 ); label = gtk_label_new ( "Time Range: " ); gtk_table_attach_defaults ( GTK_TABLE (table), label, 0, 1, 0, 1 ); gtk_widget_show ( label ); rd->time_menu = gtk_option_menu_new (); time_menu = create_time_menu ( rd ); gtk_option_menu_set_menu ( GTK_OPTION_MENU ( rd->time_menu ), time_menu ); gtk_option_menu_set_history ( GTK_OPTION_MENU ( rd->time_menu ), REPORT_RANGE_THIS_MONTH ); gtk_table_attach_defaults ( GTK_TABLE (table), rd->time_menu, 1, 2, 0, 1 ); gtk_widget_show ( rd->time_menu ); #if PV_DEBUG g_message("Report window: CP 2"); #endif label = gtk_label_new ( gettext("Format: ") ); gtk_table_attach_defaults ( GTK_TABLE (table), label, 0, 1, 1, 2 ); gtk_widget_show ( label ); rd->output_menu = gtk_option_menu_new (); output_menu = create_output_menu ( rd ); gtk_option_menu_set_menu ( GTK_OPTION_MENU ( rd->output_menu ), output_menu ); gtk_option_menu_set_history ( GTK_OPTION_MENU ( rd->output_menu ), REPORT_OUTPUT_TEXT ); gtk_table_attach_defaults ( GTK_TABLE (table), rd->output_menu, 1, 2, 1, 2 ); gtk_widget_show ( rd->output_menu ); label = gtk_label_new ( gettext("Data: ") ); gtk_table_attach_defaults ( GTK_TABLE (table), label, 0, 1, 2, 3 ); gtk_widget_show ( label ); rd->data_menu = gtk_option_menu_new (); data_menu = create_data_menu ( rd ); gtk_option_menu_set_menu ( GTK_OPTION_MENU ( rd->data_menu ), data_menu ); gtk_option_menu_set_history ( GTK_OPTION_MENU ( rd->data_menu ), REPORT_OUTPUT_TEXT ); gtk_table_attach_defaults ( GTK_TABLE (table), rd->data_menu, 1, 2, 2, 3 ); gtk_widget_show ( rd->data_menu ); label = gtk_label_new ( gettext("Rounding: ") ); gtk_table_attach_defaults ( GTK_TABLE (table), label, 0, 1, 3, 4 ); gtk_widget_show ( label ); rd->round_menu = gtk_option_menu_new (); round_menu = create_round_menu ( rd ); gtk_option_menu_set_menu ( GTK_OPTION_MENU ( rd->round_menu ), round_menu ); gtk_option_menu_set_history ( GTK_OPTION_MENU ( rd->round_menu ), REPORT_OUTPUT_TEXT ); gtk_table_attach_defaults ( GTK_TABLE (table), rd->round_menu, 1, 2, 3, 4 ); gtk_widget_show ( rd->round_menu ); gtk_widget_show ( table ); #if PV_DEBUG g_message("Report window: CP 3"); #endif label = gtk_label_new ( gettext("Tasks to include:") ); gtk_label_set_justify ( GTK_LABEL ( label ), GTK_JUSTIFY_LEFT ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (report_window)->vbox ), label, FALSE, FALSE, 2 ); gtk_widget_show ( label ); /* list of tasks */ // PV: GTK_LIST --> GTK_TREE_VIEW scrolled = gtk_scrolled_window_new ( NULL, NULL ); gtk_widget_set_usize ( scrolled, 300, 200 ); gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (report_window)->vbox ), scrolled, TRUE, TRUE, 2 ); // PV: - rd->task_list = gtk_list_new (); rd->tasks = (TaskData **) malloc ( sizeof ( TaskData * ) * num_visible_tasks ); rd->list_items = (GtkTreePath **) malloc ( sizeof ( GtkTreePath * ) * num_visible_tasks ); rd->num_tasks = num_visible_tasks; for ( loop = 0; loop < num_visible_tasks; loop++ ) { if ( visible_tasks[loop]->task->project_id < 0 ) snprintf ( temp, sizeof ( temp ), "%s", visible_tasks[loop]->task->name ); else snprintf ( temp, sizeof ( temp ), "[%s] %s", visible_tasks[loop]->project_name, visible_tasks[loop]->task->name ); items = g_list_append ( items, rd->list_items[loop] ); rd->tasks[loop] = visible_tasks[loop]; xtaskname = g_strdup_printf ("%s", temp); rd->list_items[loop] = custom_list_append_record (customlist, xtaskname); } #if PV_DEBUG g_message("Report window: CP 4"); #endif rd->task_list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(customlist)); g_object_unref(customlist); /* destroy store automatically with view */ renderer = gtk_cell_renderer_text_new(); col = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start (col, renderer, TRUE); gtk_tree_view_column_add_attribute (col, renderer, "text", CUSTOM_LIST_COL_NAME); gtk_tree_view_column_set_title (col, gettext("[Project] Task")); gtk_tree_view_append_column(GTK_TREE_VIEW(rd->task_list),col); select = gtk_tree_view_get_selection(GTK_TREE_VIEW(rd->task_list)); gtk_tree_selection_set_mode(GTK_TREE_SELECTION(select), GTK_SELECTION_MULTIPLE); gtk_scrolled_window_add_with_viewport ( GTK_SCROLLED_WINDOW ( scrolled ), rd->task_list ); // PV: select all gtk_tree_selection_select_all(GTK_TREE_SELECTION(select)); gtk_widget_show ( scrolled ); gtk_widget_show ( rd->task_list ); /* add command buttons */ /*tooltips = gtk_tooltips_new ();*/ gtk_box_set_homogeneous ( GTK_BOX ( GTK_DIALOG (report_window)->action_area ), 1 ); button = gtk_button_new_with_label ( gettext("Ok") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (report_window)->action_area), button, TRUE, FALSE, 2); gtk_box_set_spacing ( GTK_BOX (GTK_DIALOG (report_window)->action_area), 2 ); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (ok_callback), rd); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Generate a report" );*/ button = gtk_button_new_with_label ( gettext("Cancel") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (report_window)->action_area), button, TRUE, FALSE, 2); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (cancel_callback), rd); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Cancel without generating a report" );*/ button = gtk_button_new_with_label ( gettext("Select all") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (report_window)->action_area), button, TRUE, FALSE, 2); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (select_all_callback), rd); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Select all tasks" );*/ button = gtk_button_new_with_label ( gettext("Select none") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (report_window)->action_area), button, TRUE, FALSE, 2); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (select_none_callback), rd); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Unselect all tasks" );*/ gtk_widget_show_all (report_window); #if PV_DEBUG g_message("Report window: CP 100"); #endif return ( report_window ); } gtimer-2.0.0/requests0000644000175000017500000001353411353237102015007 0ustar cknudsencknudsen# This file was generated by Autom4te Wed Jan 17 19:57:31 PST 2007. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', '/usr/share/aclocal/gtk-2.0.m4', '/usr/share/aclocal-1.10/amversion.m4', '/usr/share/aclocal-1.10/auxdir.m4', '/usr/share/aclocal-1.10/cond.m4', '/usr/share/aclocal-1.10/depend.m4', '/usr/share/aclocal-1.10/depout.m4', '/usr/share/aclocal-1.10/init.m4', '/usr/share/aclocal-1.10/install-sh.m4', '/usr/share/aclocal-1.10/lead-dot.m4', '/usr/share/aclocal-1.10/make.m4', '/usr/share/aclocal-1.10/missing.m4', '/usr/share/aclocal-1.10/mkdirp.m4', '/usr/share/aclocal-1.10/options.m4', '/usr/share/aclocal-1.10/runlog.m4', '/usr/share/aclocal-1.10/sanity.m4', '/usr/share/aclocal-1.10/strip.m4', '/usr/share/aclocal-1.10/substnot.m4', '/usr/share/aclocal-1.10/tar.m4', 'configure.ac' ], { 'm4_pattern_forbid' => 1, 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, '_AM_SET_OPTION' => 1, 'AC_DEFUN' => 1, 'AM_PROG_MKDIR_P' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'AM_MISSING_HAS_RUN' => 1, 'AM_PATH_GTK_2_0' => 1, 'AM_MISSING_PROG' => 1, 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'AC_DEFUN_ONCE' => 1, 'AM_PROG_INSTALL_STRIP' => 1, '_m4_warn' => 1, 'AM_SANITY_CHECK' => 1, 'include' => 1, '_AM_PROG_TAR' => 1, 'AM_AUX_DIR_EXPAND' => 1, 'AM_DEP_TRACK' => 1, '_AM_SET_OPTIONS' => 1, 'AM_RUN_LOG' => 1, '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, '_AM_IF_OPTION' => 1, '_AM_SUBST_NOTMAKE' => 1, '_AM_AUTOCONF_VERSION' => 1, 'm4_pattern_allow' => 1, '_AM_MANGLE_OPTION' => 1, 'AM_SET_LEADING_DOT' => 1, 'AM_CONDITIONAL' => 1, 'AM_SET_DEPDIR' => 1, '_AM_DEPENDENCIES' => 1, 'm4_include' => 1, 'AM_PROG_INSTALL_SH' => 1, '_AC_AM_CONFIG_HEADER_HOOK' => 1, 'AU_DEFUN' => 1, 'AM_MAKE_INCLUDE' => 1 } ], 'Autom4te::Request' ), bless( [ '1', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', 'aclocal.m4', 'configure.ac' ], { '_LT_AC_TAGCONFIG' => 1, 'AM_PROG_F77_C_O' => 1, 'AC_INIT' => 1, 'm4_pattern_forbid' => 1, 'AC_CANONICAL_TARGET' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1, 'AC_SUBST' => 1, 'AC_CANONICAL_HOST' => 1, 'AC_FC_SRCEXT' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'LT_CONFIG_LTDL_DIR' => 1, 'AC_CONFIG_LINKS' => 1, 'AC_REQUIRE_AUX_FILE' => 1, 'LT_SUPPORTED_TAG' => 1, 'm4_sinclude' => 1, 'AM_MAINTAINER_MODE' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, '_m4_warn' => 1, 'AM_PROG_CXX_C_O' => 1, 'AM_ENABLE_MULTILIB' => 1, 'AC_CONFIG_FILES' => 1, 'LT_INIT' => 1, 'include' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_LIBSOURCE' => 1, 'AM_PROG_FC_C_O' => 1, 'AC_CANONICAL_BUILD' => 1, 'AC_FC_FREEFORM' => 1, 'AH_OUTPUT' => 1, '_AM_SUBST_NOTMAKE' => 1, 'AC_CONFIG_AUX_DIR' => 1, 'm4_pattern_allow' => 1, 'AM_PROG_CC_C_O' => 1, 'sinclude' => 1, 'AM_CONDITIONAL' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'm4_include' => 1, 'AC_SUBST_TRACE' => 1 } ], 'Autom4te::Request' ) ); gtimer-2.0.0/rules0000644000175000017500000000462111353237102014263 0ustar cknudsencknudsen#!/usr/bin/make -f # Made with the aid of dh_make, by Craig Small # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # Some lines taken from debmake, by Cristoph Lameter. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Yes, we use the Debian Build System. We won't as soon as it's easy to make # the change. I'm hoping for a new upstream release as a good opportunity to # switch to quilt or Git. TAR_DIR=gtimer-1.1.6 include /usr/share/dbs/dbs-build.mk CFLAGS=-DLANG_EN -g -Wall ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif # Tell Autoconf the correct system types. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) SYSTEM = --build $(DEB_HOST_GNU_TYPE) else SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif # Comply with Policy 4.14. patch: $(patched) configure: configure-stamp configure-stamp: $(patched) sed -e "s,@BUILD_TREE@,$(BUILD_TREE)," debian/gtimer.install.in \ > debian/gtimer.install cd $(BUILD_TREE) && ./configure --prefix=/usr \ --mandir=/usr/share/man $(SYSTEM) cd $(BUILD_TREE) && mv po/cz.po po/cs.po touch configure-stamp build: build-arch build-indep build-arch: build-arch-stamp build-indep: build-arch-stamp: configure-stamp dh_testdir cd $(BUILD_TREE) && $(MAKE) touch build-arch-stamp clean: dh_testdir dh_testroot rm -f configure-stamp build-arch-stamp install-stamp rm -rf $(STAMP_DIR) $(SOURCE_DIR) dh_clean debian/gtimer.install install: install-stamp install-stamp: build-arch-stamp dh_testdir dh_testroot dh_clean -k dh_installdirs cd $(BUILD_TREE) && $(MAKE) prefix=$(CURDIR)/debian/tmp/usr install dh_install touch install-stamp # Build architecture-dependent files here. binary: binary-arch binary-indep binary-indep: binary-arch: build install dh_testdir dh_testroot dh_installchangelogs $(BUILD_TREE)/ChangeLog dh_installdocs $(BUILD_TREE)/README $(BUILD_TREE)/FAQ.html \ $(BUILD_TREE)/AUTHORS dh_installmenu dh_installman $(BUILD_TREE)/gtimer.1 dh_desktop dh_strip dh_link dh_compress -X doc/gtimer/contrib dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb .PHONY: binary binary-arch binary-indep build build-arch build-indep configure .PHONY: clean install gtimer-2.0.0/task.c0000644000175000017500000004562511353237102014325 0ustar cknudsencknudsen/* * Routines for dealing with tasks * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * History: * 17-Apr-2005 Add support for subtracting a particular offset * off of timers. (Russ Allbery) * 09-Mar-2000 Added functions to allow for restoring to * a previous state: taskMark(), taskMarkAll(), * taskRestore(), taskRestoreAll() * 25-Mar-1999 Lots of WIN32 patches made by * Thomas Epperly * 18-Mar-1999 Internationalization * 11-Nov-1998 Added support for options * 23-Apr-1998 Added new function: taskClearAll * 22-Mar-1998 Added an extra argument to TaskGetAnnotationEntries * for time offset. * 15-Mar-1998 Debugged all malloc/free and found one place * where free() was not called. * 15-Mar-1998 Fixed bug that caused SIGSEGV. Only appeared * if one more tasks (but not the last one) were * deleted. * 15-Mar-1998 Added new function: taskAddAnnotation * 11-Mar-1998 Changed functions to K&R style * */ #include #include #include #if HAVE_UNISTD_H #include #endif #ifdef WIN32 #include #else #include #endif #include #include #include #include #include #include #include #include "task.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif // PV: Internationalization #include "gtimeri18n.h" static int num_tasks = 0; static Task **tasks = NULL; static int max_task = -1; static int last_number = -1; #ifdef WIN32 static int valid_name ( filename ) char *filename; { while ( *filename && isdigit ( *filename ) ) filename++; return ( ! strcmp ( filename, ".task" ) ); } #endif /* ** Add a task. */ void taskAdd ( task ) Task *task; { int loop; int new_max_task = 0; new_max_task = max_task; if ( task->number == -1 ) { for ( loop = 0; loop < max_task && task->number < 0; loop++ ) { if ( tasks[loop] == NULL ) task->number = loop; } if ( task->number < 0 ) task->number = ++max_task; new_max_task = max_task; } else if ( task->number > max_task ) { new_max_task = task->number; } if ( tasks == NULL ) { tasks = (Task **) malloc ( sizeof ( Task * ) * ( new_max_task + 1 ) ); for ( loop = 0; loop < new_max_task; loop++ ) tasks[loop] = NULL; } else tasks = (Task **) realloc ( tasks, sizeof ( Task * ) * ( new_max_task + 1 ) ); for ( loop = max_task + 1; loop <= new_max_task; loop++ ) tasks[loop] = NULL; max_task = new_max_task; tasks[task->number] = task; num_tasks++; } /* ** Create a new task */ Task *taskCreate ( name ) char *name; { Task *task; task = (Task *) malloc ( sizeof ( Task ) ); memset ( task, '\0', sizeof ( Task ) ); task->name = (char *) malloc ( strlen ( name ) + 1 ); strcpy ( task->name, name ); time ( &task->created ); task->number = -1; /* not yet assigned */ return ( task ); } /* ** Mark the current time in a task. We can then use taskRestore() ** to restore the state of the task to what it was when this function ** was called. */ void taskMark ( task, offset ) Task *task; int offset; { int i; int seconds; for ( i = 0; i < task->num_entries; i++ ) { task->entries[i]->marked_seconds = task->entries[i]->seconds; } if ( offset > 0 && task->num_entries > 0 ) { seconds = task->entries[task->num_entries - 1]->marked_seconds; seconds -= offset; if ( seconds < 0 ) seconds = 0; task->entries[task->num_entries - 1]->marked_seconds = seconds; } } /* ** Mark the current time in all tasks so that we can use taskRestoreAll() ** to restore the state of all tasks to where they are right now. ** NOTE: this is intended to be used only with the timing elements. ** Other stuff like annotations doesn't apply here, but annotations shouldn't ** be added during idle time anyhow... */ void taskMarkAll ( offset ) int offset; { int loop; for ( loop = 0; loop <= max_task; loop++ ) { if ( tasks[loop] ) { taskMark ( tasks[loop], offset ); } } } /* ** Restore a task to its previous state when taskMark() was called. ** This is intended to allow the application to bookmark the state ** of a task and then return to it (as far as timing data goes). */ void taskRestore ( task ) Task *task; { int i; for ( i = 0; i < task->num_entries; i++ ) { task->entries[i]->seconds = task->entries[i]->marked_seconds; } } /* ** Restore all tasks to where they were when taskRestoreAll() ** was called. */ void taskRestoreAll () { int loop; for ( loop = 0; loop <= max_task; loop++ ) { if ( tasks[loop] ) { taskRestore ( tasks[loop] ); } } } /* ** Delete a task. */ int taskDelete ( task, taskdir ) Task *task; char *taskdir; { char *path; path = (char *) malloc ( strlen ( taskdir ) + 10 ); sprintf ( path, "%s/%d.task", taskdir, task->number ); unlink ( path ); sprintf ( path, "%s/%d.ann", taskdir, task->number ); unlink ( path ); free ( path ); tasks[task->number] = NULL; num_tasks--; taskFree ( task ); return ( 0 ); } /* ** Return the number of tasks currently loaded. */ int taskCount () { return ( num_tasks ); } /* ** Get a task by number. */ Task *taskGet ( number ) int number; { return ( tasks[number] ); } /* ** Get first task. */ Task *taskGetFirst () { last_number = -1; return ( taskGetNext() ); } /* ** Get next task. */ Task *taskGetNext () { int loop; if ( ! num_tasks ) return ( NULL ); for ( loop = last_number + 1; loop <= max_task; loop++ ) { if ( tasks[loop] ) { last_number = loop; return ( tasks[loop] ); } } return ( NULL ); } /* ** Clear all tasks out of memory. */ void taskClearAll () { int loop; for ( loop = 0; loop <= max_task; loop++ ) { if ( tasks[loop] ) { taskFree ( tasks[loop] ); tasks[loop] = 0; } } num_tasks = 0; last_number = max_task = -1; } /* ** Save a task to it's task file. */ int taskSave ( task, taskdir ) Task *task; char *taskdir; { char *path; FILE *fp; int loop; path = (char *) malloc ( strlen ( taskdir ) + 10 ); sprintf ( path, "%s/%d.task", taskdir, task->number ); fp = fopen ( path, "w" ); if ( !fp ) { free ( path ); return ( TASK_ERROR_SYSTEM_ERROR ); } fprintf ( fp, "Format: 1.2\n" ); fprintf ( fp, "Name: %s\n", task->name ); fprintf ( fp, "Created: %u\n", (unsigned int)task->created ); fprintf ( fp, "Options: %u\n", task->options ); fprintf ( fp, "Project: %d\n", task->project_id ); fprintf ( fp, "Data:\n" ); for ( loop = 0; loop < task->num_entries; loop++ ) { if ( task->entries[loop]->seconds ) fprintf ( fp, "%04d%02d%02d %d\n", task->entries[loop]->year, task->entries[loop]->mon, task->entries[loop]->mday, task->entries[loop]->seconds ); } fclose ( fp ); free ( path ); return ( 0 ); } /* ** Save all tasks */ int taskSaveAll ( taskdir ) char *taskdir; { int loop; int ret; for ( loop = 0; loop <= max_task; loop++ ) { if ( tasks[loop] ) { ret = taskSave ( tasks[loop], taskdir ); if ( ret ) return ( ret ); } } return ( 0 ); } /* ** Free all resources of a task. */ void taskFree ( task ) Task *task; { int loop; free ( task->name ); for ( loop = 0; loop < task->num_entries; loop++ ) free ( task->entries[loop] ); if ( task->entries ) free ( task->entries ); for ( loop = 0; loop < task->num_annotations; loop++ ) { free ( task->annotations[loop]->text ); free ( task->annotations[loop] ); } if ( task->annotations ) free ( task->annotations ); free ( task ); } /* ** Load a task from file. */ int taskLoad ( path, task ) char *path; Task **task; { FILE *fp; int fd; Task *newtask; char line[512], *ptr, *ptr2, temp[10], *annfile, *anntext; int len, created, number, options, project_id = -1; TaskTimeEntry *entry; TaskAnnotation *a; struct stat buf; fp = fopen ( path, "r" ); if ( !fp ) return ( TASK_ERROR_SYSTEM_ERROR ); for ( ptr = path + strlen ( path ) - 1; *ptr != '/' && ptr != path; ptr-- ); if ( *ptr == '/' ) ptr++; sscanf ( ptr, "%d.task", &number ); fgets ( line, 512, fp ); len = strlen ( line ); if ( line[len-1] == '\n' ) line[len-1] = '\0'; if ( strcmp ( line, "Format: 1.0" ) && strcmp ( line, "Format: 1.1" ) && strcmp ( line, "Format: 1.2" ) ) { fclose ( fp ); return ( TASK_ERROR_BAD_FILE ); } newtask = (Task *) malloc ( sizeof ( Task ) ); memset ( newtask, '\0', sizeof ( Task ) ); newtask->number = number; newtask->project_id = -1; /* no project */ while ( fgets ( line, 512, fp ) ) { len = strlen ( line ); if ( line[len-1] == '\n' ) line[len-1] = '\0'; if ( strncmp ( line, "Name:", 5 ) == 0 ) { ptr = line + 5; if ( *ptr == ' ' ) ptr++; newtask->name = (char *) malloc ( strlen ( ptr ) + 1 ); strcpy ( newtask->name, ptr ); } else if ( strncmp ( line, "Created:", 8 ) == 0 ) { sscanf ( line + 8, "%d", &created ); newtask->created = (time_t) created; } else if ( strncmp ( line, "Project:", 8 ) == 0 ) { sscanf ( line + 8, "%d", &project_id ); newtask->project_id = project_id; } else if ( strncmp ( line, "Options:", 8 ) == 0 ) { sscanf ( line + 8, "%d", &options ); newtask->options = (unsigned int) options; } else if ( strcmp ( line, "Data:" ) == 0 ) { while ( fgets ( line, 512, fp ) ) { entry = (TaskTimeEntry *) malloc ( sizeof ( TaskTimeEntry ) ); memset ( entry, '\0', sizeof ( TaskTimeEntry ) ); strncpy ( temp, line, 4 ); temp[4] = '\0'; entry->year = atoi ( temp ); strncpy ( temp, line + 4, 2 ); temp[2] = '\0'; entry->mon = atoi ( temp ); strncpy ( temp, line + 6, 2 ); temp[2] = '\0'; entry->mday = atoi ( temp ); entry->seconds = atoi ( line + 9 ); entry->marked_seconds = entry->seconds; if ( ! newtask->entries ) newtask->entries = (TaskTimeEntry **) malloc ( sizeof ( TaskTimeEntry * ) ); else newtask->entries = (TaskTimeEntry **) realloc ( newtask->entries, sizeof ( TaskTimeEntry * ) * ( newtask->num_entries + 1 ) ); newtask->entries[newtask->num_entries] = entry; newtask->num_entries++; } break; } else { fclose ( fp ); taskFree ( newtask ); return ( TASK_ERROR_BAD_FILE ); } } fclose ( fp ); /* now load annotations */ annfile = (char *) malloc ( strlen ( path ) + 1 ); strcpy ( annfile, path ); ptr = annfile + strlen ( annfile ) - 5; if ( strcmp ( ptr, ".task" ) == 0 ) { strcpy ( ptr, ".ann" ); if ( stat ( annfile, &buf ) == 0 ) { fd = open ( annfile, O_RDONLY ); anntext = (char *) malloc ( buf.st_size + 1 ); read ( fd, anntext, buf.st_size ); anntext[buf.st_size] = '\0'; close ( fd ); ptr = strtok ( anntext, "\n" ); while ( ptr ) { ptr2 = ptr; while ( isdigit ( *ptr2 ) ) ptr2++; if ( *ptr2 == ' ' ) { *ptr2 = '\0'; a = (TaskAnnotation *) malloc ( sizeof ( TaskAnnotation ) ); memset ( a, '\0', sizeof ( TaskAnnotation ) ); a->text_time = atoi ( ptr ); ptr2++; a->text = (char *) malloc ( strlen ( ptr2 ) + 1 ); strcpy ( a->text, ptr2 ); for ( ptr2 = a->text; *ptr2 != '\0'; ptr2++ ) if ( *ptr2 == '\r' ) *ptr2 = '\n'; if ( newtask->annotations == NULL ) { newtask->annotations = (TaskAnnotation **) malloc ( sizeof ( TaskAnnotation * ) ); } else { newtask->annotations = (TaskAnnotation **) realloc ( newtask->annotations, ( newtask->num_annotations + 1 ) * sizeof ( TaskAnnotation * ) ); } newtask->annotations[newtask->num_annotations] = a; newtask->num_annotations++; } ptr = strtok ( NULL, "\n" ); } free ( anntext ); } } free ( annfile ); taskAdd ( newtask ); *task = newtask; return ( 0 ); } int taskLoadAll ( taskdir ) char *taskdir; { #ifdef WIN32 char *pattern; Task *task; long handle; struct _finddata_t fdata; pattern = malloc ( strlen ( taskdir ) + 8 ); (void) strcat ( strcpy ( pattern, taskdir ), "/*.task" ); if ( ( handle = _findfirst ( pattern, &fdata ) ) != -1 ) { char *path = malloc ( strlen ( taskdir ) + _MAX_FNAME + 2 ); char *start = path + strlen ( taskdir ) + 1; (void) strcat ( strcpy ( path, taskdir ), "/" ); do { (void) strcpy ( start, fdata.name ); if ( valid_name ( fdata.name ) && !_access ( path, 4 ) ){ taskLoad ( path, &task ); } } while ( !_findnext ( handle, &fdata ) ); _findclose ( handle ); free ( path ); } else { free ( pattern ); return ( TASK_ERROR_SYSTEM_ERROR ); } free ( pattern ); #else DIR *dir; struct dirent *entry; struct stat buf; char *path, *ptr; Task *task; dir = opendir ( taskdir ); if ( ! dir ) return ( TASK_ERROR_SYSTEM_ERROR ); while ( ( entry = readdir ( dir ) ) ) { path = (char *) malloc ( strlen ( taskdir ) + strlen ( entry->d_name ) + 2 ); sprintf ( path, "%s/%s", taskdir, entry->d_name ); if ( stat ( path, &buf ) == 0 ) { for ( ptr = entry->d_name; isdigit ( *ptr ); ptr++ ) ; if ( strcmp ( ptr, ".task" ) == 0 && S_ISREG ( buf.st_mode ) ) { /* NOTE: add catching of errors here... */ taskLoad ( path, &task ); } } free ( path ); } #endif return ( 0 ); } char *taskErrorString ( task_error ) int task_error; { static char msg[256]; switch ( task_error ) { case TASK_ERROR_SYSTEM_ERROR: sprintf ( msg, gettext("System Error (%d)"), errno ); return ( msg ); case TASK_ERROR_BAD_FILE: return ( gettext("Invalid task data file format") ); default: sprintf ( msg, gettext("Unknown error (%d)"), task_error ); return ( msg ); } } TaskTimeEntry *taskGetTimeEntry ( task, year, month, day ) Task *task; int year, month, day; { int loop; struct tm *tm; time_t now; if ( year < 100 ) { time ( &now ); tm = localtime ( &now ); year += 1900 + ( tm->tm_year % 100 ); } for ( loop = 0; loop < task->num_entries; loop++ ) { if ( task->entries[loop]->year == year && task->entries[loop]->mon == month && task->entries[loop]->mday == day ) return ( task->entries[loop] ); } return ( NULL ); } TaskTimeEntry *taskNewTimeEntry ( task, year, month, day ) Task *task; int year, month, day; { struct tm *tm; time_t now; TaskTimeEntry *ret; if ( year < 100 ) { time ( &now ); tm = localtime ( &now ); year += 1900 + ( tm->tm_year % 100 ); } ret = (TaskTimeEntry *) malloc ( sizeof ( TaskTimeEntry ) ); ret->year = year; ret->mon = month; ret->mday = day; ret->seconds = 0; ret->marked_seconds = 0; if ( task->entries ) task->entries = (TaskTimeEntry **) realloc ( task->entries, ( task->num_entries + 1 ) * ( sizeof ( TaskTimeEntry * ) ) ); else task->entries = (TaskTimeEntry **) malloc ( ( task->num_entries + 1 ) * ( sizeof ( TaskTimeEntry * ) ) ); task->entries[task->num_entries] = ret; task->num_entries++; return ( ret ); } /* ** Get the options for the specified task. */ unsigned int taskGetOptions ( task ) Task *task; { return task->options; } /* ** Determine if the specified option is enabled. */ unsigned int taskOptionEnabled ( task, option ) Task *task; unsigned int option; { if ( option & task->options ) return 1; else return 0; } void taskSetOption ( task, option ) Task *task; unsigned int option; { task->options |= option; } void taskUnsetOption ( task, option ) Task *task; unsigned int option; { if ( taskOptionEnabled ( task, option ) ) task->options -= option; } /* ** Add a task annotation to a task. Can be more than one line of ** text. We will convert '\n' into '\r' before saving and then ** back when loading. ** Note: It gets saved immediately (not when taskSave is called) */ void taskAddAnnotation ( task, taskdir, text ) Task *task; char *taskdir; char *text; { char *ptr, *path, *newtext; TaskAnnotation *a; FILE *fp; a = (TaskAnnotation *) malloc ( sizeof ( TaskAnnotation ) ); memset ( a, '\0', sizeof ( TaskAnnotation ) ); time ( &a->text_time ); a->text = (char *) malloc ( strlen ( text ) + 1 ); strcpy ( a->text, text ); if ( task->annotations == NULL ) { task->annotations = (TaskAnnotation **) malloc ( sizeof ( TaskAnnotation * ) ); } else { task->annotations = (TaskAnnotation **) realloc ( task->annotations, ( task->num_annotations + 1 ) * sizeof ( TaskAnnotation * ) ); } task->annotations[task->num_annotations] = a; task->num_annotations++; /* now save to file */ path = (char *) malloc ( strlen ( taskdir ) + 10 ); sprintf ( path, "%s/%d.ann", taskdir, task->number ); fp = fopen ( path, "a+" ); if ( fp ) { newtext = (char *) malloc ( strlen ( text ) + 1 ); strcpy ( newtext, text ); for ( ptr = newtext; *ptr != '\0'; ptr++ ) if ( *ptr == '\n' ) *ptr = '\r'; fprintf ( fp, "%d %s\n", (int)a->text_time, newtext ); free ( newtext ); fclose ( fp ); } free ( path ); } /* ** Get all annotations for the specified task on the specified day. ** NOTE: Caller must free return value. ** ??? Maybe we should take the midnight offset into consideration here ??? */ TaskAnnotation **TaskGetAnnotationEntries ( task, year, month, day, time_offset, num_ret ) Task *task; int year, month, day; int time_offset; int *num_ret; { TaskAnnotation **ret = NULL; int loop = 0; struct tm *tm; int num = 0; time_t then; for ( loop = 0; loop < task->num_annotations; loop++ ) { then = task->annotations[loop]->text_time - time_offset; tm = localtime ( &then ); if ( tm->tm_year + 1900 == year && tm->tm_mon + 1 == month && tm->tm_mday == day ) { if ( num ) { ret = (TaskAnnotation **) realloc ( ret, ( num + 1 ) * sizeof ( TaskAnnotation * ) ); } else { ret = (TaskAnnotation **) malloc ( sizeof ( TaskAnnotation * ) ); } ret[num] = task->annotations[loop]; num++; } } *num_ret = num; return ( ret ); } gtimer-2.0.0/task.h0000644000175000017500000000614211353237102014321 0ustar cknudsencknudsen/* * Definition for a task * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * 17-Apr-2005 Add support for subtracting a particular offset * off of timers. (Russ Allbery) */ #ifndef _TASK_H #define _TASK_H #define TASK_DIRECTORY ".gtimer" /* from $HOME */ /* Errors */ #define TASK_ERROR_SYSTEM_ERROR 1 /* check errno value */ #define TASK_ERROR_BAD_FILE 2 /* bad file format */ typedef struct { int seconds; /* time in seconds */ int mon, mday, year; /* MM/DD/YYYY */ int marked_seconds; /* time in seconds - used by taskMark() */ } TaskTimeEntry; typedef struct { char *text; /* text of annotiation */ time_t text_time; /* GMT of annotation */ } TaskAnnotation; typedef struct { char *name; /* name of task */ TaskTimeEntry **entries; /* entries */ int num_entries; /* number entries (dates) */ time_t created; /* time created */ int number; /* unique task id number */ int project_id; /* id of parent project (-1=no project) */ unsigned int options; /* app-defined bit-or options */ TaskAnnotation **annotations; /* annotations */ int num_annotations; /* size of above array */ } Task; /* * Functions */ void taskAdd ( Task *task ); int taskSave ( Task *task, char *taskdir ); int taskSaveAll ( char *taskdir ); /* rra 2005-04-17 - add an offset to subtract from running times */ void taskMark ( Task *task, int offset ); void taskMarkAll ( int offset ); void taskRestore ( Task *task ); void taskRestoreAll (); void taskClearAll (); int taskLoad ( char *file, Task **task ); int taskLoadAll ( char *taskdir ); Task *taskCreate ( char *name ); int taskDelete ( Task *task, char *taskdir ); void taskFree (); int taskCount (); Task *taskGet ( int number ); Task *taskGetFirst (); Task *taskGetNext (); TaskTimeEntry *taskGetTimeEntry ( Task *task, int year, int month, int day ); TaskTimeEntry *taskNewTimeEntry ( Task *task, int year, int month, int day ); unsigned int taskOptions ( Task *task ); unsigned int taskOptionEnabled ( Task *task, unsigned int option ); void taskSetOption ( Task *task, unsigned int option ); void taskUnsetOption ( Task *task, unsigned int option ); void taskAddAnnotation ( Task *task, char *taskdir, char *text ); TaskAnnotation **TaskGetAnnotationEntries ( Task *task, int year, int month, int day, int time_offset, int *num_ret ); char *taskErrorString ( int task_error ); #endif /* _TASK_H */ gtimer-2.0.0/tcpt.c0000644000175000017500000001677711353237102014343 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 19-May-1999 Created * * Limitations: * * 1. Winsock defines the type "SOCKET" to use with sockets * while we use "int" on UNIX. We defined sockfd which can * be used for either. * 2. Winsock must be initialized and cleaned up before exit. * 3. Winsock does not user errno for system errors like * UNIX does. * 4. Winsock must use send() and recv() to read and write * sockets. (UNIX can also use read() and write().) * 5. In summary, winsock sucks, and we most code accordingly. * *****************************************************************************/ /* system include files */ #include #include #include #ifndef SYSV #include #endif #include #include #include #ifdef WIN32 #include /* winsock API */ #else #include #include /* for gethostbyaddr() */ #include #include #include #endif #include #include #include #ifdef AIX #include #endif #include #include extern int errno; /* local include files */ #include "tcpt.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif /* local variables */ typedef struct { unsigned char version; unsigned char command; unsigned short dst_port; unsigned long dst_addr; } socks_struct; static char socks_server[256]; static int socks_port = 1080; static int socks_enabled = 0; /* ** tcptErrorString - Translate a tcptError into a text string. */ char *tcptErrorString ( error_num ) tcptError error_num; { switch ( error_num ) { case TCPT_NO_ERROR: return ( "No error" ); case TCPT_SOCKET_ERROR: return ( "Socket connection error" ); case TCPT_INIT_ERROR: return ( "Error initializing TCP/IP" ); case TCPT_CONNECT_ERROR: return ( "Error connecting socket" ); case TCPT_SOCKS_CONNECT_ERROR: return ( "Error connecting to SOCKS server" ); case TCPT_SOCKS_CONNECT_REFUSED: return ( "SOCKS access refused" ); case TCPT_INVALID_SOCKS_HOST: return ( "Invalid SOCKS host" ); case TCPT_SOCKS_CONNECT_TIMEOUT: return ( "SOCKS connection timed out" ); case TCPT_SOCKS_CONNECTION_REFUSED: return ( "SOCKS connection refused" ); case TCPT_CONNECTION_REFUSED: return ( "Server connection refused" ); default: return ( "Unknown error" ); } } /* ** tcptInit - Initialize the TCP/IP stack. Not needed in UNIX. */ tcptError tcptInit () { #ifdef WIN32 WSADATA WSAData; if ( WSAStartup ( MAKEWORD ( 1, 1 ), &WSAData ) != 0 ) { WSACleanup (); return ( TCPT_INIT_ERROR ); } #endif return ( TCPT_NO_ERROR ); } /* ** tcptEnableSocks - Enable SOCKS usage. */ tcptError tcptEnableSocks ( server, port ) char *server; int port; { strcpy ( socks_server, server ); socks_port = port; socks_enabled = 1; return ( TCPT_NO_ERROR ); } /* ** tcptDisableSocks - Disable SOCKS usage */ tcptError tcptDisableSocks () { socks_enabled = 0; return ( TCPT_NO_ERROR ); } /* ** tcptConnect - Connect a TCP/IP socket. Uses SOCKS if enabled. */ tcptError tcptConnect ( sock, server, size ) sockfd sock; struct sockaddr_in *server; int size; { int count, rval; struct timeval tv; struct hostent *hp; unsigned long addr; socks_struct data; char temp[100]; fd_set fds; uid_t uid; struct passwd *pw; int datasize; if ( socks_enabled ) { hp = gethostbyname ( socks_server ); if ( ! hp ) { /* might be an IP address */ addr = inet_addr ( socks_server ); hp = gethostbyaddr ( (char *)&addr, sizeof ( struct in_addr ), AF_INET ); if ( ! hp ) return ( TCPT_INVALID_SOCKS_HOST ); } /* save destination port */ data.version = 4; data.command = 1; data.dst_port = server->sin_port; memcpy ( (char *)&data.dst_addr, (char *)&server->sin_addr, hp->h_length ); /* setup struct for socks server */ server->sin_family = AF_INET; memcpy ( (char *)&server->sin_addr, (char*)hp->h_addr, hp->h_length ); server->sin_port = htons ( socks_port ); } tv.tv_sec = 0; tv.tv_usec = 10000; /* in microseconds = 1/100 second */ count = errno = 0; while ( errno != EISCONN && count < 5 ) { if ( ( rval = connect ( sock, (struct sockaddr *)server, size ) ) ) { if ( errno == ECONNREFUSED ) { return ( socks_enabled ? TCPT_SOCKS_CONNECTION_REFUSED : TCPT_CONNECTION_REFUSED ); } /* use select since all systems (AIX) don't have usleep() */ select ( 32, NULL, NULL, NULL, &tv ); rval = errno; } count++; } if ( count >= 5 ) { closesocket ( sock ); tcptCleanup (); return ( socks_enabled ? TCPT_SOCKS_CONNECT_ERROR : TCPT_CONNECT_ERROR ); } /* ** Now connected to end host or socks host */ if ( socks_enabled ) { /* 5 second timeout waiting for socks host */ tv.tv_sec = 5; tv.tv_usec = 0; FD_ZERO ( &fds ); FD_SET ( sock, &fds ); if ( select( 32, NULL, &fds, NULL, &tv ) > 0 ) { datasize = sizeof ( data ); memcpy ( temp, (char *)&data, sizeof ( data ) ); if ( ( pw = getpwuid ( uid = getuid () ) ) == NULL ) sprintf ( temp + datasize, "Unknown user-id %d", (int)uid ); else strcpy ( temp + datasize, pw->pw_name ); datasize += strlen ( temp + datasize ) + 1; rval = send ( sock, temp, datasize, 0 ); if ( rval < 0 ) return ( TCPT_SOCKET_ERROR ); } else return ( TCPT_SOCKS_CONNECT_TIMEOUT ); /* get response from socks server */ FD_ZERO ( &fds ); FD_SET ( sock, &fds ); tv.tv_sec = 5; tv.tv_usec = 0; memset ( &data, '\0', sizeof ( data ) ); /* wait to data is ready to read */ if ( ( rval = select ( 32, &fds, NULL, NULL, &tv ) ) > 0 ) { if ( FD_ISSET ( sock, &fds ) ) { rval = recv ( sock, (char *)&data, sizeof ( data ), 0 ); if ( rval < 0 ) return ( TCPT_SOCKET_ERROR ); else if ( ! rval ) return ( TCPT_SOCKS_CONNECT_TIMEOUT ); else if ( data.command != 90 ) return ( TCPT_SOCKS_CONNECT_REFUSED ); } else { return ( TCPT_SOCKS_CONNECT_TIMEOUT ); } } else { return ( TCPT_SOCKS_CONNECT_TIMEOUT ); } /* successful connection via socks */ } return ( TCPT_NO_ERROR ); } /* ** tcptCleanup - Shutdown the TCP/IP stack. Does nothing in UNIX. */ tcptError tcptCleanup () { #ifdef WIN32 WSACleanup (); #endif return ( TCPT_NO_ERROR ); } gtimer-2.0.0/tcpt.h0000644000175000017500000000474011353237102014333 0ustar cknudsencknudsen/* ** ** Classification: UNCLASSIFIED ** ** Copyright: (c) Copyright 1995 IBM Corporation ** This program is protected by the copyright law as an ** unpublished work. ** ** RCS Info: $Date: 1995/11/27 15:27:46 $ $Revision: 1.1 $ ** ** $Id: Header.h,v 1.1 1995/11/27 15:27:46 baseline Exp $ ** ** Filename: $Source: /Minerva/testing/minerva/src/templates/RCS/Header.h,v $ ** ** Originator: Craig Knudsen ** t/l 335-6068 ** knudsen@dev.infomkt.ibm.com ** ** Organization: IBM Corporation / infoMarket ** 3190 Fairview Park Drive ** Falls Church, VA 22042 ** Ph: (703)205-5600 FAX: (703)205-5691 ** ** Description: ** ** NewsTicker include file. ** Include file for using tcpt routines. ** Attempt to resolve some of the issues with dealing with ** winsock. See tcpt.c for more info on usage. ** Define sockfd to be an int on UNIX and SOCKET on Win32. ** ** Limitations: ** ** 1. None. ** ** Modification History: ** ** 12-Mar-96 cek Created ** ******************************************************************************/ #ifndef _TCPT_H #define _TCPT_H /* ** Define some handy definitions. */ #ifdef WIN32 #define sockfd SOCKET #else #define closesocket close #define sockfd int #endif /* ** Error values */ typedef enum { TCPT_NO_ERROR = 0, TCPT_INIT_ERROR = 1, TCPT_SOCKET_ERROR = 2, TCPT_CONNECT_ERROR = 3, TCPT_SOCKS_CONNECT_ERROR = 4, TCPT_SOCKS_CONNECT_REFUSED = 5, TCPT_INVALID_SOCKS_HOST = 6, TCPT_SOCKS_CONNECT_TIMEOUT = 7, TCPT_SOCKS_CONNECTION_REFUSED = 8, TCPT_CONNECTION_REFUSED = 9 } tcptError; /* ** tcptErrorString - Translate a tcptError into a text string. */ char *tcptErrorString ( #ifndef _NO_PROTO tcptError error_num #endif ); /* ** tcptInit - Initialize the TCP/IP stack. Not needed in UNIX. */ tcptError tcptInit (); /* ** tcptConnect - Connect a TCP/IP socket. Uses SOCKS if enabled. */ /*tcptError tcptConnect ( int sock, struct sockaddr *server, int size );*/ /* ** tcptCleanup - Shutdown the TCP/IP stack. Does nothing in UNIX. */ tcptError tcptCleanup (); /* ** tcptEnableSocks - Enable the SOCKS server */ tcptError tcptEnableSocks ( #ifndef _NO_PROTO char *server, int port #endif ); /* ** tcptDisableSocks - Disable the SOCKS server */ tcptError tcptDisableSocks (); #endif /* _TCPT_H */ gtimer-2.0.0/txt2h.pl0000644000175000017500000000116311353237102014612 0ustar cknudsencknudsen#!/usr/bin/perl # Tool for converting a plain text file into a C string (char *) that # can be used in a C program. # # This is a rewrite of this perl script. i lost the original in the # unfortunate hard disk crash of 2006 :-( # # Usage: # perl txt2h.pl < plaintext.txt > output # History: # 25 Mar 2010 Craig Knudsen # Created (again!) # ############################################################################ $varname = 'changelog_text'; print 'static char *' . $varname . ' = "\\' . "\n"; while ( <> ) { chop (); s/\\/\\\\/g; s/"/\\"/g; print; print "\\n\\\n"; } print "\";\n"; exit 0; gtimer-2.0.0/unhide.c0000644000175000017500000002271611353237102014633 0ustar cknudsencknudsen/* * GTimer * * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * Helps you keep track of time spent on different tasks. * * Author: * Craig Knudsen, cknudsen@cknudsen.com, http://www.cknudsen.com * * Home Page: * http://www.cknudsen.com/gtimer/ * * History: * 07-Sep-2007 Updated to use GtkTreeView * 09-Mar-2000 Updated call to create_confirm_window() * 18-Mar-1999 Internationalization * 16-Mar-1999 Add back support for GTK 1.0 * 16-Feb-1999 Created unhide window * ****************************************************************************/ #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include #include "project.h" #include "task.h" #include "gtimer.h" #include "config.h" // PV: #include "custom-list.h" #ifdef GTIMER_MEMDEBUG #include "memdebug/memdebug.h" #endif #define NO_TOOLTIPS 1 extern TaskData **visible_tasks, **tasks; extern int num_visible_tasks, num_tasks; extern GtkWidget *main_window; typedef struct { GtkWidget *window; GtkWidget *task_list; // PV: - //GtkTreeView *task_list; // PV: + TaskData **tasks; int num_tasks; //GtkWidget **list_items; // PV: - GtkTreePath **list_items; // PV: + } HideData; static void ok_callback ( widget, data ) GtkWidget *widget; gpointer data; { HideData *hd = (HideData *) data; GList *selected, *item; int loop; // PV: GtkTreeSelection *select; #if PV_DEBUG volatile const char *s1; volatile const char *s2; #else const char *s1, *s2; #endif // selected = GTK_LIST ( hd->task_list ) ->selection; select = gtk_tree_view_get_selection ( GTK_TREE_VIEW(hd->task_list) ); selected = gtk_tree_selection_get_selected_rows ( GTK_TREE_SELECTION(select), NULL ); // selected contains list of paths if ( ! selected ) { create_confirm_window ( CONFIRM_ERROR, gettext("Error"), gettext("You have not selected any tasks"), gettext("Ok"), NULL, NULL, NULL, NULL, NULL, NULL ); return; } /* which tasks were selected... */ for ( item = selected; item != NULL; item = item->next ) { s1 = gtk_tree_path_to_string(item->data); for ( loop = 0; loop < hd->num_tasks; loop++ ) { s2 = gtk_tree_path_to_string( hd->list_items[loop] ); // if ( item->data == hd->list_items[loop] ) { if ( strcmp (s1, s2) == 0 ) { /* don't need to realloc visible_tasks[] */ visible_tasks[num_visible_tasks] = hd->tasks[loop]; visible_tasks[num_visible_tasks]->moved = 1; visible_tasks[num_visible_tasks]->new_task = 1; /* add back */ taskUnsetOption ( visible_tasks[num_visible_tasks]->task, GTIMER_TASK_OPTION_HIDDEN ); num_visible_tasks++; } } } gtk_grab_remove ( hd->window ); gtk_widget_destroy ( hd->window ); /* Free resources */ free ( hd->tasks ); free ( hd->list_items ); free ( hd ); /* redraw the task list */ update_list (); } static void cancel_callback ( widget, data ) GtkWidget *widget; gpointer data; { HideData *hd = (HideData *) data; gtk_grab_remove ( hd->window ); gtk_widget_destroy ( hd->window ); free ( hd->tasks ); free ( hd->list_items ); free ( hd ); } static void select_all_callback ( widget, data ) GtkWidget *widget; gpointer data; { HideData *hd = (HideData *) data; gtk_tree_selection_select_all ( gtk_tree_view_get_selection ( GTK_TREE_VIEW(hd->task_list) ) ); } static void select_none_callback ( widget, data ) GtkWidget *widget; gpointer data; { HideData *hd = (HideData *) data; gtk_tree_selection_unselect_all ( gtk_tree_view_get_selection ( GTK_TREE_VIEW(hd->task_list) ) ); } /* ** Create the unhide window. */ GtkWidget *create_unhide_window () { GtkWidget *hide_window; /*GtkTooltips *tooltips;*/ GtkWidget *label, *button, *scrolled; HideData *hd; GList *items = NULL; int loop, count; char msg[100]; // PV: char temp[512]; CustomList *customlist; GtkCellRenderer *renderer; GtkTreeViewColumn *col; GtkTreeSelection *select; gchar * xtaskname; customlist = custom_list_new(); hd = (HideData *) malloc ( sizeof ( HideData ) ); memset ( hd, '\0', sizeof ( HideData ) ); hd->window = hide_window = gtk_dialog_new (); gtk_window_set_wmclass ( GTK_WINDOW ( hd->window ), "GTimer", "gtimer" ); sprintf ( msg, "GTimer: %s", gettext("Unhide") ); gtk_window_set_title (GTK_WINDOW (hide_window), msg ); gtk_window_position ( GTK_WINDOW(hide_window), GTK_WIN_POS_MOUSE ); gtk_grab_add ( hide_window ); gtk_widget_realize ( hide_window ); label = gtk_label_new ( gettext("Tasks to include:") ); gtk_label_set_justify ( GTK_LABEL ( label ), GTK_JUSTIFY_LEFT ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (hide_window)->vbox ), label, FALSE, FALSE, 2 ); gtk_widget_show ( label ); /* list of tasks */ scrolled = gtk_scrolled_window_new ( NULL, NULL ); gtk_widget_set_usize ( scrolled, 300, 200 ); gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS ); gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG (hide_window)->vbox ), scrolled, TRUE, TRUE, 2 ); hd->tasks = (TaskData **) malloc ( sizeof ( TaskData * ) * num_tasks ); /* more than we need... */ hd->list_items = (GtkWidget **) malloc ( sizeof ( GtkTreePath * ) * num_tasks ); /* more than we need... */ for ( loop = 0, count = 0; loop < num_tasks; loop++ ) { if ( taskOptionEnabled ( tasks[loop]->task, GTIMER_TASK_OPTION_HIDDEN ) ) { if (tasks[loop]->task->project_id < 0 ) snprintf ( temp, sizeof (temp), "%s", tasks[loop]->task->name ); else snprintf ( temp, sizeof (temp), "[%s] %s", tasks[loop]->project_name, tasks[loop]->task->name ); items = g_list_append ( items, hd->list_items[count] ); hd->tasks[count] = tasks[loop]; xtaskname = g_strdup_printf ("%s", temp); hd->list_items[count] = custom_list_append_record( customlist, xtaskname); count++; } } hd->num_tasks = count; // PV: TreeView hd->task_list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(customlist)); g_object_unref(customlist); renderer = gtk_cell_renderer_text_new(); col = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start ( col, renderer, TRUE ); gtk_tree_view_column_add_attribute ( col, renderer, "text", CUSTOM_LIST_COL_NAME ); gtk_tree_view_column_set_title ( col, gettext("[Project] Task") ); gtk_tree_view_append_column ( GTK_TREE_VIEW(hd->task_list), col ); select = gtk_tree_view_get_selection ( GTK_TREE_VIEW(hd->task_list) ); gtk_tree_selection_set_mode( select, GTK_SELECTION_MULTIPLE ); gtk_scrolled_window_add_with_viewport ( GTK_SCROLLED_WINDOW ( scrolled ), hd->task_list ); gtk_tree_selection_select_all ( GTK_TREE_SELECTION(select) ); gtk_widget_show ( scrolled ); gtk_widget_show ( hd->task_list ); /* add command buttons */ /*tooltips = gtk_tooltips_new ();*/ gtk_box_set_homogeneous ( GTK_BOX ( GTK_DIALOG (hide_window)->action_area ), 1 ); button = gtk_button_new_with_label (gettext("Ok")); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (hide_window)->action_area), button, TRUE, FALSE, 2); gtk_box_set_spacing ( GTK_BOX (GTK_DIALOG (hide_window)->action_area), 2 ); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (ok_callback), hd); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Uhide selected tasks" );*/ button = gtk_button_new_with_label ( gettext("Cancel") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (hide_window)->action_area), button, TRUE, FALSE, 2); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (cancel_callback), hd); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Cancel without unhiding taskst" );*/ button = gtk_button_new_with_label ( gettext("Select all") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (hide_window)->action_area), button, TRUE, FALSE, 2); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (select_all_callback), hd); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Select all tasks" );*/ button = gtk_button_new_with_label ( gettext("Select none") ); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (hide_window)->action_area), button, TRUE, FALSE, 2); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (select_none_callback), hd); gtk_widget_show (button); /*gtk_tooltips_set_tips (tooltips, button, "Unselect all tasks" );*/ gtk_widget_show_all (hide_window); return ( hide_window ); } gtimer-2.0.0/xextras.c0000644000175000017500000000500111353237102015041 0ustar cknudsencknudsen/* * Copyright: * (C) 1999 Craig Knudsen, cknudsen@cknudsen.com * See accompanying file "COPYING". * * 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 * * Description: * X utilities that I cannot find a way to implement using GTK. * (Maybe they'll appear in a future GTK release.) * * History: * 18-Mar-1999 I18N * 18-Mar-1999 Added support for X11 screen saver extension * for idle detect. (This will detect keyboard * usage rather than just mouse usage.) * 07-Apr-1998 Added call to XSetIOErrorHandler. * 28-Mar-1998 Created * ****************************************************************************/ #include #include #include #ifdef HAVE_SCREEN_SAVER_EXT #include #endif #include "gtimeri18n.h" extern void save_all (); /* ** Handle X errors. */ static int x_error_handler ( display, event ) Display *display; XErrorEvent *event; { fprintf ( stderr, "%s\n", gettext ("Received X error. See ya!") ); save_all (); exit ( 0 ); } /* ** Handle X IO errors. This could be from xkill or the window manager ** dying and closing X, etc. */ static int x_io_error_handler ( display ) Display *display; { fprintf ( stderr, "%s\n", gettext("Received X error. See ya!") ); save_all (); exit ( 0 ); } /* ** Tell X to use the above function for X errors so we can catch ** them before we exit. */ void set_x_error_handler () { XSetErrorHandler ( x_error_handler ); XSetIOErrorHandler ( x_io_error_handler ); } /* ** Get the idle time */ #ifdef HAVE_SCREEN_SAVER_EXT int get_x_idle_time ( display ) Display *display; { int idle; static XScreenSaverInfo *ss_info = NULL; if ( ss_info == NULL ) ss_info = XScreenSaverAllocInfo (); XScreenSaverQueryInfo ( display, DefaultRootWindow ( display ), ss_info ); idle = ss_info->idle / 1000; return ( idle ); } #endif