mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
pdb: add pdb calls for hardness and force
This commit is contained in:
parent
32e545277b
commit
60cf10f581
5 changed files with 763 additions and 82 deletions
|
@ -752,6 +752,168 @@ context_set_brush_default_spacing_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_get_brush_hardness_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gdouble hardness = 0.0;
|
||||
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-hardness", &hardness,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_set_double (gimp_value_array_index (return_vals, 1), hardness);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_set_brush_hardness_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
gdouble hardness;
|
||||
|
||||
hardness = g_value_get_double (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
g_object_set (list->data,
|
||||
"brush-spacing", (gdouble) hardness,
|
||||
NULL);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_set_brush_default_hardness_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpBrush *brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
gimp_paint_options_set_default_brush_hardness (list->data, brush);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_get_brush_force_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gdouble force = 0.0;
|
||||
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-force", &force,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_set_double (gimp_value_array_index (return_vals, 1), force);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_set_brush_force_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
gdouble force;
|
||||
|
||||
force = g_value_get_double (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
g_object_set (list->data,
|
||||
"brush-spacing", (gdouble) force,
|
||||
NULL);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_get_dynamics_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -2697,6 +2859,115 @@ register_context_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-get-brush-hardness
|
||||
*/
|
||||
procedure = gimp_procedure_new (context_get_brush_hardness_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-context-get-brush-hardness");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-context-get-brush-hardness",
|
||||
"Get brush hardness in paint options.",
|
||||
"Get the brush hardness for brush based paint tools.",
|
||||
"Alexia Death",
|
||||
"Alexia Death",
|
||||
"2014",
|
||||
NULL);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("hardness",
|
||||
"hardness",
|
||||
"brush hardness",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-set-brush-hardness
|
||||
*/
|
||||
procedure = gimp_procedure_new (context_set_brush_hardness_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-context-set-brush-hardness");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-context-set-brush-hardness",
|
||||
"Set brush hardness.",
|
||||
"Set the brush hardness for brush based paint tools.",
|
||||
"Alexia Death",
|
||||
"Alexia Death",
|
||||
"2014",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("hardness",
|
||||
"hardness",
|
||||
"brush hardness",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-set-brush-default-hardness
|
||||
*/
|
||||
procedure = gimp_procedure_new (context_set_brush_default_hardness_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-context-set-brush-default-hardness");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-context-set-brush-default-hardness",
|
||||
"Set brush spacing to its default.",
|
||||
"Set the brush spacing to the default for paintbrush, airbrush, or pencil tools.",
|
||||
"Alexia Death",
|
||||
"Alexia Death",
|
||||
"2014",
|
||||
NULL);
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-get-brush-force
|
||||
*/
|
||||
procedure = gimp_procedure_new (context_get_brush_force_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-context-get-brush-force");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-context-get-brush-force",
|
||||
"Get brush force in paint options.",
|
||||
"Get the brush application force for brush based paint tools.",
|
||||
"Alexia Death",
|
||||
"Alexia Death",
|
||||
"2014",
|
||||
NULL);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("force",
|
||||
"force",
|
||||
"brush application force",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-set-brush-force
|
||||
*/
|
||||
procedure = gimp_procedure_new (context_set_brush_force_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-context-set-brush-force");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-context-set-brush-force",
|
||||
"Set brush application force.",
|
||||
"Set the brush application force for brush based paint tools.",
|
||||
"Alexia Death",
|
||||
"Alexia Death",
|
||||
"2014",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("force",
|
||||
"force",
|
||||
"brush application force",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-get-dynamics
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "internal-procs.h"
|
||||
|
||||
|
||||
/* 738 procedures registered total */
|
||||
/* 742 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (GimpPDB *pdb)
|
||||
|
|
|
@ -941,6 +941,158 @@ gimp_context_set_brush_default_spacing (void)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_get_brush_hardness:
|
||||
*
|
||||
* Get brush hardness in paint options.
|
||||
*
|
||||
* Get the brush hardness for brush based paint tools.
|
||||
*
|
||||
* Returns: brush hardness.
|
||||
*
|
||||
* Since: GIMP 2.10
|
||||
**/
|
||||
gdouble
|
||||
gimp_context_get_brush_hardness (void)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble hardness = 0.0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-context-get-brush-hardness",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
hardness = return_vals[1].data.d_float;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return hardness;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_set_brush_hardness:
|
||||
* @hardness: brush hardness.
|
||||
*
|
||||
* Set brush hardness.
|
||||
*
|
||||
* Set the brush hardness for brush based paint tools.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.10
|
||||
**/
|
||||
gboolean
|
||||
gimp_context_set_brush_hardness (gdouble hardness)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-context-set-brush-hardness",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_FLOAT, hardness,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_set_brush_default_hardness:
|
||||
*
|
||||
* Set brush spacing to its default.
|
||||
*
|
||||
* Set the brush spacing to the default for paintbrush, airbrush, or
|
||||
* pencil tools.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.10
|
||||
**/
|
||||
gboolean
|
||||
gimp_context_set_brush_default_hardness (void)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-context-set-brush-default-hardness",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_get_brush_force:
|
||||
*
|
||||
* Get brush force in paint options.
|
||||
*
|
||||
* Get the brush application force for brush based paint tools.
|
||||
*
|
||||
* Returns: brush application force.
|
||||
*
|
||||
* Since: GIMP 2.10
|
||||
**/
|
||||
gdouble
|
||||
gimp_context_get_brush_force (void)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble force = 0.0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-context-get-brush-force",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
force = return_vals[1].data.d_float;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return force;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_set_brush_force:
|
||||
* @force: brush application force.
|
||||
*
|
||||
* Set brush application force.
|
||||
*
|
||||
* Set the brush application force for brush based paint tools.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.10
|
||||
**/
|
||||
gboolean
|
||||
gimp_context_set_brush_force (gdouble force)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-context-set-brush-force",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_FLOAT, force,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_get_dynamics:
|
||||
*
|
||||
|
|
|
@ -32,89 +32,94 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_context_push (void);
|
||||
gboolean gimp_context_pop (void);
|
||||
gboolean gimp_context_set_defaults (void);
|
||||
gboolean gimp_context_list_paint_methods (gint *num_paint_methods,
|
||||
gchar ***paint_methods);
|
||||
gchar* gimp_context_get_paint_method (void);
|
||||
gboolean gimp_context_set_paint_method (const gchar *name);
|
||||
gboolean gimp_context_get_foreground (GimpRGB *foreground);
|
||||
gboolean gimp_context_set_foreground (const GimpRGB *foreground);
|
||||
gboolean gimp_context_get_background (GimpRGB *background);
|
||||
gboolean gimp_context_set_background (const GimpRGB *background);
|
||||
gboolean gimp_context_set_default_colors (void);
|
||||
gboolean gimp_context_swap_colors (void);
|
||||
gdouble gimp_context_get_opacity (void);
|
||||
gboolean gimp_context_set_opacity (gdouble opacity);
|
||||
GimpLayerModeEffects gimp_context_get_paint_mode (void);
|
||||
gboolean gimp_context_set_paint_mode (GimpLayerModeEffects paint_mode);
|
||||
gchar* gimp_context_get_brush (void);
|
||||
gboolean gimp_context_set_brush (const gchar *name);
|
||||
gdouble gimp_context_get_brush_size (void);
|
||||
gboolean gimp_context_set_brush_size (gdouble size);
|
||||
gboolean gimp_context_set_brush_default_size (void);
|
||||
gdouble gimp_context_get_brush_aspect_ratio (void);
|
||||
gboolean gimp_context_set_brush_aspect_ratio (gdouble aspect);
|
||||
gdouble gimp_context_get_brush_angle (void);
|
||||
gboolean gimp_context_set_brush_angle (gdouble angle);
|
||||
gdouble gimp_context_get_brush_spacing (void);
|
||||
gboolean gimp_context_set_brush_spacing (gdouble spacing);
|
||||
gboolean gimp_context_set_brush_default_spacing (void);
|
||||
gchar* gimp_context_get_dynamics (void);
|
||||
gboolean gimp_context_set_dynamics (const gchar *name);
|
||||
gchar* gimp_context_get_pattern (void);
|
||||
gboolean gimp_context_set_pattern (const gchar *name);
|
||||
gchar* gimp_context_get_gradient (void);
|
||||
gboolean gimp_context_set_gradient (const gchar *name);
|
||||
gchar* gimp_context_get_palette (void);
|
||||
gboolean gimp_context_set_palette (const gchar *name);
|
||||
gchar* gimp_context_get_font (void);
|
||||
gboolean gimp_context_set_font (const gchar *name);
|
||||
gboolean gimp_context_get_antialias (void);
|
||||
gboolean gimp_context_set_antialias (gboolean antialias);
|
||||
gboolean gimp_context_get_feather (void);
|
||||
gboolean gimp_context_set_feather (gboolean feather);
|
||||
gboolean gimp_context_get_feather_radius (gdouble *feather_radius_x,
|
||||
gdouble *feather_radius_y);
|
||||
gboolean gimp_context_set_feather_radius (gdouble feather_radius_x,
|
||||
gdouble feather_radius_y);
|
||||
gboolean gimp_context_get_sample_merged (void);
|
||||
gboolean gimp_context_set_sample_merged (gboolean sample_merged);
|
||||
GimpSelectCriterion gimp_context_get_sample_criterion (void);
|
||||
gboolean gimp_context_set_sample_criterion (GimpSelectCriterion sample_criterion);
|
||||
gdouble gimp_context_get_sample_threshold (void);
|
||||
gboolean gimp_context_set_sample_threshold (gdouble sample_threshold);
|
||||
gint gimp_context_get_sample_threshold_int (void);
|
||||
gboolean gimp_context_set_sample_threshold_int (gint sample_threshold);
|
||||
gboolean gimp_context_get_sample_transparent (void);
|
||||
gboolean gimp_context_set_sample_transparent (gboolean sample_transparent);
|
||||
GimpInterpolationType gimp_context_get_interpolation (void);
|
||||
gboolean gimp_context_set_interpolation (GimpInterpolationType interpolation);
|
||||
GimpTransformDirection gimp_context_get_transform_direction (void);
|
||||
gboolean gimp_context_set_transform_direction (GimpTransformDirection transform_direction);
|
||||
GimpTransformResize gimp_context_get_transform_resize (void);
|
||||
gboolean gimp_context_set_transform_resize (GimpTransformResize transform_resize);
|
||||
gboolean gimp_context_push (void);
|
||||
gboolean gimp_context_pop (void);
|
||||
gboolean gimp_context_set_defaults (void);
|
||||
gboolean gimp_context_list_paint_methods (gint *num_paint_methods,
|
||||
gchar ***paint_methods);
|
||||
gchar* gimp_context_get_paint_method (void);
|
||||
gboolean gimp_context_set_paint_method (const gchar *name);
|
||||
gboolean gimp_context_get_foreground (GimpRGB *foreground);
|
||||
gboolean gimp_context_set_foreground (const GimpRGB *foreground);
|
||||
gboolean gimp_context_get_background (GimpRGB *background);
|
||||
gboolean gimp_context_set_background (const GimpRGB *background);
|
||||
gboolean gimp_context_set_default_colors (void);
|
||||
gboolean gimp_context_swap_colors (void);
|
||||
gdouble gimp_context_get_opacity (void);
|
||||
gboolean gimp_context_set_opacity (gdouble opacity);
|
||||
GimpLayerModeEffects gimp_context_get_paint_mode (void);
|
||||
gboolean gimp_context_set_paint_mode (GimpLayerModeEffects paint_mode);
|
||||
gchar* gimp_context_get_brush (void);
|
||||
gboolean gimp_context_set_brush (const gchar *name);
|
||||
gdouble gimp_context_get_brush_size (void);
|
||||
gboolean gimp_context_set_brush_size (gdouble size);
|
||||
gboolean gimp_context_set_brush_default_size (void);
|
||||
gdouble gimp_context_get_brush_aspect_ratio (void);
|
||||
gboolean gimp_context_set_brush_aspect_ratio (gdouble aspect);
|
||||
gdouble gimp_context_get_brush_angle (void);
|
||||
gboolean gimp_context_set_brush_angle (gdouble angle);
|
||||
gdouble gimp_context_get_brush_spacing (void);
|
||||
gboolean gimp_context_set_brush_spacing (gdouble spacing);
|
||||
gboolean gimp_context_set_brush_default_spacing (void);
|
||||
gdouble gimp_context_get_brush_hardness (void);
|
||||
gboolean gimp_context_set_brush_hardness (gdouble hardness);
|
||||
gboolean gimp_context_set_brush_default_hardness (void);
|
||||
gdouble gimp_context_get_brush_force (void);
|
||||
gboolean gimp_context_set_brush_force (gdouble force);
|
||||
gchar* gimp_context_get_dynamics (void);
|
||||
gboolean gimp_context_set_dynamics (const gchar *name);
|
||||
gchar* gimp_context_get_pattern (void);
|
||||
gboolean gimp_context_set_pattern (const gchar *name);
|
||||
gchar* gimp_context_get_gradient (void);
|
||||
gboolean gimp_context_set_gradient (const gchar *name);
|
||||
gchar* gimp_context_get_palette (void);
|
||||
gboolean gimp_context_set_palette (const gchar *name);
|
||||
gchar* gimp_context_get_font (void);
|
||||
gboolean gimp_context_set_font (const gchar *name);
|
||||
gboolean gimp_context_get_antialias (void);
|
||||
gboolean gimp_context_set_antialias (gboolean antialias);
|
||||
gboolean gimp_context_get_feather (void);
|
||||
gboolean gimp_context_set_feather (gboolean feather);
|
||||
gboolean gimp_context_get_feather_radius (gdouble *feather_radius_x,
|
||||
gdouble *feather_radius_y);
|
||||
gboolean gimp_context_set_feather_radius (gdouble feather_radius_x,
|
||||
gdouble feather_radius_y);
|
||||
gboolean gimp_context_get_sample_merged (void);
|
||||
gboolean gimp_context_set_sample_merged (gboolean sample_merged);
|
||||
GimpSelectCriterion gimp_context_get_sample_criterion (void);
|
||||
gboolean gimp_context_set_sample_criterion (GimpSelectCriterion sample_criterion);
|
||||
gdouble gimp_context_get_sample_threshold (void);
|
||||
gboolean gimp_context_set_sample_threshold (gdouble sample_threshold);
|
||||
gint gimp_context_get_sample_threshold_int (void);
|
||||
gboolean gimp_context_set_sample_threshold_int (gint sample_threshold);
|
||||
gboolean gimp_context_get_sample_transparent (void);
|
||||
gboolean gimp_context_set_sample_transparent (gboolean sample_transparent);
|
||||
GimpInterpolationType gimp_context_get_interpolation (void);
|
||||
gboolean gimp_context_set_interpolation (GimpInterpolationType interpolation);
|
||||
GimpTransformDirection gimp_context_get_transform_direction (void);
|
||||
gboolean gimp_context_set_transform_direction (GimpTransformDirection transform_direction);
|
||||
GimpTransformResize gimp_context_get_transform_resize (void);
|
||||
gboolean gimp_context_set_transform_resize (GimpTransformResize transform_resize);
|
||||
GIMP_DEPRECATED
|
||||
gint gimp_context_get_transform_recursion (void);
|
||||
gint gimp_context_get_transform_recursion (void);
|
||||
GIMP_DEPRECATED
|
||||
gboolean gimp_context_set_transform_recursion (gint transform_recursion);
|
||||
gdouble gimp_context_get_ink_size (void);
|
||||
gboolean gimp_context_set_ink_size (gdouble size);
|
||||
gdouble gimp_context_get_ink_angle (void);
|
||||
gboolean gimp_context_set_ink_angle (gdouble angle);
|
||||
gdouble gimp_context_get_ink_size_sensitivity (void);
|
||||
gboolean gimp_context_set_ink_size_sensitivity (gdouble size);
|
||||
gdouble gimp_context_get_ink_tilt_sensitivity (void);
|
||||
gboolean gimp_context_set_ink_tilt_sensitivity (gdouble tilt);
|
||||
gdouble gimp_context_get_ink_speed_sensitivity (void);
|
||||
gboolean gimp_context_set_ink_speed_sensitivity (gdouble speed);
|
||||
GimpInkBlobType gimp_context_get_ink_blob_type (void);
|
||||
gboolean gimp_context_set_ink_blob_type (GimpInkBlobType type);
|
||||
gdouble gimp_context_get_ink_blob_aspect_ratio (void);
|
||||
gboolean gimp_context_set_ink_blob_aspect_ratio (gdouble aspect);
|
||||
gdouble gimp_context_get_ink_blob_angle (void);
|
||||
gboolean gimp_context_set_ink_blob_angle (gdouble angle);
|
||||
gboolean gimp_context_set_transform_recursion (gint transform_recursion);
|
||||
gdouble gimp_context_get_ink_size (void);
|
||||
gboolean gimp_context_set_ink_size (gdouble size);
|
||||
gdouble gimp_context_get_ink_angle (void);
|
||||
gboolean gimp_context_set_ink_angle (gdouble angle);
|
||||
gdouble gimp_context_get_ink_size_sensitivity (void);
|
||||
gboolean gimp_context_set_ink_size_sensitivity (gdouble size);
|
||||
gdouble gimp_context_get_ink_tilt_sensitivity (void);
|
||||
gboolean gimp_context_set_ink_tilt_sensitivity (gdouble tilt);
|
||||
gdouble gimp_context_get_ink_speed_sensitivity (void);
|
||||
gboolean gimp_context_set_ink_speed_sensitivity (gdouble speed);
|
||||
GimpInkBlobType gimp_context_get_ink_blob_type (void);
|
||||
gboolean gimp_context_set_ink_blob_type (GimpInkBlobType type);
|
||||
gdouble gimp_context_get_ink_blob_aspect_ratio (void);
|
||||
gboolean gimp_context_set_ink_blob_aspect_ratio (gdouble aspect);
|
||||
gdouble gimp_context_get_ink_blob_angle (void);
|
||||
gboolean gimp_context_set_ink_blob_angle (gdouble angle);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -797,6 +797,255 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub context_get_brush_spacing {
|
||||
$blurb = 'Get brush spacing as percent of size.';
|
||||
$help = 'Get the brush spacing as percent of size for brush based paint tools.';
|
||||
|
||||
|
||||
@outargs = (
|
||||
{ name => "spacing", type => "0 < float",
|
||||
desc => "brush spacing as percent of size" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-spacing", &spacing,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_set_brush_spacing {
|
||||
$blurb = 'Set brush spacing as percent of size.';
|
||||
$help = 'Set the brush spacing as percent of size for brush based paint tools.';
|
||||
|
||||
&adeath_pdb_misc('2014', '2.10');
|
||||
|
||||
@inargs = (
|
||||
{ name => "spacing", type => "0 < float",
|
||||
desc => "brush spacing as percent of size" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
g_object_set (list->data,
|
||||
"brush-spacing", (gdouble) spacing,
|
||||
NULL);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_set_brush_default_spacing {
|
||||
$blurb = 'Set brush spacing to its default.';
|
||||
$help = <<'HELP';
|
||||
Set the brush spacing to the default for
|
||||
paintbrush, airbrush, or pencil tools.
|
||||
HELP
|
||||
|
||||
&adeath_pdb_misc('2014', '2.10');
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpBrush *brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
gimp_paint_options_set_default_brush_spacing (list->data, brush);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_get_brush_hardness {
|
||||
$blurb = 'Get brush hardness in paint options.';
|
||||
$help = 'Get the brush hardness for brush based paint tools.';
|
||||
|
||||
&adeath_pdb_misc('2014', '2.10');
|
||||
|
||||
@outargs = (
|
||||
{ name => "hardness", type => "0 < float",
|
||||
desc => "brush hardness" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-hardness", &hardness,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_set_brush_hardness {
|
||||
$blurb = 'Set brush hardness.';
|
||||
$help = 'Set the brush hardness for brush based paint tools.';
|
||||
|
||||
&adeath_pdb_misc('2014', '2.10');
|
||||
|
||||
@inargs = (
|
||||
{ name => "hardness", type => "0 < float",
|
||||
desc => "brush hardness" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
g_object_set (list->data,
|
||||
"brush-spacing", (gdouble) hardness,
|
||||
NULL);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_set_brush_default_hardness {
|
||||
$blurb = 'Set brush spacing to its default.';
|
||||
$help = <<'HELP';
|
||||
Set the brush spacing to the default for
|
||||
paintbrush, airbrush, or pencil tools.
|
||||
HELP
|
||||
|
||||
&adeath_pdb_misc('2014', '2.10');
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpBrush *brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
gimp_paint_options_set_default_brush_hardness (list->data, brush);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_get_brush_force {
|
||||
$blurb = 'Get brush force in paint options.';
|
||||
$help = 'Get the brush application force for brush based paint tools.';
|
||||
|
||||
&adeath_pdb_misc('2014', '2.10');
|
||||
|
||||
@outargs = (
|
||||
{ name => "force", type => "0 < float",
|
||||
desc => "brush application force" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-force", &force,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_set_brush_force {
|
||||
$blurb = 'Set brush application force.';
|
||||
$help = 'Set the brush application force for brush based paint tools.';
|
||||
|
||||
&adeath_pdb_misc('2014', '2.10');
|
||||
|
||||
@inargs = (
|
||||
{ name => "force", type => "0 < float",
|
||||
desc => "brush application force" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GList *options;
|
||||
GList *list;
|
||||
|
||||
options = gimp_pdb_context_get_brush_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
for (list = options; list; list = g_list_next (list))
|
||||
g_object_set (list->data,
|
||||
"brush-spacing", (gdouble) force,
|
||||
NULL);
|
||||
|
||||
g_list_free (options);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_get_dynamics {
|
||||
$blurb = 'Retrieve the currently active paint dynamics.';
|
||||
|
||||
|
@ -2285,6 +2534,10 @@ CODE
|
|||
context_get_brush_angle context_set_brush_angle
|
||||
context_get_brush_spacing
|
||||
context_set_brush_spacing context_set_brush_default_spacing
|
||||
context_get_brush_hardness
|
||||
context_set_brush_hardness context_set_brush_default_hardness
|
||||
context_get_brush_force
|
||||
context_set_brush_force
|
||||
context_get_dynamics context_set_dynamics
|
||||
context_get_pattern context_set_pattern
|
||||
context_get_gradient context_set_gradient
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue