pdb: Update text-layer-set-color to GeglColor

Resolves #10992.

GimpTextLayer's color attribute was
updated from GimpRGB to GeglColor,
but gimp-text-layer-set-color still passed
in GimpRGB. This patch updates the PDB
call to match the property type.
This commit is contained in:
Alx Sa 2024-03-05 01:42:22 +00:00
parent 1a76346ed5
commit 625b74ea00
4 changed files with 22 additions and 25 deletions

View file

@ -21,7 +21,6 @@
#include "stamp-pdbgen.h"
#include <cairo.h>
#include <pango/pango.h>
#include <gegl.h>
@ -29,7 +28,6 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpbase/gimpbase.h"
@ -759,16 +757,16 @@ text_layer_set_color_invoker (GimpProcedure *procedure,
{
gboolean success = TRUE;
GimpTextLayer *layer;
GimpRGB color;
GeglColor *color;
layer = g_value_get_object (gimp_value_array_index (args, 0));
gimp_value_get_rgb (gimp_value_array_index (args, 1), &color);
color = g_value_get_object (gimp_value_array_index (args, 1));
if (success)
{
gimp_text_layer_set (layer,
_("Set text layer attribute"),
"color", &color,
"color", color,
NULL);
}
@ -1711,12 +1709,11 @@ register_text_layer_procs (GimpPDB *pdb)
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_rgb ("color",
"color",
"The color to use for the text",
FALSE,
NULL,
GIMP_PARAM_READWRITE));
gegl_param_spec_color ("color",
"color",
"The color to use for the text",
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);

View file

@ -917,7 +917,7 @@ gimp_text_layer_get_color (GimpTextLayer *layer)
**/
gboolean
gimp_text_layer_set_color (GimpTextLayer *layer,
const GimpRGB *color)
GeglColor *color)
{
GimpValueArray *args;
GimpValueArray *return_vals;
@ -925,7 +925,7 @@ gimp_text_layer_set_color (GimpTextLayer *layer,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_TEXT_LAYER, layer,
GIMP_TYPE_RGB, color,
GEGL_TYPE_COLOR, color,
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),

View file

@ -71,7 +71,7 @@ gboolean gimp_text_layer_set_justification (GimpTextLayer
GimpTextJustification justify);
GeglColor* gimp_text_layer_get_color (GimpTextLayer *layer);
gboolean gimp_text_layer_set_color (GimpTextLayer *layer,
const GimpRGB *color);
GeglColor *color);
gdouble gimp_text_layer_get_indent (GimpTextLayer *layer);
gboolean gimp_text_layer_set_indent (GimpTextLayer *layer,
gdouble indent);

View file

@ -58,7 +58,7 @@ HELP
GeglColor *color;
color = gimp_context_get_foreground (context);
gimp_text = g_object_new (GIMP_TYPE_TEXT,
"text", text,
"font", font,
@ -66,7 +66,7 @@ HELP
"font-size-unit", unit,
"color", color,
NULL);
layer = GIMP_TEXT_LAYER (gimp_text_layer_new (image, gimp_text));
g_object_unref (gimp_text);
@ -100,7 +100,7 @@ HELP
{ name => 'text', type => 'string',
desc => 'The text from the specified text layer.' }
);
%invoke = (
code => <<'CODE'
{
@ -160,7 +160,7 @@ HELP
{ name => 'markup', type => 'string',
desc => 'The markup which represents the style of the specified text layer.' }
);
%invoke = (
code => <<'CODE'
{
@ -245,7 +245,7 @@ HELP
{ name => 'font', type => 'font',
desc => 'The font which is used in the specified text layer.' }
);
%invoke = (
code => <<'CODE'
{
@ -311,7 +311,7 @@ HELP
{ name => 'unit', type => 'unit',
desc => 'The unit used for the font size' }
);
%invoke = (
code => <<'CODE'
{
@ -434,7 +434,7 @@ HELP
{ name => 'style', type => 'enum GimpTextHintStyle',
desc => 'The hint style used for font outlines' }
);
%invoke = (
code => <<'CODE'
{
@ -754,7 +754,7 @@ HELP
@inargs = (
{ name => 'layer', type => 'text_layer',
desc => 'The text layer' },
{ name => 'color', type => 'color',
{ name => 'color', type => 'geglcolor',
desc => 'The color to use for the text' }
);
@ -763,7 +763,7 @@ HELP
{
gimp_text_layer_set (layer,
_("Set text layer attribute"),
"color", &color,
"color", color,
NULL);
}
CODE
@ -933,8 +933,8 @@ HELP
{ name => 'letter_spacing', type => '-8192.0 <= float <= 8192.0',
desc => 'The additional letter spacing to use.' }
);
%invoke = (
%invoke = (
code => <<'CODE'
{
gimp_text_layer_set (layer,