2004-09-28 22:01:21 +00: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 "pdb-types.h"
2006-03-31 19:28:53 +00:00
# include "gimpargument.h"
2006-03-31 09:15:08 +00:00
# include "gimpprocedure.h"
2004-09-28 22:01:21 +00:00
# include "procedural_db.h"
2006-03-28 19:58:00 +00:00
# include "core/gimpparamspecs.h"
2004-09-28 22:01:21 +00:00
# include "base/temp-buf.h"
# include "core/gimp.h"
# include "core/gimpbrush.h"
2004-12-30 23:28:38 +00:00
# include "core/gimpbrushgenerated.h"
2004-09-28 22:01:21 +00:00
# include "core/gimpcontext.h"
# include "core/gimpdatafactory.h"
# include "core/gimplist.h"
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_new_proc ;
static GimpProcedure brush_duplicate_proc ;
static GimpProcedure brush_is_generated_proc ;
static GimpProcedure brush_rename_proc ;
static GimpProcedure brush_delete_proc ;
static GimpProcedure brush_is_editable_proc ;
static GimpProcedure brush_get_info_proc ;
static GimpProcedure brush_get_pixels_proc ;
static GimpProcedure brush_get_spacing_proc ;
static GimpProcedure brush_set_spacing_proc ;
static GimpProcedure brush_get_shape_proc ;
static GimpProcedure brush_get_radius_proc ;
static GimpProcedure brush_get_spikes_proc ;
static GimpProcedure brush_get_hardness_proc ;
static GimpProcedure brush_get_aspect_ratio_proc ;
static GimpProcedure brush_get_angle_proc ;
static GimpProcedure brush_set_shape_proc ;
static GimpProcedure brush_set_radius_proc ;
static GimpProcedure brush_set_spikes_proc ;
static GimpProcedure brush_set_hardness_proc ;
static GimpProcedure brush_set_aspect_ratio_proc ;
static GimpProcedure brush_set_angle_proc ;
2004-09-28 22:01:21 +00:00
void
register_brush_procs ( Gimp * gimp )
{
2006-03-31 17:42:13 +00:00
GimpProcedure * procedure ;
2006-03-29 20:27:46 +00:00
2006-03-28 19:58:00 +00:00
/*
* brush_new
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_new_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The requested name of the new brush " ,
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 brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_duplicate
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_duplicate_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush 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 brush's copy " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_is_generated
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_is_generated_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_boolean ( " generated " ,
" generated " ,
" TRUE if the brush is generated " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_rename
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_rename_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush 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 brush " ,
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 brush " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_delete
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_delete_proc , 1 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_is_editable
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_is_editable_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush 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 brush can be edited " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_info
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_info_proc , 1 , 4 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " width " ,
" width " ,
" The brush width " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " height " ,
" height " ,
" The brush height " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " mask-bpp " ,
" mask bpp " ,
" The brush mask bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " color-bpp " ,
" color bpp " ,
" The brush color bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_pixels
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_pixels_proc , 1 , 8 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " width " ,
" width " ,
" The brush width " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " height " ,
" height " ,
" The brush height " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " mask-bpp " ,
" mask bpp " ,
" The brush mask bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-mask-bytes " ,
" num mask bytes " ,
" Length of brush mask data " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT8ARRAY ,
2006-04-01 01:33:28 +00:00
gimp_param_spec_array ( " mask-bytes " ,
" mask bytes " ,
" The brush mask data " ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " color-bpp " ,
" color bpp " ,
" The brush color bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-color-bytes " ,
" num color bytes " ,
" Length of brush color data " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT8ARRAY ,
2006-04-01 01:33:28 +00:00
gimp_param_spec_array ( " color-bytes " ,
" color bytes " ,
" The brush color data " ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_spacing
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_spacing_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " spacing " ,
" spacing " ,
" The brush spacing (0 <= spacing <= 1000) " ,
0 , 1000 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_set_spacing
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_set_spacing_proc , 2 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " spacing " ,
" spacing " ,
" The brush spacing (0 <= spacing <= 1000) " ,
0 , 1000 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_shape
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_shape_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " shape " ,
" shape " ,
" The brush shape: { GIMP_BRUSH_GENERATED_CIRCLE (0), GIMP_BRUSH_GENERATED_SQUARE (1), GIMP_BRUSH_GENERATED_DIAMOND (2) } " ,
GIMP_TYPE_BRUSH_GENERATED_SHAPE ,
GIMP_BRUSH_GENERATED_CIRCLE ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_radius
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_radius_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " radius " ,
" radius " ,
" The radius of the brush in pixels " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_spikes
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_spikes_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " spikes " ,
" spikes " ,
" The number of spikes on the brush. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_hardness
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_hardness_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " hardness " ,
" hardness " ,
" The hardness of the brush. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_aspect_ratio
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_aspect_ratio_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " aspect-ratio " ,
" aspect ratio " ,
" The aspect ratio of the brush. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_get_angle
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_get_angle_proc , 1 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " angle " ,
" angle " ,
" The rotation angle of the brush. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_set_shape
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_set_shape_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " shape-in " ,
" shape in " ,
" The brush shape: { GIMP_BRUSH_GENERATED_CIRCLE (0), GIMP_BRUSH_GENERATED_SQUARE (1), GIMP_BRUSH_GENERATED_DIAMOND (2) } " ,
GIMP_TYPE_BRUSH_GENERATED_SHAPE ,
GIMP_BRUSH_GENERATED_CIRCLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " shape-out " ,
" shape out " ,
" The brush shape actually assigned: { GIMP_BRUSH_GENERATED_CIRCLE (0), GIMP_BRUSH_GENERATED_SQUARE (1), GIMP_BRUSH_GENERATED_DIAMOND (2) } " ,
GIMP_TYPE_BRUSH_GENERATED_SHAPE ,
GIMP_BRUSH_GENERATED_CIRCLE ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_set_radius
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_set_radius_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " radius-in " ,
" radius in " ,
" The desired brush radius " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " radius-out " ,
" radius out " ,
" The brush radius actually assigned " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_set_spikes
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_set_spikes_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " spikes-in " ,
" spikes in " ,
" The desired number of spikes " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " spikes-out " ,
" spikes out " ,
" The number of spikes actually assigned " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_set_hardness
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_set_hardness_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " hardness-in " ,
" hardness in " ,
" The desired brush hardness " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " hardness-out " ,
" hardness out " ,
" The brush hardness actually assigned " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_set_aspect_ratio
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_set_aspect_ratio_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " aspect-ratio-in " ,
" aspect ratio in " ,
" The desired brush aspect ratio " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " aspect-ratio-out " ,
" aspect ratio out " ,
" The brush aspect ratio actually assigned " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* brush_set_angle
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brush_set_angle_proc , 2 , 1 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_STRING ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
FALSE , FALSE ,
NULL ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " angle-in " ,
" angle in " ,
" The desired brush rotation angle " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " angle-out " ,
" angle out " ,
" The brush rotation angle actually assigned " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
2004-09-28 22:01:21 +00:00
}
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_new_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-09-28 22:01:21 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-09-28 22:01:21 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gchar * actual_name = NULL ;
2004-09-28 22:01:21 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2004-10-04 09:39:27 +00:00
if ( strlen ( name ) )
2006-03-15 12:49:25 +00:00
{
GimpData * data = gimp_data_factory_data_new ( gimp - > brush_factory , name ) ;
2004-10-04 09:39:27 +00:00
2006-03-15 12:49:25 +00:00
if ( data )
2006-03-24 21:57:47 +00:00
actual_name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( data ) ) ) ;
2006-03-15 12:49:25 +00:00
else
success = FALSE ;
}
else
success = FALSE ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-09-28 22:01:21 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_take_string ( & return_vals [ 1 ] . value , actual_name ) ;
2004-09-28 22:01:21 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_new_proc =
2004-09-28 22:01:21 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-new " ,
" gimp-brush-new " ,
2004-09-28 22:01:21 +00:00
" Creates a new brush " ,
" This procedure creates a new, uninitialized brush " ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-09-28 22:01:21 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-09-28 22:01:21 +00:00
{ { brush_new_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_duplicate_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-09-28 22:01:21 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-09-28 22:01:21 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gchar * copy_name = NULL ;
2004-09-28 22:01:21 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-10-05 23:28:17 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2004-09-28 22:01:21 +00:00
if ( brush )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush_copy = ( GimpBrush * )
2004-09-28 22:01:21 +00:00
gimp_data_factory_data_duplicate ( gimp - > brush_factory ,
GIMP_DATA ( brush ) ) ;
2006-03-15 12:49:25 +00:00
if ( brush_copy )
2006-03-24 21:57:47 +00:00
copy_name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( brush_copy ) ) ) ;
2006-03-15 12:49:25 +00:00
else
success = FALSE ;
2004-09-28 22:01:21 +00:00
}
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-09-28 22:01:21 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_take_string ( & return_vals [ 1 ] . value , copy_name ) ;
2004-09-28 22:01:21 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_duplicate_proc =
2004-09-28 22:01:21 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-duplicate " ,
" gimp-brush-duplicate " ,
2004-09-28 22:01:21 +00:00
" Duplicates a brush " ,
" This procedure creates an identical brush by a different name " ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-09-28 22:01:21 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-09-28 22:01:21 +00:00
{ { brush_duplicate_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_is_generated_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gboolean generated = FALSE ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
if ( brush )
2006-03-15 12:49:25 +00:00
generated = GIMP_IS_BRUSH_GENERATED ( brush ) ;
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_boolean ( & return_vals [ 1 ] . value , generated ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_is_generated_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-is-generated " ,
" gimp-brush-is-generated " ,
2006-03-24 21:57:47 +00:00
" Tests if brush is generated " ,
" Returns TRUE if this brush is parametric, FALSE for other types " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_is_generated_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_rename_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-09-28 22:01:21 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-09-28 22:01:21 +00:00
gchar * name ;
gchar * new_name ;
2006-03-15 12:49:25 +00:00
gchar * actual_name = NULL ;
2004-09-28 22:01:21 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
new_name = ( gchar * ) g_value_get_string ( & args [ 1 ] . value ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-10-05 23:28:17 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2004-09-28 22:01:21 +00:00
if ( brush & & GIMP_DATA ( brush ) - > writable )
2006-03-15 12:49:25 +00:00
{
gimp_object_set_name ( GIMP_OBJECT ( brush ) , new_name ) ;
2006-03-24 21:57:47 +00:00
actual_name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( brush ) ) ) ;
2006-03-15 12:49:25 +00:00
}
2004-09-28 22:01:21 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-09-28 22:01:21 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_take_string ( & return_vals [ 1 ] . value , actual_name ) ;
2004-09-28 22:01:21 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_rename_proc =
2004-09-28 22:01:21 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-rename " ,
" gimp-brush-rename " ,
2004-09-28 22:01:21 +00:00
" Rename a brush " ,
" This procedure renames a brush " ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-09-28 22:01:21 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-09-28 22:01:21 +00:00
{ { brush_rename_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_delete_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-09-28 22:01:21 +00:00
{
gboolean success = TRUE ;
gchar * name ;
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-10-05 23:28:17 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2004-09-28 22:01:21 +00:00
if ( brush & & GIMP_DATA ( brush ) - > deletable )
{
GError * error = NULL ;
success = gimp_data_factory_data_delete ( gimp - > brush_factory ,
GIMP_DATA ( brush ) ,
TRUE , & error ) ;
if ( ! success )
{
g_message ( error - > message ) ;
g_clear_error ( & error ) ;
}
}
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_delete_proc =
2004-09-28 22:01:21 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-delete " ,
" gimp-brush-delete " ,
2004-09-28 22:01:21 +00:00
" Deletes a brush " ,
" This procedure deletes a brush " ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-09-28 22:01:21 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-09-28 22:01:21 +00:00
{ { brush_delete_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_is_editable_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gboolean editable = FALSE ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
if ( brush )
2006-03-15 12:49:25 +00:00
editable = GIMP_DATA ( brush ) - > writable ;
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_boolean ( & return_vals [ 1 ] . value , editable ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_is_editable_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-is-editable " ,
" gimp-brush-is-editable " ,
2004-12-30 23:28:38 +00:00
" Tests if brush can be edited " ,
2006-03-24 21:57:47 +00:00
" Returns TRUE if you have permission to change the brush " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_is_editable_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_info_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-09-28 22:01:21 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-09-28 22:01:21 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gint32 width = 0 ;
gint32 height = 0 ;
gint32 mask_bpp = 0 ;
gint32 color_bpp = 0 ;
2004-09-28 22:01:21 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-10-05 23:28:17 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2004-09-28 22:01:21 +00:00
2006-03-15 12:49:25 +00:00
if ( brush )
{
width = brush - > mask - > width ;
height = brush - > mask - > height ;
mask_bpp = brush - > mask - > bytes ;
color_bpp = brush - > pixmap ? brush - > pixmap - > bytes : 0 ;
}
else
success = FALSE ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2006-03-29 23:56:07 +00:00
g_value_set_int ( & return_vals [ 1 ] . value , width ) ;
g_value_set_int ( & return_vals [ 2 ] . value , height ) ;
g_value_set_int ( & return_vals [ 3 ] . value , mask_bpp ) ;
g_value_set_int ( & return_vals [ 4 ] . value , color_bpp ) ;
2004-09-28 22:01:21 +00:00
}
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_info_proc =
2004-09-28 22:01:21 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-info " ,
" gimp-brush-get-info " ,
2004-09-28 22:01:21 +00:00
" Retrieve information about the specified brush. " ,
" This procedure retrieves information about the specified brush. This includes the brush name, and the brush extents (width and height). " ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-09-28 22:01:21 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-09-28 22:01:21 +00:00
{ { brush_get_info_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_pixels_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-10-05 23:28:17 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-10-05 23:28:17 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gint32 width = 0 ;
gint32 height = 0 ;
2004-10-06 03:23:09 +00:00
gint32 mask_bpp = 0 ;
2004-10-05 23:28:17 +00:00
gint32 num_mask_bytes = 0 ;
guint8 * mask_bytes = NULL ;
2004-10-06 03:23:09 +00:00
gint32 color_bpp = 0 ;
gint32 num_color_bytes = 0 ;
guint8 * color_bytes = NULL ;
2004-10-05 23:28:17 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-10-05 23:28:17 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-10-05 23:28:17 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
if ( brush )
{
2006-03-15 12:49:25 +00:00
width = brush - > mask - > width ;
height = brush - > mask - > height ;
2004-10-06 03:23:09 +00:00
mask_bpp = brush - > mask - > bytes ;
2004-10-05 23:28:17 +00:00
num_mask_bytes = brush - > mask - > height * brush - > mask - > width ;
mask_bytes = g_memdup ( temp_buf_data ( brush - > mask ) , num_mask_bytes ) ;
2004-10-06 03:23:09 +00:00
if ( brush - > pixmap )
{
color_bpp = brush - > pixmap - > bytes ;
num_color_bytes = brush - > pixmap - > height * brush - > pixmap - > width ;
color_bytes = g_memdup ( temp_buf_data ( brush - > pixmap ) ,
num_color_bytes ) ;
}
2004-10-05 23:28:17 +00:00
}
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-10-05 23:28:17 +00:00
if ( success )
{
2006-03-29 23:56:07 +00:00
g_value_set_int ( & return_vals [ 1 ] . value , width ) ;
g_value_set_int ( & return_vals [ 2 ] . value , height ) ;
g_value_set_int ( & return_vals [ 3 ] . value , mask_bpp ) ;
g_value_set_int ( & return_vals [ 4 ] . value , num_mask_bytes ) ;
2006-04-01 01:33:28 +00:00
gimp_value_take_int8array ( & return_vals [ 5 ] . value , mask_bytes , num_mask_bytes ) ;
2006-03-29 23:56:07 +00:00
g_value_set_int ( & return_vals [ 6 ] . value , color_bpp ) ;
g_value_set_int ( & return_vals [ 7 ] . value , num_color_bytes ) ;
2006-04-01 01:33:28 +00:00
gimp_value_take_int8array ( & return_vals [ 8 ] . value , color_bytes , num_color_bytes ) ;
2004-10-05 23:28:17 +00:00
}
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-10-05 23:28:17 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_pixels_proc =
2004-10-05 23:28:17 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-pixels " ,
" gimp-brush-get-pixels " ,
2004-10-05 23:28:17 +00:00
" Retrieve information about the specified brush. " ,
" This procedure retrieves information about the specified brush. This includes the brush extents (width and height) and its pixels data. " ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-10-05 23:28:17 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-10-05 23:28:17 +00:00
{ { brush_get_pixels_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_spacing_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-09-28 22:01:21 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-09-28 22:01:21 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gint32 spacing = 0 ;
2004-09-28 22:01:21 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-10-05 23:28:17 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2004-09-28 22:01:21 +00:00
2006-03-15 12:49:25 +00:00
if ( brush )
spacing = gimp_brush_get_spacing ( brush ) ;
else
success = FALSE ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-09-28 22:01:21 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_int ( & return_vals [ 1 ] . value , spacing ) ;
2004-09-28 22:01:21 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_spacing_proc =
2004-09-28 22:01:21 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-spacing " ,
" gimp-brush-get-spacing " ,
2004-09-28 22:01:21 +00:00
" Get the brush spacing. " ,
" This procedure returns the spacing setting for the specified brush. The return value is an integer between 0 and 1000 which represents percentage of the maximum of the width and height of the mask. " ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-09-28 22:01:21 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-09-28 22:01:21 +00:00
{ { brush_get_spacing_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_set_spacing_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-09-28 22:01:21 +00:00
{
gboolean success = TRUE ;
gchar * name ;
gint32 spacing ;
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
spacing = g_value_get_int ( & args [ 1 ] . value ) ;
2004-09-28 22:01:21 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-10-05 23:28:17 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2004-09-28 22:01:21 +00:00
2006-01-05 08:37:17 +00:00
if ( brush )
2004-09-28 22:01:21 +00:00
gimp_brush_set_spacing ( brush , spacing ) ;
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
2004-09-28 22:01:21 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_set_spacing_proc =
2004-09-28 22:01:21 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-set-spacing " ,
" gimp-brush-set-spacing " ,
2004-09-28 22:01:21 +00:00
" Set the brush spacing. " ,
" This procedure modifies the spacing setting for the specified brush. The value should be a integer between 0 and 1000. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-09-28 22:01:21 +00:00
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-09-28 22:01:21 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-09-28 22:01:21 +00:00
{ { brush_set_spacing_invoker } }
} ;
2004-12-30 23:28:38 +00:00
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_shape_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gint32 shape = 0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-15 12:49:25 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) )
shape = GIMP_BRUSH_GENERATED ( brush ) - > shape ;
else
success = FALSE ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_enum ( & return_vals [ 1 ] . value , shape ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_shape_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-shape " ,
" gimp-brush-get-shape " ,
2004-12-30 23:28:38 +00:00
" Get the shape of a generated brush. " ,
" This procedure gets the shape value for a generated brush. If called for any other type of brush, it does not succeed. The current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added in the future. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_get_shape_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_radius_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 15:32:39 +00:00
gdouble radius = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-15 12:49:25 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) )
radius = GIMP_BRUSH_GENERATED ( brush ) - > radius ;
else
success = FALSE ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , radius ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_radius_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-radius " ,
" gimp-brush-get-radius " ,
2004-12-30 23:28:38 +00:00
" Get the radius of a generated brush. " ,
" This procedure gets the radius value for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_get_radius_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_spikes_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 12:49:25 +00:00
gint32 spikes = 0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-15 12:49:25 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) )
spikes = GIMP_BRUSH_GENERATED ( brush ) - > spikes ;
else
success = FALSE ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_int ( & return_vals [ 1 ] . value , spikes ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_spikes_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-spikes " ,
" gimp-brush-get-spikes " ,
2004-12-30 23:28:38 +00:00
" Get the number of spikes for a generated brush. " ,
" This procedure gets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_get_spikes_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_hardness_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 15:32:39 +00:00
gdouble hardness = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-15 12:49:25 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) )
hardness = GIMP_BRUSH_GENERATED ( brush ) - > hardness ;
else
success = FALSE ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , hardness ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_hardness_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-hardness " ,
" gimp-brush-get-hardness " ,
2004-12-30 23:28:38 +00:00
" Get the hardness of a generated brush. " ,
" This procedure gets the hardness of a generated brush. The hardness of a brush is the amount its intensity fades at the outside edge. If called for any other type of brush, the function does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_get_hardness_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_aspect_ratio_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 15:32:39 +00:00
gdouble aspect_ratio = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-15 12:49:25 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) )
aspect_ratio = GIMP_BRUSH_GENERATED ( brush ) - > aspect_ratio ;
else
success = FALSE ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , aspect_ratio ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_aspect_ratio_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-aspect-ratio " ,
" gimp-brush-get-aspect-ratio " ,
2004-12-30 23:28:38 +00:00
" Get the aspect ratio of a generated brush. " ,
" This procedure gets the aspect ratio of a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_get_aspect_ratio_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_get_angle_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
2006-03-15 15:32:39 +00:00
gdouble angle = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-15 12:49:25 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) )
angle = GIMP_BRUSH_GENERATED ( brush ) - > angle ;
else
success = FALSE ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , angle ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_get_angle_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-get-angle " ,
" gimp-brush-get-angle " ,
2004-12-30 23:28:38 +00:00
" Get the rotation angle of a generated brush. " ,
" This procedure gets the angle of rotation for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_get_angle_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_set_shape_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
gint32 shape_in ;
2006-03-15 12:49:25 +00:00
gint32 shape_out = 0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
shape_in = g_value_get_enum ( & args [ 1 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-22 09:58:08 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) & & GIMP_DATA ( brush ) - > writable )
2006-03-15 12:49:25 +00:00
{
gimp_brush_generated_set_shape ( GIMP_BRUSH_GENERATED ( brush ) ,
shape_in ) ;
shape_out = GIMP_BRUSH_GENERATED ( brush ) - > shape ;
}
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_enum ( & return_vals [ 1 ] . value , shape_out ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_set_shape_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-set-shape " ,
" gimp-brush-set-shape " ,
2004-12-30 23:28:38 +00:00
" Set the shape of a generated brush. " ,
" This procedure sets the shape value for a generated brush. If called for any other type of brush, it does not succeed. The current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added in the future. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_set_shape_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_set_radius_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
gdouble radius_in ;
2006-03-15 15:32:39 +00:00
gdouble radius_out = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
radius_in = g_value_get_double ( & args [ 1 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-22 09:58:08 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) & & GIMP_DATA ( brush ) - > writable )
2006-03-15 12:49:25 +00:00
{
gimp_brush_generated_set_radius ( GIMP_BRUSH_GENERATED ( brush ) ,
radius_in ) ;
radius_out = GIMP_BRUSH_GENERATED ( brush ) - > radius ;
}
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , radius_out ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_set_radius_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-set-radius " ,
" gimp-brush-set-radius " ,
2004-12-30 23:28:38 +00:00
" Set the radius of a generated brush. " ,
" This procedure sets the radius for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_set_radius_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_set_spikes_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
gint32 spikes_in ;
2006-03-15 12:49:25 +00:00
gint32 spikes_out = 0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
spikes_in = g_value_get_int ( & args [ 1 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-22 09:58:08 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) & & GIMP_DATA ( brush ) - > writable )
2006-03-15 12:49:25 +00:00
{
gimp_brush_generated_set_spikes ( GIMP_BRUSH_GENERATED ( brush ) ,
spikes_in ) ;
spikes_out = GIMP_BRUSH_GENERATED ( brush ) - > spikes ;
}
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_int ( & return_vals [ 1 ] . value , spikes_out ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_set_spikes_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-set-spikes " ,
" gimp-brush-set-spikes " ,
2004-12-30 23:28:38 +00:00
" Set the number of spikes for a generated brush. " ,
" This procedure sets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_set_spikes_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_set_hardness_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
gdouble hardness_in ;
2006-03-15 15:32:39 +00:00
gdouble hardness_out = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
hardness_in = g_value_get_double ( & args [ 1 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-22 09:58:08 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) & & GIMP_DATA ( brush ) - > writable )
2006-03-15 12:49:25 +00:00
{
gimp_brush_generated_set_hardness ( GIMP_BRUSH_GENERATED ( brush ) ,
hardness_in ) ;
hardness_out = GIMP_BRUSH_GENERATED ( brush ) - > hardness ;
}
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , hardness_out ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_set_hardness_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-set-hardness " ,
" gimp-brush-set-hardness " ,
2004-12-30 23:28:38 +00:00
" Set the hardness of a generated brush. " ,
" This procedure sets the hardness for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_set_hardness_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_set_aspect_ratio_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
gdouble aspect_ratio_in ;
2006-03-15 15:32:39 +00:00
gdouble aspect_ratio_out = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
aspect_ratio_in = g_value_get_double ( & args [ 1 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-22 09:58:08 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) & & GIMP_DATA ( brush ) - > writable )
2006-03-15 12:49:25 +00:00
{
gimp_brush_generated_set_aspect_ratio ( GIMP_BRUSH_GENERATED ( brush ) ,
aspect_ratio_in ) ;
aspect_ratio_out = GIMP_BRUSH_GENERATED ( brush ) - > aspect_ratio ;
}
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , aspect_ratio_out ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_set_aspect_ratio_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-set-aspect-ratio " ,
" gimp-brush-set-aspect-ratio " ,
2004-12-30 23:28:38 +00:00
" Set the aspect ratio of a generated brush. " ,
" This procedure sets the aspect ratio for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_set_aspect_ratio_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brush_set_angle_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-12-30 23:28:38 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * return_vals ;
2004-12-30 23:28:38 +00:00
gchar * name ;
gdouble angle_in ;
2006-03-15 15:32:39 +00:00
gdouble angle_out = 0.0 ;
2004-12-30 23:28:38 +00:00
2006-03-29 23:56:07 +00:00
name = ( gchar * ) g_value_get_string ( & args [ 0 ] . value ) ;
angle_in = g_value_get_double ( & args [ 1 ] . value ) ;
2004-12-30 23:28:38 +00:00
if ( success )
{
2006-03-15 12:49:25 +00:00
GimpBrush * brush = ( GimpBrush * )
2004-12-30 23:28:38 +00:00
gimp_container_get_child_by_name ( gimp - > brush_factory - > container , name ) ;
2006-03-22 09:58:08 +00:00
if ( GIMP_IS_BRUSH_GENERATED ( brush ) & & GIMP_DATA ( brush ) - > writable )
2006-03-15 12:49:25 +00:00
{
gimp_brush_generated_set_angle ( GIMP_BRUSH_GENERATED ( brush ) ,
angle_in ) ;
angle_out = GIMP_BRUSH_GENERATED ( brush ) - > angle ;
}
2004-12-30 23:28:38 +00:00
else
success = FALSE ;
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
2004-12-30 23:28:38 +00:00
if ( success )
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , angle_out ) ;
2004-12-30 23:28:38 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-12-30 23:28:38 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure brush_set_angle_proc =
2004-12-30 23:28:38 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brush-set-angle " ,
" gimp-brush-set-angle " ,
2004-12-30 23:28:38 +00:00
" Set the rotation angle of a generated brush. " ,
" This procedure sets the rotation angle for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-03-14 21:35:50 +00:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
2004-12-31 19:48:29 +00:00
" Bill Skaggs " ,
2004-12-30 23:28:38 +00:00
" 2004 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-12-30 23:28:38 +00:00
{ { brush_set_angle_invoker } }
} ;