[116253] trunk/dports/graphics/gimp2

devans at macports.org devans at macports.org
Wed Jan 22 18:44:34 PST 2014


Revision: 116253
          https://trac.macports.org/changeset/116253
Author:   devans at macports.org
Date:     2014-01-22 18:44:34 -0800 (Wed, 22 Jan 2014)
Log Message:
-----------
gimp2: apply latest upstream patches, increment revision.

Modified Paths:
--------------
    trunk/dports/graphics/gimp2/Portfile

Added Paths:
-----------
    trunk/dports/graphics/gimp2/files/patch-create-filechooserbutton-bz699978.diff
    trunk/dports/graphics/gimp2/files/patch-gimp-paint-options-set-default-brush-size.diff
    trunk/dports/graphics/gimp2/files/patch-remove-accelerator-markers-python-fu-tooltips.diff

Modified: trunk/dports/graphics/gimp2/Portfile
===================================================================
--- trunk/dports/graphics/gimp2/Portfile	2014-01-23 02:41:50 UTC (rev 116252)
+++ trunk/dports/graphics/gimp2/Portfile	2014-01-23 02:44:34 UTC (rev 116253)
@@ -8,7 +8,7 @@
 conflicts       gimp2-devel gimp3-devel
 # please remember to update the gimp metapackage to match
 version         2.8.10
-revision        4
+revision        5
 license         {GPL-2+ LGPL}
 categories      graphics
 maintainers     devans
@@ -99,6 +99,9 @@
                 patch-letter-spacing-in-text-tool-bz720492.diff \
                 patch-shadow-layer-for-drop-shadow-filter-bz721058.diff \
                 patch-gimpressionist-background-paper-not-aligned-bz720711.diff \
+                patch-gimp-paint-options-set-default-brush-size.diff \
+                patch-remove-accelerator-markers-python-fu-tooltips.diff \
+                patch-create-filechooserbutton-bz699978.diff \
                 patch-plug-ins-twain-tw_mac.c.diff
 
 # gcc-4.2 5493 and 5666.3_13: gimpcpuaccel.c:180: error: can't find a register in class 'BREG' while reloading 'asm'

