[gimp/metadata-browser] app: add "ERROR" to the values of enum GimpPdbErrorCode



commit 94966386641d1a40e48a8aafd55eede6e07003a6
Author: Michael Natterer <mitch gimp org>
Date:   Mon Mar 5 19:36:59 2012 +0100

    app: add "ERROR" to the values of enum GimpPdbErrorCode
    
    so they are now GIMP_PDB_ERROR_FOO instead of just GIMP_PDB_FOO,
    because it was just too confusing wrt enum GimpPdbStatusType.

 app/pdb/convert-cmds.c            |    6 ++-
 app/pdb/floating-sel-cmds.c       |    9 +++--
 app/pdb/gimppdb-query.c           |    2 +-
 app/pdb/gimppdb-utils.c           |   70 ++++++++++++++++++------------------
 app/pdb/gimppdb.c                 |    9 +++--
 app/pdb/gimppdberror.h            |   12 +++---
 app/pdb/gimpprocedure.c           |   40 +++++++++++++--------
 app/pdb/image-cmds.c              |    3 +-
 app/pdb/text-layer-cmds.c         |    2 +-
 app/plug-in/gimpplugin-progress.c |    2 +-
 app/plug-in/gimppluginprocframe.c |    2 +-
 tools/pdbgen/pdb/convert.pdb      |    6 ++-
 tools/pdbgen/pdb/floating_sel.pdb |    9 +++--
 tools/pdbgen/pdb/image.pdb        |    3 +-
 tools/pdbgen/pdb/text_layer.pdb   |    2 +-
 15 files changed, 99 insertions(+), 78 deletions(-)
