diff -ruN inkscape-0.91/configure inkscape-0.91-1artivity0/configure
--- inkscape-0.91/configure	2015-11-27 10:09:55.850318168 +0100
+++ inkscape-0.91-1artivity0/configure	2015-11-27 10:23:46.434317112 +0100
@@ -737,6 +737,12 @@
 WIN32_CFLAGS
 PLATFORM_WIN32_FALSE
 PLATFORM_WIN32_TRUE
+USE_ARTIVITY_FALSE
+USE_ARTIVITY_TRUE
+ARTIVITY_LIBS
+LIBARTIVITY_PREFIX
+LTLIBARTIVITY
+LIBARTIVITY
 FREETYPE_LIBS
 FREETYPE_CFLAGS
 FREETYPE_CONFIG
@@ -942,6 +948,8 @@
 with_libiconv_prefix
 with_libintl_prefix
 enable_openmp
+enable_artivity
+with_libartivity_prefix
 with_gnome_vfs
 with_inkjar
 enable_lcms
@@ -1667,6 +1675,7 @@
   --disable-nls           do not use Native Language Support
   --disable-rpath         do not hardcode runtime library paths
   --disable-openmp        do not use OpenMP
+  --enable-artivity       compile with support for Artivity
   --enable-lcms           enable LittleCms for color management
   --enable-poppler-cairo  Enable libpoppler-cairo for rendering PDF preview
   --disable-wpg           compile without support for WordPerfect Graphics
@@ -1693,6 +1702,8 @@
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
+  --with-libartivity-prefix[=DIR]  search for libartivity in DIR/include and DIR/lib
+  --without-libartivity-prefix     don't search for libartivity in includedir and libdir
   --with-gnome-vfs        use gnome vfs for loading files
   --without-inkjar        disable openoffice files (SVG jars)
 
@@ -20489,6 +20500,563 @@
 
 
 
+# Check whether --enable-artivity was given.
+if test "${enable_artivity+set}" = set; then :
+  enableval=$enable_artivity; enable_artivity=$enableval
+else
+  enable_artivity=no
+fi
+
+
+with_artivity="no"
+if test "x$enable_artivity" = "xyes"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lartivity" >&5
+$as_echo_n "checking for main in -lartivity... " >&6; }
+if ${ac_cv_lib_artivity_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lartivity  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ac_cv_lib_artivity_main=yes
+else
+  ac_cv_lib_artivity_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_artivity_main" >&5
+$as_echo "$ac_cv_lib_artivity_main" >&6; }
+if test "x$ac_cv_lib_artivity_main" = xyes; then :
+  with_artivity=yes
+else
+  with_artivity=no
+fi
+
+	if test "x$with_artivity" = "xyes"; then
+
+$as_echo "#define WITH_ARTIVITY 1" >>confdefs.h
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libartivity" >&5
+$as_echo_n "checking how to link with libartivity... " >&6; }
+if ${ac_cv_libartivity_libs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+
+
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-libartivity-prefix was given.
+if test "${with_libartivity_prefix+set}" = set; then :
+  withval=$with_libartivity_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+
+fi
+
+      LIBARTIVITY=
+  LTLIBARTIVITY=
+  INCARTIVITY=
+  LIBARTIVITY_PREFIX=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='artivity '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBARTIVITY="${LTLIBARTIVITY}${LTLIBARTIVITY:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
+          if test $use_additional = yes; then
+            dir="$additional_libdir"
+                                    if test -n "$acl_shlibext"; then
+              if test -f "$dir/$libname$shrext"; then
+                found_dir="$dir"
+                found_so="$dir/$libname$shrext"
+              else
+                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                  ver=`(cd "$dir" && \
+                        for f in "$libname$shrext".*; do echo "$f"; done \
+                        | sed -e "s,^$libname$shrext\\\\.,," \
+                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                        | sed 1q ) 2>/dev/null`
+                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                    found_dir="$dir"
+                    found_so="$dir/$libname$shrext.$ver"
+                  fi
+                else
+                  eval library_names=\"$acl_library_names_spec\"
+                  for f in $library_names; do
+                    if test -f "$dir/$f"; then
+                      found_dir="$dir"
+                      found_so="$dir/$f"
+                      break
+                    fi
+                  done
+                fi
+              fi
+            fi
+                        if test "X$found_dir" = "X"; then
+              if test -f "$dir/$libname.$acl_libext"; then
+                found_dir="$dir"
+                found_a="$dir/$libname.$acl_libext"
+              fi
+            fi
+            if test "X$found_dir" != "X"; then
+              if test -f "$dir/$libname.la"; then
+                found_la="$dir/$libname.la"
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBARTIVITY; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBARTIVITY="${LTLIBARTIVITY}${LTLIBARTIVITY:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+                                LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$acl_hardcode_direct" = yes; then
+                                                      LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$found_so"
+                else
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                                                            LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBARTIVITY; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                                                                                        LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$found_a"
+              else
+                                                LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                LIBARTIVITY_PREFIX="$basedir"
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCARTIVITY; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCARTIVITY="${INCARTIVITY}${INCARTIVITY:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBARTIVITY; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBARTIVITY; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBARTIVITY="${LTLIBARTIVITY}${LTLIBARTIVITY:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$dep"
+                    LTLIBARTIVITY="${LTLIBARTIVITY}${LTLIBARTIVITY:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }-l$name"
+            LTLIBARTIVITY="${LTLIBARTIVITY}${LTLIBARTIVITY:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$flag"
+    else
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBARTIVITY="${LIBARTIVITY}${LIBARTIVITY:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBARTIVITY="${LTLIBARTIVITY}${LTLIBARTIVITY:+ }-R$found_dir"
+    done
+  fi
+
+    ac_cv_libartivity_libs="$LIBARTIVITY"
+    ac_cv_libartivity_ltlibs="$LTLIBARTIVITY"
+    ac_cv_libartivity_cppflags="$INCARTIVITY"
+    ac_cv_libartivity_prefix="$LIBARTIVITY_PREFIX"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libartivity_libs" >&5
+$as_echo "$ac_cv_libartivity_libs" >&6; }
+  LIBARTIVITY="$ac_cv_libartivity_libs"
+  LTLIBARTIVITY="$ac_cv_libartivity_ltlibs"
+  INCARTIVITY="$ac_cv_libartivity_cppflags"
+  LIBARTIVITY_PREFIX="$ac_cv_libartivity_prefix"
+
+  for element in $INCARTIVITY; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
+
+
+
+
+      HAVE_LIBARTIVITY=yes
+
+
+
+	    ARTIVITY_LIBS=$LIBARTIVITY
+
+	else
+
+$as_echo "#define WITH_ARTIVITY 0" >>confdefs.h
+
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Artivity not found, activity tracking will be disabled" >&5
+$as_echo_n "checking Artivity not found, activity tracking will be disabled... " >&6; }
+	fi
+fi
+ if test "x$with_artivity" = "xyes"; then
+  USE_ARTIVITY_TRUE=
+  USE_ARTIVITY_FALSE='#'
+else
+  USE_ARTIVITY_TRUE='#'
+  USE_ARTIVITY_FALSE=
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Win32 platform" >&5
 $as_echo_n "checking for Win32 platform... " >&6; }
 case "$host" in