Added: trunk/dports/graphics/gimp2/files/patch-create-filechooserbutton-bz699978.diff
===================================================================
--- trunk/dports/graphics/gimp2/files/patch-create-filechooserbutton-bz699978.diff	                        (rev 0)
+++ trunk/dports/graphics/gimp2/files/patch-create-filechooserbutton-bz699978.diff	2014-01-23 02:44:34 UTC (rev 116253)
@@ -0,0 +1,111 @@
+From 20523c61aca40ac1189c444e77ee73f6aa81bdbb Mon Sep 17 00:00:00 2001
+From: João S. O. Bueno <gwidion at gmail.com>
+Date: Thu, 09 Jan 2014 02:44:55 +0000
+Subject: Creates a FileChooserbutton that can pick new filenames. Fixes #699978
+
+---
+diff --git a/plug-ins/pygimp/gimpfu.py b/plug-ins/pygimp/gimpfu.py
+index 5c7304d..8bd79fd 100644
+--- plug-ins/pygimp/gimpfu.py
++++ plug-ins/pygimp/gimpfu.py
+@@ -581,25 +581,61 @@ def _interact(proc_name, start_params):
+         def get_value(self):
+             return self.get_active()
+ 
+-    def FileSelector(default=""):
++    def FileSelector(default="", title=None):
+         # FIXME: should this be os.path.separator?  If not, perhaps explain why?
+         if default and default.endswith("/"):
+-            selector = DirnameSelector
+             if default == "/": default = ""
++            return DirnameSelector(default)
+         else:
+-            selector = FilenameSelector
+-        return selector(default)
+-
+-    class FilenameSelector(gtk.FileChooserButton):
+-        def __init__(self, default="", save_mode=False):
+-            gtk.FileChooserButton.__init__(self,
+-                                           _("Python-Fu File Selection"))
+-            self.set_action(gtk.FILE_CHOOSER_ACTION_OPEN)
++            return FilenameSelector(default, title=title)
++
++    class FilenameSelector(gtk.HBox):
++        #gimpfu.FileChooserButton
++        def __init__(self, default, save_mode=True, title=None):
++            super(FilenameSelector, self).__init__()
++            if not title:
++                self.title = _("Python-Fu File Selection")
++            else:
++                self.title = title
++            self.save_mode = save_mode
++            box = self
++            self.entry = gtk.Entry()
++            image = gtk.Image()
++            image.set_from_stock(gtk.STOCK_FILE, gtk.ICON_SIZE_BUTTON)
++            self.button = gtk.Button()
++            self.button.set_image(image)
++            box.pack_start(self.entry)
++            box.pack_start(self.button)
++            self.button.connect("clicked", self.pick_file)
+             if default:
+-                self.set_filename(default)
++                self.entry.set_text(default)
++
++        def show(self):
++            super(FilenameSelector, self).show()
++            self.button.show()
++            self.entry.show()
++
++        def pick_file(self, widget):
++            entry = self.entry
++            dialog = gtk.FileChooserDialog(
++                         title=self.title,
++                         action=(gtk.FILE_CHOOSER_ACTION_SAVE
++                                     if self.save_mode else
++                                 gtk.FILE_CHOOSER_ACTION_OPEN),
++                         buttons=(gtk.STOCK_CANCEL,
++                                gtk.RESPONSE_CANCEL,
++                                gtk.STOCK_OPEN,
++                                gtk.RESPONSE_OK)
++                        )
++            dialog.show_all()
++            response = dialog.run()
++            if response == gtk.RESPONSE_OK:
++                entry.set_text(dialog.get_filename())
++            dialog.destroy()
+ 
+         def get_value(self):
+-            return self.get_filename()
++            return self.entry.get_text()
++
+ 
+     class DirnameSelector(gtk.FileChooserButton):
+         def __init__(self, default=""):
+@@ -719,17 +755,22 @@ def _interact(proc_name, start_params):
+         table.attach(label, 1, 2, i, i+1, xoptions=gtk.FILL)
+         label.show()
+ 
++        # Remove accelerator markers from tooltips
++        tooltip_text = desc.replace("_", "")
++
+         if pf_type in (PF_SPINNER, PF_SLIDER, PF_RADIO, PF_OPTION):
+             wid = _edit_mapping[pf_type](def_val, params[i][4])
++        elif pf_type in (PF_FILE, PF_FILENAME):
++            wid = _edit_mapping[pf_type](def_val, title= "%s - %s" %
++                                          (proc_name, tooltip_text))
+         else:
+             wid = _edit_mapping[pf_type](def_val)
+ 
++
+         label.set_mnemonic_widget(wid)
+ 
+         table.attach(wid, 2,3, i,i+1, yoptions=0)
+ 
+-        # Remove accelerator markers from tooltips
+-        tooltip_text = desc.replace("_", "")
+         if pf_type != PF_TEXT:
+             wid.set_tooltip_text(tooltip_text)
+         else:
+--
+cgit v0.9.2

