mirror of https://github.com/GNOME/gimp.git
libgimp: use the new macros in all non-generated files
This commit is contained in:
parent
4cb4b3ef3a
commit
6ed2d03c73
|
@ -200,14 +200,14 @@ gimp_temp_brush_run (GimpProcedure *procedure,
|
|||
g_free (data->brush_name);
|
||||
g_free (data->brush_mask_data);
|
||||
|
||||
data->brush_name = g_value_dup_string (gimp_value_array_index (args, 0));
|
||||
data->opacity = g_value_get_double (gimp_value_array_index (args, 1));
|
||||
data->spacing = g_value_get_int (gimp_value_array_index (args, 2));
|
||||
data->paint_mode = g_value_get_enum (gimp_value_array_index (args, 3));
|
||||
data->width = g_value_get_int (gimp_value_array_index (args, 4));
|
||||
data->height = g_value_get_int (gimp_value_array_index (args, 5));
|
||||
data->brush_mask_data = gimp_value_dup_uint8_array (gimp_value_array_index (args, 7));
|
||||
data->closing = g_value_get_boolean (gimp_value_array_index (args, 8));
|
||||
data->brush_name = GIMP_VALUES_DUP_STRING (args, 0);
|
||||
data->opacity = GIMP_VALUES_GET_DOUBLE (args, 1);
|
||||
data->spacing = GIMP_VALUES_GET_INT (args, 2);
|
||||
data->paint_mode = GIMP_VALUES_GET_ENUM (args, 3);
|
||||
data->width = GIMP_VALUES_GET_INT (args, 4);
|
||||
data->height = GIMP_VALUES_GET_INT (args, 5);
|
||||
data->brush_mask_data = GIMP_VALUES_DUP_UINT8_ARRAY (args, 7);
|
||||
data->closing = GIMP_VALUES_GET_BOOLEAN (args, 8);
|
||||
|
||||
if (! data->idle_id)
|
||||
data->idle_id = g_idle_add ((GSourceFunc) gimp_temp_brush_idle, data);
|
||||
|
|
|
@ -146,8 +146,8 @@ gimp_temp_font_run (GimpProcedure *procedure,
|
|||
|
||||
g_free (data->font_name);
|
||||
|
||||
data->font_name = g_value_dup_string (gimp_value_array_index (args, 0));
|
||||
data->closing = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
data->font_name = GIMP_VALUES_DUP_STRING (args, 0);
|
||||
data->closing = GIMP_VALUES_GET_BOOLEAN (args, 1);
|
||||
|
||||
if (! data->idle_id)
|
||||
data->idle_id = g_idle_add ((GSourceFunc) gimp_temp_font_idle,
|
||||
|
|
|
@ -393,7 +393,7 @@ _gimp_params_to_value_array (const GimpParam *params,
|
|||
break;
|
||||
|
||||
case GIMP_PDB_INT32ARRAY:
|
||||
count = g_value_get_int (gimp_value_array_index (args, i - 1));
|
||||
count = GIMP_VALUES_GET_INT (args, i - 1);
|
||||
if (full_copy)
|
||||
gimp_value_set_int32_array (&value,
|
||||
params[i].data.d_int32array,
|
||||
|
@ -405,7 +405,7 @@ _gimp_params_to_value_array (const GimpParam *params,
|
|||
break;
|
||||
|
||||
case GIMP_PDB_INT16ARRAY:
|
||||
count = g_value_get_int (gimp_value_array_index (args, i - 1));
|
||||
count = GIMP_VALUES_GET_INT (args, i - 1);
|
||||
if (full_copy)
|
||||
gimp_value_set_int16_array (&value,
|
||||
params[i].data.d_int16array,
|
||||
|
@ -417,7 +417,7 @@ _gimp_params_to_value_array (const GimpParam *params,
|
|||
break;
|
||||
|
||||
case GIMP_PDB_INT8ARRAY:
|
||||
count = g_value_get_int (gimp_value_array_index (args, i - 1));
|
||||
count = GIMP_VALUES_GET_INT (args, i - 1);
|
||||
if (full_copy)
|
||||
gimp_value_set_uint8_array (&value,
|
||||
params[i].data.d_int8array,
|
||||
|
@ -429,7 +429,7 @@ _gimp_params_to_value_array (const GimpParam *params,
|
|||
break;
|
||||
|
||||
case GIMP_PDB_FLOATARRAY:
|
||||
count = g_value_get_int (gimp_value_array_index (args, i - 1));
|
||||
count = GIMP_VALUES_GET_INT (args, i - 1);
|
||||
if (full_copy)
|
||||
gimp_value_set_float_array (&value,
|
||||
params[i].data.d_floatarray,
|
||||
|
@ -441,7 +441,7 @@ _gimp_params_to_value_array (const GimpParam *params,
|
|||
break;
|
||||
|
||||
case GIMP_PDB_STRINGARRAY:
|
||||
count = g_value_get_int (gimp_value_array_index (args, i - 1));
|
||||
count = GIMP_VALUES_GET_INT (args, i - 1);
|
||||
if (full_copy)
|
||||
gimp_value_set_string_array (&value,
|
||||
(const gchar **) params[i].data.d_stringarray,
|
||||
|
@ -485,7 +485,7 @@ _gimp_params_to_value_array (const GimpParam *params,
|
|||
break;
|
||||
|
||||
case GIMP_PDB_COLORARRAY:
|
||||
count = g_value_get_int (gimp_value_array_index (args, i - 1));
|
||||
count = GIMP_VALUES_GET_INT (args, i - 1);
|
||||
if (full_copy)
|
||||
gimp_value_set_rgb_array (&value,
|
||||
params[i].data.d_colorarray,
|
||||
|
|
|
@ -163,10 +163,10 @@ gimp_temp_gradient_run (GimpProcedure *procedure,
|
|||
g_free (data->gradient_name);
|
||||
g_free (data->gradient_data);
|
||||
|
||||
data->gradient_name = g_value_dup_string (gimp_value_array_index (args, 0));
|
||||
data->width = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
data->gradient_data = gimp_value_dup_float_array (gimp_value_array_index (args, 2));
|
||||
data->closing = g_value_get_boolean (gimp_value_array_index (args, 3));
|
||||
data->gradient_name = GIMP_VALUES_DUP_STRING (args, 0);
|
||||
data->width = GIMP_VALUES_GET_INT (args, 1);
|
||||
data->gradient_data = GIMP_VALUES_DUP_FLOAT_ARRAY (args, 2);
|
||||
data->closing = GIMP_VALUES_GET_BOOLEAN (args, 3);
|
||||
|
||||
if (! data->idle_id)
|
||||
data->idle_id = g_idle_add ((GSourceFunc) gimp_temp_gradient_idle, data);
|
||||
|
|
|
@ -117,9 +117,9 @@ gimp_image_procedure_run (GimpProcedure *procedure,
|
|||
gint32 drawable_id;
|
||||
gint i;
|
||||
|
||||
run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
|
||||
image_id = gimp_value_get_image_id (gimp_value_array_index (args, 1));
|
||||
drawable_id = gimp_value_get_drawable_id (gimp_value_array_index (args, 2));
|
||||
run_mode = GIMP_VALUES_GET_ENUM (args, 0);
|
||||
image_id = GIMP_VALUES_GET_IMAGE (args, 1);
|
||||
drawable_id = GIMP_VALUES_GET_DRAWABLE (args, 2);
|
||||
|
||||
remaining = gimp_value_array_new (gimp_value_array_length (args) - 3);
|
||||
|
||||
|
|
|
@ -168,9 +168,9 @@ gimp_load_procedure_run (GimpProcedure *procedure,
|
|||
GFile *file;
|
||||
gint i;
|
||||
|
||||
run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
|
||||
uri = g_value_get_string (gimp_value_array_index (args, 1));
|
||||
/* raw_uri = g_value_get_string (gimp_value_array_index (args, 2)); */
|
||||
run_mode = GIMP_VALUES_GET_ENUM (args, 0);
|
||||
uri = GIMP_VALUES_GET_STRING (args, 1);
|
||||
/* raw_uri = GIMP_VALUES_GET_STRING (args, 2); */
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
|
||||
|
|
|
@ -153,9 +153,9 @@ gimp_temp_palette_run (GimpProcedure *procedure,
|
|||
|
||||
g_free (data->palette_name);
|
||||
|
||||
data->palette_name = g_value_dup_string (gimp_value_array_index (args, 0));
|
||||
data->num_colors = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
data->closing = g_value_get_boolean (gimp_value_array_index (args, 2));
|
||||
data->palette_name = GIMP_VALUES_DUP_STRING (args, 0);
|
||||
data->num_colors = GIMP_VALUES_GET_INT (args, 1);
|
||||
data->closing = GIMP_VALUES_GET_BOOLEAN (args, 2);
|
||||
|
||||
if (! data->idle_id)
|
||||
data->idle_id = g_idle_add ((GSourceFunc) gimp_temp_palette_idle,
|
||||
|
|
|
@ -181,12 +181,12 @@ gimp_temp_pattern_run (GimpProcedure *procedure,
|
|||
g_free (data->pattern_name);
|
||||
g_free (data->pattern_mask_data);
|
||||
|
||||
data->pattern_name = g_value_dup_string (gimp_value_array_index (args, 0));
|
||||
data->width = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
data->height = g_value_get_int (gimp_value_array_index (args, 2));
|
||||
data->bytes = g_value_get_int (gimp_value_array_index (args, 3));
|
||||
data->pattern_mask_data = gimp_value_dup_uint8_array (gimp_value_array_index (args, 5));
|
||||
data->closing = g_value_get_boolean (gimp_value_array_index (args, 6));
|
||||
data->pattern_name = GIMP_VALUES_DUP_STRING (args, 0);
|
||||
data->width = GIMP_VALUES_GET_INT (args, 1);
|
||||
data->height = GIMP_VALUES_GET_INT (args, 2);
|
||||
data->bytes = GIMP_VALUES_GET_INT (args, 3);
|
||||
data->pattern_mask_data = GIMP_VALUES_DUP_UINT8_ARRAY (args, 5);
|
||||
data->closing = GIMP_VALUES_GET_BOOLEAN (args, 6);
|
||||
|
||||
if (! data->idle_id)
|
||||
data->idle_id = g_idle_add ((GSourceFunc) gimp_temp_pattern_idle, data);
|
||||
|
|
|
@ -602,8 +602,7 @@ gimp_pdb_set_error (GimpPDB *pdb,
|
|||
|
||||
if (gimp_value_array_length (return_values) > 0)
|
||||
{
|
||||
pdb->priv->error_status =
|
||||
g_value_get_enum (gimp_value_array_index (return_values, 0));
|
||||
pdb->priv->error_status = GIMP_VALUES_GET_ENUM (return_values, 0);
|
||||
|
||||
switch (pdb->priv->error_status)
|
||||
{
|
||||
|
|
|
@ -338,9 +338,9 @@ gimp_temp_progress_run (GimpProcedure *procedure,
|
|||
const gchar *text;
|
||||
gdouble value;
|
||||
|
||||
command = g_value_get_enum (gimp_value_array_index (args, 0));
|
||||
text = g_value_get_string (gimp_value_array_index (args, 1));
|
||||
value = g_value_get_double (gimp_value_array_index (args, 2));
|
||||
command = GIMP_VALUES_GET_ENUM (args, 0);
|
||||
text = GIMP_VALUES_GET_STRING (args, 1);
|
||||
value = GIMP_VALUES_GET_DOUBLE (args, 2);
|
||||
|
||||
switch (command)
|
||||
{
|
||||
|
@ -379,7 +379,7 @@ gimp_temp_progress_run (GimpProcedure *procedure,
|
|||
return_vals = gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_SUCCESS,
|
||||
NULL);
|
||||
g_value_set_double (gimp_value_array_index (return_vals, 1), window_id);
|
||||
GIMP_VALUES_SET_DOUBLE (return_vals, 1, window_id);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
|
|
@ -153,11 +153,11 @@ gimp_save_procedure_run (GimpProcedure *procedure,
|
|||
GFile *file;
|
||||
gint i;
|
||||
|
||||
run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
|
||||
image_id = gimp_value_get_image_id (gimp_value_array_index (args, 1));
|
||||
drawable_id = gimp_value_get_drawable_id (gimp_value_array_index (args, 2));
|
||||
uri = g_value_get_string (gimp_value_array_index (args, 3));
|
||||
/* raw_uri = g_value_get_string (gimp_value_array_index (args, 4)); */
|
||||
run_mode = GIMP_VALUES_GET_ENUM (args, 0);
|
||||
image_id = GIMP_VALUES_GET_IMAGE (args, 1);
|
||||
drawable_id = GIMP_VALUES_GET_DRAWABLE (args, 2);
|
||||
uri = GIMP_VALUES_GET_STRING (args, 3);
|
||||
/* raw_uri = GIMP_VALUES_GET_STRING (args, 4); */
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
|
||||
|
|
|
@ -141,8 +141,8 @@ gimp_thumbnail_procedure_run (GimpProcedure *procedure,
|
|||
gint size;
|
||||
gint i;
|
||||
|
||||
uri = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
size = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
uri = GIMP_VALUES_GET_STRING (args, 0);
|
||||
size = GIMP_VALUES_GET_INT (args, 1);
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
|
||||
|
|
Loading…
Reference in New Issue