Add patches for gtk-recent support and preserving object aspect ratio
authorAndreas Hüttel <dilfridge@gentoo.org>
Wed, 16 Nov 2011 22:55:43 +0000 (22:55 +0000)
committerAndreas Hüttel <dilfridge@gentoo.org>
Wed, 16 Nov 2011 22:55:43 +0000 (22:55 +0000)
Package-Manager: portage-2.1.10.34/cvs/Linux x86_64

app-text/xournal/ChangeLog
app-text/xournal/Manifest
app-text/xournal/files/xournal-0.4.5_p20111022-aspectratio.patch [new file with mode: 0644]
app-text/xournal/files/xournal-0.4.5_p20111022-gtk-recent.patch [new file with mode: 0644]
app-text/xournal/xournal-0.4.5_p20111022-r1.ebuild [new file with mode: 0644]

index 7f8c0be7a228b2f4f1f2083c5649edc7f8d21910..2a959338be0d916e2522f239158c41196cc4ca58 100644 (file)
@@ -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 <dilfridge@gentoo.org>
+  +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)
 
index 2966e4909347fce50d76b5235e76d18e46116aca..27c52eab9de967441a46cc87c3fd5c08f1d76836 100644 (file)
@@ -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
-EUNcMRVESMH7VRznxAhZnETw3aFWYCJt2kC6PT8yZ+tYQcTHwtv0ra7KLrYXAqRy
-cIoQbCl3PzQdnLzXcSwCGsf7Ghw+4bLXDTgsuoQSQSCCVWtur2GfLIhFyJx2y+1H
-aWgMV2LAKb0ckcQ7aC356Er6dCl+zeg6sWLKvSvlHvmmS5gjM1dYdzfkKSjQo1Mz
-SCxvaKVZywwTTzGvwNaFcRyfVHC2U+I/VLFJEwD1R2twt+rS46NPNvqS/iV6C4lw
-vP2UUXEie0GbBdvqRyHkiHA5oAkNAWg4mpRCD24//ktEpKOGnCd3KbNPlo8Aaw39
-NNrlybrY1ASC8Z9zdfBo89FqI3+f1/B7+RInU30uQqh+vZBKNVP7Q8uQ2XQTuDYd
-z+LqfmOOvPkkV/N/K3BTX4UpPxoL97Eaf9AjXaG96IKoXp6JCNpbDonU8F+4Mh2E
-ap2xMsdNBWDbY/YlufOySsT0nKaM6kdUpvROywSEVEzMhJOhuiRE5SSgx8npLkU2
-bVHDUA8uncQ9LpxuVIoo
-=gje5
+iQIcBAEBCgAGBQJOxE2+AAoJENwGBM22xffeqcUP/2onxBjQonJoW5szvMCFnWgp
+7ONeN5afk77OrUfLfhy0Zqegc5dxHBsjpTF4CdUHMBGK9mjVCxvZwzTzOA/hZEkY
+241BNR5o7/hyHCyw3Kw502QpjoAA9YD9ESmmPav7JxI+0shIKrk6ANFzqAGJ59KS
+xr1cimxEJUpi5D1u8x7tYobc3yyt3gZ+CdUqs5aQh7E56ByQWO0TYP+CczzDVN4J
+pFTQS9B7XyRyYOzMm10MRFrwCMtfg9a003HRS7QHCV5vk5EzYAtkXt1GKKsnWI7r
+T4DoId9jRfrEUi4CY09Ex7byaZFroWpCGOqGTOTZwkQYZeQ0tCF4kYi913T30tBU
+K9OA++yLKCTVYjBySRteaVaR/WtAloKSW0y7SfS/1rdtWkDIoZRX8MiegsyA+02T
+eyL5HkCeMUeEjmyvn1Fv4jIIyx6X1aTO/j/UfVUKT90Gcs/lLCJ4IV8s8q8FJ2E5
+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 (file)
index 0000000..3ce12bf
--- /dev/null
@@ -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 (file)
index 0000000..3bddbee
--- /dev/null
@@ -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; i<MRU_SIZE; s[3]++, i++) {
+-    ui.mrumenu[i] = GET_COMPONENT(s);
+-    ui.mru[i] = NULL;
+-  }
+   f = g_io_channel_new_file(ui.mrufile, "r", NULL);
+   if (f) status = G_IO_STATUS_NORMAL;
+   else status = G_IO_STATUS_ERROR;
+-  i = 0;
+-  while (status == G_IO_STATUS_NORMAL && i<MRU_SIZE) {
++  while (status == G_IO_STATUS_NORMAL) {
+     lfptr = 0;
+     status = g_io_channel_read_line(f, &str, NULL, &lfptr, NULL);
+     if (status == G_IO_STATUS_NORMAL && lfptr>0) {
+       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<MRU_SIZE; i++) {
+-    if (ui.mru[i]!=NULL) {
+-      tmp = g_strdup_printf("_%d %s", i+1,
+-               g_strjoinv("__", g_strsplit_set(g_basename(ui.mru[i]),"_",-1)));
+-      gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(ui.mrumenu[i]))),
+-          tmp);
+-      g_free(tmp);
+-      gtk_widget_show(ui.mrumenu[i]);
+-      anyone = TRUE;
+-    }
+-    else gtk_widget_hide(ui.mrumenu[i]);
+-  }
+-  gtk_widget_set_sensitive(GET_COMPONENT("fileRecentFiles"), anyone);
++  g_unlink (ui.mrufile);
+ }
+ 
+ void new_mru_entry(char *name)
+ {
+-  int i, j;
+-  
+-  for (i=0;i<MRU_SIZE;i++) 
+-    if (ui.mru[i]!=NULL && !strcmp(ui.mru[i], name)) {
+-      g_free(ui.mru[i]);
+-      for (j=i+1; j<MRU_SIZE; j++) ui.mru[j-1] = ui.mru[j];
+-      ui.mru[MRU_SIZE-1]=NULL;
+-    }
+-  if (ui.mru[MRU_SIZE-1]!=NULL) g_free(ui.mru[MRU_SIZE-1]);
+-  for (j=MRU_SIZE-1; j>=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<MRU_SIZE;i++) 
+-    ui.mru[i-1] = ui.mru[i];
+-  ui.mru[MRU_SIZE-1] = NULL;
+-  update_mru_menu();
+-}
+-
+-void save_mru_list(void)
+-{
+-  FILE *f;
+-  int i;
+-  
+-  f = fopen(ui.mrufile, "w");
+-  if (f==NULL) return;
+-  for (i=0; i<MRU_SIZE; i++)
+-    if (ui.mru[i]!=NULL) fprintf(f, "%s\n", ui.mru[i]);
+-  fclose(f);
++  gchar *uri = g_filename_to_uri (name, NULL, NULL);
++  gtk_recent_manager_add_item (gtk_recent_manager_get_default(), uri);
++  g_free(uri);
++}
++
++void delete_mru_entry(char *name)
++{
++  gchar *uri = g_filename_to_uri(name, NULL, NULL);
++  gtk_recent_manager_remove_item(gtk_recent_manager_get_default(), uri, NULL);
++  g_free(uri);
+ }
+ 
+ void init_config_default(void)
+
+=== modified file 'src/xo-file.h'
+--- src/xo-file.h      2011-03-10 18:14:21 +0000
++++ src/xo-file.h      2011-03-27 16:32:52 +0000
+@@ -28,10 +28,8 @@
+ void bgpdf_update_bg(int pageno, struct BgPdfPage *bgpg);
+ 
+ void init_mru(void);
+-void update_mru_menu(void);
+ void new_mru_entry(char *name);
+-void delete_mru_entry(int which);
+-void save_mru_list(void);
++void delete_mru_entry(char *name);
+ 
+ void init_config_default(void);
+ void load_config_from_file(void);
+
+=== modified file 'src/xo-interface.c'
+--- src/xo-interface.c 2011-03-10 18:14:21 +0000
++++ src/xo-interface.c 2011-03-27 17:09:20 +0000
+@@ -43,14 +43,6 @@
+   GtkWidget *separator1;
+   GtkWidget *fileRecentFiles;
+   GtkWidget *fileRecentFiles_menu;
+-  GtkWidget *mru0;
+-  GtkWidget *mru1;
+-  GtkWidget *mru2;
+-  GtkWidget *mru3;
+-  GtkWidget *mru4;
+-  GtkWidget *mru5;
+-  GtkWidget *mru6;
+-  GtkWidget *mru7;
+   GtkWidget *separator22;
+   GtkWidget *filePrintOptions;
+   GtkWidget *image624;
+@@ -397,41 +389,9 @@
+   gtk_widget_show (fileRecentFiles);
+   gtk_container_add (GTK_CONTAINER (menuFile_menu), fileRecentFiles);
+ 
+-  fileRecentFiles_menu = gtk_menu_new ();
++  fileRecentFiles_menu = gtk_recent_chooser_menu_new_for_manager (gtk_recent_manager_get_default ());
+   gtk_menu_item_set_submenu (GTK_MENU_ITEM (fileRecentFiles), fileRecentFiles_menu);
+-
+-  mru0 = gtk_menu_item_new_with_mnemonic (_("0"));
+-  gtk_widget_show (mru0);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru0);
+-
+-  mru1 = gtk_menu_item_new_with_mnemonic (_("1"));
+-  gtk_widget_show (mru1);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru1);
+-
+-  mru2 = gtk_menu_item_new_with_mnemonic (_("2"));
+-  gtk_widget_show (mru2);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru2);
+-
+-  mru3 = gtk_menu_item_new_with_mnemonic (_("3"));
+-  gtk_widget_show (mru3);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru3);
+-
+-  mru4 = gtk_menu_item_new_with_mnemonic (_("4"));
+-  gtk_widget_show (mru4);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru4);
+-
+-  mru5 = gtk_menu_item_new_with_mnemonic (_("5"));
+-  gtk_widget_show (mru5);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru5);
+-
+-  mru6 = gtk_menu_item_new_with_mnemonic (_("6"));
+-  gtk_widget_show (mru6);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru6);
+-
+-  mru7 = gtk_menu_item_new_with_mnemonic (_("7"));
+-  gtk_widget_show (mru7);
+-  gtk_container_add (GTK_CONTAINER (fileRecentFiles_menu), mru7);
+-
++    
+   separator22 = gtk_separator_menu_item_new ();
+   gtk_widget_show (separator22);
+   gtk_container_add (GTK_CONTAINER (menuFile_menu), separator22);
+@@ -1967,28 +1927,7 @@
+   g_signal_connect ((gpointer) fileSaveAs, "activate",
+                     G_CALLBACK (on_fileSaveAs_activate),
+                     NULL);
+-  g_signal_connect ((gpointer) mru0, "activate",
+-                    G_CALLBACK (on_mru_activate),
+-                    NULL);
+-  g_signal_connect ((gpointer) mru1, "activate",
+-                    G_CALLBACK (on_mru_activate),
+-                    NULL);
+-  g_signal_connect ((gpointer) mru2, "activate",
+-                    G_CALLBACK (on_mru_activate),
+-                    NULL);
+-  g_signal_connect ((gpointer) mru3, "activate",
+-                    G_CALLBACK (on_mru_activate),
+-                    NULL);
+-  g_signal_connect ((gpointer) mru4, "activate",
+-                    G_CALLBACK (on_mru_activate),
+-                    NULL);
+-  g_signal_connect ((gpointer) mru5, "activate",
+-                    G_CALLBACK (on_mru_activate),
+-                    NULL);
+-  g_signal_connect ((gpointer) mru6, "activate",
+-                    G_CALLBACK (on_mru_activate),
+-                    NULL);
+-  g_signal_connect ((gpointer) mru7, "activate",
++  g_signal_connect ((gpointer) fileRecentFiles_menu, "item-activated",
+                     G_CALLBACK (on_mru_activate),
+                     NULL);
+   g_signal_connect ((gpointer) filePrintOptions, "activate",
+@@ -2520,14 +2459,6 @@
+   GLADE_HOOKUP_OBJECT (winMain, separator1, "separator1");
+   GLADE_HOOKUP_OBJECT (winMain, fileRecentFiles, "fileRecentFiles");
+   GLADE_HOOKUP_OBJECT (winMain, fileRecentFiles_menu, "fileRecentFiles_menu");
+-  GLADE_HOOKUP_OBJECT (winMain, mru0, "mru0");
+-  GLADE_HOOKUP_OBJECT (winMain, mru1, "mru1");
+-  GLADE_HOOKUP_OBJECT (winMain, mru2, "mru2");
+-  GLADE_HOOKUP_OBJECT (winMain, mru3, "mru3");
+-  GLADE_HOOKUP_OBJECT (winMain, mru4, "mru4");
+-  GLADE_HOOKUP_OBJECT (winMain, mru5, "mru5");
+-  GLADE_HOOKUP_OBJECT (winMain, mru6, "mru6");
+-  GLADE_HOOKUP_OBJECT (winMain, mru7, "mru7");
+   GLADE_HOOKUP_OBJECT (winMain, separator22, "separator22");
+   GLADE_HOOKUP_OBJECT (winMain, filePrintOptions, "filePrintOptions");
+   GLADE_HOOKUP_OBJECT (winMain, image624, "image624");
+
+=== modified file 'src/xournal.h'
+--- src/xournal.h      2011-03-10 18:14:21 +0000
++++ src/xournal.h      2011-03-27 16:32:52 +0000
+@@ -257,8 +257,6 @@
+   GdkCursor *cursor;
+   gboolean progressive_bg; // update PDF bg's one at a time
+   char *mrufile, *configfile; // file names for MRU & config
+-  char *mru[MRU_SIZE]; // MRU data
+-  GtkWidget *mrumenu[MRU_SIZE];
+   gboolean bg_apply_all_pages;
+   int window_default_width, window_default_height, scrollbar_step_increment;
+   gboolean print_ruling; // print the paper ruling ?
+
diff --git a/app-text/xournal/xournal-0.4.5_p20111022-r1.ebuild b/app-text/xournal/xournal-0.4.5_p20111022-r1.ebuild
new file mode 100644 (file)
index 0000000..116ae24
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/xournal/xournal-0.4.5_p20111022-r1.ebuild,v 1.1 2011/11/16 22:55:43 dilfridge Exp $
+
+EAPI=4
+inherit base gnome2 autotools
+
+DESCRIPTION="Xournal is an application for notetaking, sketching, and keeping a journal using a stylus."
+HOMEPAGE="http://xournal.sourceforge.net/"
+
+SRC_URI="http://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.xz http://dev.gentoo.org/~dilfridge/distfiles/${P}-sjg-image-rev7.patch.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pdf doc"
+
+COMMONDEPEND="
+       app-text/poppler[cairo]
+       dev-libs/atk
+       dev-libs/glib
+       gnome-base/libgnomecanvas
+       media-libs/freetype
+       media-libs/fontconfig
+       sys-libs/zlib
+       x11-libs/cairo
+       x11-libs/gdk-pixbuf
+       x11-libs/gtk+:2
+       x11-libs/pango
+"
+RDEPEND="${COMMONDEPEND}
+       pdf? ( app-text/poppler[utils] app-text/ghostscript-gpl )
+"
+DEPEND="${COMMONDEPEND}
+       dev-util/pkgconfig
+"
+
+PATCHES=(
+       "${DISTDIR}"/${P}-sjg-image-rev7.patch.gz
+       "${FILESDIR}"/${P}-gtk-recent.patch
+       "${FILESDIR}"/${P}-aspectratio.patch
+)
+
+src_prepare() {
+       base_src_prepare
+       eautoreconf
+}
+
+src_install() {
+       emake DESTDIR="${D}" install
+       emake DESTDIR="${D}" desktop-install
+
+       dodoc ChangeLog AUTHORS README
+       if use doc ; then
+               dohtml -r html-doc/*
+       fi
+}