Added: trunk/dports/graphics/gimp2/files/patch-gimp-paint-options-set-default-brush-size.diff
===================================================================
--- trunk/dports/graphics/gimp2/files/patch-gimp-paint-options-set-default-brush-size.diff	                        (rev 0)
+++ trunk/dports/graphics/gimp2/files/patch-gimp-paint-options-set-default-brush-size.diff	2014-01-23 02:44:34 UTC (rev 116253)
@@ -0,0 +1,273 @@
+From b4477d8e01e4b03121a9b834d35b69d0d8374638 Mon Sep 17 00:00:00 2001
+From: Michael Natterer <mitch at gimp.org>
+Date: Sat, 04 Jan 2014 14:45:25 +0000
+Subject: app: add gimp_paint_options_set_default_brush_size()
+
+and use it globally instead of two different methods, one of which was
+forgotten to be ported to the new aspect ratio range where 0.0 means
+1:1. Add a FIXME comment in paint_tools.pdb where I think setting the
+default size is a bug, see #721249.
+
+(cherry picked from commit ef858453724f6d4ca105fc9daec038fdff358f30)
+---
+diff --git a/app/core/gimpstrokeoptions.c b/app/core/gimpstrokeoptions.c
+index 832e99a..9505398 100644
+--- app/core/gimpstrokeoptions.c
++++ app/core/gimpstrokeoptions.c
+@@ -31,7 +31,6 @@
+ #include "config/gimpcoreconfig.h"
+ 
+ #include "gimp.h"
+-#include "gimpbrush.h"
+ #include "gimpcontext.h"
+ #include "gimpdashpattern.h"
+ #include "gimpmarshal.h"
+@@ -566,24 +565,10 @@ gimp_stroke_options_prepare (GimpStrokeOptions *options,
+ 
+         if (use_default_values)
+           {
+-            GimpBrush *brush;
+-            gdouble    brush_size;
+-            gint       height;
+-            gint       width;
+-
+             paint_options = gimp_paint_options_new (paint_info);
+ 
+-            brush = gimp_context_get_brush (context);
+-
+-            if (GIMP_IS_BRUSH (brush))
+-              {
+-                gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
+-                brush_size = MAX (height, width);
+-
+-                g_object_set (paint_options,
+-                              "brush-size", brush_size,
+-                              NULL);
+-              }
++            gimp_paint_options_set_default_brush_size (paint_options,
++                                                       gimp_context_get_brush (context));
+ 
+             /*  undefine the paint-relevant context properties and get them
+              *  from the passed context
+diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c
+index 10430a2..a624f2d 100644
+--- app/paint/gimppaintoptions.c
++++ app/paint/gimppaintoptions.c
+@@ -26,6 +26,7 @@
+ #include "paint-types.h"
+ 
+ #include "core/gimp.h"
++#include "core/gimpbrush.h"
+ #include "core/gimpimage.h"
+ #include "core/gimpdynamics.h"
+ #include "core/gimpdynamicsoutput.h"
+@@ -715,6 +716,29 @@ gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options)
+ }
+ 
+ void
++gimp_paint_options_set_default_brush_size (GimpPaintOptions *paint_options,
++                                           GimpBrush        *brush)
++{
++  g_return_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options));
++  g_return_if_fail (brush == NULL || GIMP_IS_BRUSH (brush));
++
++  if (! brush)
++    brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
++
++  if (brush)
++    {
++      gint height;
++      gint width;
++
++      gimp_brush_transform_size (brush, 1.0, 0.0, 0.0, &height, &width);
++
++      g_object_set (paint_options,
++                    "brush-size", (gdouble) MAX (height, width),
++                    NULL);
++    }
++}
++
++void
+ gimp_paint_options_copy_brush_props (GimpPaintOptions *src,
+                                      GimpPaintOptions *dest)
+ {
+diff --git a/app/paint/gimppaintoptions.h b/app/paint/gimppaintoptions.h
+index 70c4e40..a5a84c9 100644
+--- app/paint/gimppaintoptions.h
++++ app/paint/gimppaintoptions.h
+@@ -132,6 +132,9 @@ gboolean gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,
+ GimpBrushApplicationMode
+              gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options);
+ 
++void gimp_paint_options_set_default_brush_size (GimpPaintOptions *paint_options,
++                                                GimpBrush        *brush);
++
+ void    gimp_paint_options_copy_brush_props    (GimpPaintOptions *src,
+                                                 GimpPaintOptions *dest);
+ void    gimp_paint_options_copy_dynamics_props (GimpPaintOptions *src,
+diff --git a/app/pdb/context-cmds.c b/app/pdb/context-cmds.c
+index bf4ab08..ac2fc64 100644
+--- app/pdb/context-cmds.c
++++ app/pdb/context-cmds.c
+@@ -28,12 +28,11 @@
+ 
+ #include "pdb-types.h"
+ 
+-#include "base/temp-buf.h"
+ #include "core/gimp.h"
+-#include "core/gimpbrush.h"
+ #include "core/gimpcontainer.h"
+ #include "core/gimpdatafactory.h"
+ #include "core/gimpparamspecs.h"
++#include "paint/gimppaintoptions.h"
+ #include "plug-in/gimpplugin-context.h"
+ #include "plug-in/gimpplugin.h"
+ #include "plug-in/gimppluginmanager.h"
+@@ -509,10 +508,7 @@ context_set_brush_default_size_invoker (GimpProcedure      *procedure,
+       options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+ 
+       for (list = options; list; list = g_list_next (list))
+-        g_object_set (list->data,
+-                      "brush-size", (gdouble) MAX (brush->mask->width,
+-                                                   brush->mask->height),
+-                      NULL);
++        gimp_paint_options_set_default_brush_size (list->data, brush);
+ 
+       g_list_free (options);
+     }
+diff --git a/app/pdb/paint-tools-cmds.c b/app/pdb/paint-tools-cmds.c
+index 99faf15..d1d6de3 100644
+--- app/pdb/paint-tools-cmds.c
++++ app/pdb/paint-tools-cmds.c
+@@ -26,7 +26,6 @@
+ 
+ #include "pdb-types.h"
+ 
+-#include "core/gimpbrush.h"
+ #include "core/gimpdrawable.h"
+ #include "core/gimpdynamics.h"
+ #include "core/gimppaintinfo.h"
+@@ -57,22 +56,15 @@ paint_tools_stroke (Gimp              *gimp,
+ {
+   GimpPaintCore *core;
+   GimpCoords    *coords;
+-  GimpBrush     *brush;
+   gboolean       retval;
+-  gdouble        brush_size;
+-  gint           height, width;
+   gint           i;
+   va_list        args;
+ 
+   n_strokes /= 2;  /* #doubles -> #points */
+ 
+-  brush = gimp_context_get_brush (context);
+-  gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
+-  brush_size = MAX (height, width);
+-
+-  g_object_set (options,
+-                "brush-size", brush_size,
+-                NULL);
++  /* FIXME: i'm most certain that this is wrong, see bug 721249 --mitch */
++  gimp_paint_options_set_default_brush_size (options,
++                                             gimp_context_get_brush (context));
+ 
+   /*  undefine the paint-relevant context properties and get them
+    *  from the current context
+diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c
+index 9ba8f74..11ca180 100644
+--- app/tools/gimppaintoptions-gui.c
++++ app/tools/gimppaintoptions-gui.c
+@@ -23,9 +23,6 @@
+ 
+ #include "tools-types.h"
+ 
+-#include "base/temp-buf.h"
+-
+-#include "core/gimpbrush.h"
+ #include "core/gimptoolinfo.h"
+ 
+ #include "paint/gimppaintoptions.h"
+@@ -411,12 +408,7 @@ gimp_paint_options_gui_reset_size (GtkWidget        *button,
+  GimpBrush *brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
+ 
+  if (brush)
+-   {
+-     g_object_set (paint_options,
+-                   "brush-size", (gdouble) MAX (brush->mask->width,
+-                                                brush->mask->height),
+-                   NULL);
+-   }
++   gimp_paint_options_set_default_brush_size (paint_options, brush);
+ }
+ 
+ static void
+diff --git a/tools/pdbgen/pdb/context.pdb b/tools/pdbgen/pdb/context.pdb
+index 8e1447e..3dfbe4b 100644
+--- tools/pdbgen/pdb/context.pdb
++++ tools/pdbgen/pdb/context.pdb
+@@ -569,10 +569,7 @@ HELP
+       options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
+ 
+       for (list = options; list; list = g_list_next (list))
+-        g_object_set (list->data,
+-                      "brush-size", (gdouble) MAX (brush->mask->width,
+-                                                   brush->mask->height),
+-                      NULL);
++        gimp_paint_options_set_default_brush_size (list->data, brush);
+ 
+       g_list_free (options);
+     }
+@@ -2195,11 +2192,10 @@ CODE
+     );
+ }
+ 
+- at headers = qw("base/temp-buf.h"
+-              "core/gimp.h"
+-              "core/gimpbrush.h"
++ at headers = qw("core/gimp.h"
+               "core/gimpcontainer.h"
+               "core/gimpdatafactory.h"
++              "paint/gimppaintoptions.h"
+               "libgimpconfig/gimpconfig.h"
+               "plug-in/gimpplugin.h"
+               "plug-in/gimpplugin-context.h"
+diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb
+index f82c140..8544a56 100644
+--- tools/pdbgen/pdb/paint_tools.pdb
++++ tools/pdbgen/pdb/paint_tools.pdb
+@@ -981,22 +981,15 @@ paint_tools_stroke (Gimp              *gimp,
+ {
+   GimpPaintCore *core;
+   GimpCoords    *coords;
+-  GimpBrush     *brush;
+   gboolean       retval;
+-  gdouble        brush_size;
+-  gint           height, width;
+   gint           i;
+   va_list        args;
+ 
+   n_strokes /= 2;  /* #doubles -> #points */
+ 
+-  brush = gimp_context_get_brush (context);
+-  gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
+-  brush_size = MAX (height, width);
+-
+-  g_object_set (options,
+-                "brush-size", brush_size,
+-                NULL);
++  /* FIXME: i'm most certain that this is wrong, see bug 721249 --mitch */
++  gimp_paint_options_set_default_brush_size (options,
++                                             gimp_context_get_brush (context));
+ 
+   /*  undefine the paint-relevant context properties and get them
+    *  from the current context
+@@ -1036,7 +1029,6 @@ CODE
+ 
+ @headers = qw("libgimpmath/gimpmath.h"
+               "libgimpconfig/gimpconfig.h"
+-              "core/gimpbrush.h"
+               "core/gimpdynamics.h"
+               "core/gimppaintinfo.h"
+               "paint/gimppaintcore.h"
+--
+cgit v0.9.2

Added: trunk/dports/graphics/gimp2/files/patch-remove-accelerator-markers-python-fu-tooltips.diff
===================================================================
--- trunk/dports/graphics/gimp2/files/patch-remove-accelerator-markers-python-fu-tooltips.diff	                        (rev 0)
+++ trunk/dports/graphics/gimp2/files/patch-remove-accelerator-markers-python-fu-tooltips.diff	2014-01-23 02:44:34 UTC (rev 116253)
@@ -0,0 +1,28 @@
+From e3a65f2ff5df4c7dd6b48b6e68989f4776e1a90e Mon Sep 17 00:00:00 2001
+From: João S. O. Bueno <gwidion at gmail.com>
+Date: Sun, 05 Jan 2014 06:40:04 +0000
+Subject: Remove accelerator markers from tooltips for python-fu dialogs
+
+---
+diff --git a/plug-ins/pygimp/gimpfu.py b/plug-ins/pygimp/gimpfu.py
+index ba833c2..5c7304d 100644
+--- plug-ins/pygimp/gimpfu.py
++++ plug-ins/pygimp/gimpfu.py
+@@ -728,11 +728,13 @@ def _interact(proc_name, start_params):
+ 
+         table.attach(wid, 2,3, i,i+1, yoptions=0)
+ 
++        # Remove accelerator markers from tooltips
++        tooltip_text = desc.replace("_", "")
+         if pf_type != PF_TEXT:
+-            wid.set_tooltip_text(desc)
++            wid.set_tooltip_text(tooltip_text)
+         else:
+             # Attach tip to TextView, not to ScrolledWindow
+-            wid.view.set_tooltip_text(desc)
++            wid.view.set_tooltip_text(tooltip_text)
+         wid.show()
+ 
+         wid.desc = desc
+--
+cgit v0.9.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140122/fc145c0f/attachment-0001.html>


More information about the macports-changes mailing list