From 5539a03e2c18a13d2e45b77d38926efb7962647a Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 9 Oct 2025 22:41:25 +0000 Subject: [PATCH] pdb: Add PDB for text layer outline This patch adds PDB API to get and set text outline properties, modelled after similar API for getting vector layer stroke settings. --- app/pdb/internal-procs.c | 2 +- app/pdb/text-layer-cmds.c | 1053 +++++++++++++++++++++++++++++++++++ libgimp/gimp.def | 18 + libgimp/gimptextlayer_pdb.c | 679 ++++++++++++++++++++++ libgimp/gimptextlayer_pdb.h | 131 +++-- pdb/groups/text_layer.pdb | 539 ++++++++++++++++++ 6 files changed, 2369 insertions(+), 53 deletions(-) diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c index c6d4b81a2e..e4ebe98535 100644 --- a/app/pdb/internal-procs.c +++ b/app/pdb/internal-procs.c @@ -30,7 +30,7 @@ #include "internal-procs.h" -/* 759 procedures registered total */ +/* 777 procedures registered total */ void internal_procs_init (GimpPDB *pdb) diff --git a/app/pdb/text-layer-cmds.c b/app/pdb/text-layer-cmds.c index 69da7ddfa9..6de8e2a20b 100644 --- a/app/pdb/text-layer-cmds.c +++ b/app/pdb/text-layer-cmds.c @@ -36,6 +36,7 @@ #include "pdb-types.h" #include "core/gimpcontext.h" +#include "core/gimpdashpattern.h" #include "core/gimpimage.h" #include "core/gimpparamspecs.h" #include "text/gimpfont.h" @@ -965,6 +966,526 @@ text_layer_set_letter_spacing_invoker (GimpProcedure *procedure, error ? *error : NULL); } +static GimpValueArray * +text_layer_get_outline_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gint outline = 0; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline", &outline, + NULL); + } + + return_vals = gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); + + if (success) + g_value_set_enum (gimp_value_array_index (return_vals, 1), outline); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gint outline; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline = g_value_get_enum (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline", outline, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_antialias_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gboolean outline_antialias = FALSE; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline-antialias", &outline_antialias, + NULL); + } + + return_vals = gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); + + if (success) + g_value_set_boolean (gimp_value_array_index (return_vals, 1), outline_antialias); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_antialias_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gboolean outline_antialias; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline_antialias = g_value_get_boolean (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-antialias", outline_antialias, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_cap_style_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gint outline_cap_style = 0; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline-cap-style", &outline_cap_style, + NULL); + } + + return_vals = gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); + + if (success) + g_value_set_enum (gimp_value_array_index (return_vals, 1), outline_cap_style); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_cap_style_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gint outline_cap_style; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline_cap_style = g_value_get_enum (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-cap-style", outline_cap_style, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_color_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + GeglColor *color = NULL; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + color = gegl_color_duplicate (gimp_text_layer_get_text (layer)->outline_foreground); + } + + return_vals = gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); + + if (success) + g_value_take_object (gimp_value_array_index (return_vals, 1), color); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_color_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + GeglColor *color; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + color = g_value_get_object (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-foreground", color, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_dash_offset_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gdouble outline_dash_offset = 0.0; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline-dash-offset", &outline_dash_offset, + NULL); + } + + 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), outline_dash_offset); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_dash_offset_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gdouble outline_dash_offset; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline_dash_offset = g_value_get_double (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-dash-offset", outline_dash_offset, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_direction_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gint outline_direction = 0; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline-direction", &outline_direction, + NULL); + } + + return_vals = gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); + + if (success) + g_value_set_enum (gimp_value_array_index (return_vals, 1), outline_direction); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_direction_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gint outline_direction; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline_direction = g_value_get_enum (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-direction", outline_direction, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_join_style_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gint outline_join_style = 0; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline-join-style", &outline_join_style, + NULL); + } + + return_vals = gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); + + if (success) + g_value_set_enum (gimp_value_array_index (return_vals, 1), outline_join_style); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_join_style_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gint outline_join_style; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline_join_style = g_value_get_enum (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-join-style", outline_join_style, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_miter_limit_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gdouble outline_miter_limit = 0.0; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline-miter-limit", &outline_miter_limit, + NULL); + } + + 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), outline_miter_limit); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_miter_limit_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gdouble outline_miter_limit; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline_miter_limit = g_value_get_double (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-miter-limit", outline_miter_limit, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +text_layer_get_outline_width_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + GimpTextLayer *layer; + gdouble outline_width = 0.0; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + + if (success) + { + g_object_get (gimp_text_layer_get_text (layer), + "outline-width", &outline_width, + NULL); + } + + 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), outline_width); + + return return_vals; +} + +static GimpValueArray * +text_layer_set_outline_width_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpTextLayer *layer; + gdouble outline_width; + + layer = g_value_get_object (gimp_value_array_index (args, 0)); + outline_width = g_value_get_double (gimp_value_array_index (args, 1)); + + if (success) + { + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-width", outline_width, + NULL); + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + static GimpValueArray * text_layer_resize_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -1920,6 +2441,538 @@ register_text_layer_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); + /* + * gimp-text-layer-get-outline + */ + procedure = gimp_procedure_new (text_layer_get_outline_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline"); + gimp_procedure_set_static_help (procedure, + "Get the outline type from a text layer.", + "This procedure returns the outline type of a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_enum ("outline", + "outline", + "The type of outline in the text layer", + GIMP_TYPE_TEXT_OUTLINE, + GIMP_TEXT_OUTLINE_NONE, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline + */ + procedure = gimp_procedure_new (text_layer_set_outline_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline"); + gimp_procedure_set_static_help (procedure, + "Set the outline type for the text layer.", + "This procedure sets the type of the outline in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_enum ("outline", + "outline", + "The type of outline in the text layer", + GIMP_TYPE_TEXT_OUTLINE, + GIMP_TEXT_OUTLINE_NONE, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-antialias + */ + procedure = gimp_procedure_new (text_layer_get_outline_antialias_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-antialias"); + gimp_procedure_set_static_help (procedure, + "Get the outline antialias setting from a text layer.", + "This procedure returns the antialias setting of the text outline in a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_boolean ("outline-antialias", + "outline antialias", + "The text outline antialias setting", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-antialias + */ + procedure = gimp_procedure_new (text_layer_set_outline_antialias_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-antialias"); + gimp_procedure_set_static_help (procedure, + "Set the outline antialias setting from a text layer.", + "This procedure sets the text outline antialias in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_boolean ("outline-antialias", + "outline antialias", + "The text outline antialias setting", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-cap-style + */ + procedure = gimp_procedure_new (text_layer_get_outline_cap_style_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-cap-style"); + gimp_procedure_set_static_help (procedure, + "Get the outline cap style from a text layer.", + "This procedure returns the outline cap style of a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_enum ("outline-cap-style", + "outline cap style", + "The cap style of the outline in the text layer", + GIMP_TYPE_CAP_STYLE, + GIMP_CAP_BUTT, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-cap-style + */ + procedure = gimp_procedure_new (text_layer_set_outline_cap_style_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-cap-style"); + gimp_procedure_set_static_help (procedure, + "Set the outline cap style for the text layer.", + "This procedure sets the cap style of the outline in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_enum ("outline-cap-style", + "outline cap style", + "The cap style of the outline in the text layer", + GIMP_TYPE_CAP_STYLE, + GIMP_CAP_BUTT, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-color + */ + procedure = gimp_procedure_new (text_layer_get_outline_color_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-color"); + gimp_procedure_set_static_help (procedure, + "Get the color of the text outline in a text layer.", + "This procedure returns the color of the text outline in a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer.", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + gimp_param_spec_color ("color", + "color", + "The color of the text outline.", + FALSE, + NULL, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-color + */ + procedure = gimp_procedure_new (text_layer_set_outline_color_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-color"); + gimp_procedure_set_static_help (procedure, + "Set the color of the text outline in the text layer.", + "This procedure sets the outline color in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + gimp_param_spec_color ("color", + "color", + "The color to use for the text outline.", + FALSE, + NULL, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-dash-offset + */ + procedure = gimp_procedure_new (text_layer_get_outline_dash_offset_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-dash-offset"); + gimp_procedure_set_static_help (procedure, + "Get the outline dash offset from a text layer.", + "This procedure returns the dash offset of the text outline in a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_double ("outline-dash-offset", + "outline dash offset", + "The text outline dash offset", + -G_MAXDOUBLE, G_MAXDOUBLE, 0, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-dash-offset + */ + procedure = gimp_procedure_new (text_layer_set_outline_dash_offset_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-dash-offset"); + gimp_procedure_set_static_help (procedure, + "Set the outline dash offset from a text layer.", + "This procedure sets the outline dash offset in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_double ("outline-dash-offset", + "outline dash offset", + "The text outline dash offset", + 0.0, 2000.0, 0.0, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-direction + */ + procedure = gimp_procedure_new (text_layer_get_outline_direction_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-direction"); + gimp_procedure_set_static_help (procedure, + "Get the outline direction from a text layer.", + "This procedure returns the outline direction of a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_enum ("outline-direction", + "outline direction", + "The direction of the outline in the text layer", + GIMP_TYPE_TEXT_OUTLINE_DIRECTION, + GIMP_TEXT_OUTLINE_DIRECTION_OUTER, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-direction + */ + procedure = gimp_procedure_new (text_layer_set_outline_direction_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-direction"); + gimp_procedure_set_static_help (procedure, + "Set the outline direction for the text layer.", + "This procedure sets the direction of the outline in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_enum ("outline-direction", + "outline direction", + "The direction of the outline in the text layer", + GIMP_TYPE_TEXT_OUTLINE_DIRECTION, + GIMP_TEXT_OUTLINE_DIRECTION_OUTER, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-join-style + */ + procedure = gimp_procedure_new (text_layer_get_outline_join_style_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-join-style"); + gimp_procedure_set_static_help (procedure, + "Get the outline join style from a text layer.", + "This procedure returns the outline join style of a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_enum ("outline-join-style", + "outline join style", + "The join style of the outline in the text layer", + GIMP_TYPE_JOIN_STYLE, + GIMP_JOIN_MITER, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-join-style + */ + procedure = gimp_procedure_new (text_layer_set_outline_join_style_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-join-style"); + gimp_procedure_set_static_help (procedure, + "Set the outline join style for the text layer.", + "This procedure sets the join style of the outline in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_enum ("outline-join-style", + "outline join style", + "The join style of the outline in the text layer", + GIMP_TYPE_JOIN_STYLE, + GIMP_JOIN_MITER, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-miter-limit + */ + procedure = gimp_procedure_new (text_layer_get_outline_miter_limit_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-miter-limit"); + gimp_procedure_set_static_help (procedure, + "Get the outline miter limit from a text layer.", + "This procedure returns the miter limit of the text outline in a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_double ("outline-miter-limit", + "outline miter limit", + "The text outline miter limit", + -G_MAXDOUBLE, G_MAXDOUBLE, 0, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-miter-limit + */ + procedure = gimp_procedure_new (text_layer_set_outline_miter_limit_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-miter-limit"); + gimp_procedure_set_static_help (procedure, + "Set the outline miter limit from a text layer.", + "This procedure sets the text outline miter limit in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_double ("outline-miter-limit", + "outline miter limit", + "The text outline miter limit", + 0.0, 100.0, 0.0, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-get-outline-width + */ + procedure = gimp_procedure_new (text_layer_get_outline_width_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-get-outline-width"); + gimp_procedure_set_static_help (procedure, + "Get the outline width from a text layer.", + "This procedure returns the color of the text outline in a text layer.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_double ("outline-width", + "outline width", + "The text outline width", + -G_MAXDOUBLE, G_MAXDOUBLE, 0, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + + /* + * gimp-text-layer-set-outline-width + */ + procedure = gimp_procedure_new (text_layer_set_outline_width_invoker, FALSE); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-text-layer-set-outline-width"); + gimp_procedure_set_static_help (procedure, + "Set the outline width from a text layer.", + "This procedure sets the text outline color in the text layer 'layer'.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Alex S.", + "Alex S.", + "2025"); + gimp_procedure_add_argument (procedure, + gimp_param_spec_text_layer ("layer", + "layer", + "The text layer", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_argument (procedure, + g_param_spec_double ("outline-width", + "outline width", + "The text outline width", + 0.0, 8192.0, 0.0, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + /* * gimp-text-layer-resize */ diff --git a/libgimp/gimp.def b/libgimp/gimp.def index 8ddcafdc6e..dce318e30d 100644 --- a/libgimp/gimp.def +++ b/libgimp/gimp.def @@ -1063,6 +1063,15 @@ EXPORTS gimp_text_layer_get_letter_spacing gimp_text_layer_get_line_spacing gimp_text_layer_get_markup + gimp_text_layer_get_outline + gimp_text_layer_get_outline_antialias + gimp_text_layer_get_outline_cap_style + gimp_text_layer_get_outline_color + gimp_text_layer_get_outline_dash_offset + gimp_text_layer_get_outline_direction + gimp_text_layer_get_outline_join_style + gimp_text_layer_get_outline_miter_limit + gimp_text_layer_get_outline_width gimp_text_layer_get_text gimp_text_layer_get_type gimp_text_layer_new @@ -1080,6 +1089,15 @@ EXPORTS gimp_text_layer_set_letter_spacing gimp_text_layer_set_line_spacing gimp_text_layer_set_markup + gimp_text_layer_set_outline + gimp_text_layer_set_outline_antialias + gimp_text_layer_set_outline_cap_style + gimp_text_layer_set_outline_color + gimp_text_layer_set_outline_dash_offset + gimp_text_layer_set_outline_direction + gimp_text_layer_set_outline_join_style + gimp_text_layer_set_outline_miter_limit + gimp_text_layer_set_outline_width gimp_text_layer_set_text gimp_thumbnail_procedure_get_type gimp_thumbnail_procedure_new diff --git a/libgimp/gimptextlayer_pdb.c b/libgimp/gimptextlayer_pdb.c index 13a70c4823..2d22deba25 100644 --- a/libgimp/gimptextlayer_pdb.c +++ b/libgimp/gimptextlayer_pdb.c @@ -1174,6 +1174,685 @@ gimp_text_layer_set_letter_spacing (GimpTextLayer *layer, return success; } +/** + * gimp_text_layer_get_outline: + * @layer: The text layer. + * + * Get the outline type from a text layer. + * + * This procedure returns the outline type of a text layer. + * + * Returns: The type of outline in the text layer. + * + * Since: 3.2 + **/ +GimpTextOutline +gimp_text_layer_get_outline (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + GimpTextOutline outline = 0; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline = GIMP_VALUES_GET_ENUM (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline; +} + +/** + * gimp_text_layer_set_outline: + * @layer: The text layer. + * @outline: The type of outline in the text layer. + * + * Set the outline type for the text layer. + * + * This procedure sets the type of the outline in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline (GimpTextLayer *layer, + GimpTextOutline outline) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + GIMP_TYPE_TEXT_OUTLINE, outline, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_antialias: + * @layer: The text layer. + * + * Get the outline antialias setting from a text layer. + * + * This procedure returns the antialias setting of the text outline in + * a text layer. + * + * Returns: The text outline antialias setting. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_get_outline_antialias (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean outline_antialias = FALSE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-antialias", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline_antialias = GIMP_VALUES_GET_BOOLEAN (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline_antialias; +} + +/** + * gimp_text_layer_set_outline_antialias: + * @layer: The text layer. + * @outline_antialias: The text outline antialias setting. + * + * Set the outline antialias setting from a text layer. + * + * This procedure sets the text outline antialias in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_antialias (GimpTextLayer *layer, + gboolean outline_antialias) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_BOOLEAN, outline_antialias, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-antialias", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_cap_style: + * @layer: The text layer. + * + * Get the outline cap style from a text layer. + * + * This procedure returns the outline cap style of a text layer. + * + * Returns: The cap style of the outline in the text layer. + * + * Since: 3.2 + **/ +GimpCapStyle +gimp_text_layer_get_outline_cap_style (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + GimpCapStyle outline_cap_style = 0; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-cap-style", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline_cap_style = GIMP_VALUES_GET_ENUM (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline_cap_style; +} + +/** + * gimp_text_layer_set_outline_cap_style: + * @layer: The text layer. + * @outline_cap_style: The cap style of the outline in the text layer. + * + * Set the outline cap style for the text layer. + * + * This procedure sets the cap style of the outline in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_cap_style (GimpTextLayer *layer, + GimpCapStyle outline_cap_style) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + GIMP_TYPE_CAP_STYLE, outline_cap_style, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-cap-style", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_color: + * @layer: The text layer. + * + * Get the color of the text outline in a text layer. + * + * This procedure returns the color of the text outline in a text + * layer. + * + * Returns: (transfer full): The color of the text outline. + * + * Since: 3.2 + **/ +GeglColor * +gimp_text_layer_get_outline_color (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + GeglColor *color = NULL; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-color", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + color = g_value_dup_object (gimp_value_array_index (return_vals, 1)); + + gimp_value_array_unref (return_vals); + + return color; +} + +/** + * gimp_text_layer_set_outline_color: + * @layer: The text layer. + * @color: The color to use for the text outline. + * + * Set the color of the text outline in the text layer. + * + * This procedure sets the outline color in the text layer 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_color (GimpTextLayer *layer, + GeglColor *color) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + GEGL_TYPE_COLOR, color, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-color", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_dash_offset: + * @layer: The text layer. + * + * Get the outline dash offset from a text layer. + * + * This procedure returns the dash offset of the text outline in a text + * layer. + * + * Returns: The text outline dash offset. + * + * Since: 3.2 + **/ +gdouble +gimp_text_layer_get_outline_dash_offset (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gdouble outline_dash_offset = 0.0; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-dash-offset", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline_dash_offset = GIMP_VALUES_GET_DOUBLE (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline_dash_offset; +} + +/** + * gimp_text_layer_set_outline_dash_offset: + * @layer: The text layer. + * @outline_dash_offset: The text outline dash offset. + * + * Set the outline dash offset from a text layer. + * + * This procedure sets the outline dash offset in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_dash_offset (GimpTextLayer *layer, + gdouble outline_dash_offset) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_DOUBLE, outline_dash_offset, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-dash-offset", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_direction: + * @layer: The text layer. + * + * Get the outline direction from a text layer. + * + * This procedure returns the outline direction of a text layer. + * + * Returns: The direction of the outline in the text layer. + * + * Since: 3.2 + **/ +GimpTextOutlineDirection +gimp_text_layer_get_outline_direction (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + GimpTextOutlineDirection outline_direction = 0; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-direction", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline_direction = GIMP_VALUES_GET_ENUM (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline_direction; +} + +/** + * gimp_text_layer_set_outline_direction: + * @layer: The text layer. + * @outline_direction: The direction of the outline in the text layer. + * + * Set the outline direction for the text layer. + * + * This procedure sets the direction of the outline in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_direction (GimpTextLayer *layer, + GimpTextOutlineDirection outline_direction) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + GIMP_TYPE_TEXT_OUTLINE_DIRECTION, outline_direction, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-direction", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_join_style: + * @layer: The text layer. + * + * Get the outline join style from a text layer. + * + * This procedure returns the outline join style of a text layer. + * + * Returns: The join style of the outline in the text layer. + * + * Since: 3.2 + **/ +GimpJoinStyle +gimp_text_layer_get_outline_join_style (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + GimpJoinStyle outline_join_style = 0; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-join-style", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline_join_style = GIMP_VALUES_GET_ENUM (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline_join_style; +} + +/** + * gimp_text_layer_set_outline_join_style: + * @layer: The text layer. + * @outline_join_style: The join style of the outline in the text layer. + * + * Set the outline join style for the text layer. + * + * This procedure sets the join style of the outline in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_join_style (GimpTextLayer *layer, + GimpJoinStyle outline_join_style) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + GIMP_TYPE_JOIN_STYLE, outline_join_style, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-join-style", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_miter_limit: + * @layer: The text layer. + * + * Get the outline miter limit from a text layer. + * + * This procedure returns the miter limit of the text outline in a text + * layer. + * + * Returns: The text outline miter limit. + * + * Since: 3.2 + **/ +gdouble +gimp_text_layer_get_outline_miter_limit (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gdouble outline_miter_limit = 0.0; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-miter-limit", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline_miter_limit = GIMP_VALUES_GET_DOUBLE (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline_miter_limit; +} + +/** + * gimp_text_layer_set_outline_miter_limit: + * @layer: The text layer. + * @outline_miter_limit: The text outline miter limit. + * + * Set the outline miter limit from a text layer. + * + * This procedure sets the text outline miter limit in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_miter_limit (GimpTextLayer *layer, + gdouble outline_miter_limit) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_DOUBLE, outline_miter_limit, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-miter-limit", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + +/** + * gimp_text_layer_get_outline_width: + * @layer: The text layer. + * + * Get the outline width from a text layer. + * + * This procedure returns the color of the text outline in a text + * layer. + * + * Returns: The text outline width. + * + * Since: 3.2 + **/ +gdouble +gimp_text_layer_get_outline_width (GimpTextLayer *layer) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gdouble outline_width = 0.0; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-get-outline-width", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + outline_width = GIMP_VALUES_GET_DOUBLE (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return outline_width; +} + +/** + * gimp_text_layer_set_outline_width: + * @layer: The text layer. + * @outline_width: The text outline width. + * + * Set the outline width from a text layer. + * + * This procedure sets the text outline color in the text layer + * 'layer'. + * + * Returns: TRUE on success. + * + * Since: 3.2 + **/ +gboolean +gimp_text_layer_set_outline_width (GimpTextLayer *layer, + gdouble outline_width) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean success = TRUE; + + args = gimp_value_array_new_from_types (NULL, + GIMP_TYPE_TEXT_LAYER, layer, + G_TYPE_DOUBLE, outline_width, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-text-layer-set-outline-width", + args); + gimp_value_array_unref (args); + + success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; + + gimp_value_array_unref (return_vals); + + return success; +} + /** * gimp_text_layer_resize: * @layer: The text layer. diff --git a/libgimp/gimptextlayer_pdb.h b/libgimp/gimptextlayer_pdb.h index 8b3ad5b0da..3d8b8e1811 100644 --- a/libgimp/gimptextlayer_pdb.h +++ b/libgimp/gimptextlayer_pdb.h @@ -32,58 +32,85 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -GimpTextLayer* gimp_text_layer_new (GimpImage *image, - const gchar *text, - GimpFont *font, - gdouble size, - GimpUnit *unit); -gchar* gimp_text_layer_get_text (GimpTextLayer *layer); -gboolean gimp_text_layer_set_text (GimpTextLayer *layer, - const gchar *text); -gchar* gimp_text_layer_get_markup (GimpTextLayer *layer); -gboolean gimp_text_layer_set_markup (GimpTextLayer *layer, - const gchar *markup); -GimpFont* gimp_text_layer_get_font (GimpTextLayer *layer); -gboolean gimp_text_layer_set_font (GimpTextLayer *layer, - GimpFont *font); -gdouble gimp_text_layer_get_font_size (GimpTextLayer *layer, - GimpUnit **unit); -gboolean gimp_text_layer_set_font_size (GimpTextLayer *layer, - gdouble font_size, - GimpUnit *unit); -gboolean gimp_text_layer_get_antialias (GimpTextLayer *layer); -gboolean gimp_text_layer_set_antialias (GimpTextLayer *layer, - gboolean antialias); -GimpTextHintStyle gimp_text_layer_get_hint_style (GimpTextLayer *layer); -gboolean gimp_text_layer_set_hint_style (GimpTextLayer *layer, - GimpTextHintStyle style); -gboolean gimp_text_layer_get_kerning (GimpTextLayer *layer); -gboolean gimp_text_layer_set_kerning (GimpTextLayer *layer, - gboolean kerning); -gchar* gimp_text_layer_get_language (GimpTextLayer *layer); -gboolean gimp_text_layer_set_language (GimpTextLayer *layer, - const gchar *language); -GimpTextDirection gimp_text_layer_get_base_direction (GimpTextLayer *layer); -gboolean gimp_text_layer_set_base_direction (GimpTextLayer *layer, - GimpTextDirection direction); -GimpTextJustification gimp_text_layer_get_justification (GimpTextLayer *layer); -gboolean gimp_text_layer_set_justification (GimpTextLayer *layer, - GimpTextJustification justify); -GeglColor* gimp_text_layer_get_color (GimpTextLayer *layer); -gboolean gimp_text_layer_set_color (GimpTextLayer *layer, - GeglColor *color); -gdouble gimp_text_layer_get_indent (GimpTextLayer *layer); -gboolean gimp_text_layer_set_indent (GimpTextLayer *layer, - gdouble indent); -gdouble gimp_text_layer_get_line_spacing (GimpTextLayer *layer); -gboolean gimp_text_layer_set_line_spacing (GimpTextLayer *layer, - gdouble line_spacing); -gdouble gimp_text_layer_get_letter_spacing (GimpTextLayer *layer); -gboolean gimp_text_layer_set_letter_spacing (GimpTextLayer *layer, - gdouble letter_spacing); -gboolean gimp_text_layer_resize (GimpTextLayer *layer, - gdouble width, - gdouble height); +GimpTextLayer* gimp_text_layer_new (GimpImage *image, + const gchar *text, + GimpFont *font, + gdouble size, + GimpUnit *unit); +gchar* gimp_text_layer_get_text (GimpTextLayer *layer); +gboolean gimp_text_layer_set_text (GimpTextLayer *layer, + const gchar *text); +gchar* gimp_text_layer_get_markup (GimpTextLayer *layer); +gboolean gimp_text_layer_set_markup (GimpTextLayer *layer, + const gchar *markup); +GimpFont* gimp_text_layer_get_font (GimpTextLayer *layer); +gboolean gimp_text_layer_set_font (GimpTextLayer *layer, + GimpFont *font); +gdouble gimp_text_layer_get_font_size (GimpTextLayer *layer, + GimpUnit **unit); +gboolean gimp_text_layer_set_font_size (GimpTextLayer *layer, + gdouble font_size, + GimpUnit *unit); +gboolean gimp_text_layer_get_antialias (GimpTextLayer *layer); +gboolean gimp_text_layer_set_antialias (GimpTextLayer *layer, + gboolean antialias); +GimpTextHintStyle gimp_text_layer_get_hint_style (GimpTextLayer *layer); +gboolean gimp_text_layer_set_hint_style (GimpTextLayer *layer, + GimpTextHintStyle style); +gboolean gimp_text_layer_get_kerning (GimpTextLayer *layer); +gboolean gimp_text_layer_set_kerning (GimpTextLayer *layer, + gboolean kerning); +gchar* gimp_text_layer_get_language (GimpTextLayer *layer); +gboolean gimp_text_layer_set_language (GimpTextLayer *layer, + const gchar *language); +GimpTextDirection gimp_text_layer_get_base_direction (GimpTextLayer *layer); +gboolean gimp_text_layer_set_base_direction (GimpTextLayer *layer, + GimpTextDirection direction); +GimpTextJustification gimp_text_layer_get_justification (GimpTextLayer *layer); +gboolean gimp_text_layer_set_justification (GimpTextLayer *layer, + GimpTextJustification justify); +GeglColor* gimp_text_layer_get_color (GimpTextLayer *layer); +gboolean gimp_text_layer_set_color (GimpTextLayer *layer, + GeglColor *color); +gdouble gimp_text_layer_get_indent (GimpTextLayer *layer); +gboolean gimp_text_layer_set_indent (GimpTextLayer *layer, + gdouble indent); +gdouble gimp_text_layer_get_line_spacing (GimpTextLayer *layer); +gboolean gimp_text_layer_set_line_spacing (GimpTextLayer *layer, + gdouble line_spacing); +gdouble gimp_text_layer_get_letter_spacing (GimpTextLayer *layer); +gboolean gimp_text_layer_set_letter_spacing (GimpTextLayer *layer, + gdouble letter_spacing); +GimpTextOutline gimp_text_layer_get_outline (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline (GimpTextLayer *layer, + GimpTextOutline outline); +gboolean gimp_text_layer_get_outline_antialias (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_antialias (GimpTextLayer *layer, + gboolean outline_antialias); +GimpCapStyle gimp_text_layer_get_outline_cap_style (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_cap_style (GimpTextLayer *layer, + GimpCapStyle outline_cap_style); +GeglColor* gimp_text_layer_get_outline_color (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_color (GimpTextLayer *layer, + GeglColor *color); +gdouble gimp_text_layer_get_outline_dash_offset (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_dash_offset (GimpTextLayer *layer, + gdouble outline_dash_offset); +GimpTextOutlineDirection gimp_text_layer_get_outline_direction (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_direction (GimpTextLayer *layer, + GimpTextOutlineDirection outline_direction); +GimpJoinStyle gimp_text_layer_get_outline_join_style (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_join_style (GimpTextLayer *layer, + GimpJoinStyle outline_join_style); +gdouble gimp_text_layer_get_outline_miter_limit (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_miter_limit (GimpTextLayer *layer, + gdouble outline_miter_limit); +gdouble gimp_text_layer_get_outline_width (GimpTextLayer *layer); +gboolean gimp_text_layer_set_outline_width (GimpTextLayer *layer, + gdouble outline_width); +gboolean gimp_text_layer_resize (GimpTextLayer *layer, + gdouble width, + gdouble height); G_END_DECLS diff --git a/pdb/groups/text_layer.pdb b/pdb/groups/text_layer.pdb index 51091fdb98..190348dec6 100644 --- a/pdb/groups/text_layer.pdb +++ b/pdb/groups/text_layer.pdb @@ -967,6 +967,526 @@ CODE ); } +sub text_layer_get_outline { + $blurb = 'Get the outline type from a text layer.'; + + $help = <<'HELP'; +This procedure returns the outline type of a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline', type => 'enum GimpTextOutline', + desc => 'The type of outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline", &outline, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline { + $blurb = 'Set the outline type for the text layer.'; + + $help = <<'HELP'; +This procedure sets the type of the outline in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline', type => 'enum GimpTextOutline', + desc => 'The type of outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline", outline, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_antialias { + $blurb = 'Get the outline antialias setting from a text layer.'; + + $help = <<'HELP'; +This procedure returns the antialias setting of the text outline in a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline_antialias', type => 'boolean', + desc => 'The text outline antialias setting' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline-antialias", &outline_antialias, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline_antialias { + $blurb = 'Set the outline antialias setting from a text layer.'; + + $help = <<'HELP'; +This procedure sets the text outline antialias in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline_antialias', type => 'boolean', + desc => 'The text outline antialias setting' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-antialias", outline_antialias, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_cap_style { + $blurb = 'Get the outline cap style from a text layer.'; + + $help = <<'HELP'; +This procedure returns the outline cap style of a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline_cap_style', type => 'enum GimpCapStyle', + desc => 'The cap style of the outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline-cap-style", &outline_cap_style, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline_cap_style { + $blurb = 'Set the outline cap style for the text layer.'; + + $help = <<'HELP'; +This procedure sets the cap style of the outline in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline_cap_style', type => 'enum GimpCapStyle', + desc => 'The cap style of the outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-cap-style", outline_cap_style, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_color { + $blurb = 'Get the color of the text outline in a text layer.'; + + $help = <<'HELP'; +This procedure returns the color of the text outline in a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer.' } + ); + + @outargs = ( + { name => 'color', type => 'geglcolor', + desc => 'The color of the text outline.' } + ); + + %invoke = ( + code => <<'CODE' +{ + color = gegl_color_duplicate (gimp_text_layer_get_text (layer)->outline_foreground); +} +CODE + ); +} + +sub text_layer_set_outline_color { + $blurb = 'Set the color of the text outline in the text layer.'; + + $help = <<'HELP'; +This procedure sets the outline color in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'color', type => 'geglcolor', + desc => 'The color to use for the text outline.' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-foreground", color, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_dash_offset { + $blurb = 'Get the outline dash offset from a text layer.'; + + $help = <<'HELP'; +This procedure returns the dash offset of the text outline in a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline_dash_offset', type => 'double', + desc => 'The text outline dash offset' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline-dash-offset", &outline_dash_offset, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline_dash_offset { + $blurb = 'Set the outline dash offset from a text layer.'; + + $help = <<'HELP'; +This procedure sets the outline dash offset in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline_dash_offset', type => '0.0 <= double <= 2000.0', + desc => 'The text outline dash offset' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-dash-offset", outline_dash_offset, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_direction { + $blurb = 'Get the outline direction from a text layer.'; + + $help = <<'HELP'; +This procedure returns the outline direction of a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline_direction', type => 'enum GimpTextOutlineDirection', + desc => 'The direction of the outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline-direction", &outline_direction, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline_direction { + $blurb = 'Set the outline direction for the text layer.'; + + $help = <<'HELP'; +This procedure sets the direction of the outline in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline_direction', type => 'enum GimpTextOutlineDirection', + desc => 'The direction of the outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-direction", outline_direction, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_join_style { + $blurb = 'Get the outline join style from a text layer.'; + + $help = <<'HELP'; +This procedure returns the outline join style of a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline_join_style', type => 'enum GimpJoinStyle', + desc => 'The join style of the outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline-join-style", &outline_join_style, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline_join_style { + $blurb = 'Set the outline join style for the text layer.'; + + $help = <<'HELP'; +This procedure sets the join style of the outline in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline_join_style', type => 'enum GimpJoinStyle', + desc => 'The join style of the outline in the text layer' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-join-style", outline_join_style, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_miter_limit { + $blurb = 'Get the outline miter limit from a text layer.'; + + $help = <<'HELP'; +This procedure returns the miter limit of the text outline in a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline_miter_limit', type => 'double', + desc => 'The text outline miter limit' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline-miter-limit", &outline_miter_limit, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline_miter_limit { + $blurb = 'Set the outline miter limit from a text layer.'; + + $help = <<'HELP'; +This procedure sets the text outline miter limit in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline_miter_limit', type => '0.0 <= double <= 100.0', + desc => 'The text outline miter limit' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-miter-limit", outline_miter_limit, + NULL); +} +CODE + ); +} + +sub text_layer_get_outline_width { + $blurb = 'Get the outline width from a text layer.'; + + $help = <<'HELP'; +This procedure returns the color of the text outline in a text layer. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' } + ); + + @outargs = ( + { name => 'outline_width', type => 'double', + desc => 'The text outline width' } + ); + + %invoke = ( + code => <<'CODE' +{ + g_object_get (gimp_text_layer_get_text (layer), + "outline-width", &outline_width, + NULL); +} +CODE + ); +} + +sub text_layer_set_outline_width { + $blurb = 'Set the outline width from a text layer.'; + + $help = <<'HELP'; +This procedure sets the text outline color in the text layer 'layer'. +HELP + + &alxsa_pdb_misc('2025', '3.2'); + + @inargs = ( + { name => 'layer', type => 'text_layer', + desc => 'The text layer' }, + { name => 'outline_width', type => '0.0 <= double <= 8192.0', + desc => 'The text outline width' } + ); + + %invoke = ( + code => <<'CODE' +{ + gimp_text_layer_set (layer, + _("Set text layer attribute"), + "outline-width", outline_width, + NULL); +} +CODE + ); +} + sub text_layer_resize { $blurb = 'Resize the box of a text layer.'; @@ -1015,6 +1535,7 @@ CODE @headers = qw( "libgimpbase/gimpbase.h" "core/gimpcontext.h" + "core/gimpdashpattern.h" "text/gimpfont.h" "text/gimptext.h" "text/gimptextlayer.h" @@ -1051,6 +1572,24 @@ CODE text_layer_set_line_spacing text_layer_get_letter_spacing text_layer_set_letter_spacing + text_layer_get_outline + text_layer_set_outline + text_layer_get_outline_antialias + text_layer_set_outline_antialias + text_layer_get_outline_cap_style + text_layer_set_outline_cap_style + text_layer_get_outline_color + text_layer_set_outline_color + text_layer_get_outline_dash_offset + text_layer_set_outline_dash_offset + text_layer_get_outline_direction + text_layer_set_outline_direction + text_layer_get_outline_join_style + text_layer_set_outline_join_style + text_layer_get_outline_miter_limit + text_layer_set_outline_miter_limit + text_layer_get_outline_width + text_layer_set_outline_width text_layer_resize); %exports = (app => [@procs], lib => [@procs]);