2004-05-31 06:04:16 +08:00
/* The GIMP -- an image manipulation program
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
/* NOTE: This file is autogenerated by pdbgen.pl. */
# include "config.h"
# include <string.h>
# include <glib-object.h>
# include "libgimpcolor/gimpcolor.h"
# include "pdb-types.h"
2006-03-31 17:15:08 +08:00
# include "gimpprocedure.h"
2004-05-31 06:04:16 +08:00
# include "procedural_db.h"
2006-03-29 03:58:00 +08:00
# include "core/gimpparamspecs.h"
2004-05-31 06:04:16 +08:00
# include "core/gimp.h"
# include "core/gimpcontainer.h"
# include "core/gimpcontext.h"
# include "core/gimpdatafactory.h"
# include "core/gimpgradient.h"
# include "core/gimplist.h"
2004-09-29 06:01:21 +08:00
static ProcRecord gradient_new_proc ;
static ProcRecord gradient_duplicate_proc ;
2005-01-04 01:58:25 +08:00
static ProcRecord gradient_is_editable_proc ;
2004-09-29 06:01:21 +08:00
static ProcRecord gradient_rename_proc ;
static ProcRecord gradient_delete_proc ;
2004-10-06 07:28:17 +08:00
static ProcRecord gradient_get_uniform_samples_proc ;
static ProcRecord gradient_get_custom_samples_proc ;
2004-05-31 06:04:16 +08:00
static ProcRecord gradient_segment_get_left_color_proc ;
static ProcRecord gradient_segment_set_left_color_proc ;
static ProcRecord gradient_segment_get_right_color_proc ;
static ProcRecord gradient_segment_set_right_color_proc ;
static ProcRecord gradient_segment_get_left_pos_proc ;
static ProcRecord gradient_segment_set_left_pos_proc ;
static ProcRecord gradient_segment_get_middle_pos_proc ;
static ProcRecord gradient_segment_set_middle_pos_proc ;
static ProcRecord gradient_segment_get_right_pos_proc ;
static ProcRecord gradient_segment_set_right_pos_proc ;
static ProcRecord gradient_segment_get_blending_function_proc ;
static ProcRecord gradient_segment_get_coloring_type_proc ;
2004-06-03 01:45:56 +08:00
static ProcRecord gradient_segment_range_set_blending_function_proc ;
static ProcRecord gradient_segment_range_set_coloring_type_proc ;
2004-05-31 06:04:16 +08:00
static ProcRecord gradient_segment_range_flip_proc ;
static ProcRecord gradient_segment_range_replicate_proc ;
static ProcRecord gradient_segment_range_split_midpoint_proc ;
static ProcRecord gradient_segment_range_split_uniform_proc ;
static ProcRecord gradient_segment_range_delete_proc ;
static ProcRecord gradient_segment_range_redistribute_handles_proc ;
static ProcRecord gradient_segment_range_blend_colors_proc ;
static ProcRecord gradient_segment_range_blend_opacity_proc ;
static ProcRecord gradient_segment_range_move_proc ;
void
2004-09-29 06:01:21 +08:00
register_gradient_procs ( Gimp * gimp )
2004-05-31 06:04:16 +08:00
{
2006-03-30 04:27:46 +08:00
ProcRecord * procedure ;
2006-03-29 03:58:00 +08:00
/*
* gradient_new
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_new_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The requested name of the new gradient " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " actual-name " ,
" actual name " ,
" The actual new gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_duplicate
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_duplicate_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " copy-name " ,
" copy name " ,
" The name of the gradient's copy " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_is_editable
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_is_editable_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_boolean ( " editable " ,
" editable " ,
" TRUE if the gradient can be edited " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_rename
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_rename_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " new-name " ,
" new name " ,
" The new name of the gradient " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " actual-name " ,
" actual name " ,
" The actual new name of the gradient " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_delete
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_delete_proc , 1 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_get_uniform_samples
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_get_uniform_samples_proc , 3 , 2 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-samples " ,
" num samples " ,
" The number of samples to take " ,
2 , G_MAXINT32 , 2 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_boolean ( " reverse " ,
" reverse " ,
" Use the reverse gradient (TRUE or FALSE) " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-color-samples " ,
" num color samples " ,
" Length of the color_samples array (4 * num_samples) " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOATARRAY ,
g_param_spec_pointer ( " color-samples " ,
" color samples " ,
" Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An } " ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_get_custom_samples
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_get_custom_samples_proc , 4 , 2 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-samples " ,
" num samples " ,
" The number of samples to take " ,
1 , G_MAXINT32 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOATARRAY ,
g_param_spec_pointer ( " positions " ,
" positions " ,
" The list of positions to sample along the gradient " ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_boolean ( " reverse " ,
" reverse " ,
" Use the reverse gradient (TRUE or FALSE) " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-color-samples " ,
" num color samples " ,
" Length of the color_samples array (4 * num_samples) " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOATARRAY ,
g_param_spec_pointer ( " color-samples " ,
" color samples " ,
" Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An } " ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_get_left_color
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_get_left_color_proc , 2 , 2 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
2006-03-29 03:58:00 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_COLOR ,
gimp_param_spec_rgb ( " color " ,
" color " ,
" The return color " ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " opacity " ,
" opacity " ,
" The opacity of the endpoint " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_set_left_color
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_set_left_color_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_COLOR ,
gimp_param_spec_rgb ( " color " ,
" color " ,
" The color to set " ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " opacity " ,
" opacity " ,
" The opacity to set for the endpoint " ,
0 , 100.0 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_get_right_color
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_get_right_color_proc , 2 , 2 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
2006-03-29 03:58:00 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_COLOR ,
gimp_param_spec_rgb ( " color " ,
" color " ,
" The return color " ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " opacity " ,
" opacity " ,
" The opacity of the endpoint " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_set_right_color
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_set_right_color_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_COLOR ,
gimp_param_spec_rgb ( " color " ,
" color " ,
" The color to set " ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " opacity " ,
" opacity " ,
" The opacity to set for the endpoint " ,
0 , 100.0 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_get_left_pos
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_get_left_pos_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " pos " ,
" pos " ,
" The return position " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_set_left_pos
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_set_left_pos_proc , 3 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " pos " ,
" pos " ,
" The position to set the guidepoint to " ,
0.0 , 1.0 , 0.0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " final-pos " ,
" final pos " ,
" The return position " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_get_middle_pos
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_get_middle_pos_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " pos " ,
" pos " ,
" The return position " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_set_middle_pos
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_set_middle_pos_proc , 3 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " pos " ,
" pos " ,
" The position to set the guidepoint to " ,
0.0 , 1.0 , 0.0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " final-pos " ,
" final pos " ,
" The return position " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_get_right_pos
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_get_right_pos_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " pos " ,
" pos " ,
" The return position " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_set_right_pos
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_set_right_pos_proc , 3 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " pos " ,
" pos " ,
" The position to set the guidepoint to " ,
0.0 , 1.0 , 0.0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " final-pos " ,
" final pos " ,
" The return position " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_get_blending_function
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_get_blending_function_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " blend-func " ,
" blend func " ,
" The blending function of the segment: { GIMP_GRADIENT_SEGMENT_LINEAR (0), GIMP_GRADIENT_SEGMENT_CURVED (1), GIMP_GRADIENT_SEGMENT_SINE (2), GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING (3), GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING (4) } " ,
GIMP_TYPE_GRADIENT_SEGMENT_TYPE ,
GIMP_GRADIENT_SEGMENT_LINEAR ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_get_coloring_type
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_get_coloring_type_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " segment " ,
" segment " ,
" The index of the segment within the gradient " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " coloring-type " ,
" coloring type " ,
" The coloring type of the segment: { GIMP_GRADIENT_SEGMENT_RGB (0), GIMP_GRADIENT_SEGMENT_HSV_CCW (1), GIMP_GRADIENT_SEGMENT_HSV_CW (2) } " ,
GIMP_TYPE_GRADIENT_SEGMENT_COLOR ,
GIMP_GRADIENT_SEGMENT_RGB ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_set_blending_function
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_set_blending_function_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " blending-function " ,
" blending function " ,
" The Blending Function: { GIMP_GRADIENT_SEGMENT_LINEAR (0), GIMP_GRADIENT_SEGMENT_CURVED (1), GIMP_GRADIENT_SEGMENT_SINE (2), GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING (3), GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING (4) } " ,
GIMP_TYPE_GRADIENT_SEGMENT_TYPE ,
GIMP_GRADIENT_SEGMENT_LINEAR ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_set_coloring_type
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_set_coloring_type_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " coloring-type " ,
" coloring type " ,
" The Coloring Type: { GIMP_GRADIENT_SEGMENT_RGB (0), GIMP_GRADIENT_SEGMENT_HSV_CCW (1), GIMP_GRADIENT_SEGMENT_HSV_CW (2) } " ,
GIMP_TYPE_GRADIENT_SEGMENT_COLOR ,
GIMP_GRADIENT_SEGMENT_RGB ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_flip
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_flip_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_replicate
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_replicate_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " replicate-times " ,
" replicate times " ,
" The number of times to replicate " ,
2 , 20 , 2 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_split_midpoint
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_split_midpoint_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_split_uniform
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_split_uniform_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " split-parts " ,
" split parts " ,
" The number of uniform divisions to split each segment to " ,
2 , 20 , 2 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_delete
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_delete_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_redistribute_handles
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_redistribute_handles_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_blend_colors
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_blend_colors_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_blend_opacity
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_blend_opacity_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
/*
* gradient_segment_range_move
*/
2006-03-31 17:15:08 +08:00
procedure = gimp_procedure_init ( & gradient_segment_range_move_proc , 5 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The gradient name " ,
FALSE , FALSE ,
NULL ,
2006-03-29 03:58:00 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 17:15:08 +08:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-segment " ,
" start segment " ,
" The index of the first segment to operate on " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-segment " ,
" end segment " ,
" The index of the last segment to operate on. If negative, the selection will extend to the end of the string. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " delta " ,
" delta " ,
" The delta to move the segment range " ,
- 1.0 , 1.0 , - 1.0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_boolean ( " control-compress " ,
" control compress " ,
" Whether or not to compress the neighboring segments " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " final-delta " ,
" final delta " ,
" The final delta by which the range moved " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-30 04:27:46 +08:00
procedural_db_register ( gimp , procedure ) ;
2006-03-29 03:58:00 +08:00
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
GimpGradient *
gradient_get ( Gimp * gimp ,
const gchar * name ,
gint segment ,
GimpGradientSegment * * seg )
{
GimpGradient * gradient = ( GimpGradient * )
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
* seg = NULL ;
if ( gradient )
* seg = gimp_gradient_segment_get_nth ( gradient - > segments , segment ) ;
return gradient ;
}
GimpGradient *
gradient_get_range ( Gimp * gimp ,
const gchar * name ,
gint start_segment ,
gint end_segment ,
GimpGradientSegment * * start_seg ,
GimpGradientSegment * * end_seg )
{
GimpGradient * gradient = ( GimpGradient * )
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
* start_seg = NULL ;
* end_seg = NULL ;
if ( end_segment > = 0 & & end_segment < start_segment )
return NULL ;
if ( gradient )
{
* start_seg = gimp_gradient_segment_get_nth ( gradient - > segments ,
start_segment ) ;
if ( * start_seg & & end_segment > = 0 )
* end_seg = gimp_gradient_segment_get_nth ( * start_seg ,
end_segment -
start_segment ) ;
}
return gradient ;
}
2004-09-29 06:01:21 +08:00
static Argument *
2006-03-28 03:32:19 +08:00
gradient_new_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-09-29 06:01:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-09-29 06:01:21 +08:00
gchar * name ;
2006-03-15 20:49:25 +08:00
gchar * actual_name = NULL ;
2004-09-29 06:01:21 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-29 06:01:21 +08:00
if ( success )
{
2004-10-04 17:39:27 +08:00
if ( strlen ( name ) )
2006-03-15 20:49:25 +08:00
{
GimpData * data = gimp_data_factory_data_new ( gimp - > gradient_factory , name ) ;
2004-10-04 17:39:27 +08:00
2006-03-15 20:49:25 +08:00
if ( data )
2006-03-25 05:57:47 +08:00
actual_name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( data ) ) ) ;
2006-03-15 20:49:25 +08:00
else
success = FALSE ;
}
else
success = FALSE ;
2004-09-29 06:01:21 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-09-29 06:01:21 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_take_string ( & return_vals [ 1 ] . value , actual_name ) ;
2004-09-29 06:01:21 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-09-29 06:01:21 +08:00
}
static ProcRecord gradient_new_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-new " ,
" gimp-gradient-new " ,
2004-09-29 06:01:21 +08:00
" Creates a new gradient " ,
" This procedure creates a new, uninitialized gradient " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-09-29 06:01:21 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-09-29 06:01:21 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-09-29 06:01:21 +08:00
{ { gradient_new_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_duplicate_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-09-29 06:01:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-09-29 06:01:21 +08:00
gchar * name ;
2006-03-15 20:49:25 +08:00
gchar * copy_name = NULL ;
2004-09-29 06:01:21 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-29 06:01:21 +08:00
if ( success )
{
2006-03-15 20:49:25 +08:00
GimpGradient * gradient = ( GimpGradient * )
2004-10-06 07:28:17 +08:00
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
2004-09-29 06:01:21 +08:00
if ( gradient )
{
2006-03-15 20:49:25 +08:00
GimpGradient * gradient_copy = ( GimpGradient * )
2004-09-29 06:01:21 +08:00
gimp_data_factory_data_duplicate ( gimp - > gradient_factory ,
GIMP_DATA ( gradient ) ) ;
2006-03-15 20:49:25 +08:00
if ( gradient_copy )
2006-03-25 05:57:47 +08:00
copy_name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( gradient_copy ) ) ) ;
2006-03-15 20:49:25 +08:00
else
success = FALSE ;
2004-09-29 06:01:21 +08:00
}
else
success = FALSE ;
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-09-29 06:01:21 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_take_string ( & return_vals [ 1 ] . value , copy_name ) ;
2004-09-29 06:01:21 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-09-29 06:01:21 +08:00
}
static ProcRecord gradient_duplicate_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-duplicate " ,
" gimp-gradient-duplicate " ,
2004-09-29 06:01:21 +08:00
" Duplicates a gradient " ,
" This procedure creates an identical gradient by a different name " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-09-29 06:01:21 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-09-29 06:01:21 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-09-29 06:01:21 +08:00
{ { gradient_duplicate_invoker } }
} ;
2005-01-04 01:58:25 +08:00
static Argument *
2006-03-28 03:32:19 +08:00
gradient_is_editable_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2005-01-04 01:58:25 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2005-01-04 01:58:25 +08:00
gchar * name ;
2006-03-15 20:49:25 +08:00
gboolean editable = FALSE ;
2005-01-04 01:58:25 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2005-01-04 01:58:25 +08:00
if ( success )
{
2006-03-15 20:49:25 +08:00
GimpGradient * gradient = ( GimpGradient * )
2005-01-04 01:58:25 +08:00
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
if ( gradient )
2006-03-15 20:49:25 +08:00
editable = GIMP_DATA ( gradient ) - > writable ;
2005-01-04 01:58:25 +08:00
else
success = FALSE ;
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2005-01-04 01:58:25 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_boolean ( & return_vals [ 1 ] . value , editable ) ;
2005-01-04 01:58:25 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2005-01-04 01:58:25 +08:00
}
static ProcRecord gradient_is_editable_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-is-editable " ,
" gimp-gradient-is-editable " ,
2005-01-04 01:58:25 +08:00
" Tests if gradient can be edited " ,
2006-03-22 05:48:21 +08:00
" Returns TRUE if you have permission to change the gradient " ,
2006-03-15 05:35:50 +08:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2005-01-04 01:58:25 +08:00
" Bill Skaggs " ,
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2005-01-04 01:58:25 +08:00
{ { gradient_is_editable_invoker } }
} ;
2004-09-29 06:01:21 +08:00
static Argument *
2006-03-28 03:32:19 +08:00
gradient_rename_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-09-29 06:01:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-09-29 06:01:21 +08:00
gchar * name ;
gchar * new_name ;
2006-03-15 20:49:25 +08:00
gchar * actual_name = NULL ;
2004-09-29 06:01:21 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
new_name = ( gchar * ) g_value_get_string ( & args [ 1 ] . value ) ;
2004-09-29 06:01:21 +08:00
if ( success )
{
2006-03-15 20:49:25 +08:00
GimpGradient * gradient = ( GimpGradient * )
2004-10-06 07:28:17 +08:00
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
2004-09-29 06:01:21 +08:00
if ( gradient & & GIMP_DATA ( gradient ) - > writable )
2006-03-15 20:49:25 +08:00
{
gimp_object_set_name ( GIMP_OBJECT ( gradient ) , new_name ) ;
2006-03-25 05:57:47 +08:00
actual_name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( gradient ) ) ) ;
2006-03-15 20:49:25 +08:00
}
2004-09-29 06:01:21 +08:00
else
success = FALSE ;
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-09-29 06:01:21 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_take_string ( & return_vals [ 1 ] . value , actual_name ) ;
2004-09-29 06:01:21 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-09-29 06:01:21 +08:00
}
static ProcRecord gradient_rename_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-rename " ,
" gimp-gradient-rename " ,
2004-09-29 06:01:21 +08:00
" Rename a gradient " ,
" This procedure renames a gradient " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-09-29 06:01:21 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-09-29 06:01:21 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-09-29 06:01:21 +08:00
{ { gradient_rename_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_delete_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-09-29 06:01:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
{
gboolean success = TRUE ;
gchar * name ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-29 06:01:21 +08:00
if ( success )
{
2006-03-15 20:49:25 +08:00
GimpGradient * gradient = ( GimpGradient * )
2004-10-06 07:28:17 +08:00
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
2004-09-29 06:01:21 +08:00
if ( gradient & & GIMP_DATA ( gradient ) - > deletable )
{
GError * error = NULL ;
success = gimp_data_factory_data_delete ( gimp - > gradient_factory ,
GIMP_DATA ( gradient ) ,
TRUE , & error ) ;
if ( ! success )
{
g_message ( error - > message ) ;
g_clear_error ( & error ) ;
}
}
else
success = FALSE ;
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-09-29 06:01:21 +08:00
}
static ProcRecord gradient_delete_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-delete " ,
" gimp-gradient-delete " ,
2004-09-29 06:01:21 +08:00
" Deletes a gradient " ,
" This procedure deletes a gradient " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-09-29 06:01:21 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-09-29 06:01:21 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-09-29 06:01:21 +08:00
{ { gradient_delete_invoker } }
} ;
2004-10-06 07:28:17 +08:00
static Argument *
2006-03-28 03:32:19 +08:00
gradient_get_uniform_samples_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-10-06 07:28:17 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-10-06 07:28:17 +08:00
gchar * name ;
gint32 num_samples ;
gboolean reverse ;
gint32 num_color_samples = 0 ;
gdouble * color_samples = NULL ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
num_samples = g_value_get_int ( & args [ 1 ] . value ) ;
reverse = g_value_get_boolean ( & args [ 2 ] . value ) ;
2004-10-06 07:28:17 +08:00
if ( success )
{
2006-03-15 20:49:25 +08:00
GimpGradient * gradient = ( GimpGradient * )
2004-10-06 07:28:17 +08:00
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
if ( gradient )
{
2005-02-27 07:55:50 +08:00
GimpGradientSegment * seg = NULL ;
gdouble pos = 0.0 ;
gdouble delta = 1.0 / ( num_samples - 1 ) ;
gdouble * sample ;
2004-10-06 07:28:17 +08:00
num_color_samples = num_samples * 4 ;
sample = color_samples = g_new ( gdouble , num_color_samples ) ;
while ( num_samples - - )
{
GimpRGB color ;
2005-02-27 07:55:50 +08:00
seg = gimp_gradient_get_color_at ( gradient , seg , pos , reverse , & color ) ;
2004-10-06 07:28:17 +08:00
* sample + + = color . r ;
* sample + + = color . g ;
* sample + + = color . b ;
* sample + + = color . a ;
pos + = delta ;
}
}
else
success = FALSE ;
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-10-06 07:28:17 +08:00
if ( success )
{
2006-03-30 07:56:07 +08:00
g_value_set_int ( & return_vals [ 1 ] . value , num_color_samples ) ;
g_value_set_pointer ( & return_vals [ 2 ] . value , color_samples ) ;
2004-10-06 07:28:17 +08:00
}
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-10-06 07:28:17 +08:00
}
static ProcRecord gradient_get_uniform_samples_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-get-uniform-samples " ,
" gimp-gradient-get-uniform-samples " ,
2004-10-06 07:28:17 +08:00
" Sample the specified in uniform parts. " ,
" This procedure samples the active gradient in the specified number of uniform parts. It returns a list of floating-point values which correspond to the RGBA values for each sample. The minimum number of samples to take is 2, in which case the returned colors will correspond to the { 0.0, 1.0 } positions in the gradient. For example, if the number of samples is 3, the procedure will return the colors at positions { 0.0, 0.5, 1.0 }. " ,
" Federico Mena Quintero " ,
" Federico Mena Quintero " ,
" 1997 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-10-06 07:28:17 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-10-06 07:28:17 +08:00
{ { gradient_get_uniform_samples_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_get_custom_samples_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-10-06 07:28:17 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-10-06 07:28:17 +08:00
gchar * name ;
gint32 num_samples ;
2006-03-15 23:00:01 +08:00
gdouble * positions ;
2004-10-06 07:28:17 +08:00
gboolean reverse ;
gint32 num_color_samples = 0 ;
gdouble * color_samples = NULL ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
num_samples = g_value_get_int ( & args [ 1 ] . value ) ;
positions = g_value_get_pointer ( & args [ 2 ] . value ) ;
reverse = g_value_get_boolean ( & args [ 3 ] . value ) ;
2004-10-06 07:28:17 +08:00
if ( success )
{
2006-03-15 20:49:25 +08:00
GimpGradient * gradient = ( GimpGradient * )
2004-10-06 07:28:17 +08:00
gimp_container_get_child_by_name ( gimp - > gradient_factory - > container , name ) ;
if ( gradient )
{
2005-02-27 07:55:50 +08:00
GimpGradientSegment * seg = NULL ;
gdouble * sample ;
2004-10-06 07:28:17 +08:00
num_color_samples = num_samples * 4 ;
sample = color_samples = g_new ( gdouble , num_color_samples ) ;
while ( num_samples - - )
{
GimpRGB color ;
2006-03-15 23:00:01 +08:00
seg = gimp_gradient_get_color_at ( gradient , seg , * positions ,
reverse , & color ) ;
2004-10-06 07:28:17 +08:00
* sample + + = color . r ;
* sample + + = color . g ;
* sample + + = color . b ;
* sample + + = color . a ;
2006-03-15 23:00:01 +08:00
positions + + ;
2004-10-06 07:28:17 +08:00
}
}
else
success = FALSE ;
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-10-06 07:28:17 +08:00
if ( success )
{
2006-03-30 07:56:07 +08:00
g_value_set_int ( & return_vals [ 1 ] . value , num_color_samples ) ;
g_value_set_pointer ( & return_vals [ 2 ] . value , color_samples ) ;
2004-10-06 07:28:17 +08:00
}
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-10-06 07:28:17 +08:00
}
static ProcRecord gradient_get_custom_samples_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-get-custom-samples " ,
" gimp-gradient-get-custom-samples " ,
2004-10-06 07:28:17 +08:00
" Sample the spacified gradient in custom positions. " ,
" This procedure samples the active gradient in the specified number of points. The procedure will sample the gradient in the specified positions from the list. The left endpoint of the gradient corresponds to position 0.0, and the right endpoint corresponds to 1.0. The procedure returns a list of floating-point values which correspond to the RGBA values for each sample. " ,
" Federico Mena Quintero " ,
" Federico Mena Quintero " ,
" 1997 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-10-06 07:28:17 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-10-06 07:28:17 +08:00
{ { gradient_get_custom_samples_invoker } }
} ;
2004-05-31 06:04:16 +08:00
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_get_left_color_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
2006-03-15 23:32:39 +08:00
GimpRGB color = { 0.0 , 0.0 , 0.0 , 1.0 } ;
gdouble opacity = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg )
{
gimp_gradient_segment_get_left_color ( gradient , seg , & color ) ;
opacity = color . a * 100.0 ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-30 07:56:07 +08:00
gimp_value_set_rgb ( & return_vals [ 1 ] . value , & color ) ;
g_value_set_double ( & return_vals [ 2 ] . value , opacity ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_get_left_color_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-get-left-color " ,
" gimp-gradient-segment-get-left-color " ,
2006-03-22 05:48:21 +08:00
" Retrieves the left endpoint color of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure retrieves the left endpoint color of the specified segment of the specified gradient. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_get_left_color_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_set_left_color_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 segment ;
GimpRGB color ;
gdouble opacity ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
gimp_value_get_rgb ( & args [ 2 ] . value , & color ) ;
opacity = g_value_get_double ( & args [ 3 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg & & GIMP_DATA ( gradient ) - > writable )
{
color . a = opacity / 100.0 ;
gimp_gradient_segment_set_left_color ( gradient , seg , & color ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_set_left_color_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-set-left-color " ,
" gimp-gradient-segment-set-left-color " ,
2006-03-22 05:48:21 +08:00
" Retrieves the left endpoint color of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure retrieves the left endpoint color of the specified segment of the specified gradient. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_set_left_color_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_get_right_color_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
2006-03-15 23:32:39 +08:00
GimpRGB color = { 0.0 , 0.0 , 0.0 , 1.0 } ;
gdouble opacity = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg )
{
gimp_gradient_segment_get_right_color ( gradient , seg , & color ) ;
opacity = color . a * 100.0 ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-30 07:56:07 +08:00
gimp_value_set_rgb ( & return_vals [ 1 ] . value , & color ) ;
g_value_set_double ( & return_vals [ 2 ] . value , opacity ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_get_right_color_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-get-right-color " ,
" gimp-gradient-segment-get-right-color " ,
2006-03-22 05:48:21 +08:00
" Retrieves the right endpoint color of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure retrieves the right endpoint color of the specified segment of the specified gradient. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_get_right_color_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_set_right_color_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 segment ;
GimpRGB color ;
gdouble opacity ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
gimp_value_get_rgb ( & args [ 2 ] . value , & color ) ;
opacity = g_value_get_double ( & args [ 3 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg & & GIMP_DATA ( gradient ) - > writable )
{
color . a = opacity / 100.0 ;
gimp_gradient_segment_set_right_color ( gradient , seg , & color ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_set_right_color_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-set-right-color " ,
" gimp-gradient-segment-set-right-color " ,
2006-03-22 05:48:21 +08:00
" Retrieves the right endpoint color of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure retrieves the right endpoint color of the specified segment of the specified gradient. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_set_right_color_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_get_left_pos_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
2006-03-15 23:32:39 +08:00
gdouble pos = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg )
{
pos = gimp_gradient_segment_get_left_pos ( gradient , seg ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_double ( & return_vals [ 1 ] . value , pos ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_get_left_pos_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-get-left-pos " ,
" gimp-gradient-segment-get-left-pos " ,
2006-03-22 05:48:21 +08:00
" Retrieves the left endpoint position of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure retrieves the left endpoint position of the specified segment of the specified gradient. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_get_left_pos_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_set_left_pos_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
gdouble pos ;
2006-03-15 23:32:39 +08:00
gdouble final_pos = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
pos = g_value_get_double ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg & & GIMP_DATA ( gradient ) - > writable )
{
final_pos = gimp_gradient_segment_set_left_pos ( gradient , seg , pos ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_double ( & return_vals [ 1 ] . value , final_pos ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_set_left_pos_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-set-left-pos " ,
" gimp-gradient-segment-set-left-pos " ,
2006-03-22 05:48:21 +08:00
" Sets the left endpoint position of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure sets the left endpoint position of the specified segment of the specified gradient. The final position will be between the position of the middle point to the left to the middle point of the current segement. This procedure returns the final position. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_set_left_pos_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_get_middle_pos_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
2006-03-15 23:32:39 +08:00
gdouble pos = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg )
{
pos = gimp_gradient_segment_get_middle_pos ( gradient , seg ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_double ( & return_vals [ 1 ] . value , pos ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_get_middle_pos_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-get-middle-pos " ,
" gimp-gradient-segment-get-middle-pos " ,
2006-03-22 05:48:21 +08:00
" Retrieves the middle point position of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure retrieves the middle point position of the specified segment of the specified gradient. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_get_middle_pos_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_set_middle_pos_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
gdouble pos ;
2006-03-15 23:32:39 +08:00
gdouble final_pos = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
pos = g_value_get_double ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg & & GIMP_DATA ( gradient ) - > writable )
{
final_pos =
gimp_gradient_segment_set_middle_pos ( gradient , seg , pos ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_double ( & return_vals [ 1 ] . value , final_pos ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_set_middle_pos_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-set-middle-pos " ,
" gimp-gradient-segment-set-middle-pos " ,
2006-03-22 05:48:21 +08:00
" Sets the middle point position of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure sets the middle point position of the specified segment of the specified gradient. The final position will be between the two endpoints of the segment. This procedure returns the final position. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_set_middle_pos_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_get_right_pos_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
2006-03-15 23:32:39 +08:00
gdouble pos = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg )
{
pos = gimp_gradient_segment_get_right_pos ( gradient , seg ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_double ( & return_vals [ 1 ] . value , pos ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_get_right_pos_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-get-right-pos " ,
" gimp-gradient-segment-get-right-pos " ,
2006-03-22 05:48:21 +08:00
" Retrieves the right endpoint position of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure retrieves the right endpoint position of the specified segment of the specified gradient. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_get_right_pos_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_set_right_pos_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
gdouble pos ;
2006-03-15 23:32:39 +08:00
gdouble final_pos = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
pos = g_value_get_double ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg & & GIMP_DATA ( gradient ) - > writable )
{
final_pos =
gimp_gradient_segment_set_right_pos ( gradient , seg , pos ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_double ( & return_vals [ 1 ] . value , final_pos ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_set_right_pos_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-set-right-pos " ,
" gimp-gradient-segment-set-right-pos " ,
2006-03-22 05:48:21 +08:00
" Sets the right endpoint position of the specified segment " ,
2004-05-31 06:04:16 +08:00
" This procedure sets the right endpoint position of the specified segment of the specified gradient. The final position will be between the position of the middle point of the current segment and the middle point of the segment to the right. This procedure returns the final position. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_set_right_pos_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_get_blending_function_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 segment ;
gint32 blend_func = 0 ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-02 05:58:08 +08:00
2006-03-22 05:48:21 +08:00
if ( seg )
{
blend_func = gimp_gradient_segment_get_blending_function ( gradient , seg ) ;
2004-05-31 06:04:16 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_enum ( & return_vals [ 1 ] . value , blend_func ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_get_blending_function_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-get-blending-function " ,
" gimp-gradient-segment-get-blending-function " ,
2004-05-31 06:04:16 +08:00
" Retrieves the gradient segment's blending function " ,
" This procedure retrieves the blending function of the segment at the specified gradient name and segment index. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_get_blending_function_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_get_coloring_type_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-06-03 01:45:56 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-06-03 01:45:56 +08:00
gchar * name ;
gint32 segment ;
gint32 coloring_type = 0 ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
segment = g_value_get_int ( & args [ 1 ] . value ) ;
2004-06-03 01:45:56 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * seg ;
2004-06-03 01:45:56 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get ( gimp , name , segment , & seg ) ;
2004-06-03 01:45:56 +08:00
2006-03-22 05:48:21 +08:00
if ( seg )
{
coloring_type = gimp_gradient_segment_get_coloring_type ( gradient , seg ) ;
2004-06-03 01:45:56 +08:00
}
2004-10-06 07:28:17 +08:00
else
success = FALSE ;
2004-06-03 01:45:56 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-06-03 01:45:56 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_enum ( & return_vals [ 1 ] . value , coloring_type ) ;
2004-06-03 01:45:56 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-06-03 01:45:56 +08:00
}
static ProcRecord gradient_segment_get_coloring_type_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-get-coloring-type " ,
" gimp-gradient-segment-get-coloring-type " ,
2004-06-03 01:45:56 +08:00
" Retrieves the gradient segment's coloring type " ,
" This procedure retrieves the coloring type of the segment at the specified gradient name and segment index. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-06-03 01:45:56 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-06-03 01:45:56 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-06-03 01:45:56 +08:00
{ { gradient_segment_get_coloring_type_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_set_blending_function_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
gint32 blending_function ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
blending_function = g_value_get_enum ( & args [ 3 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_set_blending_function ( gradient ,
start_seg , end_seg ,
blending_function ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
2004-06-03 01:45:56 +08:00
static ProcRecord gradient_segment_range_set_blending_function_proc =
2004-05-31 06:04:16 +08:00
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-set-blending-function " ,
" gimp-gradient-segment-range-set-blending-function " ,
2004-05-31 06:04:16 +08:00
" Change the blending function of a segments range " ,
" This function changes the blending function of a segment range to the specified blending function. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-06-03 01:45:56 +08:00
{ { gradient_segment_range_set_blending_function_invoker } }
2004-05-31 06:04:16 +08:00
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_set_coloring_type_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
gint32 coloring_type ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
coloring_type = g_value_get_enum ( & args [ 3 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_set_coloring_type ( gradient ,
start_seg , end_seg ,
coloring_type ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
2004-06-03 01:45:56 +08:00
static ProcRecord gradient_segment_range_set_coloring_type_proc =
2004-05-31 06:04:16 +08:00
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-set-coloring-type " ,
" gimp-gradient-segment-range-set-coloring-type " ,
2004-05-31 06:04:16 +08:00
" Change the coloring type of a segments range " ,
" This function changes the coloring type of a segment range to the specified coloring type. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-06-03 01:45:56 +08:00
{ { gradient_segment_range_set_coloring_type_invoker } }
2004-05-31 06:04:16 +08:00
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_flip_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_flip ( gradient ,
start_seg , end_seg ,
NULL , NULL ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_flip_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-flip " ,
" gimp-gradient-segment-range-flip " ,
2004-05-31 06:04:16 +08:00
" Flip the segment range " ,
" This function flips a segment range. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_flip_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_replicate_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
gint32 replicate_times ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
replicate_times = g_value_get_int ( & args [ 3 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_replicate ( gradient ,
start_seg , end_seg ,
replicate_times ,
NULL , NULL ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_replicate_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-replicate " ,
" gimp-gradient-segment-range-replicate " ,
2004-05-31 06:04:16 +08:00
" Replicate the segment range " ,
" This function replicates a segment range a given number of times. Instead of the original segment range, several smaller scaled copies of it will appear in equal widths. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_replicate_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_split_midpoint_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_split_midpoint ( gradient ,
start_seg , end_seg ,
NULL , NULL ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_split_midpoint_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-split-midpoint " ,
" gimp-gradient-segment-range-split-midpoint " ,
2004-05-31 06:04:16 +08:00
" Splits each segment in the segment range at midpoint " ,
" This function splits each segment in the segment range at its midpoint. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_split_midpoint_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_split_uniform_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
gint32 split_parts ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
split_parts = g_value_get_int ( & args [ 3 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_split_uniform ( gradient ,
start_seg , end_seg ,
split_parts ,
NULL , NULL ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_split_uniform_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-split-uniform " ,
" gimp-gradient-segment-range-split-uniform " ,
2004-05-31 06:04:16 +08:00
" Splits each segment in the segment range uniformly " ,
" This function splits each segment in the segment range uniformly according to the number of times specified by the parameter. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_split_uniform_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_delete_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_delete ( gradient ,
start_seg , end_seg ,
NULL , NULL ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_delete_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-delete " ,
" gimp-gradient-segment-range-delete " ,
2004-05-31 06:04:16 +08:00
" Delete the segment range " ,
" This function deletes a segment range. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_delete_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_redistribute_handles_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_redistribute_handles ( gradient ,
start_seg , end_seg ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_redistribute_handles_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-redistribute-handles " ,
" gimp-gradient-segment-range-redistribute-handles " ,
2004-05-31 06:04:16 +08:00
" Uniformly redistribute the segment range's handles " ,
" This function redistributes the handles of the specified segment range of the specified gradient, so they'll be evenly spaced. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_redistribute_handles_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_blend_colors_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_blend ( gradient ,
start_seg , end_seg ,
& start_seg - > left_color ,
& end_seg - > right_color ,
TRUE , FALSE ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_blend_colors_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-blend-colors " ,
" gimp-gradient-segment-range-blend-colors " ,
2004-05-31 06:04:16 +08:00
" Blend the colors of the segment range. " ,
" This function blends the colors (but not the opacity) of the segments' range of the gradient. Using it, the colors' transition will be uniform across the range. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_blend_colors_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_blend_opacity_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
gimp_gradient_segment_range_blend ( gradient ,
start_seg , end_seg ,
& start_seg - > left_color ,
& end_seg - > right_color ,
FALSE , TRUE ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_blend_opacity_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-blend-opacity " ,
" gimp-gradient-segment-range-blend-opacity " ,
2004-05-31 06:04:16 +08:00
" Blend the opacity of the segment range. " ,
" This function blends the opacity (but not the colors) of the segments' range of the gradient. Using it, the opacity's transition will be uniform across the range. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_blend_opacity_invoker } }
} ;
static Argument *
2006-03-28 03:32:19 +08:00
gradient_segment_range_move_invoker ( ProcRecord * proc_record ,
Gimp * gimp ,
2004-08-11 02:47:21 +08:00
GimpContext * context ,
GimpProgress * progress ,
Argument * args )
2004-05-31 06:04:16 +08:00
{
gboolean success = TRUE ;
2006-03-28 05:09:32 +08:00
Argument * return_vals ;
2004-05-31 06:04:16 +08:00
gchar * name ;
gint32 start_segment ;
gint32 end_segment ;
gdouble delta ;
gboolean control_compress ;
2006-03-15 23:32:39 +08:00
gdouble final_delta = 0.0 ;
2004-05-31 06:04:16 +08:00
2006-03-30 07:56:07 +08:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
start_segment = g_value_get_int ( & args [ 1 ] . value ) ;
end_segment = g_value_get_int ( & args [ 2 ] . value ) ;
delta = g_value_get_double ( & args [ 3 ] . value ) ;
control_compress = g_value_get_boolean ( & args [ 4 ] . value ) ;
2004-05-31 06:04:16 +08:00
if ( success )
{
2006-03-22 05:48:21 +08:00
GimpGradient * gradient ;
GimpGradientSegment * start_seg ;
GimpGradientSegment * end_seg ;
2004-05-31 06:04:16 +08:00
2006-03-22 05:48:21 +08:00
gradient = gradient_get_range ( gimp , name , start_segment , end_segment ,
& start_seg , & end_seg ) ;
2006-03-15 05:35:50 +08:00
2006-03-22 05:48:21 +08:00
if ( start_seg & & GIMP_DATA ( gradient ) - > writable )
{
final_delta = gimp_gradient_segment_range_move ( gradient ,
start_seg , end_seg ,
delta ,
control_compress ) ;
2004-05-31 06:04:16 +08:00
}
2006-03-22 05:48:21 +08:00
else
success = FALSE ;
2004-05-31 06:04:16 +08:00
}
2006-03-31 17:15:08 +08:00
return_vals = gimp_procedure_get_return_values ( proc_record , success ) ;
2004-05-31 06:04:16 +08:00
if ( success )
2006-03-30 07:56:07 +08:00
g_value_set_double ( & return_vals [ 1 ] . value , final_delta ) ;
2004-05-31 06:04:16 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-05-31 06:04:16 +08:00
}
static ProcRecord gradient_segment_range_move_proc =
{
2006-04-01 00:17:07 +08:00
TRUE , TRUE ,
2005-08-03 06:52:23 +08:00
" gimp-gradient-segment-range-move " ,
" gimp-gradient-segment-range-move " ,
2004-05-31 06:04:16 +08:00
" Move the position of an entire segment range by a delta. " ,
" This funtions moves the position of an entire segment range by a delta. The actual delta (which is returned) will be limited by the control points of the neighboring segments. " ,
2006-03-15 05:35:50 +08:00
" Shlomi Fish <shlomif@iglu.org.il> " ,
2004-05-31 06:04:16 +08:00
" Shlomi Fish " ,
" 2003 " ,
2004-10-06 21:13:08 +08:00
NULL ,
2004-05-31 06:04:16 +08:00
GIMP_INTERNAL ,
2006-03-29 03:58:00 +08:00
0 , NULL , 0 , NULL ,
2004-05-31 06:04:16 +08:00
{ { gradient_segment_range_move_invoker } }
} ;