From 9438c74c1068bf65de72c2e7d57764baae38b55b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20H=C3=BCttel?= Date: Wed, 16 Nov 2011 22:55:43 +0000 Subject: [PATCH] Add patches for gtk-recent support and preserving object aspect ratio Package-Manager: portage-2.1.10.34/cvs/Linux x86_64 --- app-text/xournal/ChangeLog | 10 +- app-text/xournal/Manifest | 31 +- .../xournal-0.4.5_p20111022-aspectratio.patch | 74 ++++ .../xournal-0.4.5_p20111022-gtk-recent.patch | 347 ++++++++++++++++++ .../xournal/xournal-0.4.5_p20111022-r1.ebuild | 57 +++ 5 files changed, 504 insertions(+), 15 deletions(-) create mode 100644 app-text/xournal/files/xournal-0.4.5_p20111022-aspectratio.patch create mode 100644 app-text/xournal/files/xournal-0.4.5_p20111022-gtk-recent.patch create mode 100644 app-text/xournal/xournal-0.4.5_p20111022-r1.ebuild diff --git a/app-text/xournal/ChangeLog b/app-text/xournal/ChangeLog index 7f8c0be7a228..2a959338be0d 100644 --- a/app-text/xournal/ChangeLog +++ b/app-text/xournal/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-text/xournal # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/xournal/ChangeLog,v 1.20 2011/10/22 16:20:46 dilfridge Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/xournal/ChangeLog,v 1.21 2011/11/16 22:55:43 dilfridge Exp $ + +*xournal-0.4.5_p20111022-r1 (16 Nov 2011) + + 16 Nov 2011; Andreas K. Huettel + +xournal-0.4.5_p20111022-r1.ebuild, + +files/xournal-0.4.5_p20111022-aspectratio.patch, + +files/xournal-0.4.5_p20111022-gtk-recent.patch: + Add patches for gtk-recent support and preserving object aspect ratio *xournal-0.4.5_p20111022 (22 Oct 2011) diff --git a/app-text/xournal/Manifest b/app-text/xournal/Manifest index 2966e4909347..27c52eab9de9 100644 --- a/app-text/xournal/Manifest +++ b/app-text/xournal/Manifest @@ -2,28 +2,31 @@ Hash: SHA512 AUX xournal-0.4.5-xoprint-len.patch 4299 RMD160 e1fe28debea0d010494aa79f3a6eaf47853dd0b2 SHA1 2b642dc6d01a8c89095e150323ca755276000636 SHA256 0b2bb739e2719658186df82379f083daf71f0a6883aeb7f93f97312cf4cdb96e +AUX xournal-0.4.5_p20111022-aspectratio.patch 3547 RMD160 fc53a86e58b7f5c0de3d3e31c43506d88b120a11 SHA1 fdb8fdaeeb4cfb8022c1a0c899a5bf024e2c29e1 SHA256 27791e240551c2987088d8d979a9389a9dbbb9fda836d537f3637e7966af52ac +AUX xournal-0.4.5_p20111022-gtk-recent.patch 11391 RMD160 411e88bbe51468cb58ff0debe999d46b53ad79a6 SHA1 8bde995a0757ee691afbca0afa3efc5ddab76339 SHA256 d9b8bf35b527e4283554b804acd0a455f66a8e08fa753370bca34ae543d1f58c DIST xournal-0.4.5-sjg-image-rev7.patch.gz 24137 RMD160 9a389ecf98dfc2b709555b8efc0c0f440fe4fa00 SHA1 96a2d88e5ff2b9452a1acf46592e650eb5088c8d SHA256 ac89ceb35941d9a13804fd6650f1a6b84474b3f50c89682611f2f9e66af96705 DIST xournal-0.4.5.tar.gz 425062 RMD160 a4228e6874482bd381c59cd8e3db1100361c1d40 SHA1 390cb275774469ed1b04b7268dd625bd456c895e SHA256 a7d7c2cb544451939779276e6e5ee5acc756bd0efb5253de15dc00bfe07755d1 DIST xournal-0.4.5_p20111022-sjg-image-rev7.patch.gz 21551 RMD160 6048a996fdb7b43e05beff67cf5ae0da53cff840 SHA1 0ff950726a7ad5b0012421c158406d6d49d2c38d SHA256 88b050483fc27f37f307adb358b3e5c4bfc0b600b7d3427599dea4c1ffe87fc2 DIST xournal-0.4.5_p20111022.tar.xz 332700 RMD160 6578c037ad536c0173c533758c5f86ffc046dfbe SHA1 69f66e1125ba3de3deea14be1eb6d7e8f07abe61 SHA256 46573706645a78f1cbdd9e3eed0b2409ab61947eb5f78be9c1b7d7e4535f721f EBUILD xournal-0.4.5-r2.ebuild 1294 RMD160 d123c46f65d0c25e1c134d0e99c15f2f6503f6e5 SHA1 1c50cdbc98773a000e87ad8eee2d720513d21040 SHA256 6e9e1dd61017407aa6c734c15510a98de913f2a5637e0210e3a9b9f9da8cc38a +EBUILD xournal-0.4.5_p20111022-r1.ebuild 1332 RMD160 cdc8602913b2ff53684fbfb9514877a04635217f SHA1 b2eb2cd57e9e5c93e519dde0f6d2e3d96d579fa0 SHA256 25a17977318203b2f8d86c08d899427505df28e3ae232b3b478d18dbed7759e4 EBUILD xournal-0.4.5_p20111022.ebuild 1252 RMD160 fd9af62f9c4f22e9ff26d27b8fd3a65e9fdc449f SHA1 188fe5124bce80003eaa179f93b4f523d7ea7729 SHA256 5be5460466e207ff9a2b192827ba811f499190fe6191925a2814ccb97a9e82c2 -MISC ChangeLog 3573 RMD160 6f4ea332e71e0039509b577b0b58394213dcf742 SHA1 7e639c40684c0198dc520c00e4759e9ffc8590b1 SHA256 470d2f7f87209a38501fd49d26327decd5e3e38a1454fc6ccbde8e0d7c487bef +MISC ChangeLog 3887 RMD160 42e0106716abbef3d3b1478d254ac70758a7d884 SHA1 7f5e4ed5a3ae0dced10f79f20ef447ddcb742bcb SHA256 d7780da18b66f7c0b3c1a7ea740e03bbe77944171bbbf4917d64ef44eda8607f MISC metadata.xml 653 RMD160 f0e7b38b207db6082a6b845ceb8b293668e52bb4 SHA1 f6aac8c9078d20955f92e08ffaa8e2b1c737e7c8 SHA256 a44dc37c1edd247b527b1d5658c0a48e14c56eceab7156611f9bd224c416fbf5 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) -iQIcBAEBCgAGBQJOou1uAAoJENwGBM22xffe8kMP/06A+gcuJLHqL1hjkFcpjYSz -W/lp7wMqBhGVgX3midU9GreZsuMAtppqGPRPdkMtu/TtXEZODfwU567QDWnrPRD1 -m7MaoeCqs2mS/Vjk5NYxQ2NjB5L/lZ32VYGKYdTrQcOy5I9AQa5q7v+4r4qcy2qb -EU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 +0tofDyQhyRGxt38qTslHBv0r+LCirHysughZ6m/LdzE7K0nTIlWQ0tSp2y0E4iCW +zYOBymIeFJibx6tAt8TC544fTfrEveMJDwdW7zuaF2QlTK9iT2jgW2nnRrBwKTRT +Fu01O9qgq8T/4Y5UD3FP7b+Wga9PvN92LJGj7MQyjGkJvsR8x7x0amNJszzMogcx +PsxHzDRMmLzHbcrkjo0m +=SB3H -----END PGP SIGNATURE----- diff --git a/app-text/xournal/files/xournal-0.4.5_p20111022-aspectratio.patch b/app-text/xournal/files/xournal-0.4.5_p20111022-aspectratio.patch new file mode 100644 index 000000000000..3ce12bfd4528 --- /dev/null +++ b/app-text/xournal/files/xournal-0.4.5_p20111022-aspectratio.patch @@ -0,0 +1,74 @@ +https://sourceforge.net/tracker/?func=detail&aid=3082301&group_id=163434&atid=827735 +To make the image patch even more useful, I've written this patch to allow the aspect ratio +to be preserved when resizing selections. (It doesn't just apply to images.) Simply resize using the right +mouse button (button-3) rather than the left mouse button. +This patch should be applied after the enhanced image patch. (Though it'd be easy enough to make the +changes to the raw 0.4.5 source directly since it doesn't change any of the image patch related areas.) +David Barton ( db9052 ) - 2010-10-06 09:30:56 PDT + +diff -ur xournal-0.4.5/src/xo-paint.c xournal-0.4.5-aspectratio/src/xo-paint.c +--- xournal-0.4.5/src/xo-paint.c 2010-10-06 16:45:01.000000000 +0100 ++++ xournal-0.4.5-aspectratio/src/xo-paint.c 2010-10-06 17:10:19.000000000 +0100 +@@ -609,6 +609,12 @@ + ui.selection->new_x2 = ui.selection->bbox.right; + gnome_canvas_item_set(ui.selection->canvas_item, "dash", NULL, NULL); + update_cursor_for_resize(pt); ++ ++ // Check whether we should preserve the aspect ratio ++ if (event->button.button == 3) ++ ui.cur_brush->tool_options |= TOOLOPT_SELECT_PRESERVE; ++ else ++ ui.cur_brush->tool_options &= ~TOOLOPT_SELECT_PRESERVE; + return TRUE; + } + return FALSE; +@@ -740,6 +746,38 @@ + if (ui.selection->resizing_left) ui.selection->new_x1 = pt[0]; + if (ui.selection->resizing_right) ui.selection->new_x2 = pt[0]; + ++ if (ui.cur_brush->tool_options & TOOLOPT_SELECT_PRESERVE) { ++ double aspectratio = (ui.selection->bbox.top - ui.selection->bbox.bottom)/(ui.selection->bbox.right - ui.selection->bbox.left); ++ double newheight = ui.selection->new_y1 - ui.selection->new_y2; ++ double newwidth = ui.selection->new_x2 - ui.selection->new_x1; ++ gboolean boundheight; ++ ++ // Resizing from top or bottom only ++ if ((ui.selection->resizing_top || ui.selection->resizing_bottom) && !(ui.selection->resizing_left || ui.selection->resizing_right)) ++ boundheight = 0; ++ // Resizing from right or left only ++ else if (!(ui.selection->resizing_top || ui.selection->resizing_bottom) && (ui.selection->resizing_left || ui.selection->resizing_right)) ++ boundheight = 1; ++ // Resizing from a corner ++ else if (newheight/aspectratio > newwidth) ++ boundheight = 0; ++ else ++ boundheight = 1; ++ ++ if (boundheight) { ++ // Bound the height ++ newheight = newwidth*aspectratio; ++ if (ui.selection->resizing_top) ui.selection->new_y1 = ui.selection->new_y2 + newheight; ++ else ui.selection->new_y2 = ui.selection->new_y1 - newheight; ++ } ++ else { ++ // Bound the width ++ newwidth = newheight/aspectratio; ++ if (ui.selection->resizing_left) ui.selection->new_x1 = ui.selection->new_x2 - newwidth; ++ else ui.selection->new_x2 = ui.selection->new_x1 + newwidth; ++ } ++ } ++ + gnome_canvas_item_set(ui.selection->canvas_item, + "x1", ui.selection->new_x1, "x2", ui.selection->new_x2, + "y1", ui.selection->new_y1, "y2", ui.selection->new_y2, NULL); +diff -ur xournal-0.4.5/src/xournal.h xournal-0.4.5-aspectratio/src/xournal.h +--- xournal-0.4.5/src/xournal.h 2010-10-06 16:45:01.000000000 +0100 ++++ xournal-0.4.5-aspectratio/src/xournal.h 2010-10-06 16:31:07.000000000 +0100 +@@ -130,6 +130,7 @@ + #define TOOLOPT_ERASER_STANDARD 0 + #define TOOLOPT_ERASER_WHITEOUT 1 + #define TOOLOPT_ERASER_STROKES 2 ++#define TOOLOPT_SELECT_PRESERVE 1 // Preserve the aspect ratio of the selection when resizing + + extern double predef_thickness[NUM_STROKE_TOOLS][THICKNESS_MAX]; + diff --git a/app-text/xournal/files/xournal-0.4.5_p20111022-gtk-recent.patch b/app-text/xournal/files/xournal-0.4.5_p20111022-gtk-recent.patch new file mode 100644 index 000000000000..3bddbeeed81b --- /dev/null +++ b/app-text/xournal/files/xournal-0.4.5_p20111022-gtk-recent.patch @@ -0,0 +1,347 @@ +https://sourceforge.net/tracker/?func=detail&aid=3249971&group_id=163434&atid=827735 +When using GtkRecent for the management of recently used files, Xournal's recently used +files also appear in the shell. That's very convenient for the new document-centric shells +such as Gnome Shell and Unity. +Timo Kluck ( tkluck ) - 2011-03-27 10:40:08 PDT + +=== modified file 'src/main.c' +--- src/main.c 2011-03-10 18:14:21 +0000 ++++ src/main.c 2011-03-27 16:32:52 +0000 +@@ -334,7 +334,6 @@ + + if (bgpdf.status != STATUS_NOT_INIT) shutdown_bgpdf(); + +- save_mru_list(); + if (ui.auto_save_prefs) save_config_to_file(); + + return 0; + +=== modified file 'src/xo-callbacks.c' +--- src/xo-callbacks.c 2011-03-10 18:14:21 +0000 ++++ src/xo-callbacks.c 2011-03-27 16:32:52 +0000 +@@ -3101,32 +3101,36 @@ + + + void +-on_mru_activate (GtkMenuItem *menuitem, ++on_mru_activate (GtkRecentChooser *recentChooser, + gpointer user_data) + { +- int which; + gboolean success; ++ gchar *uri, *name; + GtkWidget *dialog; + + end_text(); + if (!ok_to_close()) return; // user aborted on save confirmation + +- for (which = 0 ; which < MRU_SIZE; which++) { +- if (ui.mrumenu[which] == GTK_WIDGET(menuitem)) break; +- } +- if (which == MRU_SIZE || ui.mru[which] == NULL) return; // not found... +- ++ uri = gtk_recent_chooser_get_current_uri (recentChooser); ++ name = g_filename_from_uri (uri, NULL, NULL); + set_cursor_busy(TRUE); +- success = open_journal(ui.mru[which]); ++ success = open_journal(name); + set_cursor_busy(FALSE); +- if (success) return; ++ if (success) { ++ g_free(uri); ++ g_free(name); ++ return; ++ } + + /* open failed */ + dialog = gtk_message_dialog_new(GTK_WINDOW (winMain), GTK_DIALOG_DESTROY_WITH_PARENT, +- GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Error opening file '%s'"), ui.mru[which]); ++ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Error opening file '%s'"), name); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +- delete_mru_entry(which); ++ ++ delete_mru_entry(name); ++ g_free(uri); ++ g_free(name); + } + + + +=== modified file 'src/xo-callbacks.h' +--- src/xo-callbacks.h 2011-03-10 18:14:21 +0000 ++++ src/xo-callbacks.h 2011-03-27 16:32:52 +0000 +@@ -481,7 +481,7 @@ + gpointer user_data); + + void +-on_mru_activate (GtkMenuItem *menuitem, ++on_mru_activate (GtkRecentChooser *recentChooser, + gpointer user_data); + + void + +=== modified file 'src/xo-file.c' +--- src/xo-file.c 2011-03-10 18:14:21 +0000 ++++ src/xo-file.c 2011-03-27 17:09:20 +0000 +@@ -1211,99 +1211,53 @@ + } + } + +-// initialize the recent files list ++// initialize GtkRecentManager. Also backwards compatibility: import recent files into GtkRecentManager + void init_mru(void) + { +- int i; ++ GtkRecentFilter *recentFilter = gtk_recent_filter_new (); ++ gtk_recent_filter_add_application ( recentFilter, "xournal"); ++ gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (GET_COMPONENT("fileRecentFiles_menu")), recentFilter); ++ + gsize lfptr; +- char s[5]; + GIOChannel *f; +- gchar *str; ++ gchar *str, *uri; + GIOStatus status; ++ GtkRecentManager *recentManager = gtk_recent_manager_get_default (); + +- g_strlcpy(s, "mru0", 5); +- for (s[3]='0', i=0; i0) { + str[lfptr] = 0; +- ui.mru[i] = str; +- i++; ++ uri = g_filename_to_uri (str, NULL, NULL); ++ gtk_recent_manager_add_item (recentManager, uri); ++ g_free(uri); ++ g_free(str); + } + } + if (f) { + g_io_channel_shutdown(f, FALSE, NULL); + g_io_channel_unref(f); + } +- update_mru_menu(); +-} +- +-void update_mru_menu(void) +-{ +- int i; +- gboolean anyone = FALSE; +- gchar *tmp; + +- for (i=0; i=1; j--) ui.mru[j] = ui.mru[j-1]; +- ui.mru[0] = g_strdup(name); +- update_mru_menu(); +-} +- +-void delete_mru_entry(int which) +-{ +- int i; +- +- if (ui.mru[which]!=NULL) g_free(ui.mru[which]); +- for (i=which+1;i