Remove GIMP_TYPE_INT8 and GimpParamSpecInt8

Use guchar and GParamSpecUChar instead.
This commit is contained in:
Michael Natterer 2019-08-15 13:34:11 +02:00
parent 1bfa52b692
commit 1bf90ec77f
15 changed files with 154 additions and 298 deletions

View File

@ -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 },

View File

@ -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));
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,
gimp_param_spec_int8 ("redmode",
"redmode",
"Red/hue application mode { TRUE, FALSE }",
0, 1, 0,
GIMP_PARAM_READWRITE));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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 ("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));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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));
g_param_spec_uchar ("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 ("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));
g_param_spec_uchar ("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 ("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",

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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

View File

@ -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
*/

View File

@ -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
*/

View File

@ -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') {

View File

@ -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',

View File

@ -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;