@@ -23252,63 +23820,6 @@
 
 	# Check whether we are using the X11 backend target for Gtk+ 3.
 
-  pkg_config_args=gtk+-x11-3.0
-  min_gtk_version=3.0.0
-
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="as_fn_error $? "No pkg-config found" "$LINENO" 5"
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-  if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args ; then
-    target_found=yes
-  else
-    target_found=no
-  fi
-
-  if test "x$target_found" = "xno"; then
-    have_x11=no
-  else
-    have_x11=yes
-  fi
-
 
 	# Enable strict build options that should work on most systems unless
 	# the build has been configured not to do so
@@ -24963,6 +25474,10 @@
   ac_config_commands="$ac_config_commands po/stamp-it"
 
 
+if test -z "${USE_ARTIVITY_TRUE}" && test -z "${USE_ARTIVITY_FALSE}"; then
+  as_fn_error $? "conditional \"USE_ARTIVITY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${PLATFORM_WIN32_TRUE}" && test -z "${PLATFORM_WIN32_FALSE}"; then
   as_fn_error $? "conditional \"PLATFORM_WIN32\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -27755,6 +28270,7 @@
         Enable LittleCms:         ${enable_lcms}
         Enable DBUS:              ${with_dbus}
         Enable Poppler-Cairo:     ${enable_poppler_cairo}
+	Enable Artivity:	  ${with_artivity}
         ImageMagick Magick++:     ${magick_ok}
         Libwpg:                   ${with_libwpg}
         Libvisio:                 ${with_libvisio}
diff -ruN inkscape-0.91/configure.ac inkscape-0.91-1artivity0/configure.ac
--- inkscape-0.91/configure.ac	2015-11-27 10:09:55.854318168 +0100
+++ inkscape-0.91-1artivity0/configure.ac	2015-11-27 10:23:41.030317119 +0100
@@ -283,6 +283,27 @@
 AC_SUBST(FREETYPE_LIBS)
 
 dnl ******************************
+dnl Check for libartivity
+dnl ******************************
+AC_ARG_ENABLE(artivity,
+       AS_HELP_STRING([--enable-artivity], [compile with support for Artivity]),
+       enable_artivity=$enableval,enable_artivity=no)
+
+with_artivity="no"
+if test "x$enable_artivity" = "xyes"; then
+	AC_CHECK_LIB(artivity, main, with_artivity=yes, with_artivity=no)
+	if test "x$with_artivity" = "xyes"; then
+	    AC_DEFINE(WITH_ARTIVITY,1,[Build with Artivity])
+	    AC_LIB_LINKFLAGS([artivity])
+	    AC_SUBST(ARTIVITY_LIBS, $LIBARTIVITY)
+	else
+	    AC_DEFINE(WITH_ARTIVITY,0,[Do not build with Artivity])
+	    AC_MSG_CHECKING([Artivity not found, activity tracking will be disabled])
+	fi
+fi
+AM_CONDITIONAL(USE_ARTIVITY, test "x$with_artivity" = "xyes")
+
+dnl ******************************
 dnl Win32
 dnl ******************************
 AC_MSG_CHECKING([for Win32 platform])
