[gimp] Remove GIMP_TYPE_INT8 and GimpParamSpecInt8



commit 1bf90ec77f3566275354821ef19168fbd68634ba
Author: Michael Natterer <mitch gimp org>
Date:   Thu Aug 15 13:34:11 2019 +0200

    Remove GIMP_TYPE_INT8 and GimpParamSpecInt8
    
    Use guchar and GParamSpecUChar instead.

 app/pdb/gimp-pdb-compat.c                        |   2 +-
 app/pdb/plug-in-compat-cmds.c                    | 204 +++++++++++------------
 app/plug-in/gimpgpparams.c                       |  12 +-
 devel-docs/libgimpbase/libgimpbase3-sections.txt |   9 -
 devel-docs/libgimpbase/libgimpbase3.types        |   2 -
 libgimp/gimp.c                                   |   4 +-
 libgimp/gimpgpcompat.c                           |  14 +-
 libgimp/gimpgpparams-body.c                      |  22 ++-
 libgimp/gimpgpparams.c                           |  12 +-
 libgimpbase/gimpbase.def                         |   2 -
 libgimpbase/gimpparamspecs.c                     | 108 ------------
 libgimpbase/gimpparamspecs.h                     |  37 ----
 pdb/app.pl                                       |  10 +-
 pdb/pdb.pl                                       |  10 +-
 plug-ins/common/colormap-remap.c                 |  28 ++--
 15 files changed, 166 insertions(+), 310 deletions(-)
---
diff --git a/app/pdb/gimp-pdb-compat.c b/app/pdb/gimp-pdb-compat.c
index fb68c8ea86..e5822848e6 100644
--- a/app/pdb/gimp-pdb-compat.c
+++ b/app/pdb/gimp-pdb-compat.c
@@ -57,7 +57,7 @@ gimp_pdb_compat_arg_type_from_gtype (GType type)
         { G_TYPE_BOOLEAN,            GIMP_PDB_INT32       },
 
         { GIMP_TYPE_INT16,           GIMP_PDB_INT16       },
-        { GIMP_TYPE_INT8,            GIMP_PDB_INT8        },
+        { G_TYPE_UCHAR,              GIMP_PDB_INT8        },
         { G_TYPE_DOUBLE,             GIMP_PDB_FLOAT       },
 
         { G_TYPE_STRING,             GIMP_PDB_STRING      },
