diff -Nru xournal-0.4.5/debian/changelog xournal-0.4.5/debian/changelog --- xournal-0.4.5/debian/changelog 2011-03-26 19:18:58.000000000 +0000 +++ xournal-0.4.5/debian/changelog 2012-01-29 23:21:11.000000000 +0000 @@ -1,3 +1,10 @@ +xournal (0.4.5-3+thjaeger1) oneiric; urgency=low + + * Add `smart' eraser mode + * Treat touch as hand tool + + -- Thomas Jaeger Sun, 29 Jan 2012 18:20:06 -0500 + xournal (0.4.5-3) unstable; urgency=low * Add -lz and -X11 to link flags (Closes: #617637, #556718) diff -Nru xournal-0.4.5/debian/patches/debian-changes-0.4.5-3+thjaeger1 xournal-0.4.5/debian/patches/debian-changes-0.4.5-3+thjaeger1 --- xournal-0.4.5/debian/patches/debian-changes-0.4.5-3+thjaeger1 1970-01-01 00:00:00.000000000 +0000 +++ xournal-0.4.5/debian/patches/debian-changes-0.4.5-3+thjaeger1 2012-01-29 23:25:14.000000000 +0000 @@ -0,0 +1,251 @@ +Description: Upstream changes introduced in version 0.4.5-3+thjaeger1 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + xournal (0.4.5-3+thjaeger1) oneiric; urgency=low + . + * Add `smart' eraser mode + * Treat touch as hand tool + . + The person named in the Author field signed this changelog entry. +Author: Thomas Jaeger + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- xournal-0.4.5.orig/mkinstalldirs ++++ xournal-0.4.5/mkinstalldirs +@@ -1,21 +1,36 @@ + #! /bin/sh + # mkinstalldirs --- make directory hierarchy +-# Author: Noah Friedman +-# Created: 1993-05-16 +-# Public domain + ++scriptversion=2009-04-28.21; # UTC ++ ++# Original author: Noah Friedman ++# Created: 1993-05-16 ++# Public domain. ++# ++# This file is maintained in Automake, please report ++# bugs to or send patches to ++# . ++ ++nl=' ++' ++IFS=" "" $nl" + errstatus=0 +-dirmode="" ++dirmode= + + usage="\ +-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." ++Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... ++ ++Create each directory DIR (with mode MODE, if specified), including all ++leading file name components. ++ ++Report bugs to ." + + # process command line arguments + while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help +- echo "$usage" 1>&2 +- exit 0 ++ echo "$usage" ++ exit $? + ;; + -m) # -m PERM arg + shift +@@ -23,6 +38,10 @@ while test $# -gt 0 ; do + dirmode=$1 + shift + ;; ++ --version) ++ echo "$0 $scriptversion" ++ exit $? ++ ;; + --) # stop option processing + shift + break +@@ -50,30 +69,58 @@ case $# in + 0) exit 0 ;; + esac + ++# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and ++# mkdir -p a/c at the same time, both will detect that a is missing, ++# one will create a, then the other will try to create a and die with ++# a "File exists" error. This is a problem when calling mkinstalldirs ++# from a parallel make. We use --version in the probe to restrict ++# ourselves to GNU mkdir, which is thread-safe. + case $dirmode in + '') +- if mkdir -p -- . 2>/dev/null; then ++ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" ++ else ++ # On NextStep and OpenStep, the `mkdir' command does not ++ # recognize any option. It will interpret all options as ++ # directories to create, and then abort because `.' already ++ # exists. ++ test -d ./-p && rmdir ./-p ++ test -d ./--version && rmdir ./--version + fi + ;; + *) +- if mkdir -m "$dirmode" -p -- . 2>/dev/null; then ++ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && ++ test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" ++ else ++ # Clean up after NextStep and OpenStep mkdir. ++ for d in ./-m ./-p ./--version "./$dirmode"; ++ do ++ test -d $d && rmdir $d ++ done + fi + ;; + esac + + for file + do +- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` ++ case $file in ++ /*) pathcomp=/ ;; ++ *) pathcomp= ;; ++ esac ++ oIFS=$IFS ++ IFS=/ ++ set fnord $file + shift ++ IFS=$oIFS + +- pathcomp= + for d + do +- pathcomp="$pathcomp$d" ++ test "x$d" = x && continue ++ ++ pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac +@@ -84,21 +131,21 @@ do + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then +- errstatus=$lasterr ++ errstatus=$lasterr + else +- if test ! -z "$dirmode"; then ++ if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" +- lasterr="" +- chmod "$dirmode" "$pathcomp" || lasterr=$? ++ lasterr= ++ chmod "$dirmode" "$pathcomp" || lasterr=$? + +- if test ! -z "$lasterr"; then +- errstatus=$lasterr +- fi +- fi ++ if test ! -z "$lasterr"; then ++ errstatus=$lasterr ++ fi ++ fi + fi + fi + +- pathcomp="$pathcomp/" ++ pathcomp=$pathcomp/ + done + done + +@@ -107,5 +154,9 @@ exit $errstatus + # Local Variables: + # mode: shell-script + # sh-indentation: 2 ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-start: "scriptversion=" ++# time-stamp-format: "%:y-%02m-%02d.%02H" ++# time-stamp-time-zone: "UTC" ++# time-stamp-end: "; # UTC" + # End: +-# mkinstalldirs ends here +--- xournal-0.4.5.orig/po/Makefile.in.in ++++ xournal-0.4.5/po/Makefile.in.in +@@ -79,7 +79,7 @@ INSTOBJEXT = @INSTOBJEXT@ + $(MSGFMT) -o $@ $< + + .po.gmo: +- file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ ++ $(AM_V_GEN) file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $< + + .po.cat: +@@ -93,11 +93,14 @@ all-yes: $(CATALOGS) + all-no: + + $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) +- $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \ ++ $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) \ ++ --msgid-bugs-address='http://bugzilla.gnome.org/enter_bug.cgi?product=glib&keywords=I18N+L10N&component=general' \ + --add-comments --keyword=_ --keyword=N_ \ + --keyword=C_:1c,2 \ + --keyword=NC_:1c,2 \ ++ --keyword=g_dcgettext:2 \ + --keyword=g_dngettext:2,3 \ ++ --keyword=g_dpgettext2:2c,3 \ + --flag=N_:1:pass-c-format \ + --flag=C_:2:pass-c-format \ + --flag=NC_:2:pass-c-format \ +@@ -117,7 +120,7 @@ $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTF + --flag=g_snprintf:3:c-format \ + --flag=g_scanner_error:2:c-format \ + --flag=g_scanner_warn:2:c-format \ +- --files-from=$(srcdir)/POTFILES.in \ ++ $(POTFILES) \ + && test ! -f $(GETTEXT_PACKAGE).po \ + || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \ + && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot ) +@@ -216,7 +219,7 @@ maintainer-clean: distclean + rm -f $(GMOFILES) + + distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) +-dist distdir: update-po $(DISTFILES) ++dist distdir: $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ +--- xournal-0.4.5.orig/src/ttsubset/Makefile.in ++++ xournal-0.4.5/src/ttsubset/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated by automake 1.11 from Makefile.am. ++# Makefile.in generated by automake 1.11.1 from Makefile.am. + # @configure_input@ + + # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +@@ -117,6 +117,8 @@ PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PKG_CONFIG = @PKG_CONFIG@ ++PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ ++PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ + POFILES = @POFILES@ + POSUB = @POSUB@ + PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ diff -Nru xournal-0.4.5/debian/patches/series xournal-0.4.5/debian/patches/series --- xournal-0.4.5/debian/patches/series 2009-12-08 22:34:13.000000000 +0000 +++ xournal-0.4.5/debian/patches/series 2012-01-29 23:25:14.000000000 +0000 @@ -1,3 +1,6 @@ add_ldflags compilation_flags xoprint-len_fix +smart-eraser.patch +touch-hand.diff +debian-changes-0.4.5-3+thjaeger1 diff -Nru xournal-0.4.5/debian/patches/smart-eraser.patch xournal-0.4.5/debian/patches/smart-eraser.patch --- xournal-0.4.5/debian/patches/smart-eraser.patch 1970-01-01 00:00:00.000000000 +0000 +++ xournal-0.4.5/debian/patches/smart-eraser.patch 2012-01-29 21:01:05.000000000 +0000 @@ -0,0 +1,234 @@ +Index: xournal-0.4.5/src/xo-callbacks.c +=================================================================== +--- xournal-0.4.5.orig/src/xo-callbacks.c 2009-10-03 16:48:26.523068202 -0400 ++++ xournal-0.4.5/src/xo-callbacks.c 2009-10-03 16:54:14.483067232 -0400 +@@ -2003,6 +2003,18 @@ + + + void ++on_eraserSmart_activate (GtkMenuItem *menuitem, ++ gpointer user_data) ++{ ++ if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem))) return; ++ end_text(); ++ reset_focus(); ++ ui.brushes[0][TOOL_ERASER].tool_options = TOOLOPT_ERASER_SMART; ++ update_mapping_linkings(TOOL_ERASER); ++} ++ ++ ++void + on_highlighterFine_activate (GtkMenuItem *menuitem, + gpointer user_data) + { +@@ -2339,6 +2351,7 @@ + reset_focus(); + + is_core = (event->device == gdk_device_get_core_pointer()); ++ + if (!ui.use_xinput && !is_core) return FALSE; + if (ui.use_xinput && is_core && ui.discard_corepointer) return FALSE; + if (event->type != GDK_BUTTON_PRESS) return FALSE; +@@ -2385,7 +2398,11 @@ + ui.is_corestroke = FALSE; + get_pointer_coords((GdkEvent *)event, ui.cur_path.coords); + } +- if (ui.cur_item_type != ITEM_NONE) return FALSE; // we're already doing something ++ if (ui.cur_item_type != ITEM_NONE) { ++ if (ui.cur_item_type == ITEM_ERASURE && ui.cur_brush->tool_options == TOOLOPT_ERASER_SMART) ++ ui.eraser_smart_stroke = TRUE; ++ return FALSE; // we're already doing something ++ } + + // if button_switch_mapping enabled, button 2 or 3 clicks only switch mapping + if (ui.button_switch_mapping && event->button > 1) { +@@ -2475,6 +2492,7 @@ + } + else if (ui.toolno[mapping] == TOOL_ERASER) { + ui.cur_item_type = ITEM_ERASURE; ++ ui.eraser_smart_stroke = FALSE; + do_eraser((GdkEvent *)event, ui.cur_brush->thickness/2, + ui.cur_brush->tool_options == TOOLOPT_ERASER_STROKES); + } +@@ -2508,6 +2526,8 @@ + if (ui.use_xinput && is_core && !ui.is_corestroke) return FALSE; + if (!is_core) fix_xinput_coords((GdkEvent *)event); + ++ ui.eraser_smart_stroke = FALSE; ++ + if (event->button != ui.which_mouse_button && + event->button != ui.which_unswitch_button) + return FALSE; +@@ -2718,7 +2738,7 @@ + } + else if (ui.cur_item_type == ITEM_ERASURE) { + do_eraser((GdkEvent *)event, ui.cur_brush->thickness/2, +- ui.cur_brush->tool_options == TOOLOPT_ERASER_STROKES); ++ ui.cur_brush->tool_options == TOOLOPT_ERASER_STROKES || ui.eraser_smart_stroke); + } + else if (ui.cur_item_type == ITEM_SELECTRECT) { + get_pointer_coords((GdkEvent *)event, pt); +@@ -3563,3 +3583,4 @@ + ui.button_switch_mapping = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem)); + } + ++ +Index: xournal-0.4.5/src/xo-callbacks.h +=================================================================== +--- xournal-0.4.5.orig/src/xo-callbacks.h 2009-10-03 16:48:26.553054973 -0400 ++++ xournal-0.4.5/src/xo-callbacks.h 2009-10-03 16:48:33.613040806 -0400 +@@ -317,6 +317,10 @@ + gpointer user_data); + + void ++on_eraserSmart_activate (GtkMenuItem *menuitem, ++ gpointer user_data); ++ ++void + on_highlighterFine_activate (GtkMenuItem *menuitem, + gpointer user_data); + +@@ -632,3 +636,4 @@ + void + on_optionsButtonsSwitchMappings_activate(GtkMenuItem *menuitem, + gpointer user_data); ++ +Index: xournal-0.4.5/src/xo-file.c +=================================================================== +--- xournal-0.4.5.orig/src/xo-file.c 2009-10-03 16:48:26.493058103 -0400 ++++ xournal-0.4.5/src/xo-file.c 2009-10-03 16:48:33.613040806 -0400 +@@ -1568,7 +1568,7 @@ + _(" default eraser thickness (fine = 1, medium = 2, thick = 3)"), + g_strdup_printf("%d", ui.default_brushes[TOOL_ERASER].thickness_no)); + update_keyval("tools", "eraser_mode", +- _(" default eraser mode (standard = 0, whiteout = 1, strokes = 2)"), ++ _(" default eraser mode (standard = 0, whiteout = 1, strokes = 2, smart = 3)"), + g_strdup_printf("%d", ui.default_brushes[TOOL_ERASER].tool_options)); + update_keyval("tools", "highlighter_color", + _(" default highlighter color"), +@@ -1900,7 +1900,7 @@ + parse_keyval_boolean("tools", "pen_ruler", &(ui.brushes[0][TOOL_PEN].ruler)); + parse_keyval_boolean("tools", "pen_recognizer", &(ui.brushes[0][TOOL_PEN].recognizer)); + parse_keyval_int("tools", "eraser_thickness", &(ui.brushes[0][TOOL_ERASER].thickness_no), 1, 3); +- parse_keyval_int("tools", "eraser_mode", &(ui.brushes[0][TOOL_ERASER].tool_options), 0, 2); ++ parse_keyval_int("tools", "eraser_mode", &(ui.brushes[0][TOOL_ERASER].tool_options), 0, 3); + parse_keyval_enum_color("tools", "highlighter_color", + &(ui.brushes[0][TOOL_HIGHLIGHTER].color_no), &(ui.brushes[0][TOOL_HIGHLIGHTER].color_rgba), + color_names, predef_colors_rgba, COLOR_MAX); +@@ -1929,7 +1929,7 @@ + if (ui.toolno[1] + + ++ ++ ++ ++ True ++ s_mart ++ True ++ True ++ eraserStandard ++ ++ ++ + + + diff -Nru xournal-0.4.5/debian/patches/touch-hand.diff xournal-0.4.5/debian/patches/touch-hand.diff --- xournal-0.4.5/debian/patches/touch-hand.diff 1970-01-01 00:00:00.000000000 +0000 +++ xournal-0.4.5/debian/patches/touch-hand.diff 2012-01-29 23:19:37.000000000 +0000 @@ -0,0 +1,70 @@ +diff -ru xournal-0.4.5/src/xo-callbacks.c xournal-0.4.5-new//src/xo-callbacks.c +--- xournal-0.4.5/src/xo-callbacks.c 2012-01-29 16:01:54.485106140 -0500 ++++ xournal-0.4.5-new//src/xo-callbacks.c 2012-01-29 18:09:42.217378456 -0500 +@@ -2414,8 +2414,15 @@ + ui.is_corestroke = is_core; + ui.stroke_device = event->device; + +- if (ui.use_erasertip && event->device->source == GDK_SOURCE_ERASER) +- mapping = NUM_BUTTONS; ++ gchar *tmp_name; ++ tmp_name = g_ascii_strdown (event->device->name, -1); ++ ++ if (strstr (tmp_name, "finger") || ++ (strstr (tmp_name, "touch") && ++ !strstr (tmp_name, "touchpad"))) ++ mapping = BUTTON_TOUCH; ++ else if (ui.use_erasertip && event->device->source == GDK_SOURCE_ERASER) ++ mapping = BUTTON_ERASER; + else if (ui.button_switch_mapping) { + mapping = ui.cur_mapping; + if (!mapping && (event->state & GDK_BUTTON2_MASK)) mapping = 1; +@@ -2423,6 +2430,9 @@ + } + else mapping = event->button-1; + ++ g_free (tmp_name); ++ ++ + // check whether we're in a page + page_change = FALSE; + tmppage = ui.cur_page; +diff -ru xournal-0.4.5/src/xo-file.c xournal-0.4.5-new//src/xo-file.c +--- xournal-0.4.5/src/xo-file.c 2012-01-29 16:01:54.489106137 -0500 ++++ xournal-0.4.5-new//src/xo-file.c 2012-01-29 18:16:10.425392246 -0500 +@@ -1361,7 +1361,8 @@ + for (i=1; i<=NUM_BUTTONS; i++) { + ui.toolno[i] = TOOL_ERASER; + } +- for (i=0; i<=NUM_BUTTONS; i++) ++ ui.toolno[BUTTON_TOUCH] = TOOL_HAND; ++ for (i=0; i<=NUM_BUTTONS+1; i++) + ui.linked_brush[i] = BRUSH_LINKED; + ui.brushes[0][TOOL_PEN].color_no = COLOR_BLACK; + ui.brushes[0][TOOL_ERASER].color_no = COLOR_WHITE; +iff -ru xournal-0.4.5/src/xournal.h xournal-0.4.5-new//src/xournal.h +--- xournal-0.4.5/src/xournal.h 2012-01-29 16:01:54.493106134 -0500 ++++ xournal-0.4.5-new//src/xournal.h 2012-01-29 18:11:36.081382498 -0500 +@@ -123,6 +123,8 @@ + #define NUM_STROKE_TOOLS 3 + #define NUM_TOOLS 8 + #define NUM_BUTTONS 3 ++#define BUTTON_ERASER 3 ++#define BUTTON_TOUCH 4 + + #define TOOLOPT_ERASER_STANDARD 0 + #define TOOLOPT_ERASER_WHITEOUT 1 +@@ -221,10 +223,10 @@ + struct Layer *cur_layer; + gboolean saved; // is file saved ? + struct Brush *cur_brush; // the brush in use (one of brushes[...]) +- int toolno[NUM_BUTTONS+1]; // the number of the currently selected tool +- struct Brush brushes[NUM_BUTTONS+1][NUM_STROKE_TOOLS]; // the current pen, eraser, hiliter ++ int toolno[NUM_BUTTONS+2]; // the number of the currently selected tool ++ struct Brush brushes[NUM_BUTTONS+2][NUM_STROKE_TOOLS]; // the current pen, eraser, hiliter + struct Brush default_brushes[NUM_STROKE_TOOLS]; // the default ones +- int linked_brush[NUM_BUTTONS+1]; // whether brushes are linked across buttons ++ int linked_brush[NUM_BUTTONS+2]; // whether brushes are linked across buttons + int cur_mapping; // the current button number for mappings + gboolean button_switch_mapping; // button clicks switch button 1 mappings + gboolean use_erasertip;