Commit c2e53748 authored by Michael Natterer's avatar Michael Natterer 😴

pdb, libgimp: make all PDB wrappers use GimpPDB to run procedures

parent 9a027140
Pipeline #102425 passed with stages
in 17 minutes and 54 seconds
......@@ -52,14 +52,20 @@
gchar *
gimp_version (void)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar *version = NULL;
args = gimp_value_array_new_from_types (G_TYPE_NONE);
return_vals = gimp_run_procedure_with_array ("gimp-version",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-version",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-version",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -84,14 +90,20 @@ gimp_version (void)
gint
gimp_getpid (void)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint pid = 0;
args = gimp_value_array_new_from_types (G_TYPE_NONE);
return_vals = gimp_run_procedure_with_array ("gimp-getpid",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-getpid",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-getpid",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -117,6 +129,7 @@ gimp_getpid (void)
gboolean
gimp_attach_parasite (const GimpParasite *parasite)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -125,8 +138,13 @@ gimp_attach_parasite (const GimpParasite *parasite)
G_TYPE_NONE);
g_value_set_boxed (gimp_value_array_index (args, 0), parasite);
return_vals = gimp_run_procedure_with_array ("gimp-attach-parasite",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-attach-parasite",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-attach-parasite",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -152,6 +170,7 @@ gimp_attach_parasite (const GimpParasite *parasite)
gboolean
gimp_detach_parasite (const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -160,8 +179,13 @@ gimp_detach_parasite (const gchar *name)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), name);
return_vals = gimp_run_procedure_with_array ("gimp-detach-parasite",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-detach-parasite",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-detach-parasite",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -186,6 +210,7 @@ gimp_detach_parasite (const gchar *name)
GimpParasite *
gimp_get_parasite (const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpParasite *parasite = NULL;
......@@ -194,8 +219,13 @@ gimp_get_parasite (const gchar *name)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), name);
return_vals = gimp_run_procedure_with_array ("gimp-get-parasite",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-get-parasite",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-get-parasite",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -223,14 +253,20 @@ gimp_get_parasite (const gchar *name)
gchar **
gimp_get_parasite_list (gint *num_parasites)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar **parasites = NULL;
args = gimp_value_array_new_from_types (G_TYPE_NONE);
return_vals = gimp_run_procedure_with_array ("gimp-get-parasite-list",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-get-parasite-list",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-get-parasite-list",
args);
gimp_value_array_unref (args);
*num_parasites = 0;
......@@ -261,6 +297,7 @@ gimp_get_parasite_list (gint *num_parasites)
gchar *
gimp_temp_name (const gchar *extension)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar *name = NULL;
......@@ -269,8 +306,13 @@ gimp_temp_name (const gchar *extension)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), extension);
return_vals = gimp_run_procedure_with_array ("gimp-temp-name",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-temp-name",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-temp-name",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......
This diff is collapsed.
......@@ -47,14 +47,20 @@
gboolean
gimp_brushes_refresh (void)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (G_TYPE_NONE);
return_vals = gimp_run_procedure_with_array ("gimp-brushes-refresh",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-brushes-refresh",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-brushes-refresh",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -83,6 +89,7 @@ gchar **
gimp_brushes_get_list (const gchar *filter,
gint *num_brushes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar **brush_list = NULL;
......@@ -91,8 +98,13 @@ gimp_brushes_get_list (const gchar *filter,
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), filter);
return_vals = gimp_run_procedure_with_array ("gimp-brushes-get-list",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-brushes-get-list",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-brushes-get-list",
args);
gimp_value_array_unref (args);
*num_brushes = 0;
......
......@@ -57,6 +57,7 @@ gimp_brushes_popup (const gchar *brush_callback,
gint spacing,
GimpLayerMode paint_mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -75,8 +76,13 @@ gimp_brushes_popup (const gchar *brush_callback,
g_value_set_int (gimp_value_array_index (args, 4), spacing);
g_value_set_enum (gimp_value_array_index (args, 5), paint_mode);
return_vals = gimp_run_procedure_with_array ("gimp-brushes-popup",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-brushes-popup",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-brushes-popup",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -99,6 +105,7 @@ gimp_brushes_popup (const gchar *brush_callback,
gboolean
gimp_brushes_close_popup (const gchar *brush_callback)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -107,8 +114,13 @@ gimp_brushes_close_popup (const gchar *brush_callback)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), brush_callback);
return_vals = gimp_run_procedure_with_array ("gimp-brushes-close-popup",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-brushes-close-popup",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-brushes-close-popup",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -139,6 +151,7 @@ gimp_brushes_set_popup (const gchar *brush_callback,
gint spacing,
GimpLayerMode paint_mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -155,8 +168,13 @@ gimp_brushes_set_popup (const gchar *brush_callback,
g_value_set_int (gimp_value_array_index (args, 3), spacing);
g_value_set_enum (gimp_value_array_index (args, 4), paint_mode);
return_vals = gimp_run_procedure_with_array ("gimp-brushes-set-popup",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-brushes-set-popup",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-brushes-set-popup",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......
......@@ -54,6 +54,7 @@ gchar **
gimp_buffers_get_list (const gchar *filter,
gint *num_buffers)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar **buffer_list = NULL;
......@@ -62,8 +63,13 @@ gimp_buffers_get_list (const gchar *filter,
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), filter);
return_vals = gimp_run_procedure_with_array ("gimp-buffers-get-list",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-buffers-get-list",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-buffers-get-list",
args);
gimp_value_array_unref (args);
*num_buffers = 0;
......@@ -97,6 +103,7 @@ gchar *
gimp_buffer_rename (const gchar *buffer_name,
const gchar *new_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gchar *real_name = NULL;
......@@ -107,8 +114,13 @@ gimp_buffer_rename (const gchar *buffer_name,
g_value_set_string (gimp_value_array_index (args, 0), buffer_name);
g_value_set_string (gimp_value_array_index (args, 1), new_name);
return_vals = gimp_run_procedure_with_array ("gimp-buffer-rename",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-buffer-rename",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-buffer-rename",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -134,6 +146,7 @@ gimp_buffer_rename (const gchar *buffer_name,
gboolean
gimp_buffer_delete (const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -142,8 +155,13 @@ gimp_buffer_delete (const gchar *buffer_name)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), buffer_name);
return_vals = gimp_run_procedure_with_array ("gimp-buffer-delete",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-buffer-delete",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-buffer-delete",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -168,6 +186,7 @@ gimp_buffer_delete (const gchar *buffer_name)
gint
gimp_buffer_get_width (const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint width = 0;
......@@ -176,8 +195,13 @@ gimp_buffer_get_width (const gchar *buffer_name)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), buffer_name);
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-width",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-buffer-get-width",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-width",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -203,6 +227,7 @@ gimp_buffer_get_width (const gchar *buffer_name)
gint
gimp_buffer_get_height (const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint height = 0;
......@@ -211,8 +236,13 @@ gimp_buffer_get_height (const gchar *buffer_name)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), buffer_name);
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-height",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-buffer-get-height",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-height",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -238,6 +268,7 @@ gimp_buffer_get_height (const gchar *buffer_name)
gint
gimp_buffer_get_bytes (const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint bytes = 0;
......@@ -246,8 +277,13 @@ gimp_buffer_get_bytes (const gchar *buffer_name)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), buffer_name);
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-bytes",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-buffer-get-bytes",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-bytes",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -273,6 +309,7 @@ gimp_buffer_get_bytes (const gchar *buffer_name)
GimpImageBaseType
gimp_buffer_get_image_type (const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpImageBaseType image_type = 0;
......@@ -281,8 +318,13 @@ gimp_buffer_get_image_type (const gchar *buffer_name)
G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), buffer_name);
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-image-type",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-buffer-get-image-type",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-buffer-get-image-type",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......
......@@ -63,6 +63,7 @@ _gimp_channel_new (gint32 image_ID,
gdouble opacity,
const GimpRGB *color)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 channel_ID = -1;
......@@ -81,8 +82,13 @@ _gimp_channel_new (gint32 image_ID,
g_value_set_double (gimp_value_array_index (args, 4), opacity);
gimp_value_set_rgb (gimp_value_array_index (args, 5), color);
return_vals = gimp_run_procedure_with_array ("gimp-channel-new",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-new",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -116,6 +122,7 @@ gimp_channel_new_from_component (gint32 image_ID,
GimpChannelType component,
const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 channel_ID = -1;
......@@ -128,8 +135,13 @@ gimp_channel_new_from_component (gint32 image_ID,
g_value_set_enum (gimp_value_array_index (args, 1), component);
g_value_set_string (gimp_value_array_index (args, 2), name);
return_vals = gimp_run_procedure_with_array ("gimp-channel-new-from-component",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-new-from-component",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-new-from-component",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -155,6 +167,7 @@ gimp_channel_new_from_component (gint32 image_ID,
gint32
gimp_channel_copy (gint32 channel_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 channel_copy_ID = -1;
......@@ -163,8 +176,13 @@ gimp_channel_copy (gint32 channel_ID)
G_TYPE_NONE);
gimp_value_set_channel_id (gimp_value_array_index (args, 0), channel_ID);
return_vals = gimp_run_procedure_with_array ("gimp-channel-copy",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-copy",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-copy",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -197,6 +215,7 @@ gimp_channel_combine_masks (gint32 channel1_ID,
gint offx,
gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -213,8 +232,13 @@ gimp_channel_combine_masks (gint32 channel1_ID,
g_value_set_int (gimp_value_array_index (args, 3), offx);
g_value_set_int (gimp_value_array_index (args, 4), offy);
return_vals = gimp_run_procedure_with_array ("gimp-channel-combine-masks",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-combine-masks",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-combine-masks",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -239,6 +263,7 @@ gimp_channel_combine_masks (gint32 channel1_ID,
gboolean
gimp_channel_get_show_masked (gint32 channel_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean show_masked = FALSE;
......@@ -247,8 +272,13 @@ gimp_channel_get_show_masked (gint32 channel_ID)
G_TYPE_NONE);
gimp_value_set_channel_id (gimp_value_array_index (args, 0), channel_ID);
return_vals = gimp_run_procedure_with_array ("gimp-channel-get-show-masked",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-get-show-masked",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-get-show-masked",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -276,6 +306,7 @@ gboolean
gimp_channel_set_show_masked (gint32 channel_ID,
gboolean show_masked)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -286,8 +317,13 @@ gimp_channel_set_show_masked (gint32 channel_ID,
gimp_value_set_channel_id (gimp_value_array_index (args, 0), channel_ID);
g_value_set_boolean (gimp_value_array_index (args, 1), show_masked);
return_vals = gimp_run_procedure_with_array ("gimp-channel-set-show-masked",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-set-show-masked",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-set-show-masked",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -310,6 +346,7 @@ gimp_channel_set_show_masked (gint32 channel_ID,
gdouble
gimp_channel_get_opacity (gint32 channel_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gdouble opacity = 0.0;
......@@ -318,8 +355,13 @@ gimp_channel_get_opacity (gint32 channel_ID)
G_TYPE_NONE);
gimp_value_set_channel_id (gimp_value_array_index (args, 0), channel_ID);
return_vals = gimp_run_procedure_with_array ("gimp-channel-get-opacity",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-get-opacity",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-get-opacity",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
......@@ -345,6 +387,7 @@ gboolean
gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -355,8 +398,13 @@ gimp_channel_set_opacity (gint32 channel_ID,
gimp_value_set_channel_id (gimp_value_array_index (args, 0), channel_ID);
g_value_set_double (gimp_value_array_index (args, 1), opacity);
return_vals = gimp_run_procedure_with_array ("gimp-channel-set-opacity",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-set-opacity",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-set-opacity",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -381,6 +429,7 @@ gboolean
gimp_channel_get_color (gint32 channel_ID,
GimpRGB *color)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -389,8 +438,13 @@ gimp_channel_get_color (gint32 channel_ID,
G_TYPE_NONE);
gimp_value_set_channel_id (gimp_value_array_index (args, 0), channel_ID);
return_vals = gimp_run_procedure_with_array ("gimp-channel-get-color",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-get-color",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-get-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -418,6 +472,7 @@ gboolean
gimp_channel_set_color (gint32 channel_ID,
const GimpRGB *color)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
......@@ -428,8 +483,13 @@ gimp_channel_set_color (gint32 channel_ID,
gimp_value_set_channel_id (gimp_value_array_index (args, 0), channel_ID);
gimp_value_set_rgb (gimp_value_array_index (args, 1), color);
return_vals = gimp_run_procedure_with_array ("gimp-channel-set-color",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-channel-set-color",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-channel-set-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......
This diff is collapsed.
......@@ -54,14 +54,20 @@
gboolean
gimp_debug_timer_start (void)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (G_TYPE_NONE);
return_vals = gimp_run_procedure_with_array ("gimp-debug-timer-start",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-debug-timer-start",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-debug-timer-start",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
......@@ -90,14 +96,20 @@ gimp_debug_timer_start (void)
gdouble
gimp_debug_timer_end (void)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gdouble elapsed = 0.0;
args = gimp_value_array_new_from_types (G_TYPE_NONE);
return_vals = gimp_run_procedure_with_array ("gimp-debug-timer-end",
args);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-debug-timer-end",
args);
else
return_vals = gimp_run_procedure_with_array ("gimp-debug-timer-end",
args);