[gimp] Bug 795230 - Rename Blend tool and provide PDB compatibility
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 795230 - Rename Blend tool and provide PDB compatibility
- Date: Fri, 13 Apr 2018 21:36:52 +0000 (UTC)
commit b55c116755864570bc0597dbb877c40c821949b3
Author: Michael Natterer <mitch gimp org>
Date: Fri Apr 13 23:36:16 2018 +0200
Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename GimpOperationBlend to GimpOperationGradient.
app/core/gimpdrawable-blend.c | 2 +-
app/operations/Makefile.am | 4 +-
app/operations/gimp-operations.c | 4 +-
...impoperationblend.c => gimpoperationgradient.c} | 106 ++++++++++----------
...impoperationblend.h => gimpoperationgradient.h} | 30 +++---
app/tools/gimpblendtool.c | 2 +-
6 files changed, 73 insertions(+), 75 deletions(-)
---
diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c
index 76311e3..3c012e4 100644
--- a/app/core/gimpdrawable-blend.c
+++ b/app/core/gimpdrawable-blend.c
@@ -93,7 +93,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
}
render = gegl_node_new_child (NULL,
- "operation", "gimp:blend",
+ "operation", "gimp:gradient",
"context", context,
"gradient", gradient,
"start-x", startx,
diff --git a/app/operations/Makefile.am b/app/operations/Makefile.am
index 7fe28c1..de9a042 100644
--- a/app/operations/Makefile.am
+++ b/app/operations/Makefile.am
@@ -40,8 +40,6 @@ libappoperations_a_sources = \
gimplevelsconfig.c \
gimplevelsconfig.h \
\
- gimpoperationblend.c \
- gimpoperationblend.h \
gimpoperationborder.c \
gimpoperationborder.h \
gimpoperationbuffersourcevalidate.c \
@@ -56,6 +54,8 @@ libappoperations_a_sources = \
gimpoperationequalize.h \
gimpoperationflood.c \
gimpoperationflood.h \
+ gimpoperationgradient.c \
+ gimpoperationgradient.h \
gimpoperationgrow.c \
gimpoperationgrow.h \
gimpoperationhistogramsink.c \
diff --git a/app/operations/gimp-operations.c b/app/operations/gimp-operations.c
index 4c651f4..a432abf 100644
--- a/app/operations/gimp-operations.c
+++ b/app/operations/gimp-operations.c
@@ -30,7 +30,6 @@
#include "gimp-operations.h"
-#include "gimpoperationblend.h"
#include "gimpoperationborder.h"
#include "gimpoperationbuffersourcevalidate.h"
#include "gimpoperationcagecoefcalc.h"
@@ -38,6 +37,7 @@
#include "gimpoperationcomposecrop.h"
#include "gimpoperationequalize.h"
#include "gimpoperationflood.h"
+#include "gimpoperationgradient.h"
#include "gimpoperationgrow.h"
#include "gimpoperationhistogramsink.h"
#include "gimpoperationmaskcomponents.h"
@@ -123,7 +123,6 @@ gimp_operations_init (Gimp *gimp)
gimp_layer_modes_init ();
- g_type_class_ref (GIMP_TYPE_OPERATION_BLEND);
g_type_class_ref (GIMP_TYPE_OPERATION_BORDER);
g_type_class_ref (GIMP_TYPE_OPERATION_BUFFER_SOURCE_VALIDATE);
g_type_class_ref (GIMP_TYPE_OPERATION_CAGE_COEF_CALC);
@@ -131,6 +130,7 @@ gimp_operations_init (Gimp *gimp)
g_type_class_ref (GIMP_TYPE_OPERATION_COMPOSE_CROP);
g_type_class_ref (GIMP_TYPE_OPERATION_EQUALIZE);
g_type_class_ref (GIMP_TYPE_OPERATION_FLOOD);
+ g_type_class_ref (GIMP_TYPE_OPERATION_GRADIENT);
g_type_class_ref (GIMP_TYPE_OPERATION_GROW);
g_type_class_ref (GIMP_TYPE_OPERATION_HISTOGRAM_SINK);
g_type_class_ref (GIMP_TYPE_OPERATION_MASK_COMPONENTS);
diff --git a/app/operations/gimpoperationblend.c b/app/operations/gimpoperationgradient.c
similarity index 91%
rename from app/operations/gimpoperationblend.c
rename to app/operations/gimpoperationgradient.c
index 8c43679..8382285 100644
--- a/app/operations/gimpoperationblend.c
+++ b/app/operations/gimpoperationgradient.c
@@ -1,9 +1,9 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
- * Largely based on gimpdrawable-blend.c
+ * Largely based on gimpdrawable-gradient.c
*
- * gimpoperationblend.c
+ * gimpoperationgradient.c
* Copyright (C) 2014 Michael Henning <drawoc darkrefraction com>
*
* This program is free software: you can redistribute it and/or modify
@@ -33,9 +33,7 @@
#include "core/gimpgradient.h"
-#include "gimpoperationblend.h"
-
-#include "gimp-intl.h"
+#include "gimpoperationgradient.h"
//#define USE_GRADIENT_CACHE 1
@@ -96,19 +94,19 @@ typedef struct
/* local function prototypes */
-static void gimp_operation_blend_dispose (GObject *gobject);
-static void gimp_operation_blend_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_blend_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
+static void gimp_operation_gradient_dispose (GObject *gobject);
+static void gimp_operation_gradient_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void gimp_operation_gradient_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
-static void gimp_operation_blend_prepare (GeglOperation *operation);
+static void gimp_operation_gradient_prepare (GeglOperation *operation);
-static GeglRectangle gimp_operation_blend_get_bounding_box (GeglOperation *operation);
+static GeglRectangle gimp_operation_gradient_get_bounding_box (GeglOperation *operation);
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
gdouble *axis,
@@ -165,39 +163,39 @@ static void gradient_put_pixel (gint x,
GimpRGB *color,
gpointer put_pixel_data);
-static gboolean gimp_operation_blend_process (GeglOperation *operation,
- GeglBuffer *input,
- GeglBuffer *output,
- const GeglRectangle *result,
- gint level);
+static gboolean gimp_operation_gradient_process (GeglOperation *operation,
+ GeglBuffer *input,
+ GeglBuffer *output,
+ const GeglRectangle *result,
+ gint level);
-G_DEFINE_TYPE (GimpOperationBlend, gimp_operation_blend,
+G_DEFINE_TYPE (GimpOperationGradient, gimp_operation_gradient,
GEGL_TYPE_OPERATION_FILTER)
-#define parent_class gimp_operation_blend_parent_class
+#define parent_class gimp_operation_gradient_parent_class
static void
-gimp_operation_blend_class_init (GimpOperationBlendClass *klass)
+gimp_operation_gradient_class_init (GimpOperationGradientClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationFilterClass *filter_class = GEGL_OPERATION_FILTER_CLASS (klass);
- object_class->dispose = gimp_operation_blend_dispose;
- object_class->set_property = gimp_operation_blend_set_property;
- object_class->get_property = gimp_operation_blend_get_property;
+ object_class->dispose = gimp_operation_gradient_dispose;
+ object_class->set_property = gimp_operation_gradient_set_property;
+ object_class->get_property = gimp_operation_gradient_get_property;
- operation_class->prepare = gimp_operation_blend_prepare;
- operation_class->get_bounding_box = gimp_operation_blend_get_bounding_box;
+ operation_class->prepare = gimp_operation_gradient_prepare;
+ operation_class->get_bounding_box = gimp_operation_gradient_get_bounding_box;
- filter_class->process = gimp_operation_blend_process;
+ filter_class->process = gimp_operation_gradient_process;
gegl_operation_class_set_keys (operation_class,
- "name", "gimp:blend",
+ "name", "gimp:gradient",
"categories", "gimp",
- "description", "GIMP Blend operation",
+ "description", "GIMP Gradient operation",
NULL);
g_object_class_install_property (object_class, PROP_CONTEXT,
@@ -326,14 +324,14 @@ gimp_operation_blend_class_init (GimpOperationBlendClass *klass)
}
static void
-gimp_operation_blend_init (GimpOperationBlend *self)
+gimp_operation_gradient_init (GimpOperationGradient *self)
{
}
static void
-gimp_operation_blend_dispose (GObject *object)
+gimp_operation_gradient_dispose (GObject *object)
{
- GimpOperationBlend *self = GIMP_OPERATION_BLEND (object);
+ GimpOperationGradient *self = GIMP_OPERATION_GRADIENT (object);
g_clear_object (&self->gradient);
g_clear_object (&self->context);
@@ -342,12 +340,12 @@ gimp_operation_blend_dispose (GObject *object)
}
static void
-gimp_operation_blend_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
+gimp_operation_gradient_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- GimpOperationBlend *self = GIMP_OPERATION_BLEND (object);
+ GimpOperationGradient *self = GIMP_OPERATION_GRADIENT (object);
switch (property_id)
{
@@ -418,12 +416,12 @@ gimp_operation_blend_get_property (GObject *object,
}
static void
-gimp_operation_blend_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
+gimp_operation_gradient_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- GimpOperationBlend *self = GIMP_OPERATION_BLEND (object);
+ GimpOperationGradient *self = GIMP_OPERATION_GRADIENT (object);
switch (property_id)
{
@@ -509,13 +507,13 @@ gimp_operation_blend_set_property (GObject *object,
}
static void
-gimp_operation_blend_prepare (GeglOperation *operation)
+gimp_operation_gradient_prepare (GeglOperation *operation)
{
gegl_operation_set_format (operation, "output", babl_format ("R'G'B'A float"));
}
static GeglRectangle
-gimp_operation_blend_get_bounding_box (GeglOperation *operation)
+gimp_operation_gradient_get_bounding_box (GeglOperation *operation)
{
return gegl_rectangle_infinite_plane ();
}
@@ -995,13 +993,13 @@ gradient_put_pixel (gint x,
}
static gboolean
-gimp_operation_blend_process (GeglOperation *operation,
- GeglBuffer *input,
- GeglBuffer *output,
- const GeglRectangle *result,
- gint level)
+gimp_operation_gradient_process (GeglOperation *operation,
+ GeglBuffer *input,
+ GeglBuffer *output,
+ const GeglRectangle *result,
+ gint level)
{
- GimpOperationBlend *self = GIMP_OPERATION_BLEND (operation);
+ GimpOperationGradient *self = GIMP_OPERATION_GRADIENT (operation);
const gdouble sx = self->start_x;
const gdouble sy = self->start_y;
@@ -1017,7 +1015,7 @@ gimp_operation_blend_process (GeglOperation *operation,
if (self->gradient)
rbd.gradient = g_object_ref (self->gradient);
else
- rbd.gradient = GIMP_GRADIENT (gimp_gradient_new (NULL, "Blend-Temp"));
+ rbd.gradient = GIMP_GRADIENT (gimp_gradient_new (NULL, "Gradient-Temp"));
#ifdef USE_GRADIENT_CACHE
{
diff --git a/app/operations/gimpoperationblend.h b/app/operations/gimpoperationgradient.h
similarity index 57%
rename from app/operations/gimpoperationblend.h
rename to app/operations/gimpoperationgradient.h
index 763ff93..b63686a 100644
--- a/app/operations/gimpoperationblend.h
+++ b/app/operations/gimpoperationgradient.h
@@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
- * gimpoperationblend.h
+ * gimpoperationgradient.h
* Copyright (C) 2014 Michael Henning <drawoc darkrefraction com>
*
* This program is free software: you can redistribute it and/or modify
@@ -18,25 +18,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __GIMP_OPERATION_BLEND_H__
-#define __GIMP_OPERATION_BLEND_H__
+#ifndef __GIMP_OPERATION_GRADIENT_H__
+#define __GIMP_OPERATION_GRADIENT_H__
#include <gegl-plugin.h>
-#define GIMP_TYPE_OPERATION_BLEND (gimp_operation_blend_get_type ())
-#define GIMP_OPERATION_BLEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_BLEND,
GimpOperationBlend))
-#define GIMP_OPERATION_BLEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_BLEND,
GimpOperationBlendClass))
-#define GIMP_IS_OPERATION_BLEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_BLEND))
-#define GIMP_IS_OPERATION_BLEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_BLEND))
-#define GIMP_OPERATION_BLEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_BLEND,
GimpOperationBlendClass))
+#define GIMP_TYPE_OPERATION_GRADIENT (gimp_operation_gradient_get_type ())
+#define GIMP_OPERATION_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
GIMP_TYPE_OPERATION_GRADIENT, GimpOperationGradient))
+#define GIMP_OPERATION_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
GIMP_TYPE_OPERATION_GRADIENT, GimpOperationGradientClass))
+#define GIMP_IS_OPERATION_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GIMP_TYPE_OPERATION_GRADIENT))
+#define GIMP_IS_OPERATION_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
GIMP_TYPE_OPERATION_GRADIENT))
+#define GIMP_OPERATION_GRADIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GIMP_TYPE_OPERATION_GRADIENT, GimpOperationGradientClass))
-typedef struct _GimpOperationBlend GimpOperationBlend;
-typedef struct _GimpOperationBlendClass GimpOperationBlendClass;
+typedef struct _GimpOperationGradient GimpOperationGradient;
+typedef struct _GimpOperationGradientClass GimpOperationGradientClass;
-struct _GimpOperationBlend
+struct _GimpOperationGradient
{
GeglOperationFilter parent_instance;
@@ -57,13 +57,13 @@ struct _GimpOperationBlend
gboolean dither;
};
-struct _GimpOperationBlendClass
+struct _GimpOperationGradientClass
{
GeglOperationFilterClass parent_class;
};
-GType gimp_operation_blend_get_type (void) G_GNUC_CONST;
+GType gimp_operation_gradient_get_type (void) G_GNUC_CONST;
-#endif /* __GIMP_OPERATION_BLEND_H__ */
+#endif /* __GIMP_OPERATION_GRADIENT_H__ */
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 69e01f3..851d8eb 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -850,7 +850,7 @@ gimp_blend_tool_create_graph (GimpBlendTool *blend_tool)
blend_tool->render_node =
gegl_node_new_child (blend_tool->graph,
- "operation", "gimp:blend",
+ "operation", "gimp:gradient",
"context", context,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]