@@ -1205,6 +1226,7 @@
         Enable LittleCms:         ${enable_lcms}
         Enable DBUS:              ${with_dbus} 
         Enable Poppler-Cairo:     ${enable_poppler_cairo}
+	Enable Artivity:	  ${with_artivity}
         ImageMagick Magick++:     ${magick_ok}
         Libwpg:                   ${with_libwpg}
         Libvisio:                 ${with_libvisio}
diff -ruN inkscape-0.91/src/artivity/artivity-log.cpp inkscape-0.91-1artivity0/src/artivity/artivity-log.cpp
--- inkscape-0.91/src/artivity/artivity-log.cpp	1970-01-01 01:00:00.000000000 +0100
+++ inkscape-0.91-1artivity0/src/artivity/artivity-log.cpp	2015-11-27 10:10:17.102318141 +0100
@@ -0,0 +1,696 @@
+/*
+ * Authors:
+ * Sebastian Faubel <sebastian@semiodesk.com>
+ * Moritz Eberl <moritz@semiodesk.com>
+ *
+ * Copyright (c) 2015 Authors
+ *
+ * Released under GNU GPL, see the file 'COPYING' for more information.
+ */
+
+#include "artivity/artivity-log.h"
+
+namespace Inkscape
+{
+    using namespace std;
+    using namespace artivity;
+    using Geom::Rect;
+    using Geom::OptRect;
+    using Inkscape::Util::List;
+    using Inkscape::Util::rest;
+    using Inkscape::Util::Unit;
+    using Inkscape::Util::Quantity;
+    using Inkscape::XML::AttributeRecord;
+    using Inkscape::XML::Node;
+    using Inkscape::XML::NodeType;
+    
+    ArtivityLog::ArtivityLog(SPDocument* document, SPDesktop* desktop) : UndoStackObserver()
+    {        
+        _desktop = desktop;
+        _document = document;
+        
+        _savedConnection = _document->connectURISet(sigc::hide(sigc::mem_fun(*this, &ArtivityLog::onSaved)));
+        _modifiedConnection = _document->connectModified(sigc::hide(sigc::mem_fun(*this, &ArtivityLog::onModified)));
+        
+        _log = ActivityLog();
+        _log.addAgent(new SoftwareAgent("application://inkscape.desktop"));
+        
+        double width = _document->getWidth().quantity;
+        double height = _document->getHeight().quantity;
+        const Resource* unit = getLengthUnit(_document->getWidth());
+            
+        if(_document->getURI() != NULL)
+        {
+            _filePath = string(_document->getURI());
+                        
+            _activity = _log.editFile(_filePath.c_str(), width, height, unit);
+        
+            transmitQueue();
+        }
+        else
+        {
+            _filePath = "";
+            
+            _activity = _log.createFile(width, height, unit);
+        }
+    }
+
+    ArtivityLog::~ArtivityLog()
+    {
+        if(_document->getURI() != NULL)
+        {
+            time_t now;
+            time(&now);
+            
+            _activity->setEndTime(now);
+            
+            transmitQueue();
+        }
+        
+        _savedConnection.disconnect();
+        _modifiedConnection.disconnect();
+    }
+    
+    void
+    ArtivityLog::onSaved()
+    {
+        time_t now;
+        time(&now);
+        
+        Viewport* viewport = createViewport();
+        
+        Generation* generation = _log.createEntityInfluence<Generation>(now, art::Save, viewport);
+        
+        FileDataObject* file = _log.getFile();
+        file->setGeneration(generation);
+        file->setLastModificationTime(now);
+        
+        _activity->addGeneratedEntity(file);
+        
+        transmitQueue();
+    }
+    
+    void
+    ArtivityLog::onModified()
+    {
+        // Do nothing.
+    }
+
+    void
+    ArtivityLog::notifyUndoCommitEvent(Event* e)
+    {
+        logEvent(e, art::Edit);
+    }
+    
+    void
+    ArtivityLog::notifyUndoEvent(Event* e)
+    {
+        logEvent(e, art::Undo);
+    }
+    
+    void
+    ArtivityLog::notifyRedoEvent(Event* e)
+    {        
+        logEvent(e, art::Redo);
+    }
+
+    void
+    ArtivityLog::notifyClearUndoEvent()
+    {
+        // Do nothing.
+    }
+
+    void
+    ArtivityLog::notifyClearRedoEvent()
+    {
+        // Do nothing.
+    }
+    
+    void
+    ArtivityLog::logEvent(Event* e, const Resource& type)
+    {
+        if(e->event == NULL)
+        {
+            return;
+        }
+            
+        try
+        {
+            time_t now;
+            time(&now);
+                         
+            Canvas* canvas = getCanvas();
+            
+            Viewport* viewport = createViewport();
+            
+            if(type.Uri == art::Undo.Uri || type.Uri == art::Redo.Uri)
+            {
+                logUndoOrRedo(now, e, canvas, viewport, type);
+            }
+            else if(is<Inkscape::XML::EventAdd*>(e->event))
+            {
+                logAdd(now, e, canvas, viewport);
+            }
+            else if(is<Inkscape::XML::EventDel*>(e->event))
+            {
+                logDelete(now, e, canvas, viewport);
+            }
+            else if(is<Inkscape::XML::EventChgContent*>(e->event))
+            {
+                logChangeContent(now, e, canvas, viewport);
+            }
+            else if(is<Inkscape::XML::EventChgAttr*>(e->event))
+            {
+                logChangeAttributes(now, e, canvas, viewport);
+            }
+            else if(is<Inkscape::XML::EventChgOrder*>(e->event))
+            {
+                logChangeOrder(now, e, canvas, viewport);
+            }
+        
+            transmitQueue();
+        }
+        catch(exception e)
+        {
+            // TODO: log error.
+        }
+    }
+   
+    void
+    ArtivityLog::logUndoOrRedo(time_t time, Event* e, Canvas* canvas, Viewport* viewport, const Resource& type)
+    {        
+        Generation* generation = _log.createEntityInfluence<Generation>(time, type, viewport);
+        Invalidation* invalidation = _log.createEntityInfluence<Invalidation>(time, type, viewport);
+        
+        FileDataObject* file = _log.getFile();
+        
+        FileDataObject* newver = _log.createEntityVersion<FileDataObject>(file, canvas);
+        newver->setGeneration(generation);
+        
+        FileDataObject* oldver = _log.createEntityVersion<FileDataObject>(file, canvas);
+        oldver->setInvalidation(invalidation);
+        
+        _activity->addGeneratedEntity(newver);
+        _activity->addInvalidatedEntity(oldver);
+    }
+    
+    void
+    ArtivityLog::logAdd(time_t time, Event* e, Canvas* canvas, Viewport* viewport)
+    {
+        Inkscape::XML::EventAdd* x = as<Inkscape::XML::EventAdd*>(e->event);
+        
+        BoundingRectangle* bounds = createBoundingRectangle(e);
+        
+        FileDataObject* file = _log.getFile();
+        FileDataObject* newver = _log.createEntityVersion<FileDataObject>(file, canvas);
+        FileDataObject* oldver = _log.createEntityVersion<FileDataObject>(file, canvas);
+                
+        stringstream uri;
+        uri << newver->Uri << "#" << getXmlNodeId(x->child);
+        
+        XmlElement* element = _log.createResource<XmlElement>(uri.str().c_str());
+        
+        Generation* generation = _log.createEntityInfluence<Generation>(time, art::Add, viewport);
+        generation->setLocation(element);
+        generation->setBoundaries(bounds);
+        generation->setDescription(e->description);
+        
+        Invalidation* invalidation = _log.createEntityInfluence<Invalidation>(time, art::Add, viewport);
+        invalidation->setLocation(element);
+        invalidation->setBoundaries(bounds);
+        
+        newver->setGeneration(generation);
+        oldver->setInvalidation(invalidation);
+        
+        _activity->addGeneratedEntity(newver);
+        _activity->addInvalidatedEntity(oldver);
+    }
+    
+    void
+    ArtivityLog::logDelete(time_t time, Event* e, Canvas* canvas, Viewport* viewport)
+    {
+        // Inkscape::XML::EventDel* x = as<Inkscape::XML::EventDel*>(e->event);
+            
+        Generation* generation = _log.createEntityInfluence<Generation>(time, art::Remove, viewport);
+        generation->setDescription(e->description);
+        
+        Invalidation* invalidation = _log.createEntityInfluence<Invalidation>(time, art::Remove, viewport);
+        
+        FileDataObject* file = _log.getFile();
+        
+        FileDataObject* newver = _log.createEntityVersion<FileDataObject>(file, canvas);
+        newver->setGeneration(generation);
+        
+        FileDataObject* oldver = _log.createEntityVersion<FileDataObject>(file, canvas);
+        oldver->setInvalidation(invalidation);
+        
+        _activity->addGeneratedEntity(newver);
+        _activity->addInvalidatedEntity(oldver);
+    }
+    
+    void
+    ArtivityLog::logChangeContent(time_t time, Event* e, Canvas* canvas, Viewport* viewport)
+    {
+        if(e->event->repr == NULL)
+        {
+            // TODO: Log error.
+            return;
+        }
+        
+        FileDataObject* file = _log.getFile();
+        FileDataObject* newver = _log.createEntityVersion<FileDataObject>(file, canvas);        
+        FileDataObject* oldver = _log.createEntityVersion<FileDataObject>(file, canvas);
+        
+        stringstream uri;
+        uri << newver->Uri << "#" << getXmlNodeId(e->event->repr);
+        
+        Inkscape::XML::EventChgContent* x = as<Inkscape::XML::EventChgContent*>(e->event);
+        
+        BoundingRectangle* bounds = createBoundingRectangle(e);
+        
+        XmlElement* element = _log.createResource<XmlElement>(uri.str().c_str());
+         
+        // NEW VALUE
+        string newval = x->newval != 0 ? string(x->newval) : "";
+        
+        Generation* generation = _log.createEntityInfluence<Generation>(time, art::Edit, viewport);
+        generation->setLocation(element);
+        generation->setBoundaries(bounds);
+        generation->setContent(newval);
+        generation->setDescription(e->description);
+        
+        // OLD VALUE
+        string oldval = x->oldval != 0 ? string(x->oldval) : "";
+        
+        Invalidation* invalidation = _log.createEntityInfluence<Invalidation>(time, art::Edit, viewport);
+        invalidation->setLocation(element);
+        invalidation->setBoundaries(bounds);
+        invalidation->setContent(oldval);
+        
+        newver->setGeneration(generation);
+        oldver->setInvalidation(invalidation);
+        
+        _activity->addGeneratedEntity(newver);
+        _activity->addInvalidatedEntity(oldver);
+    }
+    
+    void
+    ArtivityLog::logChangeAttributes(time_t time, Event* e, Canvas* canvas, Viewport* viewport)
+    {
+        if(e->event->repr == NULL)
+        {
+            // TODO: Log error.
+            return;
+        }
+             
+        BoundingRectangle* bounds = createBoundingRectangle(e);
+               
+        FileDataObject* file = _log.getFile();
+        FileDataObject* newver = _log.createEntityVersion<FileDataObject>(file, canvas);        
+        FileDataObject* oldver = _log.createEntityVersion<FileDataObject>(file, canvas);
+            
+        AttributeValueMap* values = getChangedAttributes(e);
+        AttributeValueIterator it = values->begin();
+        
+        stringstream uri;
+        uri << newver->Uri << "#" << getXmlNodeId(e->event->repr);
+        
+        XmlElement* element = _log.createResource<XmlElement>(uri.str().c_str());
+        
+        while(it != values->end())
+        {
+            string name = it->first;
+            
+            stringstream atturi;
+            atturi << uri.str() << "@" << name;
+            
+            XmlAttribute* attribute = _log.createResource<XmlAttribute>(atturi.str().c_str());
+            attribute->setOwnerElement(element);
+            attribute->setLocalName(name.c_str());
+            
+            Generation* generation = _log.createEntityInfluence<Generation>(time, art::Edit, viewport);
+            generation->setLocation(attribute);
+            generation->setBoundaries(bounds);
+            generation->setContent(it->second->newval.c_str());
+            generation->setDescription(e->description);
+        
+            Invalidation* invalidation = _log.createEntityInfluence<Invalidation>(time, art::Edit, viewport);
+            invalidation->setLocation(attribute);
+            invalidation->setBoundaries(bounds);
+            invalidation->setContent(it->second->oldval.c_str());
+            
+            newver->setGeneration(generation);
+            oldver->setInvalidation(invalidation);
+        
+            delete it->second;
+            
+            it++;
+        }
+        
+        _activity->addGeneratedEntity(newver);
+        _activity->addInvalidatedEntity(oldver);
+        
+        delete values;
+    }
+    
+    void
+    ArtivityLog::logChangeOrder(time_t time, Event* e, Canvas* canvas, Viewport* viewport)
+    {                    
+        // Inkscape::XML::EventChgOrder* x = as<Inkscape::XML::EventChgOrder*>(e->event);
+        
+        // TODO: Set the element and location.
+    }
+    
+    Viewport*
+    ArtivityLog::createViewport()
+    {
+        Rect vbox = _desktop->get_display_area();
+        
+        Point* p = _log.createResource<Point>();
+        p->setX(vbox.left());
+        p->setY(vbox.top());
+        
+        Viewport* viewport = _log.createResource<Viewport>();
+        viewport->setPosition(p);
+        viewport->setWidth(vbox.right() - vbox.left());
+        viewport->setHeight(vbox.bottom() - vbox.top());
+        viewport->setZoomFactor(_desktop->current_zoom());
+        
+        return viewport;
+    }
+    
+    BoundingRectangle*
+    ArtivityLog::createBoundingRectangle(Event* e)
+    {
+        const char* id = getXmlNodeId(e->event->repr);
+        
+        SPObject* obj = _document->getObjectById(id);
+        
+        if(!obj) return NULL;
+            
+        SPItem* item = dynamic_cast<SPItem*>(obj);
+
+        if(!item) return NULL;
+                
+        OptRect rect = item->documentVisualBounds();
+        
+        if(!rect) return NULL;
+        
+        const Unit* svg = &(_document->getSVGUnit());
+        
+        Quantity x = Quantity(rect->min()[0], svg);
+        Quantity y = Quantity(rect->min()[1], svg);
+        Quantity w = Quantity(rect->dimensions()[0], svg);
+        Quantity h = Quantity(rect->dimensions()[1], svg);
+        
+        const Unit* doc = _document->getWidth().unit;
+        
+        Point* p = _log.createResource<Point>();
+        p->setX(x.value(doc));
+        p->setY(y.value(doc));
+        
+        BoundingRectangle* bounds = _log.createResource<BoundingRectangle>();
+        bounds->setPosition(p);
+        bounds->setWidth(w.value(doc));
+        bounds->setHeight(h.value(doc));
+        
+        return bounds;
+    }
+    
+    Canvas*
+    ArtivityLog::getCanvas()
+    {
+        double width = _document->getWidth().quantity;
+        double height = _document->getHeight().quantity;
+        const Resource* lengthUnit = getLengthUnit(_document->getWidth());
+                
+        _log.updateCanvas(width, height, lengthUnit);
+        
+        return _log.getCanvas();
+    }
+    
+    const char*
+    ArtivityLog::getXmlNodeId(Node* n)
+    {
+        if(n != NULL)
+        {        
+            const gchar* id = n->attribute("id");
+            
+            if(id == NULL)
+            {
+                n = n->parent();
+                
+                while(id == NULL && n != NULL)
+                {
+                    id = n->attribute("id");
+                }
+            }
+            
+            if(id != NULL)
+            {
+                return string(id).c_str();
+            }
+        }
+        
+        return NULL;
+    }
+
+    const Resource*
+    ArtivityLog::getLengthUnit(const Quantity& quantity)
+    {        
+        const Unit* unit = quantity.unit;
+                    
+        if(unit->abbr == "px")
+        {
+            return &(art::px);
+        }
+        else if(unit->abbr == "m")
+        {
+            return &(art::m);
+        }
+        else if(unit->abbr == "cm")
+        {
+            return &(art::cm);
+        }
+        else if(unit->abbr == "mm")
+        {
+            return &(art::mm);
+        }
+        else if(unit->abbr == "in")
+        {
+            return &(art::in);
+        }
+        else if(unit->abbr == "ft")
+        {
+            return &(art::ft);
+        }
+        else
+        {
+            return NULL;
+        }
+    }
+
+    AttributeValueMap*
+    ArtivityLog::getChangedAttributes(Event* e)
+    {
+        AttributeValueMap* result = new AttributeValueMap();
+        
+        Inkscape::XML::EventChgAttr* x = as<Inkscape::XML::EventChgAttr*>(e->event);
+        
+        string newval = x->newval != 0 ? string(x->newval) : "";
+        string oldval = x->oldval != 0 ? string(x->oldval) : "";
+        
+        const char* k = g_quark_to_string(x->key);
+        
+        if(strcmp(k, "style") == 0)
+        {            
+            string buffer = "";
+            string key = "";
+            unsigned int i = 0;
+            
+            while(i < oldval.size())
+            {
+                char c = oldval[i];
+                
+                if(c == ':')
+                {
+                    key = buffer;
+                    buffer = "";
+                }
+                else if(c == ';' || i == oldval.size() - 1)
+                {
+                    if(key != "")
+                    {
+                        ValueRecord* r = new ValueRecord();
+                        r->oldval = string(buffer);
+                        r->newval = "";
+                        
+                        result->operator[](key) = r;
+                    }
+                    
+                    buffer = "";
+                }
+                else
+                {
+                    buffer += c;
+                }
+                
+                i++;
+            }
+            
+            buffer = "";
+            key = "";
+            i = 0;
+            
+            while(i < newval.size())
+            {
+                char c = newval[i];
+                
+                if(c == ':')
+                {
+                    key = buffer;
+                    buffer = "";
+                }
+                else if(c == ';' || i == newval.size() - 1)
+                {
+                    if(key != "")
+                    {
+                        AttributeValueIterator it = result->find(key);
+                        
+                        if(it != result->end())
+                        {
+                            ValueRecord* r = result->operator[](key);
+                            
+                            if(r->oldval == buffer)
+                            {
+                                result->erase(it);
+                                
+                                delete r;
+                            }
+                            else
+                            {
+                                r->newval = string(buffer);
+                            }
+                        }
+                        else
+                        {
+                            ValueRecord* r = new ValueRecord();
+                            r->oldval = "";
+                            r->newval = string(buffer);
+                            
+                            result->operator[](key) = r;
+                        }
+                    }
+
+                    buffer = "";
+                }
+                else
+                {
+                    buffer += c;
+                }
+                
+                i++;
+            }
+        }
+        else
+        {
+            ValueRecord* r = new ValueRecord();
+            r->oldval = oldval;
+            r->newval = newval;
+            
+            result->operator[](k) = r;
+        }
+        
+        return result;
+    }
+    
+    void
+    ArtivityLog::transmitQueue()
+    { 
+        // If the document has not been saved yet, we keep all 
+        // pending changes in the event queue.
+        if(_log.empty() || _document->getURI() == NULL)
+        {
+            return;
+        }
+        
+        FileDataObject* file = _log.getFile();
+        
+        if(file == NULL)
+        {
+            g_error("ERROR: File data object is not initialized.");
+            return;
+        }
+        
+        if(_filePath.empty())
+        {
+            _filePath = string(_document->getURI());
+            
+            // Add the newly created file to the file system monitor.
+            _log.enableMonitoring(_filePath);
+        }
+        
+        string fileUrl = string("file://") + _log.escapePath(_filePath);
+        
+        file->setUrl(fileUrl.c_str());
+        
+        _activity->addUsedEntity(file);
+        
+        if(!_activity->getGeneratedEntities().empty())
+        {
+            Entity* e = *(_activity->getGeneratedEntities().begin());
+    
+            FileDataObject* newver = dynamic_cast<FileDataObject*>(e);
+            
+            if(newver != NULL)
+            {
+                stringstream uri;
+                uri << fileUrl << "#" << UriGenerator::getRandomId(10);
+            
+                newver->setUri(uri.str());
+                newver->addGenericEntity(file);
+            }
+        }
+        
+        if(!_activity->getInvalidatedEntities().empty())
+        {
+            Entity* e = *(_activity->getInvalidatedEntities().begin());
+    
+            FileDataObject* oldver = dynamic_cast<FileDataObject*>(e);
+            
+            if(oldver != NULL)
+            {
+                stringstream uri;
+                uri << fileUrl << "#" << UriGenerator::getRandomId(10);
+            
+                oldver->setUri(uri.str());
+                oldver->addGenericEntity(file);
+            }
+        }
+        
+        _log.transmit();
+    }
+    
+    template<class TEvent> bool
+    ArtivityLog::is(Inkscape::XML::Event* event)
+    {
+        return dynamic_cast<TEvent>(event) != NULL;
+    }
+
+    template<class TEvent> TEvent
+    ArtivityLog::as(Inkscape::XML::Event* event)
+    {
+        return dynamic_cast<TEvent>(event);
+    }
+}
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
diff -ruN inkscape-0.91/src/artivity/artivity-log.h inkscape-0.91-1artivity0/src/artivity/artivity-log.h
--- inkscape-0.91/src/artivity/artivity-log.h	1970-01-01 01:00:00.000000000 +0100
+++ inkscape-0.91-1artivity0/src/artivity/artivity-log.h	2015-11-27 10:10:17.102318141 +0100
@@ -0,0 +1,144 @@
+/*
+ * Authors:
+ * Sebastian Faubel <sebastian@semiodesk.com>
+ * Moritz Eberl <moritz@semiodesk.com>
+ *
+ * Copyright (c) 2015 Authors
+ *
+ * Released under GNU GPL, see the file 'COPYING' for more information
+ */
+
+#ifndef SEEN_INKSCAPE_ARTIVITY_OBSERVER_H
+#define SEEN_INKSCAPE_ARTIVITY_OBSERVER_H
+
+#include "undo-stack-observer.h"
+#include "desktop.h"
+#include "document.h"
+#include "event.h"
+#include "xml/event.h"
+#include "xml/node.h"
+#include "xml/attribute-record.h"
+#include "util/units.h"
+#include "sp-item.h"
+#include "2geom/coord.h"
+#include <ctime>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <libartivity/artivity.h>
+
+class SPDesktop;
+
+namespace Inkscape
+{
+    struct EventRecord
+    {
+        const char* eventType;
+
+        Event* event;
+
+        gint64 timestamp;
+    };
+    
+    struct ValueRecord
+    {
+        string oldval;
+        string newval;
+    };
+    
+    typedef map<string, ValueRecord*> AttributeValueMap;
+    
+    typedef map<string, ValueRecord*>::iterator AttributeValueIterator;
+ 
+    /**
+     * Inkscape::ArtivityObserver - observer for tracing calls to
+     * SPDocumentUndo::undo, SPDocumentUndo::redo, SPDocumentUndo::maybe_done.
+     *
+     */   
+    class ArtivityLog : public UndoStackObserver, public sigc::trackable
+    {
+    private:
+        
+        SPDocument* _document;
+
+        SPDesktop* _desktop;
+
+        artivity::ActivityLog _log;
+        
+        artivity::Activity* _activity;
+        
+        string _filePath;
+        
+        template<class TEvent> bool is(Inkscape::XML::Event* event);
+            
+        template<class TEvent> TEvent as(Inkscape::XML::Event* event);
+        
+        sigc::connection _modifiedConnection;
+        
+        sigc::connection _savedConnection;
+        
+    protected:
+           
+        void onSaved();
+        
+        void onModified();
+        
+        void logEvent(Event* e, const artivity::Resource& type);
+        
+        void logUndoOrRedo(time_t time, Event* e, artivity::Canvas* canvas, artivity::Viewport* viewport, const artivity::Resource& type);
+    
+        void logAdd(time_t time, Event* e, artivity::Canvas* canvas, artivity::Viewport* viewport);
+        
+        void logDelete(time_t time, Event* e, artivity::Canvas* canvas, artivity::Viewport* viewport);
+        
+        void logChangeContent(time_t time, Event* e, artivity::Canvas* canvas, artivity::Viewport* viewport);
+    
+        void logChangeAttributes(time_t time, Event* e, artivity::Canvas* canvas, artivity::Viewport* viewport);
+        
+        void logChangeOrder(time_t time, Event* e, artivity::Canvas* canvas, artivity::Viewport* viewport);
+    
+        artivity::Viewport* createViewport();
+        
+        artivity::BoundingRectangle* createBoundingRectangle(Event* e);
+        
+        artivity::Canvas* getCanvas();
+        
+        const char* getXmlNodeId(Inkscape::XML::Node* n);
+    
+        const artivity::Resource* getLengthUnit(const Util::Quantity& quantity);
+    
+        AttributeValueMap* getChangedAttributes(Event* e);
+    
+        void transmitQueue();
+        
+    public:
+        
+        ArtivityLog(SPDocument* document, SPDesktop* desktop);
+        
+        virtual ~ArtivityLog();
+        
+        void notifyUndoEvent(Event* e);
+        
+        void notifyRedoEvent(Event* e);
+        
+        void notifyUndoCommitEvent(Event* e);
+        
+        void notifyClearUndoEvent();
+        
+        void notifyClearRedoEvent();
+    };
+}
+
+#endif // SEEN_INKSCAPE_ARTIVITY_OBSERVER_H
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
diff -ruN inkscape-0.91/src/artivity/Makefile_insert inkscape-0.91-1artivity0/src/artivity/Makefile_insert
--- inkscape-0.91/src/artivity/Makefile_insert	1970-01-01 01:00:00.000000000 +0100
+++ inkscape-0.91-1artivity0/src/artivity/Makefile_insert	2015-11-27 10:10:17.106318141 +0100
@@ -0,0 +1,9 @@
+## Makefile.am fragment sourced by src/Makefile.am.
+
+if USE_ARTIVITY
+
+ink_common_sources +=	\
+	artivity/artivity-log.h	\
+	artivity/artivity-log.cpp
+
+endif
diff -ruN inkscape-0.91/src/desktop.cpp inkscape-0.91-1artivity0/src/desktop.cpp
--- inkscape-0.91/src/desktop.cpp	2015-11-27 10:09:56.158318167 +0100
+++ inkscape-0.91-1artivity0/src/desktop.cpp	2015-11-27 10:10:17.106318141 +0100
@@ -81,6 +81,10 @@
 #include "ui/tools/node-tool.h"
 #include "ui/tool/control-point-selection.h"
 