---
diff --git a/app/pdb/convert-cmds.c b/app/pdb/convert-cmds.c
index 7702af6..8a316f4 100644
--- a/app/pdb/convert-cmds.c
+++ b/app/pdb/convert-cmds.c
@@ -148,7 +148,8 @@ image_convert_indexed_invoker (GimpProcedure      *procedure,
               else if (pal->n_colors > MAXNUMCOLORS)
                 {
                   g_set_error_literal (error,
-                                       GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                       GIMP_PDB_ERROR,
+                                       GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                        _("Cannot convert to a palette "
                                          "with more than 256 colors."));
                   success = FALSE;
@@ -203,7 +204,8 @@ image_convert_set_dither_matrix_invoker (GimpProcedure      *procedure,
         }
       else
         {
-          g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+          g_set_error_literal (error, GIMP_PDB_ERROR,
+                               GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                "Dither matrix length must be width * height");
           success = FALSE;
         }
diff --git a/app/pdb/floating-sel-cmds.c b/app/pdb/floating-sel-cmds.c
index 4ddebaa..e2de020 100644
--- a/app/pdb/floating-sel-cmds.c
+++ b/app/pdb/floating-sel-cmds.c
@@ -60,7 +60,8 @@ floating_sel_remove_invoker (GimpProcedure      *procedure,
         }
       else
         {
-          g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+          g_set_error_literal (error, GIMP_PDB_ERROR,
+                               GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                _("Cannot remove this layer because "
                                  "it is not a floating selection."));
           success = FALSE;
@@ -92,7 +93,8 @@ floating_sel_anchor_invoker (GimpProcedure      *procedure,
         }
       else
         {
-          g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+          g_set_error_literal (error, GIMP_PDB_ERROR,
+                               GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                _("Cannot anchor this layer because "
                                  "it is not a floating selection."));
           success = FALSE;
@@ -124,7 +126,8 @@ floating_sel_to_layer_invoker (GimpProcedure      *procedure,
         }
       else
         {
-          g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+          g_set_error_literal (error, GIMP_PDB_ERROR,
+                               GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                _("Cannot convert this layer to a normal layer "
                                  "because it is not a floating selection."));
           success = FALSE;
diff --git a/app/pdb/gimppdb-query.c b/app/pdb/gimppdb-query.c
index 9dc9377..32a1b25 100644
--- a/app/pdb/gimppdb-query.c
+++ b/app/pdb/gimppdb-query.c
@@ -295,7 +295,7 @@ gimp_pdb_proc_info (GimpPDB          *pdb,
       return TRUE;
     }
 
-  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_PROCEDURE_NOT_FOUND,
+  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
                _("Procedure '%s' not found"), proc_name);
 
   return FALSE;
diff --git a/app/pdb/gimppdb-utils.c b/app/pdb/gimppdb-utils.c
index ea7056f..1742f3b 100644
--- a/app/pdb/gimppdb-utils.c
+++ b/app/pdb/gimppdb-utils.c
@@ -69,7 +69,7 @@ gimp_pdb_get_brush (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty brush name"));
       return NULL;
     }
@@ -78,12 +78,12 @@ gimp_pdb_get_brush (Gimp         *gimp,
 
   if (! brush)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Brush '%s' not found"), name);
     }
   else if (writable && ! gimp_data_is_writable (GIMP_DATA (brush)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Brush '%s' is not editable"), name);
       return NULL;
     }
@@ -109,7 +109,7 @@ gimp_pdb_get_generated_brush (Gimp         *gimp,
 
   if (! GIMP_IS_BRUSH_GENERATED (brush))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Brush '%s' is not a generated brush"), name);
       return NULL;
     }
@@ -130,7 +130,7 @@ gimp_pdb_get_dynamics (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty paint dynamics name"));
       return NULL;
     }
@@ -139,12 +139,12 @@ gimp_pdb_get_dynamics (Gimp         *gimp,
 
   if (! dynamics)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Paint dynamics '%s' not found"), name);
     }
   else if (writable && ! gimp_data_is_writable (GIMP_DATA (dynamics)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Paint dynamics '%s' is not editable"), name);
       return NULL;
     }
@@ -164,7 +164,7 @@ gimp_pdb_get_pattern (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty pattern name"));
       return NULL;
     }
@@ -173,7 +173,7 @@ gimp_pdb_get_pattern (Gimp         *gimp,
 
   if (! pattern)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Pattern '%s' not found"), name);
     }
 
@@ -193,7 +193,7 @@ gimp_pdb_get_gradient (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty gradient name"));
       return NULL;
     }
@@ -202,12 +202,12 @@ gimp_pdb_get_gradient (Gimp         *gimp,
 
   if (! gradient)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Gradient '%s' not found"), name);
     }
   else if (writable && ! gimp_data_is_writable (GIMP_DATA (gradient)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Gradient '%s' is not editable"), name);
       return NULL;
     }
@@ -228,7 +228,7 @@ gimp_pdb_get_palette (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty palette name"));
       return NULL;
     }
@@ -237,12 +237,12 @@ gimp_pdb_get_palette (Gimp         *gimp,
 
   if (! palette)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Palette '%s' not found"), name);
     }
   else if (writable && ! gimp_data_is_writable (GIMP_DATA (palette)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Palette '%s' is not editable"), name);
       return NULL;
     }
@@ -262,7 +262,7 @@ gimp_pdb_get_font (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty font name"));
       return NULL;
     }
@@ -272,7 +272,7 @@ gimp_pdb_get_font (Gimp         *gimp,
 
   if (! font)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Font '%s' not found"), name);
     }
 
@@ -291,7 +291,7 @@ gimp_pdb_get_buffer (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty buffer name"));
       return NULL;
     }
@@ -301,7 +301,7 @@ gimp_pdb_get_buffer (Gimp         *gimp,
 
   if (! buffer)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Named buffer '%s' not found"), name);
     }
 
@@ -320,7 +320,7 @@ gimp_pdb_get_paint_info (Gimp         *gimp,
 
   if (! name || ! strlen (name))
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
 			   _("Invalid empty paint method name"));
       return NULL;
     }
@@ -330,7 +330,7 @@ gimp_pdb_get_paint_info (Gimp         *gimp,
 
   if (! paint_info)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Paint method '%s' does not exist"), name);
     }
 
@@ -349,7 +349,7 @@ gimp_pdb_item_is_attached (GimpItem  *item,
 
   if (! gimp_item_is_attached (item))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) cannot be used because it has not "
                      "been added to an image"),
                    gimp_object_get_name (item),
@@ -359,7 +359,7 @@ gimp_pdb_item_is_attached (GimpItem  *item,
 
   if (image && image != gimp_item_get_image (item))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) cannot be used because it is "
                      "attached to another image"),
                    gimp_object_get_name (item),
@@ -388,7 +388,7 @@ gimp_pdb_item_is_in_tree (GimpItem   *item,
 
   if (! gimp_item_get_tree (item))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) cannot be used because it is not "
                      "a direct child of an item tree"),
                    gimp_object_get_name (item),
@@ -416,7 +416,7 @@ gimp_pdb_item_is_in_same_tree (GimpItem   *item,
 
   if (gimp_item_get_tree (item) != gimp_item_get_tree (item2))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Items '%s' (%d) and '%s' (%d) cannot be used "
                      "because they are not part of the same item tree"),
                    gimp_object_get_name (item),
@@ -441,7 +441,7 @@ gimp_pdb_item_is_not_ancestor (GimpItem  *item,
   if (gimp_viewable_is_ancestor (GIMP_VIEWABLE (item),
                                  GIMP_VIEWABLE (not_descendant)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) must not be an ancestor of "
                      "'%s' (%d)"),
                    gimp_object_get_name (item),
@@ -465,7 +465,7 @@ gimp_pdb_item_is_floating (GimpItem  *item,
 
   if (! g_object_is_floating (item))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) has already been added to an image"),
                    gimp_object_get_name (item),
                    gimp_item_get_ID (item));
@@ -473,7 +473,7 @@ gimp_pdb_item_is_floating (GimpItem  *item,
     }
   else if (gimp_item_get_image (item) != dest_image)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Trying to add item '%s' (%d) to wrong image"),
                    gimp_object_get_name (item),
                    gimp_item_get_ID (item));
@@ -492,7 +492,7 @@ gimp_pdb_item_is_writable (GimpItem  *item,
 
   if (gimp_item_is_content_locked (item))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) cannot be modified because its "
                      "contents are locked"),
                    gimp_object_get_name (item),
@@ -512,7 +512,7 @@ gimp_pdb_item_is_group (GimpItem  *item,
 
   if (! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) cannot be used because it is "
                      "not a group item"),
                    gimp_object_get_name (item),
@@ -532,7 +532,7 @@ gimp_pdb_item_is_not_group (GimpItem  *item,
 
   if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Item '%s' (%d) cannot be modified because it "
                      "is a group item"),
                    gimp_object_get_name (item),
@@ -553,7 +553,7 @@ gimp_pdb_layer_is_text_layer (GimpLayer  *layer,
 
   if (! gimp_item_is_text_layer (GIMP_ITEM (layer)))
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Layer '%s' (%d) cannot be used because it is not "
                      "a text layer"),
                    gimp_object_get_name (layer),
@@ -594,7 +594,7 @@ gimp_pdb_image_is_base_type (GimpImage          *image,
   if (gimp_image_base_type (image) == type)
     return TRUE;
 
-  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                _("Image '%s' (%d) is of type '%s', "
                  "but an image of type '%s' is expected"),
                gimp_image_get_display_name (image),
@@ -617,7 +617,7 @@ gimp_pdb_image_is_not_base_type (GimpImage          *image,
   if (gimp_image_base_type (image) != type)
     return TRUE;
 
-  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+  g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                _("Image '%s' (%d) is already of type '%s'"),
                gimp_image_get_display_name (image),
                gimp_image_get_ID (image),
@@ -645,7 +645,7 @@ gimp_pdb_get_vectors_stroke (GimpVectors  *vectors,
       stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_ID);
 
       if (! stroke)
-        g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+        g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                      _("Vectors object %d does not contain stroke with ID %d"),
                      gimp_item_get_ID (GIMP_ITEM (vectors)), stroke_ID);
     }
diff --git a/app/pdb/gimppdb.c b/app/pdb/gimppdb.c
index 875b37e..db00c22 100644
--- a/app/pdb/gimppdb.c
+++ b/app/pdb/gimppdb.c
@@ -301,7 +301,7 @@ gimp_pdb_execute_procedure_by_name_args (GimpPDB       *pdb,
   if (list == NULL)
     {
       GError *pdb_error = g_error_new (GIMP_PDB_ERROR,
-                                       GIMP_PDB_PROCEDURE_NOT_FOUND,
+                                       GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
                                        _("Procedure '%s' not found"), name);
 
       return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error);
@@ -371,7 +371,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB       *pdb,
   if (! procedure)
     {
       GError *pdb_error = g_error_new (GIMP_PDB_ERROR,
-                                       GIMP_PDB_PROCEDURE_NOT_FOUND,
+                                       GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
                                        _("Procedure '%s' not found"), name);
 
       return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error);
@@ -405,7 +405,8 @@ gimp_pdb_execute_procedure_by_name (GimpPDB       *pdb,
 
           g_value_array_free (args);
 
-          pdb_error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+          pdb_error = g_error_new (GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                    _("Procedure '%s' has been called with a "
                                      "wrong type for argument #%d. "
                                      "Expected %s, got %s."),
@@ -426,7 +427,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB       *pdb,
       if (error_msg)
         {
           GError *pdb_error = g_error_new_literal (GIMP_PDB_ERROR,
-                                                   GIMP_PDB_INTERNAL_ERROR,
+                                                   GIMP_PDB_ERROR_INTERNAL_ERROR,
                                                    error_msg);
           g_warning ("%s: %s", G_STRFUNC, error_msg);
           g_free (error_msg);
diff --git a/app/pdb/gimppdberror.h b/app/pdb/gimppdberror.h
index 33e2025..90869f8 100644
--- a/app/pdb/gimppdberror.h
+++ b/app/pdb/gimppdberror.h
@@ -21,12 +21,12 @@
 
 typedef enum
 {
-  GIMP_PDB_FAILED,  /* generic error condition */
-  GIMP_PDB_CANCELLED,
-  GIMP_PDB_PROCEDURE_NOT_FOUND,
-  GIMP_PDB_INVALID_ARGUMENT,
-  GIMP_PDB_INVALID_RETURN_VALUE,
-  GIMP_PDB_INTERNAL_ERROR
+  GIMP_PDB_ERROR_FAILED,  /* generic error condition */
+  GIMP_PDB_ERROR_CANCELLED,
+  GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
+  GIMP_PDB_ERROR_INVALID_ARGUMENT,
+  GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
+  GIMP_PDB_ERROR_INTERNAL_ERROR
 } GimpPdbErrorCode;
 
 
diff --git a/app/pdb/gimpprocedure.c b/app/pdb/gimpprocedure.c
index 83a9cee..7c1b726 100644
--- a/app/pdb/gimpprocedure.c
+++ b/app/pdb/gimpprocedure.c
@@ -352,7 +352,8 @@ gimp_procedure_execute (GimpProcedure  *procedure,
               if (return_vals->n_values > 1 &&
                   G_VALUE_HOLDS_STRING (&return_vals->values[1]))
                 {
-                  g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_FAILED,
+                  g_set_error_literal (error, GIMP_PDB_ERROR,
+                                       GIMP_PDB_ERROR_FAILED,
 				       g_value_get_string (&return_vals->values[1]));
                 }
             }
@@ -366,7 +367,8 @@ gimp_procedure_execute (GimpProcedure  *procedure,
     {
       g_warning ("%s: no return values, shouldn't happen", G_STRFUNC);
 
-      pdb_error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+      pdb_error = g_error_new (GIMP_PDB_ERROR,
+                               GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
                                _("Procedure '%s' returned no return values"),
                                gimp_object_get_name (procedure));
 
@@ -476,15 +478,15 @@ gimp_procedure_get_return_values (GimpProcedure *procedure,
         {
           switch ((GimpPdbErrorCode) error->code)
             {
-            case GIMP_PDB_FAILED:
-            case GIMP_PDB_PROCEDURE_NOT_FOUND:
-            case GIMP_PDB_INVALID_ARGUMENT:
-            case GIMP_PDB_INVALID_RETURN_VALUE:
-            case GIMP_PDB_INTERNAL_ERROR:
+            case GIMP_PDB_ERROR_FAILED:
+            case GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND:
+            case GIMP_PDB_ERROR_INVALID_ARGUMENT:
+            case GIMP_PDB_ERROR_INVALID_RETURN_VALUE:
+            case GIMP_PDB_ERROR_INTERNAL_ERROR:
               g_value_set_enum (&value, GIMP_PDB_CALLING_ERROR);
               break;
 
-            case GIMP_PDB_CANCELLED:
+            case GIMP_PDB_ERROR_CANCELLED:
               g_value_set_enum (&value, GIMP_PDB_CANCEL);
               break;
 
@@ -636,7 +638,7 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
           if (return_vals)
             {
               g_set_error (error,
-                           GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+                           GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
                            _("Procedure '%s' returned a wrong value type "
                              "for return value '%s' (#%d). "
                              "Expected %s, got %s."),
@@ -648,7 +650,7 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
           else
             {
               g_set_error (error,
-                           GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                           GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                            _("Procedure '%s' has been called with a "
                              "wrong value type for argument '%s' (#%d). "
                              "Expected %s, got %s."),
@@ -680,7 +682,8 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
                   if (return_vals)
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+                                   GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
                                    _("Procedure '%s' returned an "
                                      "invalid ID for argument '%s'. "
                                      "Most likely a plug-in is trying "
@@ -692,7 +695,8 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
                   else
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                   GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                    _("Procedure '%s' has been called with an "
                                      "invalid ID for argument '%s'. "
                                      "Most likely a plug-in is trying "
@@ -708,7 +712,8 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
                   if (return_vals)
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+                                   GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
                                    _("Procedure '%s' returned an "
                                      "invalid ID for argument '%s'. "
                                      "Most likely a plug-in is trying "
@@ -720,7 +725,8 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
                   else
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                   GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                    _("Procedure '%s' has been called with an "
                                      "invalid ID for argument '%s'. "
                                      "Most likely a plug-in is trying "
@@ -740,7 +746,8 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
                   if (return_vals)
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+                                   GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
                                    _("Procedure '%s' returned "
                                      "'%s' as return value '%s' "
                                      "(#%d, type %s). "
@@ -753,7 +760,8 @@ gimp_procedure_validate_args (GimpProcedure  *procedure,
                   else
                     {
                       g_set_error (error,
-                                   GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+                                   GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                    _("Procedure '%s' has been called with "
                                      "value '%s' for argument '%s' "
                                      "(#%d, type %s). "
diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c
index 60ca5aa..466d150 100644
--- a/app/pdb/image-cmds.c
+++ b/app/pdb/image-cmds.c
@@ -2355,7 +2355,8 @@ image_set_resolution_invoker (GimpProcedure      *procedure,
           ! FINITE (yresolution) ||
           yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
         {
-          g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+          g_set_error_literal (error, GIMP_PDB_ERROR,
+                               GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                _("Image resolution is out of bounds, "
                                  "using the default resolution instead."));
           success = FALSE;
diff --git a/app/pdb/text-layer-cmds.c b/app/pdb/text-layer-cmds.c
index 38e595d..e3edcd7 100644
--- a/app/pdb/text-layer-cmds.c
+++ b/app/pdb/text-layer-cmds.c
@@ -87,7 +87,7 @@ text_layer_new_invoker (GimpProcedure      *procedure,
 
       if (! layer)
         {
-          g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+          g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                        _("Failed to create text layer"));
 
           success = FALSE;
diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c
index 5d45fb6..9c06937 100644
--- a/app/plug-in/gimpplugin-progress.c
+++ b/app/plug-in/gimpplugin-progress.c
@@ -327,7 +327,7 @@ get_cancel_return_values (GimpProcedure *procedure)
   GValueArray *return_vals;
   GError      *error;
 
-  error = g_error_new_literal (GIMP_PDB_ERROR, GIMP_PDB_CANCELLED,
+  error = g_error_new_literal (GIMP_PDB_ERROR, GIMP_PDB_ERROR_CANCELLED,
                                _("Cancelled"));
   return_vals = gimp_procedure_get_return_values (procedure, FALSE, error);
   g_error_free (error);
diff --git a/app/plug-in/gimppluginprocframe.c b/app/plug-in/gimppluginprocframe.c
index 4b57b66..d9b4863 100644
--- a/app/plug-in/gimppluginprocframe.c
+++ b/app/plug-in/gimppluginprocframe.c
@@ -204,7 +204,7 @@ gimp_plug_in_proc_frame_get_return_values (GimpPlugInProcFrame *proc_frame)
       GimpProcedure *procedure = proc_frame->procedure;
       GError        *error;
 
-      error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
+      error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
                            _("Procedure '%s' returned no return values"),
                            gimp_object_get_name (procedure));
 
diff --git a/tools/pdbgen/pdb/convert.pdb b/tools/pdbgen/pdb/convert.pdb
index 1368414..a88cb12 100644
--- a/tools/pdbgen/pdb/convert.pdb
+++ b/tools/pdbgen/pdb/convert.pdb
@@ -149,7 +149,8 @@ HELP
           else if (pal->n_colors > MAXNUMCOLORS)
             {
               g_set_error_literal (error,
-	                           GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+	                           GIMP_PDB_ERROR,
+                                   GIMP_PDB_ERROR_INVALID_ARGUMENT,
                                    _("Cannot convert to a palette "
                                      "with more than 256 colors."));
               success = FALSE;
@@ -207,7 +208,8 @@ HELP
     }
   else
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR,
+                           GIMP_PDB_ERROR_INVALID_ARGUMENT,
                            "Dither matrix length must be width * height");
       success = FALSE;
     }
diff --git a/tools/pdbgen/pdb/floating_sel.pdb b/tools/pdbgen/pdb/floating_sel.pdb
index efa0c92..3296795 100644
--- a/tools/pdbgen/pdb/floating_sel.pdb
+++ b/tools/pdbgen/pdb/floating_sel.pdb
@@ -43,7 +43,8 @@ HELP
     }
   else
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR,
+                           GIMP_PDB_ERROR_INVALID_ARGUMENT,
                            _("Cannot remove this layer because "
                              "it is not a floating selection."));
       success = FALSE;
@@ -80,7 +81,8 @@ HELP
     }
   else
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR,
+                           GIMP_PDB_ERROR_INVALID_ARGUMENT,
                            _("Cannot anchor this layer because "
                              "it is not a floating selection."));
       success = FALSE;
@@ -119,7 +121,8 @@ HELP
     }
   else
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR,
+                           GIMP_PDB_ERROR_INVALID_ARGUMENT,
                            _("Cannot convert this layer to a normal layer "
                              "because it is not a floating selection."));
       success = FALSE;
diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb
index cc57c36..3da6601 100644
--- a/tools/pdbgen/pdb/image.pdb
+++ b/tools/pdbgen/pdb/image.pdb
@@ -2372,7 +2372,8 @@ HELP
       ! FINITE (yresolution) ||
       yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
     {
-      g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error_literal (error, GIMP_PDB_ERROR,
+                           GIMP_PDB_ERROR_INVALID_ARGUMENT,
                            _("Image resolution is out of bounds, "
                              "using the default resolution instead."));
       success = FALSE;
diff --git a/tools/pdbgen/pdb/text_layer.pdb b/tools/pdbgen/pdb/text_layer.pdb
index d5e0989..9e0e7be 100644
--- a/tools/pdbgen/pdb/text_layer.pdb
+++ b/tools/pdbgen/pdb/text_layer.pdb
@@ -70,7 +70,7 @@ HELP
 
   if (! layer)
     {
-      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
+      g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
                    _("Failed to create text layer"));
 
       success = FALSE;



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