Commit 67b845bc authored by Manish Singh's avatar Manish Singh

Resurrected channel_set_color

-Yosh
parent 0790fdc7
Thu Jan 25 10:22:39 PST 2001 Manish Singh <yosh@gimp.org>
* tools/pdbgen/pdb/channel.pdb: resurrected channel_set_color
2001-01-25 Michael Natterer <mitch@gimp.org>
* libgimp/Makefile.am
......
......@@ -44,6 +44,7 @@ static ProcRecord channel_set_show_masked_proc;
static ProcRecord channel_get_opacity_proc;
static ProcRecord channel_set_opacity_proc;
static ProcRecord channel_get_color_proc;
static ProcRecord channel_set_color_proc;
static ProcRecord channel_get_tattoo_proc;
static ProcRecord channel_set_tattoo_proc;
......@@ -62,6 +63,7 @@ register_channel_procs (void)
procedural_db_register (&channel_get_opacity_proc);
procedural_db_register (&channel_set_opacity_proc);
procedural_db_register (&channel_get_color_proc);
procedural_db_register (&channel_set_color_proc);
procedural_db_register (&channel_get_tattoo_proc);
procedural_db_register (&channel_set_tattoo_proc);
}
......@@ -746,6 +748,60 @@ static ProcRecord channel_get_color_proc =
{ { channel_get_color_invoker } }
};
static Argument *
channel_set_color_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpRGB color;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
success = FALSE;
color = args[1].value.pdb_color;
if (success)
{
GimpRGB rgb_color = color;
rgb_color.a = channel->color.a;
channel_set_color(channel, &rgb_color);
}
return procedural_db_return_args (&channel_set_color_proc, success);
}
static ProcArg channel_set_color_inargs[] =
{
{
PDB_CHANNEL,
"channel",
"The channel"
},
{
PDB_COLOR,
"color",
"The new channel compositing color"
}
};
static ProcRecord channel_set_color_proc =
{
"gimp_channel_set_color",
"Set the compositing color of the specified channel.",
"This procedure sets the specified channel's compositing color.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
PDB_INTERNAL,
2,
channel_set_color_inargs,
0,
NULL,
{ { channel_set_color_invoker } }
};
static Argument *
channel_get_tattoo_invoker (Argument *args)
{
......
......@@ -60,7 +60,7 @@ void register_tools_procs (void);
void register_undo_procs (void);
void register_unit_procs (void);
/* 322 procedures registered total */
/* 323 procedures registered total */
void
internal_procs_init (void)
......@@ -74,85 +74,85 @@ internal_procs_init (void)
app_init_update_status (NULL, _("Channel"), 0.043);
register_channel_procs ();
app_init_update_status (NULL, _("Channel Ops"), 0.087);
app_init_update_status (NULL, _("Channel Ops"), 0.09);
register_channel_ops_procs ();
app_init_update_status (NULL, _("Color"), 0.093);
app_init_update_status (NULL, _("Color"), 0.096);
register_color_procs ();
app_init_update_status (NULL, _("Convert"), 0.13);
app_init_update_status (NULL, _("Convert"), 0.133);
register_convert_procs ();
app_init_update_status (NULL, _("GDisplay procedures"), 0.14);
app_init_update_status (NULL, _("GDisplay procedures"), 0.142);
register_display_procs ();
app_init_update_status (NULL, _("Drawable procedures"), 0.149);
app_init_update_status (NULL, _("Drawable procedures"), 0.152);
register_drawable_procs ();
app_init_update_status (NULL, _("Edit procedures"), 0.217);
app_init_update_status (NULL, _("Edit procedures"), 0.22);
register_edit_procs ();
app_init_update_status (NULL, _("File Operations"), 0.236);
app_init_update_status (NULL, _("File Operations"), 0.238);
register_fileops_procs ();
app_init_update_status (NULL, _("Floating selections"), 0.261);
app_init_update_status (NULL, _("Floating selections"), 0.263);
register_floating_sel_procs ();
app_init_update_status (NULL, _("Gimprc procedures"), 0.28);
app_init_update_status (NULL, _("Gimprc procedures"), 0.282);
register_gimprc_procs ();
app_init_update_status (NULL, _("Gradients"), 0.289);
app_init_update_status (NULL, _("Gradients"), 0.291);
register_gradients_procs ();
app_init_update_status (NULL, _("Gradient UI"), 0.304);
app_init_update_status (NULL, _("Gradient UI"), 0.307);
register_gradient_select_procs ();
app_init_update_status (NULL, _("Guide procedures"), 0.317);
app_init_update_status (NULL, _("Guide procedures"), 0.319);
register_guides_procs ();
app_init_update_status (NULL, _("Help procedures"), 0.335);
app_init_update_status (NULL, _("Help procedures"), 0.337);
register_help_procs ();
app_init_update_status (NULL, _("Image"), 0.339);
app_init_update_status (NULL, _("Image"), 0.341);
register_image_procs ();
app_init_update_status (NULL, _("Layer"), 0.522);
app_init_update_status (NULL, _("Layer"), 0.523);
register_layer_procs ();
app_init_update_status (NULL, _("Interface"), 0.618);
app_init_update_status (NULL, _("Interface"), 0.619);
register_message_procs ();
app_init_update_status (NULL, _("Miscellaneous"), 0.627);
app_init_update_status (NULL, _("Miscellaneous"), 0.628);
register_misc_procs ();
app_init_update_status (NULL, _("Palette"), 0.634);
app_init_update_status (NULL, _("Palette"), 0.635);
register_palette_procs ();
app_init_update_status (NULL, _("Parasite procedures"), 0.655);
app_init_update_status (NULL, _("Parasite procedures"), 0.656);
register_parasite_procs ();
app_init_update_status (NULL, _("Paths"), 0.693);
register_paths_procs ();
app_init_update_status (NULL, _("Pattern UI"), 0.733);
app_init_update_status (NULL, _("Pattern UI"), 0.734);
register_pattern_select_procs ();
app_init_update_status (NULL, _("Patterns"), 0.742);
app_init_update_status (NULL, _("Patterns"), 0.743);
register_patterns_procs ();
app_init_update_status (NULL, _("Plug-in"), 0.755);
register_plug_in_procs ();
app_init_update_status (NULL, _("Procedural database"), 0.773);
app_init_update_status (NULL, _("Procedural database"), 0.774);
register_procedural_db_procs ();
app_init_update_status (NULL, _("Image mask"), 0.798);
app_init_update_status (NULL, _("Image mask"), 0.799);
register_selection_procs ();
app_init_update_status (NULL, _("Text procedures"), 0.851);
register_text_tool_procs ();
app_init_update_status (NULL, _("Tool procedures"), 0.863);
app_init_update_status (NULL, _("Tool procedures"), 0.864);
register_tools_procs ();
app_init_update_status (NULL, _("Undo"), 0.957);
......
......@@ -424,6 +424,38 @@ gimp_channel_get_color (gint32 channel_ID,
return success;
}
/**
* gimp_channel_set_color:
* @channel_ID: The channel.
* @color: The new channel compositing color.
*
* Set the compositing color of the specified channel.
*
* This procedure sets the specified channel's compositing color.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_set_color (gint32 channel_ID,
GimpRGB *color)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_channel_set_color",
&nreturn_vals,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_COLOR, color,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_channel_get_tattoo:
* @channel_ID: The channel.
......
......@@ -53,6 +53,8 @@ gboolean gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity);
gboolean gimp_channel_get_color (gint32 channel_ID,
GimpRGB *color);
gboolean gimp_channel_set_color (gint32 channel_ID,
GimpRGB *color);
gint gimp_channel_get_tattoo (gint32 channel_ID);
gboolean gimp_channel_set_tattoo (gint32 channel_ID,
gint tattoo);
......
......@@ -230,7 +230,7 @@ CODE
s%(color.a);$%(($1 / 100.0);%' ]);
&channel_accessors('color', 'color', 'compositing color', 0,
[ '$outargs[0]->{void_ret} = 1' ]);
[ '$outargs[0]->{void_ret} = 1', '' ]);
&channel_accessors('tattoo', 'tattoo', 'tattoo', 1,
<<'CODE');
......
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