+#ifdef WITH_ARTIVITY
+#include "artivity/artivity-log.h"
+#endif // WITH_ARTIVITY
+
 namespace Inkscape { namespace XML { class Node; }}
 
 // Callback declarations
@@ -401,6 +405,23 @@
 
 SPDesktop::~SPDesktop()
 {
+    SPDocument* doc = this->doc();
+
+    // free the event log on shutdown or closing of the window.
+    if (event_log) {
+       doc->removeUndoObserver(*event_log);
+       delete event_log;
+       event_log = 0;
+    }
+ 
+#ifdef WITH_ARTIVITY
+    // free the artivity log on shutdown or closing of the window.
+    if (artivity_log) {
+       doc->removeUndoObserver(*artivity_log);
+       delete artivity_log;
+       artivity_log = 0;
+    }
+#endif //WITH_ARTIVITY
 }
 
 
@@ -1563,6 +1584,19 @@
     event_log = new Inkscape::EventLog(doc);
     doc->addUndoObserver(*event_log);
 
+#ifdef WITH_ARTIVITY
+    // remove old ArtivityLog if it exists
+    if (artivity_log) {
+       doc->removeUndoObserver(*artivity_log);
+       delete artivity_log;
+       artivity_log = 0;
+    }
+
+    /* setup ArtivityLog */
+    artivity_log = new Inkscape::ArtivityLog(doc, this);
+    doc->addUndoObserver(*artivity_log);
+#endif //WITH_ARTIVITY
+
     _commit_connection.disconnect();
     _commit_connection = doc->connectCommit(sigc::mem_fun(*this, &SPDesktop::updateNow));
 
