[gimp] pdb: update autogenerated files.



commit 8839cb58bb86adf756929a55146163b6fbf7983f
Author: Simon Budig <simon budig de>
Date:   Mon May 25 22:55:01 2020 +0200

    pdb: update autogenerated files.

 app/pdb/internal-procs.c  |  2 +-
 app/pdb/vectors-cmds.c    | 68 +++++++++++++++++++++++++++++++++++++++++++++++
 libgimp/gimpvectors_pdb.c | 38 ++++++++++++++++++++++++++
 libgimp/gimpvectors_pdb.h |  2 ++
 4 files changed, 109 insertions(+), 1 deletion(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 62670ef47d..123a42eeae 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 752 procedures registered total */
+/* 753 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
diff --git a/app/pdb/vectors-cmds.c b/app/pdb/vectors-cmds.c
index 87351b6012..2b01b78f4d 100644
--- a/app/pdb/vectors-cmds.c
+++ b/app/pdb/vectors-cmds.c
@@ -377,6 +377,45 @@ vectors_stroke_close_invoker (GimpProcedure         *procedure,
                                            error ? *error : NULL);
 }
 
+static GimpValueArray *
+vectors_stroke_reverse_invoker (GimpProcedure         *procedure,
+                                Gimp                  *gimp,
+                                GimpContext           *context,
+                                GimpProgress          *progress,
+                                const GimpValueArray  *args,
+                                GError               **error)
+{
+  gboolean success = TRUE;
+  GimpVectors *vectors;
+  gint stroke_id;
+
+  vectors = g_value_get_object (gimp_value_array_index (args, 0));
+  stroke_id = g_value_get_int (gimp_value_array_index (args, 1));
+
+  if (success)
+    {
+      GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id,
+                                                        GIMP_PDB_ITEM_CONTENT, error);
+
+      if (stroke)
+        {
+          if (gimp_item_is_attached (GIMP_ITEM (vectors)))
+            gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)),
+                                              _("Reverse path stroke"),
+                                              vectors);
+
+          gimp_vectors_freeze (vectors);
+          gimp_stroke_reverse (stroke);
+          gimp_vectors_thaw (vectors);
+        }
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
 static GimpValueArray *
 vectors_stroke_translate_invoker (GimpProcedure         *procedure,
                                   Gimp                  *gimp,
@@ -1595,6 +1634,35 @@ register_vectors_procs (GimpPDB *pdb)
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
+  /*
+   * gimp-vectors-stroke-reverse
+   */
+  procedure = gimp_procedure_new (vectors_stroke_reverse_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-vectors-stroke-reverse");
+  gimp_procedure_set_static_help (procedure,
+                                  "reverses the specified stroke.",
+                                  "Reverses the specified stroke.",
+                                  NULL);
+  gimp_procedure_set_static_attribution (procedure,
+                                         "Simon Budig",
+                                         "Simon Budig",
+                                         "2020");
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_vectors ("vectors",
+                                                        "vectors",
+                                                        "The vectors object",
+                                                        FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_int ("stroke-id",
+                                                 "stroke id",
+                                                 "The stroke ID",
+                                                 G_MININT32, G_MAXINT32, 0,
+                                                 GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
   /*
    * gimp-vectors-stroke-translate
    */
diff --git a/libgimp/gimpvectors_pdb.c b/libgimp/gimpvectors_pdb.c
index 64e2124244..95b9abc629 100644
--- a/libgimp/gimpvectors_pdb.c
+++ b/libgimp/gimpvectors_pdb.c
@@ -386,6 +386,44 @@ gimp_vectors_stroke_close (GimpVectors *vectors,
   return success;
 }
 
+/**
+ * gimp_vectors_stroke_reverse:
+ * @vectors: The vectors object.
+ * @stroke_id: The stroke ID.
+ *
+ * reverses the specified stroke.
+ *
+ * Reverses the specified stroke.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gimp_vectors_stroke_reverse (GimpVectors *vectors,
+                             gint         stroke_id)
+{
+  GimpValueArray *args;
+  GimpValueArray *return_vals;
+  gboolean success = TRUE;
+
+  args = gimp_value_array_new_from_types (NULL,
+                                          GIMP_TYPE_VECTORS, vectors,
+                                          G_TYPE_INT, stroke_id,
+                                          G_TYPE_NONE);
+
+  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
+                                              "gimp-vectors-stroke-reverse",
+                                              args);
+  gimp_value_array_unref (args);
+
+  success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
+
+  gimp_value_array_unref (return_vals);
+
+  return success;
+}
+
 /**
  * gimp_vectors_stroke_translate:
  * @vectors: The vectors object.
diff --git a/libgimp/gimpvectors_pdb.h b/libgimp/gimpvectors_pdb.h
index 8665f8a8f4..a8424e95f0 100644
--- a/libgimp/gimpvectors_pdb.h
+++ b/libgimp/gimpvectors_pdb.h
@@ -54,6 +54,8 @@ gboolean              gimp_vectors_remove_stroke             (GimpVectors
                                                               gint                     stroke_id);
 gboolean              gimp_vectors_stroke_close              (GimpVectors             *vectors,
                                                               gint                     stroke_id);
+gboolean              gimp_vectors_stroke_reverse            (GimpVectors             *vectors,
+                                                              gint                     stroke_id);
 gboolean              gimp_vectors_stroke_translate          (GimpVectors             *vectors,
                                                               gint                     stroke_id,
                                                               gint                     off_x,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]