2006-12-09 13:33:38 -08:00
/* GIMP - The GNU Image Manipulation Program
2004-09-28 15:01:21 -07:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
*
2009-01-17 14:28:01 -08:00
* This program is free software : you can redistribute it and / or modify
2004-09-28 15:01:21 -07:00
* it under the terms of the GNU General Public License as published by
2009-01-17 14:28:01 -08:00
* the Free Software Foundation ; either version 3 of the License , or
2004-09-28 15:01:21 -07:00
* ( 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
2018-07-11 14:47:19 -07:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
2004-09-28 15:01:21 -07:00
*/
2007-01-09 02:52:47 -08:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
2004-09-28 15:01:21 -07:00
# include "config.h"
# include <string.h>
2008-10-09 13:24:04 -07:00
# include <gegl.h>
2004-09-28 15:01:21 -07:00
2012-05-02 18:36:22 -07:00
# include <gdk-pixbuf/gdk-pixbuf.h>
2012-05-03 15:50:23 -07:00
# include "libgimpbase/gimpbase.h"
2004-09-28 15:01:21 -07:00
# include "pdb-types.h"
# include "core/gimp.h"
# include "core/gimpbrush.h"
2004-12-30 15:28:38 -08:00
# include "core/gimpbrushgenerated.h"
2004-09-28 15:01:21 -07:00
# include "core/gimpcontext.h"
# include "core/gimpdatafactory.h"
2008-02-07 09:08:54 -08:00
# include "core/gimpparamspecs.h"
2012-04-08 15:59:20 -07:00
# include "core/gimptempbuf.h"
2019-02-07 06:12:53 -08:00
# include "gegl/gimp-babl-compat.h"
2004-09-28 15:01:21 -07:00
2008-02-07 09:08:54 -08:00
# include "gimppdb.h"
# include "gimppdb-utils.h"
# include "gimpprocedure.h"
2008-04-04 04:15:55 -07:00
# include "internal-procs.h"
2006-10-31 11:02:56 -08:00
2004-09-28 15:01:21 -07:00
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_new_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-09-28 15:01:21 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-03-15 04:49:25 -08:00
gchar * actual_name = NULL ;
2004-09-28 15:01:21 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
2010-04-05 04:24:54 -07:00
GimpData * data = gimp_data_factory_data_new ( gimp - > brush_factory ,
2010-04-10 10:55:42 -07:00
context , name ) ;
2004-10-04 02:39:27 -07:00
2007-04-25 07:23:05 -07:00
if ( data )
2009-08-31 13:47:18 -07:00
actual_name = g_strdup ( gimp_object_get_name ( data ) ) ;
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-09-28 15:01:21 -07:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-09-28 15:01:21 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_take_string ( gimp_value_array_index ( return_vals , 1 ) , actual_name ) ;
2004-09-28 15:01:21 -07:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-09-28 15:01:21 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_duplicate_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-09-28 15:01:21 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-03-15 04:49:25 -08:00
gchar * copy_name = NULL ;
2004-09-28 15:01:21 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-09-28 15:01:21 -07:00
if ( brush )
{
2006-03-15 04:49:25 -08:00
GimpBrush * brush_copy = ( GimpBrush * )
2004-09-28 15:01:21 -07:00
gimp_data_factory_data_duplicate ( gimp - > brush_factory ,
GIMP_DATA ( brush ) ) ;
2006-03-15 04:49:25 -08:00
if ( brush_copy )
2009-08-31 13:47:18 -07:00
copy_name = g_strdup ( gimp_object_get_name ( brush_copy ) ) ;
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-09-28 15:01:21 -07:00
}
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-09-28 15:01:21 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_take_string ( gimp_value_array_index ( return_vals , 1 ) , copy_name ) ;
2004-09-28 15:01:21 -07:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-09-28 15:01:21 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_is_generated_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-03-15 04:49:25 -08:00
gboolean generated = FALSE ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-12-30 15:28:38 -08:00
if ( brush )
2006-03-15 04:49:25 -08:00
generated = GIMP_IS_BRUSH_GENERATED ( brush ) ;
2004-12-30 15:28:38 -08:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , generated ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_rename_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-09-28 15:01:21 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
const gchar * new_name ;
2006-03-15 04:49:25 -08:00
gchar * actual_name = NULL ;
2004-09-28 15:01:21 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
new_name = g_value_get_string ( gimp_value_array_index ( args , 1 ) ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_RENAME , error ) ;
2004-09-28 15:01:21 -07:00
2007-12-11 01:54:41 -08:00
if ( brush )
2006-03-15 04:49:25 -08:00
{
gimp_object_set_name ( GIMP_OBJECT ( brush ) , new_name ) ;
2009-08-31 13:47:18 -07:00
actual_name = g_strdup ( gimp_object_get_name ( brush ) ) ;
2006-03-15 04:49:25 -08:00
}
2004-09-28 15:01:21 -07:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-09-28 15:01:21 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_take_string ( gimp_value_array_index ( return_vals , 1 ) , actual_name ) ;
2004-09-28 15:01:21 -07:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-09-28 15:01:21 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_delete_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-09-28 15:01:21 -07:00
{
gboolean success = TRUE ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2004-09-28 15:01:21 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-09-28 15:01:21 -07:00
2009-10-31 10:48:38 -07:00
if ( brush & & gimp_data_is_deletable ( GIMP_DATA ( brush ) ) )
2007-12-04 11:01:06 -08:00
success = gimp_data_factory_data_delete ( gimp - > brush_factory ,
GIMP_DATA ( brush ) ,
TRUE , error ) ;
2004-09-28 15:01:21 -07:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-09-28 15:01:21 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_is_editable_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-03-15 04:49:25 -08:00
gboolean editable = FALSE ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-12-30 15:28:38 -08:00
if ( brush )
2009-10-31 10:48:38 -07:00
editable = gimp_data_is_writable ( GIMP_DATA ( brush ) ) ;
2004-12-30 15:28:38 -08:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , editable ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_info_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-09-28 15:01:21 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-03-15 04:49:25 -08:00
gint32 width = 0 ;
gint32 height = 0 ;
gint32 mask_bpp = 0 ;
gint32 color_bpp = 0 ;
2004-09-28 15:01:21 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-09-28 15:01:21 -07:00
2006-03-15 04:49:25 -08:00
if ( brush )
{
2014-10-11 16:16:32 -07:00
GimpTempBuf * mask = gimp_brush_get_mask ( brush ) ;
GimpTempBuf * pixmap = gimp_brush_get_pixmap ( brush ) ;
2019-02-07 06:12:53 -08:00
const Babl * format ;
2014-10-11 16:16:32 -07:00
2019-02-07 06:12:53 -08:00
format = gimp_babl_compat_u8_mask_format (
gimp_temp_buf_get_format ( mask ) ) ;
width = gimp_brush_get_width ( brush ) ;
height = gimp_brush_get_height ( brush ) ;
mask_bpp = babl_format_get_bytes_per_pixel ( format ) ;
if ( pixmap )
{
format = gimp_babl_compat_u8_format (
gimp_temp_buf_get_format ( pixmap ) ) ;
color_bpp = babl_format_get_bytes_per_pixel ( format ) ;
}
2006-03-15 04:49:25 -08:00
}
else
success = FALSE ;
2004-09-28 15:01:21 -07:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
2012-05-03 15:50:23 -07:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , width ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 2 ) , height ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 3 ) , mask_bpp ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 4 ) , color_bpp ) ;
2004-09-28 15:01:21 -07:00
}
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-09-28 15:01:21 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_pixels_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-10-05 16:28:17 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-03-15 04:49:25 -08:00
gint32 width = 0 ;
gint32 height = 0 ;
2004-10-05 20:23:09 -07:00
gint32 mask_bpp = 0 ;
2004-10-05 16:28:17 -07:00
gint32 num_mask_bytes = 0 ;
guint8 * mask_bytes = NULL ;
2004-10-05 20:23:09 -07:00
gint32 color_bpp = 0 ;
gint32 num_color_bytes = 0 ;
guint8 * color_bytes = NULL ;
2004-10-05 16:28:17 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-10-05 16:28:17 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-10-05 16:28:17 -07:00
if ( brush )
{
2014-10-11 16:16:32 -07:00
GimpTempBuf * mask = gimp_brush_get_mask ( brush ) ;
GimpTempBuf * pixmap = gimp_brush_get_pixmap ( brush ) ;
2019-02-07 06:12:53 -08:00
const Babl * format ;
gpointer data ;
format = gimp_babl_compat_u8_mask_format (
gimp_temp_buf_get_format ( mask ) ) ;
data = gimp_temp_buf_lock ( mask , format , GEGL_ACCESS_READ ) ;
2014-10-11 16:16:32 -07:00
width = gimp_temp_buf_get_width ( mask ) ;
height = gimp_temp_buf_get_height ( mask ) ;
2019-02-07 06:12:53 -08:00
mask_bpp = babl_format_get_bytes_per_pixel ( format ) ;
2014-10-11 16:16:32 -07:00
num_mask_bytes = gimp_temp_buf_get_height ( mask ) *
gimp_temp_buf_get_width ( mask ) * mask_bpp ;
2019-02-07 06:12:53 -08:00
mask_bytes = g_memdup ( data , num_mask_bytes ) ;
gimp_temp_buf_unlock ( mask , data ) ;
2004-10-05 20:23:09 -07:00
2014-10-11 16:16:32 -07:00
if ( pixmap )
2004-10-05 20:23:09 -07:00
{
2019-02-07 06:12:53 -08:00
format = gimp_babl_compat_u8_format (
gimp_temp_buf_get_format ( pixmap ) ) ;
data = gimp_temp_buf_lock ( pixmap , format , GEGL_ACCESS_READ ) ;
color_bpp = babl_format_get_bytes_per_pixel ( format ) ;
2014-10-11 16:16:32 -07:00
num_color_bytes = gimp_temp_buf_get_height ( pixmap ) *
gimp_temp_buf_get_width ( pixmap ) *
2012-04-08 09:47:49 -07:00
color_bpp ;
2019-02-07 06:12:53 -08:00
color_bytes = g_memdup ( data , num_color_bytes ) ;
gimp_temp_buf_unlock ( pixmap , data ) ;
2004-10-05 20:23:09 -07:00
}
2004-10-05 16:28:17 -07:00
}
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-10-05 16:28:17 -07:00
if ( success )
{
2012-05-03 15:50:23 -07:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , width ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 2 ) , height ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 3 ) , mask_bpp ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 4 ) , num_mask_bytes ) ;
gimp_value_take_int8array ( gimp_value_array_index ( return_vals , 5 ) , mask_bytes , num_mask_bytes ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 6 ) , color_bpp ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 7 ) , num_color_bytes ) ;
gimp_value_take_int8array ( gimp_value_array_index ( return_vals , 8 ) , color_bytes , num_color_bytes ) ;
2004-10-05 16:28:17 -07:00
}
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-10-05 16:28:17 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_spacing_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-09-28 15:01:21 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-03-15 04:49:25 -08:00
gint32 spacing = 0 ;
2004-09-28 15:01:21 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-09-28 15:01:21 -07:00
2006-03-15 04:49:25 -08:00
if ( brush )
spacing = gimp_brush_get_spacing ( brush ) ;
else
success = FALSE ;
2004-09-28 15:01:21 -07:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-09-28 15:01:21 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , spacing ) ;
2004-09-28 15:01:21 -07:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-09-28 15:01:21 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_set_spacing_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-09-28 15:01:21 -07:00
{
gboolean success = TRUE ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2004-09-28 15:01:21 -07:00
gint32 spacing ;
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
spacing = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
2004-09-28 15:01:21 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_WRITE , error ) ;
2004-09-28 15:01:21 -07:00
2006-01-05 00:37:17 -08:00
if ( brush )
2004-09-28 15:01:21 -07:00
gimp_brush_set_spacing ( brush , spacing ) ;
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 14:11:45 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_shape_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 14:11:45 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-04 14:11:45 -07:00
const gchar * name ;
gint32 shape = 0 ;
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-04 14:11:45 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2006-04-04 14:11:45 -07:00
2007-12-11 01:54:41 -08:00
if ( brush )
2006-04-04 14:11:45 -07:00
shape = GIMP_BRUSH_GENERATED ( brush ) - > shape ;
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 14:11:45 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , shape ) ;
2006-04-04 14:11:45 -07:00
return return_vals ;
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_set_shape_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 14:11:45 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-04 14:11:45 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gint32 shape_in ;
gint32 shape_out = 0 ;
2006-04-04 14:11:45 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
shape_in = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2006-04-04 14:11:45 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_WRITE , error ) ;
2006-04-04 14:11:45 -07:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
{
gimp_brush_generated_set_shape ( GIMP_BRUSH_GENERATED ( brush ) ,
shape_in ) ;
shape_out = GIMP_BRUSH_GENERATED ( brush ) - > shape ;
}
2006-04-04 14:11:45 -07:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 14:11:45 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , shape_out ) ;
2006-04-04 14:11:45 -07:00
return return_vals ;
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_radius_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 14:11:45 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-04 14:11:45 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gdouble radius = 0.0 ;
2006-04-04 14:11:45 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-04 14:11:45 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2006-04-04 14:11:45 -07:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
radius = GIMP_BRUSH_GENERATED ( brush ) - > radius ;
2006-04-04 14:11:45 -07:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 14:11:45 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , radius ) ;
2006-04-04 14:11:45 -07:00
return return_vals ;
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_set_radius_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 14:11:45 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-04 14:11:45 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gdouble radius_in ;
gdouble radius_out = 0.0 ;
2006-04-04 14:11:45 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
radius_in = g_value_get_double ( gimp_value_array_index ( args , 1 ) ) ;
2006-04-04 14:11:45 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_WRITE , error ) ;
2006-04-04 14:11:45 -07:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
{
gimp_brush_generated_set_radius ( GIMP_BRUSH_GENERATED ( brush ) ,
radius_in ) ;
radius_out = GIMP_BRUSH_GENERATED ( brush ) - > radius ;
}
2006-04-04 14:11:45 -07:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 14:11:45 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , radius_out ) ;
2006-04-04 14:11:45 -07:00
return return_vals ;
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_spikes_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 14:11:45 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-04 14:11:45 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gint32 spikes = 0 ;
2006-04-04 14:11:45 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-04 14:11:45 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2006-04-04 14:11:45 -07:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
spikes = GIMP_BRUSH_GENERATED ( brush ) - > spikes ;
2006-04-04 14:11:45 -07:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 14:11:45 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , spikes ) ;
2006-04-04 14:11:45 -07:00
return return_vals ;
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_set_spikes_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 14:11:45 -07:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-04 14:11:45 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gint32 spikes_in ;
gint32 spikes_out = 0 ;
2006-04-04 14:11:45 -07:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
spikes_in = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
2006-04-04 14:11:45 -07:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_WRITE , error ) ;
2006-04-04 14:11:45 -07:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
{
gimp_brush_generated_set_spikes ( GIMP_BRUSH_GENERATED ( brush ) ,
spikes_in ) ;
spikes_out = GIMP_BRUSH_GENERATED ( brush ) - > spikes ;
}
2006-04-04 14:11:45 -07:00
else
success = FALSE ;
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 14:11:45 -07:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , spikes_out ) ;
2006-04-04 14:11:45 -07:00
return return_vals ;
2004-09-28 15:01:21 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_hardness_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gdouble hardness = 0.0 ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-12-30 15:28:38 -08:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
hardness = GIMP_BRUSH_GENERATED ( brush ) - > hardness ;
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-12-30 15:28:38 -08:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , hardness ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_set_hardness_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gdouble hardness_in ;
gdouble hardness_out = 0.0 ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
hardness_in = g_value_get_double ( gimp_value_array_index ( args , 1 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_WRITE , error ) ;
2004-12-30 15:28:38 -08:00
2007-12-11 01:54:41 -08:00
if ( brush )
2006-04-04 14:11:45 -07:00
{
2008-02-07 09:08:54 -08:00
gimp_brush_generated_set_hardness ( GIMP_BRUSH_GENERATED ( brush ) ,
hardness_in ) ;
hardness_out = GIMP_BRUSH_GENERATED ( brush ) - > hardness ;
2006-04-04 14:11:45 -07:00
}
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-12-30 15:28:38 -08:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , hardness_out ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_aspect_ratio_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gdouble aspect_ratio = 0.0 ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-12-30 15:28:38 -08:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
aspect_ratio = GIMP_BRUSH_GENERATED ( brush ) - > aspect_ratio ;
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-12-30 15:28:38 -08:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , aspect_ratio ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_set_aspect_ratio_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gdouble aspect_ratio_in ;
gdouble aspect_ratio_out = 0.0 ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
aspect_ratio_in = g_value_get_double ( gimp_value_array_index ( args , 1 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_WRITE , error ) ;
2004-12-30 15:28:38 -08:00
2007-12-11 01:54:41 -08:00
if ( brush )
2006-04-04 14:11:45 -07:00
{
2008-02-07 09:08:54 -08:00
gimp_brush_generated_set_aspect_ratio ( GIMP_BRUSH_GENERATED ( brush ) ,
aspect_ratio_in ) ;
aspect_ratio_out = GIMP_BRUSH_GENERATED ( brush ) - > aspect_ratio ;
2006-04-04 14:11:45 -07:00
}
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-12-30 15:28:38 -08:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , aspect_ratio_out ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_get_angle_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2008-02-07 09:08:54 -08:00
gdouble angle = 0.0 ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_READ , error ) ;
2004-12-30 15:28:38 -08:00
2007-12-11 01:54:41 -08:00
if ( brush )
2008-02-07 09:08:54 -08:00
angle = GIMP_BRUSH_GENERATED ( brush ) - > angle ;
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-12-30 15:28:38 -08:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , angle ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
brush_set_angle_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-12-30 15:28:38 -08:00
{
gboolean success = TRUE ;
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-04-02 09:03:32 -07:00
const gchar * name ;
2006-04-04 14:11:45 -07:00
gdouble angle_in ;
gdouble angle_out = 0.0 ;
2004-12-30 15:28:38 -08:00
2012-05-03 15:50:23 -07:00
name = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
angle_in = g_value_get_double ( gimp_value_array_index ( args , 1 ) ) ;
2004-12-30 15:28:38 -08:00
if ( success )
{
app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable(). Currently, the only such
object is the custom gradient.
Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.
Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter. Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 14:06:31 -07:00
GimpBrush * brush = gimp_pdb_get_generated_brush ( gimp , name , GIMP_PDB_DATA_ACCESS_WRITE , error ) ;
2004-12-30 15:28:38 -08:00
2007-12-11 01:54:41 -08:00
if ( brush )
2006-04-04 14:11:45 -07:00
{
gimp_brush_generated_set_angle ( GIMP_BRUSH_GENERATED ( brush ) ,
angle_in ) ;
angle_out = GIMP_BRUSH_GENERATED ( brush ) - > angle ;
}
2006-03-15 04:49:25 -08:00
else
success = FALSE ;
2004-12-30 15:28:38 -08:00
}
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-12-30 15:28:38 -08:00
if ( success )
2012-05-03 15:50:23 -07:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , angle_out ) ;
2004-12-30 15:28:38 -08:00
2006-03-27 13:09:32 -08:00
return return_vals ;
2004-12-30 15:28:38 -08:00
}
2006-04-04 14:11:45 -07:00
void
2006-04-26 02:13:47 -07:00
register_brush_procs ( GimpPDB * pdb )
2004-12-30 15:28:38 -08:00
{
2006-04-04 14:11:45 -07:00
GimpProcedure * procedure ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - new
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_new_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-new " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-new " ,
2015-11-02 08:15:13 -08:00
" Creates a new brush. " ,
" This procedure creates a new, uninitialized brush. " ,
2006-04-04 14:11:45 -07:00
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The requested name of the new brush " ,
2007-04-25 07:23:05 -07:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " actual-name " ,
" actual name " ,
2015-11-02 08:15:13 -08:00
" The actual new brush name. The returned value must be freed with g_free() " ,
2007-04-25 07:23:05 -07:00
FALSE , FALSE , FALSE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - duplicate
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_duplicate_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-duplicate " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-duplicate " ,
2015-11-02 08:15:13 -08:00
" Duplicates a brush. " ,
" This procedure creates an identical brush by a different name. " ,
2006-04-04 14:11:45 -07:00
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " copy-name " ,
" copy name " ,
2015-11-02 08:15:13 -08:00
" The name of the brush's copy. The returned value must be freed with g_free() " ,
2007-04-25 07:23:05 -07:00
FALSE , FALSE , FALSE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - is - generated
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_is_generated_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-is-generated " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-is-generated " ,
2015-11-02 08:15:13 -08:00
" Tests if brush is generated. " ,
" Returns TRUE if this brush is parametric, FALSE for other types. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " generated " ,
" generated " ,
" TRUE if the brush is generated " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - rename
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_rename_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-rename " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-rename " ,
2015-11-02 08:15:13 -08:00
" Renames a brush. " ,
" This procedure renames a brush. " ,
2006-04-04 14:11:45 -07:00
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " new-name " ,
" new name " ,
" The new name of the brush " ,
2007-04-25 07:23:05 -07:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " actual-name " ,
" actual name " ,
2015-11-02 08:15:13 -08:00
" The actual new name of the brush. The returned value must be freed with g_free() " ,
2007-04-25 07:23:05 -07:00
FALSE , FALSE , FALSE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - delete
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_delete_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-delete " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-delete " ,
2015-11-02 08:15:13 -08:00
" Deletes a brush. " ,
" This procedure deletes a brush. " ,
2006-04-04 14:11:45 -07:00
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - is - editable
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_is_editable_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-is-editable " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-is-editable " ,
2015-11-02 08:15:13 -08:00
" Tests if brush can be edited. " ,
" Returns TRUE if you have permission to change the brush. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " editable " ,
" editable " ,
" TRUE if the brush can be edited " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - get - info
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_get_info_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-info " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-get-info " ,
2015-11-02 08:15:13 -08:00
" Retrieves information about the specified brush. " ,
" This procedure retrieves information about the specified brush: brush extents (width and height), color depth and mask depth. " ,
2006-04-04 14:11:45 -07:00
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " width " ,
" width " ,
" The brush width " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " height " ,
" height " ,
" The brush height " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " mask-bpp " ,
" mask bpp " ,
" The brush mask bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " color-bpp " ,
" color bpp " ,
" The brush color bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - get - pixels
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_get_pixels_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-pixels " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-get-pixels " ,
2015-11-02 08:15:13 -08:00
" Retrieves information about the specified brush. " ,
2006-04-04 14:11:45 -07:00
" 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 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " width " ,
" width " ,
" The brush width " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " height " ,
" height " ,
" The brush height " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " mask-bpp " ,
" mask bpp " ,
" The brush mask bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " 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_param_spec_int8_array ( " mask-bytes " ,
" mask bytes " ,
" The brush mask data " ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " color-bpp " ,
" color bpp " ,
" The brush color bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " 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_param_spec_int8_array ( " color-bytes " ,
" color bytes " ,
" The brush color data " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - get - spacing
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_get_spacing_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-spacing " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-get-spacing " ,
2015-11-02 08:15:13 -08:00
" Gets the brush spacing. " ,
2006-04-04 14:11:45 -07:00
" 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 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " spacing " ,
" spacing " ,
2006-05-18 10:25:15 -07:00
" The brush spacing " ,
2006-04-04 14:11:45 -07:00
0 , 1000 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - set - spacing
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_set_spacing_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-set-spacing " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-set-spacing " ,
2015-11-02 08:15:13 -08:00
" Sets the brush spacing. " ,
2006-04-04 14:11:45 -07:00
" This procedure modifies the spacing setting for the specified brush. The value should be a integer between 0 and 1000. " ,
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " spacing " ,
" spacing " ,
2006-05-18 10:25:15 -07:00
" The brush spacing " ,
2006-04-04 14:11:45 -07:00
0 , 1000 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - get - shape
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_get_shape_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-shape " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-get-shape " ,
2015-11-02 08:15:13 -08:00
" Gets the shape of a generated brush. " ,
2006-04-04 14:11:45 -07:00
" 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. " ,
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_enum ( " shape " ,
" shape " ,
2006-05-18 10:25:15 -07:00
" The brush shape " ,
2006-04-04 14:11:45 -07:00
GIMP_TYPE_BRUSH_GENERATED_SHAPE ,
GIMP_BRUSH_GENERATED_CIRCLE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - set - shape
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_set_shape_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-set-shape " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-set-shape " ,
2015-11-02 08:15:13 -08:00
" Sets the shape of a generated brush. " ,
2008-02-07 09:08:54 -08:00
" 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-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2008-02-07 09:08:54 -08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " shape-in " ,
" shape in " ,
" The brush shape " ,
GIMP_TYPE_BRUSH_GENERATED_SHAPE ,
GIMP_BRUSH_GENERATED_CIRCLE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_enum ( " shape-out " ,
" shape out " ,
" The brush shape actually assigned " ,
GIMP_TYPE_BRUSH_GENERATED_SHAPE ,
GIMP_BRUSH_GENERATED_CIRCLE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - get - radius
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_get_radius_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-radius " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-get-radius " ,
2015-11-02 08:15:13 -08:00
" Gets the radius of a generated brush. " ,
2008-02-07 09:08:54 -08:00
" This procedure gets the radius value for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " radius " ,
" radius " ,
" The radius of the brush in pixels " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - set - radius
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_set_radius_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-set-radius " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-set-radius " ,
2015-11-02 08:15:13 -08:00
" Sets the radius of a generated brush. " ,
2008-02-07 09:08:54 -08:00
" This procedure sets the radius for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2008-02-07 09:08:54 -08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " radius-in " ,
" radius in " ,
2015-11-02 08:15:13 -08:00
" The desired brush radius in pixel " ,
2008-02-07 09:08:54 -08:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " radius-out " ,
" radius out " ,
" The brush radius actually assigned " ,
2006-04-04 14:11:45 -07:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - get - spikes
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_get_spikes_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-spikes " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-get-spikes " ,
2015-11-02 08:15:13 -08:00
" Gets the number of spikes for a generated brush. " ,
2008-02-07 09:08:54 -08:00
" This procedure gets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
gimp_param_spec_int32 ( " spikes " ,
" spikes " ,
" The number of spikes on the brush. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - set - spikes
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_set_spikes_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-set-spikes " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-set-spikes " ,
2015-11-02 08:15:13 -08:00
" Sets the number of spikes for a generated brush. " ,
2008-02-07 09:08:54 -08:00
" This procedure sets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2008-02-07 09:08:54 -08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " spikes-in " ,
" spikes in " ,
" The desired number of spikes " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
gimp_param_spec_int32 ( " spikes-out " ,
" spikes out " ,
" The number of spikes actually assigned " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - get - hardness
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_get_hardness_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-hardness " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-get-hardness " ,
2015-11-02 08:15:13 -08:00
" Gets 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, as a float between 0.0 and 1.0. If called for any other type of brush, the function does not succeed. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " hardness " ,
" hardness " ,
" The hardness of the brush. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - set - hardness
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_set_hardness_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-set-hardness " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-set-hardness " ,
2015-11-02 08:15:13 -08:00
" Sets 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. The value should be a float between 0.0 and 1.0. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " hardness-in " ,
" hardness in " ,
" The desired brush hardness " ,
2006-04-04 14:11:45 -07:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " hardness-out " ,
" hardness out " ,
" The brush hardness actually assigned " ,
2006-04-04 14:11:45 -07:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - get - aspect - ratio
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_get_aspect_ratio_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-aspect-ratio " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-get-aspect-ratio " ,
2015-11-02 08:15:13 -08:00
" Gets 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. The return value is a float between 0.0 and 1000.0. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " aspect-ratio " ,
" aspect ratio " ,
" The aspect ratio of the brush. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - set - aspect - ratio
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_set_aspect_ratio_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-set-aspect-ratio " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-set-aspect-ratio " ,
2015-11-02 08:15:13 -08:00
" Sets 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. The value should be a float between 0.0 and 1000.0. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " aspect-ratio-in " ,
" aspect ratio in " ,
" The desired brush aspect ratio " ,
2006-04-04 14:11:45 -07:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " aspect-ratio-out " ,
" aspect ratio out " ,
" The brush aspect ratio actually assigned " ,
2006-04-04 14:11:45 -07:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
2008-02-07 09:08:54 -08:00
* gimp - brush - get - angle
2006-04-04 14:11:45 -07:00
*/
2008-02-07 09:08:54 -08:00
procedure = gimp_procedure_new ( brush_get_angle_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-get-angle " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
2008-02-07 09:08:54 -08:00
" gimp-brush-get-angle " ,
2015-11-02 08:15:13 -08:00
" Gets the rotation angle of a generated brush. " ,
2008-02-07 09:08:54 -08:00
" This procedure gets the angle of rotation for a generated brush. If called for any other type of brush, it does not succeed. " ,
2006-04-04 14:11:45 -07:00
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2008-02-07 09:08:54 -08:00
g_param_spec_double ( " angle " ,
" angle " ,
2015-11-02 08:15:13 -08:00
" The rotation angle of the brush in degree. " ,
2006-04-04 14:11:45 -07:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
2006-04-04 14:11:45 -07:00
/*
* gimp - brush - set - angle
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( brush_set_angle_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brush-set-angle " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brush-set-angle " ,
2015-11-02 08:15:13 -08:00
" Sets the rotation angle of a generated brush. " ,
2006-04-04 14:11:45 -07:00
" This procedure sets the rotation angle for a generated brush. If called for any other type of brush, it does not succeed. " ,
" Bill Skaggs <weskaggs@primate.ucdavis.edu> " ,
" Bill Skaggs " ,
" 2004 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The brush name " ,
2007-12-11 01:54:41 -08:00
FALSE , FALSE , TRUE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " angle-in " ,
" angle in " ,
2015-11-02 08:15:13 -08:00
" The desired brush rotation angle in degree " ,
2006-04-04 14:11:45 -07:00
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " angle-out " ,
" angle out " ,
" The brush rotation angle actually assigned " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2004-12-30 15:28:38 -08:00
}