Commit 449e84c1 authored by Michael Natterer's avatar Michael Natterer 😴

pdb: use guint for tatoo, guide, sample point, which they are

and initialize GimpUnit with PIXEL instead of just 0.
parent 0e1f7457
......@@ -491,7 +491,7 @@ context_get_line_width_unit_invoker (GimpProcedure *procedure,
GError **error)
{
GimpValueArray *return_vals;
GimpUnit line_width_unit = 0;
GimpUnit line_width_unit = GIMP_UNIT_PIXEL;
GimpStrokeOptions *options =
gimp_pdb_context_get_stroke_options (GIMP_PDB_CONTEXT (context));
......
......@@ -140,7 +140,7 @@ get_default_unit_invoker (GimpProcedure *procedure,
GError **error)
{
GimpValueArray *return_vals;
GimpUnit unit_id = 0;
GimpUnit unit_id = GIMP_UNIT_PIXEL;
unit_id = gimp_get_default_unit ();
......
......@@ -2359,7 +2359,7 @@ image_get_unit_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
GimpUnit unit = 0;
GimpUnit unit = GIMP_UNIT_PIXEL;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
......@@ -2412,7 +2412,7 @@ image_get_tattoo_state_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint tattoo_state = 0;
guint tattoo_state = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
......@@ -2440,7 +2440,7 @@ image_set_tattoo_state_invoker (GimpProcedure *procedure,
{
gboolean success = TRUE;
GimpImage *image;
gint tattoo_state;
guint tattoo_state;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
tattoo_state = g_value_get_uint (gimp_value_array_index (args, 1));
......@@ -2465,7 +2465,7 @@ image_get_layer_by_tattoo_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint tattoo;
guint tattoo;
GimpLayer *layer = NULL;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
......@@ -2496,7 +2496,7 @@ image_get_channel_by_tattoo_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint tattoo;
guint tattoo;
GimpChannel *channel = NULL;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
......@@ -2527,7 +2527,7 @@ image_get_vectors_by_tattoo_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint tattoo;
guint tattoo;
GimpVectors *vectors = NULL;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
......
......@@ -55,7 +55,7 @@ image_add_hguide_invoker (GimpProcedure *procedure,
GimpValueArray *return_vals;
GimpImage *image;
gint yposition;
gint guide = 0;
guint guide = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
yposition = g_value_get_int (gimp_value_array_index (args, 1));
......@@ -94,7 +94,7 @@ image_add_vguide_invoker (GimpProcedure *procedure,
GimpValueArray *return_vals;
GimpImage *image;
gint xposition;
gint guide = 0;
guint guide = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
xposition = g_value_get_int (gimp_value_array_index (args, 1));
......@@ -131,7 +131,7 @@ image_delete_guide_invoker (GimpProcedure *procedure,
{
gboolean success = TRUE;
GimpImage *image;
gint guide;
guint guide;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
guide = g_value_get_uint (gimp_value_array_index (args, 1));
......@@ -161,8 +161,8 @@ image_find_next_guide_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint guide;
gint next_guide = 0;
guint guide;
guint next_guide = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
guide = g_value_get_uint (gimp_value_array_index (args, 1));
......@@ -202,7 +202,7 @@ image_get_guide_orientation_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint guide;
guint guide;
gint orientation = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
......@@ -238,7 +238,7 @@ image_get_guide_position_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint guide;
guint guide;
gint position = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
......
......@@ -54,7 +54,7 @@ image_add_sample_point_invoker (GimpProcedure *procedure,
GimpImage *image;
gint position_x;
gint position_y;
gint sample_point = 0;
guint sample_point = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
position_x = g_value_get_int (gimp_value_array_index (args, 1));
......@@ -94,7 +94,7 @@ image_delete_sample_point_invoker (GimpProcedure *procedure,
{
gboolean success = TRUE;
GimpImage *image;
gint sample_point;
guint sample_point;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
sample_point = g_value_get_uint (gimp_value_array_index (args, 1));
......@@ -125,8 +125,8 @@ image_find_next_sample_point_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint sample_point;
gint next_sample_point = 0;
guint sample_point;
guint next_sample_point = 0;
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
sample_point = g_value_get_uint (gimp_value_array_index (args, 1));
......@@ -167,7 +167,7 @@ image_get_sample_point_position_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpImage *image;
gint sample_point;
guint sample_point;
gint position_x = 0;
gint position_y = 0;
......
......@@ -832,7 +832,7 @@ item_get_tattoo_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpValueArray *return_vals;
GimpItem *item;
gint tattoo = 0;
guint tattoo = 0;
item = gimp_value_get_item (gimp_value_array_index (args, 0), gimp);
......@@ -860,7 +860,7 @@ item_set_tattoo_invoker (GimpProcedure *procedure,
{
gboolean success = TRUE;
GimpItem *item;
gint tattoo;
guint tattoo;
item = gimp_value_get_item (gimp_value_array_index (args, 0), gimp);
tattoo = g_value_get_uint (gimp_value_array_index (args, 1));
......
......@@ -301,7 +301,7 @@ text_layer_get_font_size_invoker (GimpProcedure *procedure,
GimpValueArray *return_vals;
GimpLayer *layer;
gdouble font_size = 0.0;
GimpUnit unit = 0;
GimpUnit unit = GIMP_UNIT_PIXEL;
layer = gimp_value_get_layer (gimp_value_array_index (args, 0), gimp);
......
......@@ -92,7 +92,7 @@ unit_new_invoker (GimpProcedure *procedure,
const gchar *abbreviation;
const gchar *singular;
const gchar *plural;
GimpUnit unit_id = 0;
GimpUnit unit_id = GIMP_UNIT_PIXEL;
identifier = g_value_get_string (gimp_value_array_index (args, 0));
factor = g_value_get_double (gimp_value_array_index (args, 1));
......
......@@ -890,7 +890,7 @@ gimp_context_get_line_width_unit (void)
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpUnit line_width_unit = 0;
GimpUnit line_width_unit = GIMP_UNIT_PIXEL;
args = gimp_value_array_new_from_types (NULL,
G_TYPE_NONE);
......
......@@ -182,7 +182,7 @@ gimp_get_default_unit (void)
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpUnit unit_id = 0;
GimpUnit unit_id = GIMP_UNIT_PIXEL;
args = gimp_value_array_new_from_types (NULL,
G_TYPE_NONE);
......
......@@ -3172,7 +3172,7 @@ gimp_image_get_unit (gint32 image_ID)
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpUnit unit = 0;
GimpUnit unit = GIMP_UNIT_PIXEL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
......@@ -3252,13 +3252,13 @@ gimp_image_set_unit (gint32 image_ID,
*
* Returns: The tattoo state.
**/
gint
guint
gimp_image_get_tattoo_state (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint tattoo_state = 0;
guint tattoo_state = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
......@@ -3305,7 +3305,7 @@ gimp_image_get_tattoo_state (gint32 image_ID)
**/
gboolean
gimp_image_set_tattoo_state (gint32 image_ID,
gint tattoo_state)
guint tattoo_state)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -3314,7 +3314,7 @@ gimp_image_set_tattoo_state (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, tattoo_state,
G_TYPE_UINT, tattoo_state,
G_TYPE_NONE);
if (pdb)
......@@ -3347,7 +3347,7 @@ gimp_image_set_tattoo_state (gint32 image_ID,
**/
gint32
gimp_image_get_layer_by_tattoo (gint32 image_ID,
gint tattoo)
guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -3356,7 +3356,7 @@ gimp_image_get_layer_by_tattoo (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, tattoo,
G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
......@@ -3390,7 +3390,7 @@ gimp_image_get_layer_by_tattoo (gint32 image_ID,
**/
gint32
gimp_image_get_channel_by_tattoo (gint32 image_ID,
gint tattoo)
guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -3399,7 +3399,7 @@ gimp_image_get_channel_by_tattoo (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, tattoo,
G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
......@@ -3435,7 +3435,7 @@ gimp_image_get_channel_by_tattoo (gint32 image_ID,
**/
gint32
gimp_image_get_vectors_by_tattoo (gint32 image_ID,
gint tattoo)
guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -3444,7 +3444,7 @@ gimp_image_get_vectors_by_tattoo (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, tattoo,
G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
......
......@@ -168,15 +168,15 @@ gboolean gimp_image_set_resolution (gint32
GimpUnit gimp_image_get_unit (gint32 image_ID);
gboolean gimp_image_set_unit (gint32 image_ID,
GimpUnit unit);
gint gimp_image_get_tattoo_state (gint32 image_ID);
guint gimp_image_get_tattoo_state (gint32 image_ID);
gboolean gimp_image_set_tattoo_state (gint32 image_ID,
gint tattoo_state);
guint tattoo_state);
gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID,
gint tattoo);
guint tattoo);
gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID,
gint tattoo);
guint tattoo);
gint32 gimp_image_get_vectors_by_tattoo (gint32 image_ID,
gint tattoo);
guint tattoo);
gint32 gimp_image_get_layer_by_name (gint32 image_ID,
const gchar *name);
gint32 gimp_image_get_channel_by_name (gint32 image_ID,
......
......@@ -145,7 +145,7 @@ gimp_image_delete_guide (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, guide_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
......@@ -190,7 +190,7 @@ gimp_image_find_next_guide (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, guide_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
......@@ -233,7 +233,7 @@ gimp_image_get_guide_orientation (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, guide_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
......@@ -276,7 +276,7 @@ gimp_image_get_guide_position (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, guide_ID,
G_TYPE_UINT, guide_ID,
G_TYPE_NONE);
if (pdb)
......
......@@ -108,7 +108,7 @@ gimp_image_delete_sample_point (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, sample_point_ID,
G_TYPE_UINT, sample_point_ID,
G_TYPE_NONE);
if (pdb)
......@@ -156,7 +156,7 @@ gimp_image_find_next_sample_point (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, sample_point_ID,
G_TYPE_UINT, sample_point_ID,
G_TYPE_NONE);
if (pdb)
......@@ -204,7 +204,7 @@ gimp_image_get_sample_point_position (gint32 image_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, sample_point_ID,
G_TYPE_UINT, sample_point_ID,
G_TYPE_NONE);
if (pdb)
......
......@@ -1185,13 +1185,13 @@ gimp_item_set_color_tag (gint32 item_ID,
*
* Since: 2.8
**/
gint
guint
gimp_item_get_tattoo (gint32 item_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint tattoo = 0;
guint tattoo = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM_ID, item_ID,
......@@ -1231,7 +1231,7 @@ gimp_item_get_tattoo (gint32 item_ID)
**/
gboolean
gimp_item_set_tattoo (gint32 item_ID,
gint tattoo)
guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -1240,7 +1240,7 @@ gimp_item_set_tattoo (gint32 item_ID,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM_ID, item_ID,
G_TYPE_INT, tattoo,
G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
......
......@@ -67,9 +67,9 @@ gboolean gimp_item_set_lock_position (gint32 item_ID,
GimpColorTag gimp_item_get_color_tag (gint32 item_ID);
gboolean gimp_item_set_color_tag (gint32 item_ID,
GimpColorTag color_tag);
gint gimp_item_get_tattoo (gint32 item_ID);
guint gimp_item_get_tattoo (gint32 item_ID);
gboolean gimp_item_set_tattoo (gint32 item_ID,
gint tattoo);
guint tattoo);
gboolean gimp_item_attach_parasite (gint32 item_ID,
const GimpParasite *parasite);
gboolean gimp_item_detach_parasite (gint32 item_ID,
......
......@@ -279,7 +279,7 @@ package Gimp::CodeGen::pdb;
take_value_func => 'g_value_take_param ($value, $var)' },
# Special cases
enum => { name => 'INT32',
enum => { name => 'ENUM',
gtype => 'G_TYPE_ENUM',
type => 'gint ',
const_type => 'gint ',
......@@ -289,7 +289,7 @@ package Gimp::CodeGen::pdb;
set_value_func => 'g_value_set_enum ($value, $var)',
take_value_func => 'g_value_set_enum ($value, $var)' },
boolean => { name => 'INT32',
boolean => { name => 'BOOLEAN',
gtype => 'G_TYPE_BOOLEAN',
type => 'gboolean ',
const_type => 'gboolean ',
......@@ -299,20 +299,20 @@ package Gimp::CodeGen::pdb;
set_value_func => 'g_value_set_boolean ($value, $var)',
take_value_func => 'g_value_set_boolean ($value, $var)' },
tattoo => { name => 'INT32',
gtype => 'G_TYPE_INT',
type => 'gint ',
const_type => 'gint ',
tattoo => { name => 'TATTOO',
gtype => 'G_TYPE_UINT',
type => 'guint ',
const_type => 'guint ',
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)' },
guide => { name => 'INT32',
gtype => 'G_TYPE_INT',
type => 'gint ',
const_type => 'gint ',
guide => { name => 'GUIDE',
gtype => 'G_TYPE_UINT',
type => 'guint ',
const_type => 'guint ',
id => 1,
init_value => '0',
get_value_func => '$var = g_value_get_uint ($value)',
......@@ -320,10 +320,10 @@ package Gimp::CodeGen::pdb;
set_value_func => 'g_value_set_uint ($value, $var)',
take_value_func => 'g_value_set_uint ($value, $var)' },
sample_point => { name => 'INT32',
gtype => 'G_TYPE_INT',
type => 'gint ',
const_type => 'gint ',
sample_point => { name => 'SAMPLE_POINT',
gtype => 'G_TYPE_UINT',
type => 'guint ',
const_type => 'guint ',
id => 1,
init_value => '0',
get_value_func => '$var = g_value_get_uint ($value)',
......@@ -331,11 +331,11 @@ package Gimp::CodeGen::pdb;
set_value_func => 'g_value_set_uint ($value, $var)',
take_value_func => 'g_value_set_uint ($value, $var)' },
unit => { name => 'INT32',
unit => { name => 'UNIT',
gtype => 'GIMP_TYPE_UNIT',
type => 'GimpUnit ',
const_type => 'GimpUnit ',
init_value => '0',
init_value => 'GIMP_UNIT_PIXEL',
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_int ($value)',
dup_value_func => '$var = g_value_get_int ($value)',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment