Commit 0f7f322f authored by Michael Natterer's avatar Michael Natterer 😴

libgimp: _gimp_gp_params_to_value_array() remove "gboolean full_copy"

With all the GValue and GimpValueArray copying involved, we can't
really make a shallow copy anyway, so don't let the API pretend we
could.
parent 17f8cff6
......@@ -574,7 +574,7 @@ gimp_plug_in_handle_proc_run (GimpPlugIn *plug_in,
procedure ? procedure->num_args : 0,
proc_run->params,
proc_run->nparams,
FALSE, FALSE);
FALSE);
/* Execute the procedure even if gimp_pdb_lookup_procedure()
* returned NULL, gimp_pdb_execute_procedure_by_name_args() will
......@@ -645,7 +645,7 @@ gimp_plug_in_handle_proc_return (GimpPlugIn *plug_in,
proc_frame->procedure->num_values,
proc_return->params,
proc_return->nparams,
TRUE, TRUE);
TRUE);
if (proc_frame->main_loop)
{
......@@ -681,7 +681,7 @@ gimp_plug_in_handle_temp_proc_return (GimpPlugIn *plug_in,
proc_frame->procedure->num_values,
proc_return->params,
proc_return->nparams,
TRUE, TRUE);
TRUE);
gimp_plug_in_main_loop_quit (plug_in);
gimp_plug_in_proc_frame_pop (plug_in);
......
......@@ -442,8 +442,7 @@ static void
gimp_gp_param_to_value (gpointer gimp,
const GPParam *param,
GType type,
GValue *value,
gboolean full_copy)
GValue *value)
{
g_return_if_fail (param != NULL);
g_return_if_fail (value != NULL);
......@@ -476,10 +475,7 @@ gimp_gp_param_to_value (gpointer gimp,
}
else if (G_VALUE_HOLDS_STRING (value))
{
if (full_copy)
g_value_set_string (value, param->data.d_string);
else
g_value_set_static_string (value, param->data.d_string);
g_value_set_string (value, param->data.d_string);
}
else if (GIMP_VALUE_HOLDS_RGB (value))
{
......@@ -487,92 +483,51 @@ gimp_gp_param_to_value (gpointer gimp,
}
else if (GIMP_VALUE_HOLDS_PARASITE (value))
{
if (full_copy)
g_value_set_boxed (value, &param->data.d_parasite);
else
g_value_set_static_boxed (value, &param->data.d_parasite);
g_value_set_boxed (value, &param->data.d_parasite);
}
else if (GIMP_VALUE_HOLDS_INT32_ARRAY (value))
{
if (full_copy)
gimp_value_set_int32_array (value,
(gint32 *) param->data.d_array.data,
param->data.d_array.size /
sizeof (gint32));
else
gimp_value_set_static_int32_array (value,
(gint32 *) param->data.d_array.data,
param->data.d_array.size /
sizeof (gint32));
gimp_value_set_int32_array (value,
(gint32 *) param->data.d_array.data,
param->data.d_array.size /
sizeof (gint32));
}
else if (GIMP_VALUE_HOLDS_INT16_ARRAY (value))
{
if (full_copy)
gimp_value_set_int16_array (value,
(gint16 *) param->data.d_array.data,
param->data.d_array.size /
sizeof (gint16));
else
gimp_value_set_static_int16_array (value,
(gint16 *) param->data.d_array.data,
param->data.d_array.size /
sizeof (gint16));
gimp_value_set_int16_array (value,
(gint16 *) param->data.d_array.data,
param->data.d_array.size /
sizeof (gint16));
}
else if (GIMP_VALUE_HOLDS_UINT8_ARRAY (value))
{
if (full_copy)
gimp_value_set_uint8_array (value,
param->data.d_array.data,
param->data.d_array.size /
sizeof (guint8));
else
gimp_value_set_static_uint8_array (value,
param->data.d_array.data,
param->data.d_array.size /
sizeof (guint8));
gimp_value_set_uint8_array (value,
param->data.d_array.data,
param->data.d_array.size /
sizeof (guint8));
}
else if (GIMP_VALUE_HOLDS_FLOAT_ARRAY (value))
{
if (full_copy)
gimp_value_set_float_array (value,
(const gdouble *)
param->data.d_array.data,
param->data.d_array.size /
sizeof (gdouble));
else
gimp_value_set_static_float_array (value,
(const gdouble *)
param->data.d_array.data,
param->data.d_array.size /
sizeof (gdouble));
gimp_value_set_float_array (value,
(const gdouble *)
param->data.d_array.data,
param->data.d_array.size /
sizeof (gdouble));
}
else if (GIMP_VALUE_HOLDS_STRING_ARRAY (value))
{
if (full_copy)
gimp_value_set_string_array (value,
(const gchar **)
param->data.d_string_array.data,
param->data.d_string_array.size);
else
gimp_value_set_static_string_array (value,
(const gchar **)
param->data.d_string_array.data,
param->data.d_string_array.size);
gimp_value_set_string_array (value,
(const gchar **)
param->data.d_string_array.data,
param->data.d_string_array.size);
}
else if (GIMP_VALUE_HOLDS_RGB_ARRAY (value))
{
if (full_copy)
gimp_value_set_rgb_array (value,
(GimpRGB *)
param->data.d_array.data,
param->data.d_array.size /
sizeof (GimpRGB));
else
gimp_value_set_static_rgb_array (value,
(GimpRGB *)
param->data.d_array.data,
param->data.d_array.size /
sizeof (GimpRGB));
gimp_value_set_rgb_array (value,
(GimpRGB *)
param->data.d_array.data,
param->data.d_array.size /
sizeof (GimpRGB));
}
else if (GIMP_VALUE_HOLDS_OBJECT_ARRAY (value))
{
......@@ -635,8 +590,7 @@ _gimp_gp_params_to_value_array (gpointer gimp,
gint n_pspecs,
const GPParam *params,
gint n_params,
gboolean return_values,
gboolean full_copy)
gboolean return_values)
{
GimpValueArray *args;
gint i;
......@@ -702,7 +656,7 @@ _gimp_gp_params_to_value_array (gpointer gimp,
}
}
gimp_gp_param_to_value (gimp, &params[i], type, &value, full_copy);
gimp_gp_param_to_value (gimp, &params[i], type, &value);
gimp_value_array_append (args, &value);
g_value_unset (&value);
......
......@@ -34,8 +34,7 @@ GimpValueArray * _gimp_gp_params_to_value_array (gpointer gimp,
gint n_pspecs,
const GPParam *params,
gint n_params,
gboolean return_values,
gboolean full_copy);
gboolean return_values);
GPParam * _gimp_value_array_to_gp_params (const GimpValueArray *args,
gboolean full_copy);
......
......@@ -313,7 +313,7 @@ gimp_pdb_run_procedure_array (GimpPDB *pdb,
NULL, 0,
proc_return->params,
proc_return->nparams,
TRUE, FALSE);
TRUE);
gimp_wire_destroy (&msg);
......
......@@ -1170,7 +1170,7 @@ gimp_plug_in_proc_run_internal (GimpPlugIn *plug_in,
NULL, 0,
proc_run->params,
proc_run->nparams,
FALSE, FALSE);
FALSE);
return_values = gimp_procedure_run (procedure, arguments);
......
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