[gimp] app: avoid GIMP_TYPE_INT32 with gimp_pdb_execute_procedure_by_name()



commit 0f8747f10a21b276b9727bda5e1933269847e28b
Author: Michael Natterer <mitch gimp org>
Date:   Sun Aug 4 14:10:42 2019 +0200

    app: avoid GIMP_TYPE_INT32 with gimp_pdb_execute_procedure_by_name()
    
    Instead, use the actual enum type, G_TYPE_BOOLEAN, and G_TYPE_INT for
    plain integers.

 app/core/gimppdbprogress.c       |  6 +++---
 app/errors.c                     |  2 +-
 app/file/file-open.c             |  4 ++--
 app/widgets/gimpbrushselect.c    | 10 +++++-----
 app/widgets/gimpfontselect.c     |  4 ++--
 app/widgets/gimpgradientselect.c |  2 +-
 app/widgets/gimppaletteselect.c  |  6 +++---
 app/widgets/gimppatternselect.c  |  8 ++++----
 8 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/app/core/gimppdbprogress.c b/app/core/gimppdbprogress.c
index 85147e8494..7ac6b42be6 100644
--- a/app/core/gimppdbprogress.c
+++ b/app/core/gimppdbprogress.c
@@ -256,9 +256,9 @@ gimp_pdb_progress_run_callback (GimpPdbProgress     *progress,
                                             progress->context,
                                             NULL, NULL,
                                             progress->callback_name,
-                                            GIMP_TYPE_INT32, command,
-                                            G_TYPE_STRING,   text,
-                                            G_TYPE_DOUBLE,   value,
+                                            GIMP_TYPE_PROGRESS_COMMAND, command,
+                                            G_TYPE_STRING,              text,
+                                            G_TYPE_DOUBLE,              value,
                                             G_TYPE_NONE);
 
       if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) !=