diff -ruN inkscape-0.91/src/desktop.h inkscape-0.91-1artivity0/src/desktop.h
--- inkscape-0.91/src/desktop.h	2015-11-27 10:09:55.878318168 +0100
+++ inkscape-0.91-1artivity0/src/desktop.h	2015-11-27 10:10:17.106318141 +0100
@@ -79,6 +79,9 @@
   class Selection;
   class LayerManager;
   class EventLog;
+#ifdef WITH_ARTIVITY
+  class ArtivityLog;
+#endif // WITH_ARTIVITY
   namespace UI {
       namespace Dialog {
           class DialogManager;
@@ -147,6 +150,10 @@
     Inkscape::Display::TemporaryItemList *temporary_item_list;
     Inkscape::Display::SnapIndicator *snapindicator;
 
+#ifdef WITH_ARTIVITY
+    Inkscape::ArtivityLog     *artivity_log;
+#endif //WITH_ARTIVITY
+
     Inkscape::UI::Tools::ToolBase* getEventContext() const;
     Inkscape::Selection* getSelection() const;
     SPDocument* getDocument() const;
diff -ruN inkscape-0.91/src/Makefile.am inkscape-0.91-1artivity0/src/Makefile.am
--- inkscape-0.91/src/Makefile.am	2015-11-27 10:09:55.942318167 +0100
+++ inkscape-0.91-1artivity0/src/Makefile.am	2015-11-27 10:10:17.106318141 +0100
@@ -50,7 +50,8 @@
 	$(DBUS_LIBS)		\
 	$(GDL_LIBS)             \
 	$(IMAGEMAGICK_LIBS)     \
-	$(X11_LIBS)
+	$(X11_LIBS)		\
+	$(ARTIVITY_LIBS)
 
 # Add sources common for Inkscape and Inkview to this variable.
 ink_common_sources =
@@ -139,6 +140,7 @@
 include trace/Makefile_insert
 include 2geom/Makefile_insert
 include libdepixelize/Makefile_insert
+include artivity/Makefile_insert
 
 # Extra files not mentioned as sources to include in the source tarball
 EXTRA_DIST +=	\