diff --git a/app/pdb/plug-in-compat-cmds.c b/app/pdb/plug-in-compat-cmds.c
index df4b1e7860..664a0d5f2f 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -417,10 +417,10 @@ plug_in_alienmap2_invoker (GimpProcedure         *procedure,
   greenangle = g_value_get_double (gimp_value_array_index (args, 6));
   bluefrequency = g_value_get_double (gimp_value_array_index (args, 7));
   blueangle = g_value_get_double (gimp_value_array_index (args, 8));
-  colormodel = g_value_get_uint (gimp_value_array_index (args, 9));
-  redmode = g_value_get_uint (gimp_value_array_index (args, 10));
-  greenmode = g_value_get_uint (gimp_value_array_index (args, 11));
-  bluemode = g_value_get_uint (gimp_value_array_index (args, 12));
+  colormodel = g_value_get_uchar (gimp_value_array_index (args, 9));
+  redmode = g_value_get_uchar (gimp_value_array_index (args, 10));
+  greenmode = g_value_get_uchar (gimp_value_array_index (args, 11));
+  bluemode = g_value_get_uchar (gimp_value_array_index (args, 12));
 
   if (success)
     {
@@ -1736,15 +1736,15 @@ plug_in_exchange_invoker (GimpProcedure         *procedure,
   guint8 blue_threshold;
 
   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
-  from_red = g_value_get_uint (gimp_value_array_index (args, 3));
-  from_green = g_value_get_uint (gimp_value_array_index (args, 4));
-  from_blue = g_value_get_uint (gimp_value_array_index (args, 5));
-  to_red = g_value_get_uint (gimp_value_array_index (args, 6));
-  to_green = g_value_get_uint (gimp_value_array_index (args, 7));
-  to_blue = g_value_get_uint (gimp_value_array_index (args, 8));
-  red_threshold = g_value_get_uint (gimp_value_array_index (args, 9));
-  green_threshold = g_value_get_uint (gimp_value_array_index (args, 10));
-  blue_threshold = g_value_get_uint (gimp_value_array_index (args, 11));
+  from_red = g_value_get_uchar (gimp_value_array_index (args, 3));
+  from_green = g_value_get_uchar (gimp_value_array_index (args, 4));
+  from_blue = g_value_get_uchar (gimp_value_array_index (args, 5));
+  to_red = g_value_get_uchar (gimp_value_array_index (args, 6));
+  to_green = g_value_get_uchar (gimp_value_array_index (args, 7));
+  to_blue = g_value_get_uchar (gimp_value_array_index (args, 8));
+  red_threshold = g_value_get_uchar (gimp_value_array_index (args, 9));
+  green_threshold = g_value_get_uchar (gimp_value_array_index (args, 10));
+  blue_threshold = g_value_get_uchar (gimp_value_array_index (args, 11));
 
   if (success)
     {
@@ -2354,8 +2354,8 @@ plug_in_maze_invoker (GimpProcedure         *procedure,
   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
   width = g_value_get_int (gimp_value_array_index (args, 3));
   height = g_value_get_int (gimp_value_array_index (args, 4));
-  tileable = g_value_get_uint (gimp_value_array_index (args, 5));
-  algorithm = g_value_get_uint (gimp_value_array_index (args, 6));
+  tileable = g_value_get_uchar (gimp_value_array_index (args, 5));
+  algorithm = g_value_get_uchar (gimp_value_array_index (args, 6));
   seed = g_value_get_int (gimp_value_array_index (args, 7));
 
   if (success)
@@ -4851,29 +4851,29 @@ register_plug_in_compat_procs (GimpPDB *pdb)
                                                     0, 360, 0,
                                                     GIMP_PARAM_READWRITE));
   gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("colormodel",
-                                                     "colormodel",
-                                                     "Color model { RGB-MODEL (0), HSL-MODEL (1) }",
-                                                     0, 1, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("redmode",
-                                                     "redmode",
-                                                     "Red/hue application mode { TRUE, FALSE }",
-                                                     0, 1, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("greenmode",
-                                                     "greenmode",
-                                                     "Green/saturation application mode { TRUE, FALSE }",
-                                                     0, 1, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("bluemode",
-                                                     "bluemode",
-                                                     "Blue/luminance application mode { TRUE, FALSE }",
-                                                     0, 1, 0,
-                                                     GIMP_PARAM_READWRITE));
+                               g_param_spec_uchar ("colormodel",
+                                                   "colormodel",
+                                                   "Color model { RGB-MODEL (0), HSL-MODEL (1) }",
+                                                   0, 1, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("redmode",
+                                                   "redmode",
+                                                   "Red/hue application mode { TRUE, FALSE }",
+                                                   0, 1, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("greenmode",
+                                                   "greenmode",
+                                                   "Green/saturation application mode { TRUE, FALSE }",
+                                                   0, 1, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("bluemode",
+                                                   "bluemode",
+                                                   "Blue/luminance application mode { TRUE, FALSE }",
+                                                   0, 1, 0,
+                                                   GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
@@ -6255,59 +6255,59 @@ register_plug_in_compat_procs (GimpPDB *pdb)
                                                             pdb->gimp, FALSE,
                                                             GIMP_PARAM_READWRITE));
   gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("from-red",
-                                                     "from red",
-                                                     "Red value (from)",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("from-green",
-                                                     "from green",
-                                                     "Green value (from)",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("from-blue",
-                                                     "from blue",
-                                                     "Blue value (from)",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("to-red",
-                                                     "to red",
-                                                     "Red value (to)",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("to-green",
-                                                     "to green",
-                                                     "Green value (to)",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("to-blue",
-                                                     "to blue",
-                                                     "Blue value (to)",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("red-threshold",
-                                                     "red threshold",
-                                                     "Red threshold",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("green-threshold",
-                                                     "green threshold",
-                                                     "Green threshold",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("blue-threshold",
-                                                     "blue threshold",
-                                                     "Blue threshold",
-                                                     0, G_MAXUINT8, 0,
-                                                     GIMP_PARAM_READWRITE));
+                               g_param_spec_uchar ("from-red",
+                                                   "from red",
+                                                   "Red value (from)",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("from-green",
+                                                   "from green",
+                                                   "Green value (from)",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("from-blue",
+                                                   "from blue",
+                                                   "Blue value (from)",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("to-red",
+                                                   "to red",
+                                                   "Red value (to)",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("to-green",
+                                                   "to green",
+                                                   "Green value (to)",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("to-blue",
+                                                   "to blue",
+                                                   "Blue value (to)",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("red-threshold",
+                                                   "red threshold",
+                                                   "Red threshold",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("green-threshold",
+                                                   "green threshold",
+                                                   "Green threshold",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("blue-threshold",
+                                                   "blue threshold",
+                                                   "Blue threshold",
+                                                   0, G_MAXUINT8, 0,
+                                                   GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
@@ -7035,17 +7035,17 @@ register_plug_in_compat_procs (GimpPDB *pdb)
                                                       1, 1024, 1,
                                                       GIMP_PARAM_READWRITE));
   gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("tileable",
-                                                     "tileable",
-                                                     "Tileable maze? (TRUE or FALSE)",
-                                                     0, 1, 0,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_int8 ("algorithm",
-                                                     "algorithm",
-                                                     "Generation algorithm (0 = DEPTH FIRST, 1 = PRIM'S 
ALGORITHM)",
-                                                     0, 1, 0,
-                                                     GIMP_PARAM_READWRITE));
+                               g_param_spec_uchar ("tileable",
+                                                   "tileable",
+                                                   "Tileable maze? (TRUE or FALSE)",
+                                                   0, 1, 0,
+                                                   GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uchar ("algorithm",
+                                                   "algorithm",
+                                                   "Generation algorithm (0 = DEPTH FIRST, 1 = PRIM'S 
ALGORITHM)",
+                                                   0, 1, 0,
+                                                   GIMP_PARAM_READWRITE));
   gimp_procedure_add_argument (procedure,
                                gimp_param_spec_int32 ("seed",
                                                       "seed",
diff --git a/app/plug-in/gimpgpparams.c b/app/plug-in/gimpgpparams.c
index b266d28951..37a10aecf3 100644
--- a/app/plug-in/gimpgpparams.c
+++ b/app/plug-in/gimpgpparams.c
@@ -111,12 +111,12 @@ _gimp_gp_param_def_to_param_spec (gpointer          gimp,
                                   param_def->meta.m_int.default_val,
                                   flags);
 
-      if (! strcmp (param_def->type_name, "GimpParamInt8"))
-        return gimp_param_spec_int8 (name, nick, blurb,
-                                     param_def->meta.m_int.min_val,
-                                     param_def->meta.m_int.max_val,
-                                     param_def->meta.m_int.default_val,
-                                     flags);
+      if (! strcmp (param_def->type_name, "GParamUChar"))
+        return g_param_spec_uchar (name, nick, blurb,
+                                   param_def->meta.m_int.min_val,
+                                   param_def->meta.m_int.max_val,
+                                   param_def->meta.m_int.default_val,
+                                   flags);
       break;
 
     case GP_PARAM_DEF_TYPE_UNIT:
diff --git a/devel-docs/libgimpbase/libgimpbase3-sections.txt 
b/devel-docs/libgimpbase/libgimpbase3-sections.txt
index 1de5aa03ca..5e122178c9 100644
--- a/devel-docs/libgimpbase/libgimpbase3-sections.txt
+++ b/devel-docs/libgimpbase/libgimpbase3-sections.txt
@@ -298,7 +298,6 @@ GIMP_PARAM_WRITABLE
 GIMP_PARAM_READWRITE
 gimp_param_spec_int32
 gimp_param_spec_int16
-gimp_param_spec_int8
 gimp_param_spec_string
 gimp_array_new
 gimp_array_copy
@@ -350,7 +349,6 @@ GIMP_IS_PARAM_SPEC_INT16
 GIMP_IS_PARAM_SPEC_INT16_ARRAY
 GIMP_IS_PARAM_SPEC_INT32
 GIMP_IS_PARAM_SPEC_INT32_ARRAY
-GIMP_IS_PARAM_SPEC_INT8
 GIMP_IS_PARAM_SPEC_INT8_ARRAY
 GIMP_IS_PARAM_SPEC_RGB_ARRAY
 GIMP_IS_PARAM_SPEC_STRING
@@ -361,7 +359,6 @@ GIMP_PARAM_SPEC_INT16
 GIMP_PARAM_SPEC_INT16_ARRAY
 GIMP_PARAM_SPEC_INT32
 GIMP_PARAM_SPEC_INT32_ARRAY
-GIMP_PARAM_SPEC_INT8
 GIMP_PARAM_SPEC_INT8_ARRAY
 GIMP_PARAM_SPEC_RGB_ARRAY
 GIMP_PARAM_SPEC_STRING
@@ -372,7 +369,6 @@ GIMP_TYPE_INT16
 GIMP_TYPE_INT16_ARRAY
 GIMP_TYPE_INT32
 GIMP_TYPE_INT32_ARRAY
-GIMP_TYPE_INT8
 GIMP_TYPE_INT8_ARRAY
 GIMP_TYPE_PARAM_ARRAY
 GIMP_TYPE_PARAM_FLOAT_ARRAY
@@ -380,7 +376,6 @@ GIMP_TYPE_PARAM_INT16
 GIMP_TYPE_PARAM_INT16_ARRAY
 GIMP_TYPE_PARAM_INT32
 GIMP_TYPE_PARAM_INT32_ARRAY
-GIMP_TYPE_PARAM_INT8
 GIMP_TYPE_PARAM_INT8_ARRAY
 GIMP_TYPE_PARAM_RGB_ARRAY
 GIMP_TYPE_PARAM_STRING
@@ -393,7 +388,6 @@ GIMP_VALUE_HOLDS_INT16
 GIMP_VALUE_HOLDS_INT16_ARRAY
 GIMP_VALUE_HOLDS_INT32
 GIMP_VALUE_HOLDS_INT32_ARRAY
-GIMP_VALUE_HOLDS_INT8
 GIMP_VALUE_HOLDS_INT8_ARRAY
 GIMP_VALUE_HOLDS_RGB_ARRAY
 GIMP_VALUE_HOLDS_STRING_ARRAY
@@ -405,7 +399,6 @@ GimpParamSpecInt16
 GimpParamSpecInt16Array
 GimpParamSpecInt32
 GimpParamSpecInt32Array
-GimpParamSpecInt8
 GimpParamSpecInt8Array
 GimpParamSpecRGBArray
 GimpParamSpecString
@@ -417,7 +410,6 @@ gimp_int16_get_type
 gimp_int32_array_get_type
 gimp_int32_get_type
 gimp_int8_array_get_type
-gimp_int8_get_type
 gimp_param_array_get_type
 gimp_param_float_array_get_type
 gimp_param_int16_array_get_type
@@ -425,7 +417,6 @@ gimp_param_int16_get_type
 gimp_param_int32_array_get_type
 gimp_param_int32_get_type
 gimp_param_int8_array_get_type
-gimp_param_int8_get_type
 gimp_param_rgb_array_get_type
 gimp_param_string_array_get_type
 gimp_param_string_get_type
diff --git a/devel-docs/libgimpbase/libgimpbase3.types b/devel-docs/libgimpbase/libgimpbase3.types
index d43c337e57..5963336e86 100644
--- a/devel-docs/libgimpbase/libgimpbase3.types
+++ b/devel-docs/libgimpbase/libgimpbase3.types
@@ -5,7 +5,6 @@ gimp_int16_get_type
 gimp_int32_array_get_type
 gimp_int32_get_type
 gimp_int8_array_get_type
-gimp_int8_get_type
 gimp_memsize_get_type
 gimp_metadata_get_type
 gimp_param_array_get_type
@@ -15,7 +14,6 @@ gimp_param_int16_get_type
 gimp_param_int32_array_get_type
 gimp_param_int32_get_type
 gimp_param_int8_array_get_type
-gimp_param_int8_get_type
 gimp_param_rgb_array_get_type
 gimp_param_string_array_get_type
 gimp_param_string_get_type
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 9e1c762f0e..cfe2738d44 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -448,9 +448,9 @@ _gimp_main_internal (GType                 plug_in_type,
     {
       GIMP_TYPE_INT32,         GIMP_TYPE_PARAM_INT32,
       GIMP_TYPE_INT16,         GIMP_TYPE_PARAM_INT16,
-      GIMP_TYPE_INT8,          GIMP_TYPE_PARAM_INT8,
+      G_TYPE_UCHAR,            G_TYPE_PARAM_UCHAR,
 
-      GIMP_TYPE_PARAM_STRING,
+      G_TYPE_STRING,           GIMP_TYPE_PARAM_STRING,
 
       GIMP_TYPE_ARRAY,         GIMP_TYPE_PARAM_ARRAY,
       GIMP_TYPE_INT8_ARRAY,    GIMP_TYPE_PARAM_INT8_ARRAY,
diff --git a/libgimp/gimpgpcompat.c b/libgimp/gimpgpcompat.c
index 199f692297..abf45adc9f 100644
--- a/libgimp/gimpgpcompat.c
+++ b/libgimp/gimpgpcompat.c
@@ -58,9 +58,9 @@ _gimp_gp_compat_param_spec (GimpPDBArgType  arg_type,
       break;
 
     case GIMP_PDB_INT8:
-      pspec = gimp_param_spec_int8 (name, nick, blurb,
-                                    0, G_MAXUINT8, 0,
-                                    G_PARAM_READWRITE);
+      pspec = g_param_spec_uchar (name, nick, blurb,
+                                  0, G_MAXUINT8, 0,
+                                  G_PARAM_READWRITE);
       break;
 
     case GIMP_PDB_FLOAT:
@@ -195,7 +195,7 @@ _gimp_pdb_arg_type_to_gtype (GimpPDBArgType  type)
       return GIMP_TYPE_INT16;
 
     case GIMP_PDB_INT8:
-      return GIMP_TYPE_INT8;
+      return G_TYPE_UCHAR;
 
     case GIMP_PDB_FLOAT:
       return G_TYPE_DOUBLE;
@@ -286,7 +286,7 @@ _gimp_pdb_gtype_to_arg_type (GType type)
         { G_TYPE_BOOLEAN,            GIMP_PDB_INT32       },
 
         { GIMP_TYPE_INT16,           GIMP_PDB_INT16       },
-        { GIMP_TYPE_INT8,            GIMP_PDB_INT8        },
+        { G_TYPE_UCHAR,              GIMP_PDB_INT8        },
         { G_TYPE_DOUBLE,             GIMP_PDB_FLOAT       },
 
         { G_TYPE_STRING,             GIMP_PDB_STRING      },
@@ -381,7 +381,7 @@ _gimp_params_to_value_array (const GimpParam  *params,
           break;
 
         case GIMP_PDB_INT8:
-          g_value_set_uint (&value, params[i].data.d_int8);
+          g_value_set_uchar (&value, params[i].data.d_int8);
           break;
 
         case GIMP_PDB_FLOAT:
@@ -569,7 +569,7 @@ _gimp_value_array_to_params (GimpValueArray *args,
           break;
 
         case GIMP_PDB_INT8:
-          params[i].data.d_int8 = g_value_get_uint (value);
+          params[i].data.d_int8 = g_value_get_uchar (value);
           break;
 
         case GIMP_PDB_FLOAT:
diff --git a/libgimp/gimpgpparams-body.c b/libgimp/gimpgpparams-body.c
index 21637dc247..2380527745 100644
--- a/libgimp/gimpgpparams-body.c
+++ b/libgimp/gimpgpparams-body.c
@@ -51,13 +51,22 @@ _gimp_param_spec_to_gp_param_def (GParamSpec *pspec,
       param_def->meta.m_int.max_val     = ispec->maximum;
       param_def->meta.m_int.default_val = ispec->default_value;
     }
-  else if (pspec_type == G_TYPE_PARAM_UINT ||
-           pspec_type == GIMP_TYPE_PARAM_INT8)
+  else if (pspec_type == G_TYPE_PARAM_UINT)
     {
       GParamSpecUInt *uspec = G_PARAM_SPEC_UINT (pspec);
 
       param_def->param_def_type = GP_PARAM_DEF_TYPE_INT;
 
+      param_def->meta.m_int.min_val     = uspec->minimum;
+      param_def->meta.m_int.max_val     = uspec->maximum;
+      param_def->meta.m_int.default_val = uspec->default_value;
+    }
+  else if (pspec_type == G_TYPE_PARAM_UCHAR)
+    {
+      GParamSpecUChar *uspec = G_PARAM_SPEC_UCHAR (pspec);
+
+      param_def->param_def_type = GP_PARAM_DEF_TYPE_INT;
+
       param_def->meta.m_int.min_val     = uspec->minimum;
       param_def->meta.m_int.max_val     = uspec->maximum;
       param_def->meta.m_int.default_val = uspec->default_value;
@@ -436,13 +445,18 @@ _gimp_value_to_gp_param (const GValue *value,
 
       param->data.d_int = g_value_get_int (value);
     }
-  else if (type == G_TYPE_UINT ||
-           type == GIMP_TYPE_INT8)
+  else if (type == G_TYPE_UINT)
     {
       param->param_type = GP_PARAM_TYPE_INT;
 
       param->data.d_int = g_value_get_uint (value);
     }
+  else if (type == G_TYPE_UCHAR)
+    {
+      param->param_type = GP_PARAM_TYPE_INT;
+
+      param->data.d_int = g_value_get_uchar (value);
+    }
   else if (G_VALUE_HOLDS_ENUM (value))
     {
       param->param_type = GP_PARAM_TYPE_INT;
diff --git a/libgimp/gimpgpparams.c b/libgimp/gimpgpparams.c
index 469a82e64d..e098aa18bf 100644
--- a/libgimp/gimpgpparams.c
+++ b/libgimp/gimpgpparams.c
@@ -102,12 +102,12 @@ _gimp_gp_param_def_to_param_spec (gpointer          gimp,
                                   param_def->meta.m_int.default_val,
                                   flags);
 
-      if (! strcmp (param_def->type_name, "GimpParamInt8"))
-        return gimp_param_spec_int8 (name, nick, blurb,
-                                     param_def->meta.m_int.min_val,
-                                     param_def->meta.m_int.max_val,
-                                     param_def->meta.m_int.default_val,
-                                     flags);
+      if (! strcmp (param_def->type_name, "GParamUChar"))
+        return g_param_spec_uchar (name, nick, blurb,
+                                   param_def->meta.m_int.min_val,
+                                   param_def->meta.m_int.max_val,
+                                   param_def->meta.m_int.default_val,
+                                   flags);
       break;
 
     case GP_PARAM_DEF_TYPE_UNIT:
diff --git a/libgimpbase/gimpbase.def b/libgimpbase/gimpbase.def
index f6728b0f4a..d3ecac6a24 100644
--- a/libgimpbase/gimpbase.def
+++ b/libgimpbase/gimpbase.def
@@ -115,7 +115,6 @@ EXPORTS
        gimp_param_int32_array_get_type
        gimp_param_int32_get_type
        gimp_param_int8_array_get_type
-       gimp_param_int8_get_type
        gimp_param_memsize_get_type
        gimp_param_parasite_get_type
        gimp_param_rgb_array_get_type
@@ -125,7 +124,6 @@ EXPORTS
        gimp_param_spec_int16_array
        gimp_param_spec_int32
        gimp_param_spec_int32_array
-       gimp_param_spec_int8
        gimp_param_spec_int8_array
        gimp_param_spec_memsize
        gimp_param_spec_parasite
diff --git a/libgimpbase/gimpparamspecs.c b/libgimpbase/gimpparamspecs.c
index b55b2297b4..6527f24fcf 100644
--- a/libgimpbase/gimpparamspecs.c
+++ b/libgimpbase/gimpparamspecs.c
@@ -244,114 +244,6 @@ gimp_param_spec_int16 (const gchar *name,
 }
 
 
-/*
- * GIMP_TYPE_INT8
- */
-
-GType
-gimp_int8_get_type (void)
-{
-  static GType type = 0;
-
-  if (! type)
-    {
-      const GTypeInfo info = { 0, };
-
-      type = g_type_register_static (G_TYPE_UINT, "GimpInt8", &info, 0);
-    }
-
-  return type;
-}
-
-
-/*
- * GIMP_TYPE_PARAM_INT8
- */
-
-static void   gimp_param_int8_class_init (GParamSpecClass *klass);
-static void   gimp_param_int8_init       (GParamSpec      *pspec);
-
-GType
-gimp_param_int8_get_type (void)
-{
-  static GType type = 0;
-
-  if (! type)
-    {
-      const GTypeInfo info =
-      {
-        sizeof (GParamSpecClass),
-        NULL, NULL,
-        (GClassInitFunc) gimp_param_int8_class_init,
-        NULL, NULL,
-        sizeof (GimpParamSpecInt8),
-        0,
-        (GInstanceInitFunc) gimp_param_int8_init
-      };
-
-      type = g_type_register_static (G_TYPE_PARAM_UINT,
-                                     "GimpParamInt8", &info, 0);
-    }
-
-  return type;
-}
-
-static void
-gimp_param_int8_class_init (GParamSpecClass *klass)
-{
-  klass->value_type = GIMP_TYPE_INT8;
-}
-
-static void
-gimp_param_int8_init (GParamSpec *pspec)
-{
-}
-
-/**
- * gimp_param_spec_int8:
- * @name:          Canonical name of the property specified.
- * @nick:          Nick name of the property specified.
- * @blurb:         Description of the property specified.
- * @minimum:       The minimum accepted value.
- * @maximum:       The maximum accepted value.
- * @default_value: The default value.
- * @flags:         Flags for the property specified.
- *
- * Creates a new #GimpParamSpecInt8 specifying a
- * #GIMP_TYPE_INT8 property.
- *
- * See g_param_spec_internal() for details on property names.
- *
- * Returns: (transfer full): The newly created #GimpParamSpecInt8.
- *
- * Since: 3.0
- **/
-GParamSpec *
-gimp_param_spec_int8 (const gchar *name,
-                      const gchar *nick,
-                      const gchar *blurb,
-                      guint        minimum,
-                      guint        maximum,
-                      guint        default_value,
-                      GParamFlags  flags)
-{
-  GParamSpecInt *ispec;
-
-  g_return_val_if_fail (maximum <= G_MAXUINT8, NULL);
-  g_return_val_if_fail (default_value >= minimum &&
-                        default_value <= maximum, NULL);
-
-  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_INT8,
-                                 name, nick, blurb, flags);
-
-  ispec->minimum       = minimum;
-  ispec->maximum       = maximum;
-  ispec->default_value = default_value;
-
-  return G_PARAM_SPEC (ispec);
-}
-
-
 /*
  * GIMP_TYPE_PARAM_STRING
  */
diff --git a/libgimpbase/gimpparamspecs.h b/libgimpbase/gimpparamspecs.h
index e08e515d95..d7a197ae27 100644
--- a/libgimpbase/gimpparamspecs.h
+++ b/libgimpbase/gimpparamspecs.h
@@ -148,43 +148,6 @@ GParamSpec * gimp_param_spec_int16     (const gchar *name,
                                         GParamFlags  flags);
 
 
-/*
- * GIMP_TYPE_INT8
- */
-
-#define GIMP_TYPE_INT8               (gimp_int8_get_type ())
-#define GIMP_VALUE_HOLDS_INT8(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
-                                      GIMP_TYPE_INT8))
-
-GType   gimp_int8_get_type           (void) G_GNUC_CONST;
-
-
-/*
- * GIMP_TYPE_PARAM_INT8
- */
-
-#define GIMP_TYPE_PARAM_INT8           (gimp_param_int8_get_type ())
-#define GIMP_PARAM_SPEC_INT8(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT8, 
GimpParamSpecInt8))
-#define GIMP_IS_PARAM_SPEC_INT8(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT8))
-
-typedef struct _GimpParamSpecInt8 GimpParamSpecInt8;
-
-struct _GimpParamSpecInt8
-{
-  GParamSpecUInt parent_instance;
-};
-
-GType        gimp_param_int8_get_type (void) G_GNUC_CONST;
-
-GParamSpec * gimp_param_spec_int8     (const gchar *name,
-                                       const gchar *nick,
-                                       const gchar *blurb,
-                                       guint        minimum,
-                                       guint        maximum,
-                                       guint        default_value,
-                                       GParamFlags  flags);
-
-
 /*
  * GIMP_TYPE_PARAM_STRING
  */
diff --git a/pdb/app.pl b/pdb/app.pl
index 61b9b9aa1a..ff21841fe1 100644
--- a/pdb/app.pl
+++ b/pdb/app.pl
@@ -407,11 +407,11 @@ CODE
        }
        $default = exists $arg->{default} ? $arg->{default} : defined $typeinfo[0] ? $typeinfo[0] : 0;
        $pspec = <<CODE;
-gimp_param_spec_int8 ("$name",
-                      "$nick",
-                      "$blurb",
-                      $min, $max, $default,
-                      $flags)
+g_param_spec_uchar ("$name",
+                    "$nick",
+                    "$blurb",
+                    $min, $max, $default,
+                    $flags)
 CODE
     }
     elsif ($pdbtype eq 'boolean') {
diff --git a/pdb/pdb.pl b/pdb/pdb.pl
index e1a7ff20a7..ca851414f8 100644
--- a/pdb/pdb.pl
+++ b/pdb/pdb.pl
@@ -38,14 +38,14 @@ package Gimp::CodeGen::pdb;
                     take_value_func => 'g_value_set_int ($value, $var)' },
 
     int8        => { name            => 'INT8',
-                    gtype           => 'GIMP_TYPE_INT8',
+                    gtype           => 'G_TYPE_UCHAR',
                     type            => 'guint8 ',
                     const_type      => 'guint8 ',
                     init_value      => '0',
-                    get_value_func  => '$var = g_value_get_uint ($value)',
-                    dup_value_func  => '$var = g_value_get_uint ($value)',
-                    set_value_func  => 'g_value_set_uint ($value, $var)',
-                    take_value_func => 'g_value_set_uint ($value, $var)' },
+                    get_value_func  => '$var = g_value_get_uchar ($value)',
+                    dup_value_func  => '$var = g_value_get_uchar ($value)',
+                    set_value_func  => 'g_value_set_uchar ($value, $var)',
+                    take_value_func => 'g_value_set_uchar ($value, $var)' },
 
     float       => { name            => 'FLOAT',
                     gtype           => 'G_TYPE_DOUBLE',
diff --git a/plug-ins/common/colormap-remap.c b/plug-ins/common/colormap-remap.c
index 2e5be44ab8..a8f4f5fa4e 100644
--- a/plug-ins/common/colormap-remap.c
+++ b/plug-ins/common/colormap-remap.c
@@ -216,19 +216,19 @@ remap_create_procedure (GimpPlugIn  *plug_in,
                                                                 FALSE,
                                                                 G_PARAM_READWRITE));
       gimp_procedure_add_argument (procedure,
-                                   gimp_param_spec_int8 ("index1",
-                                                         "Index 1",
-                                                         "First index in the "
-                                                         "colormap",
-                                                         0, 255, 0,
-                                                         G_PARAM_READWRITE));
+                                   g_param_spec_uchar ("index1",
+                                                       "Index 1",
+                                                       "First index in the "
+                                                       "colormap",
+                                                       0, 255, 0,
+                                                       G_PARAM_READWRITE));
       gimp_procedure_add_argument (procedure,
-                                   gimp_param_spec_int8 ("index2",
-                                                         "Index 2",
-                                                         "First (other) index "
-                                                         "in the colormap",
-                                                         0, 255, 0,
-                                                         G_PARAM_READWRITE));
+                                   g_param_spec_uchar ("index2",
+                                                       "Index 2",
+                                                       "First (other) index "
+                                                       "in the colormap",
+                                                       0, 255, 0,
+                                                       G_PARAM_READWRITE));
     }
 
   return procedure;
@@ -309,8 +309,8 @@ remap_run (GimpProcedure        *procedure,
   else if (strcmp (gimp_procedure_get_name (procedure),
                    PLUG_IN_PROC_SWAP) == 0)
     {
-      guchar index1 = g_value_get_uint (gimp_value_array_index (args, 3));
-      guchar index2 = g_value_get_uint (gimp_value_array_index (args, 4));
+      guchar index1 = g_value_get_uchar (gimp_value_array_index (args, 3));
+      guchar index2 = g_value_get_uchar (gimp_value_array_index (args, 4));
       guchar tmp;
       gint   n_cols;
 


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