diff --git a/app/errors.c b/app/errors.c
index 7d26373fdd..7fba23b878 100644
--- a/app/errors.c
+++ b/app/errors.c
@@ -488,7 +488,7 @@ gimp_eek (const gchar *reason,
                                               gimp_get_user_context (the_errors_gimp),
                                               NULL, NULL,
                                               "gimp-xcf-save",
-                                              GIMP_TYPE_INT32, 0,
+                                              GIMP_TYPE_RUN_MODE,    GIMP_RUN_NONINTERACTIVE,
                                               GIMP_TYPE_IMAGE_ID,    gimp_image_get_ID (image),
                                               GIMP_TYPE_DRAWABLE_ID, gimp_item_get_ID (item),
                                               G_TYPE_STRING,         backup_path,
diff --git a/app/file/file-open.c b/app/file/file-open.c
index 1067036cbe..3c2be2fa39 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -386,8 +386,8 @@ file_open_thumbnail (Gimp           *gimp,
         gimp_pdb_execute_procedure_by_name (gimp->pdb,
                                             context, progress, error,
                                             gimp_object_get_name (procedure),
-                                            G_TYPE_STRING,   path,
-                                            GIMP_TYPE_INT32, size,
+                                            G_TYPE_STRING, path,
+                                            G_TYPE_INT,    size,
                                             G_TYPE_NONE);
 
       g_free (path);
diff --git a/app/widgets/gimpbrushselect.c b/app/widgets/gimpbrushselect.c
index c27116b92a..352936cc2a 100644
--- a/app/widgets/gimpbrushselect.c
+++ b/app/widgets/gimpbrushselect.c
@@ -282,13 +282,13 @@ gimp_brush_select_run_callback (GimpPdbDialog  *dialog,
                                         dialog->callback_name,
                                         G_TYPE_STRING,        gimp_object_get_name (object),
                                         G_TYPE_DOUBLE,        gimp_context_get_opacity (dialog->context) * 
100.0,
-                                        GIMP_TYPE_INT32,      GIMP_BRUSH_SELECT (dialog)->spacing,
-                                        GIMP_TYPE_INT32,      gimp_context_get_paint_mode (dialog->context),
-                                        GIMP_TYPE_INT32,      gimp_brush_get_width  (brush),
-                                        GIMP_TYPE_INT32,      gimp_brush_get_height (brush),
+                                        G_TYPE_INT,           GIMP_BRUSH_SELECT (dialog)->spacing,
+                                        GIMP_TYPE_LAYER_MODE, gimp_context_get_paint_mode (dialog->context),
+                                        G_TYPE_INT,           gimp_brush_get_width  (brush),
+                                        G_TYPE_INT,           gimp_brush_get_height (brush),
                                         GIMP_TYPE_INT32,      array->length,
                                         GIMP_TYPE_INT8_ARRAY, array,
-                                        GIMP_TYPE_INT32,      closing,
+                                        G_TYPE_BOOLEAN,       closing,
                                         G_TYPE_NONE);
 
   gimp_array_free (array);
diff --git a/app/widgets/gimpfontselect.c b/app/widgets/gimpfontselect.c
index 027e00e1fe..89f85d5bdd 100644
--- a/app/widgets/gimpfontselect.c
+++ b/app/widgets/gimpfontselect.c
@@ -106,7 +106,7 @@ gimp_font_select_run_callback (GimpPdbDialog  *dialog,
                                              dialog->caller_context,
                                              NULL, error,
                                              dialog->callback_name,
-                                             G_TYPE_STRING,   gimp_object_get_name (object),
-                                             GIMP_TYPE_INT32, closing,
+                                             G_TYPE_STRING,  gimp_object_get_name (object),
+                                             G_TYPE_BOOLEAN, closing,
                                              G_TYPE_NONE);
 }
diff --git a/app/widgets/gimpgradientselect.c b/app/widgets/gimpgradientselect.c
index 9d2b2856b0..f3f0800e82 100644
--- a/app/widgets/gimpgradientselect.c
+++ b/app/widgets/gimpgradientselect.c
@@ -186,7 +186,7 @@ gimp_gradient_select_run_callback (GimpPdbDialog  *dialog,
                                         G_TYPE_STRING,         gimp_object_get_name (object),
                                         GIMP_TYPE_INT32,       array->length / sizeof (gdouble),
                                         GIMP_TYPE_FLOAT_ARRAY, array,
-                                        GIMP_TYPE_INT32,       closing,
+                                        G_TYPE_BOOLEAN,        closing,
                                         G_TYPE_NONE);
 
   gimp_array_free (array);
diff --git a/app/widgets/gimppaletteselect.c b/app/widgets/gimppaletteselect.c
index 5f0520c26f..0754cf4c53 100644
--- a/app/widgets/gimppaletteselect.c
+++ b/app/widgets/gimppaletteselect.c
@@ -109,8 +109,8 @@ gimp_palette_select_run_callback (GimpPdbDialog  *dialog,
                                              dialog->caller_context,
                                              NULL, error,
                                              dialog->callback_name,
-                                             G_TYPE_STRING,   gimp_object_get_name (object),
-                                             GIMP_TYPE_INT32, gimp_palette_get_n_colors (palette),
-                                             GIMP_TYPE_INT32, closing,
+                                             G_TYPE_STRING,  gimp_object_get_name (object),
+                                             G_TYPE_INT,     gimp_palette_get_n_colors (palette),
+                                             G_TYPE_BOOLEAN, closing,
                                              G_TYPE_NONE);
 }
diff --git a/app/widgets/gimppatternselect.c b/app/widgets/gimppatternselect.c
index 6cd3b5ae55..9888ebccf3 100644
--- a/app/widgets/gimppatternselect.c
+++ b/app/widgets/gimppatternselect.c
@@ -126,12 +126,12 @@ gimp_pattern_select_run_callback (GimpPdbDialog  *dialog,
                                         NULL, error,
                                         dialog->callback_name,
                                         G_TYPE_STRING,        gimp_object_get_name (object),
-                                        GIMP_TYPE_INT32,      gimp_temp_buf_get_width  (pattern->mask),
-                                        GIMP_TYPE_INT32,      gimp_temp_buf_get_height (pattern->mask),
-                                        GIMP_TYPE_INT32,      babl_format_get_bytes_per_pixel 
(gimp_temp_buf_get_format (pattern->mask)),
+                                        G_TYPE_INT,           gimp_temp_buf_get_width  (pattern->mask),
+                                        G_TYPE_INT,           gimp_temp_buf_get_height (pattern->mask),
+                                        G_TYPE_INT,           babl_format_get_bytes_per_pixel 
(gimp_temp_buf_get_format (pattern->mask)),
                                         GIMP_TYPE_INT32,      array->length,
                                         GIMP_TYPE_INT8_ARRAY, array,
-                                        GIMP_TYPE_INT32,      closing,
+                                        G_TYPE_BOOLEAN,       closing,
                                         G_TYPE_NONE);
 
   gimp_array_free (array);


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