diff --git a/app/pdb/text-layer-cmds.c b/app/pdb/text-layer-cmds.c index b9c7c2ef73..dc8e0f5cb1 100644 --- a/app/pdb/text-layer-cmds.c +++ b/app/pdb/text-layer-cmds.c @@ -999,12 +999,16 @@ register_text_layer_procs (GimpPDB *pdb) /* * gimp-text-layer-new */ - procedure = gimp_procedure_new (text_layer_new_invoker, TRUE, TRUE); + procedure = gimp_procedure_new (text_layer_new_invoker, TRUE, FALSE); gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-text-layer-new"); gimp_procedure_set_static_help (procedure, "Creates a new text layer.", - "This procedure creates a new text layer. The arguments are kept as simple as necessary for the normal case. All text attributes, however, can be modified with the appropriate gimp_text_layer_set_*() procedures. The new layer still needs to be added to the image, as this is not automatic. Add the new layer using 'gimp-image-insert-layer'.", + "This procedure creates a new text layer displaying the specified @text. By default the width and height of the layer will be determined by the @text contents, the @font, @size and @unit.\n" + "\n" + "The new layer still needs to be added to the image as this is not automatic. Add the new layer with the [method@Image.insert_layer] method.\n" + "\n" + "The arguments are kept as simple as necessary for the basic case. All text attributes, however, can be modified with the appropriate `gimp_text_layer_set_*()` procedures.", NULL); gimp_procedure_set_static_attribution (procedure, "Marcus Heese ", @@ -1048,7 +1052,7 @@ register_text_layer_procs (GimpPDB *pdb) gimp_procedure_add_return_value (procedure, gimp_param_spec_text_layer ("layer", "layer", - "The new text layer.", + "The new text layer. The object belongs to libgimp and you should not free it.", FALSE, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); diff --git a/libgimp/gimptextlayer.c b/libgimp/gimptextlayer.c index 491ecb5913..1612314c0d 100644 --- a/libgimp/gimptextlayer.c +++ b/libgimp/gimptextlayer.c @@ -80,40 +80,6 @@ gimp_text_layer_get_by_id (gint32 layer_id) return NULL; } -/** - * gimp_text_layer_new: - * @image: The image to which to add the layer. - * @text: The text to generate (in UTF-8 encoding). - * @font: The name of the font. - * @size: The size of text in either pixels or points. - * @unit: The units of specified size. - * - * Create a new layer. - * - * This procedure creates a new text layer displaying the specified @text. By - * default the width and height of the layer will be determined by the @text - * contents, the @fontname, @size and @unit. - * - * The new layer still needs to be added to the image, as this is not automatic. - * Add the new layer with the gimp_image_insert_layer() command. Other - * attributes such as layer mask modes, and offsets should be set with explicit - * procedure calls. - * - * Returns: (transfer none): The newly created text layer. - * The object belongs to libgimp and you should not free it. - * - * Since: 3.0 - */ -GimpTextLayer * -gimp_text_layer_new (GimpImage *image, - const gchar *text, - GimpFont *font, - gdouble size, - GimpUnit *unit) -{ - return _gimp_text_layer_new (image, text, font, size, unit); -} - /* private functions */ diff --git a/libgimp/gimptextlayer.h b/libgimp/gimptextlayer.h index cc98979e81..e05de4a151 100644 --- a/libgimp/gimptextlayer.h +++ b/libgimp/gimptextlayer.h @@ -40,12 +40,6 @@ G_DECLARE_FINAL_TYPE (GimpTextLayer, gimp_text_layer, GIMP, TEXT_LAYER, GimpLaye GimpTextLayer * gimp_text_layer_get_by_id (gint32 layer_id); -GimpTextLayer * gimp_text_layer_new (GimpImage *image, - const gchar *text, - GimpFont *font, - gdouble size, - GimpUnit *unit) G_GNUC_WARN_UNUSED_RESULT; - G_END_DECLS diff --git a/libgimp/gimptextlayer_pdb.c b/libgimp/gimptextlayer_pdb.c index 9bd1e581c3..13a70c4823 100644 --- a/libgimp/gimptextlayer_pdb.c +++ b/libgimp/gimptextlayer_pdb.c @@ -37,7 +37,7 @@ /** - * _gimp_text_layer_new: + * gimp_text_layer_new: * @image: The image. * @text: The text to generate (in UTF-8 encoding). * @font: The font to write the text with. @@ -46,23 +46,29 @@ * * Creates a new text layer. * - * This procedure creates a new text layer. The arguments are kept as - * simple as necessary for the normal case. All text attributes, - * however, can be modified with the appropriate - * gimp_text_layer_set_*() procedures. The new layer still needs to be - * added to the image, as this is not automatic. Add the new layer - * using gimp_image_insert_layer(). + * This procedure creates a new text layer displaying the specified + * @text. By default the width and height of the layer will be + * determined by the @text contents, the @font, @size and @unit. * - * Returns: (transfer none): The new text layer. + * The new layer still needs to be added to the image as this is not + * automatic. Add the new layer with the [method@Image.insert_layer] + * method. + * + * The arguments are kept as simple as necessary for the basic case. + * All text attributes, however, can be modified with the appropriate + * `gimp_text_layer_set_*()` procedures. + * + * Returns: (transfer none): + * The new text layer. The object belongs to libgimp and you should not free it. * * Since: 2.6 **/ GimpTextLayer * -_gimp_text_layer_new (GimpImage *image, - const gchar *text, - GimpFont *font, - gdouble size, - GimpUnit *unit) +gimp_text_layer_new (GimpImage *image, + const gchar *text, + GimpFont *font, + gdouble size, + GimpUnit *unit) { GimpValueArray *args; GimpValueArray *return_vals; diff --git a/libgimp/gimptextlayer_pdb.h b/libgimp/gimptextlayer_pdb.h index 657e943d16..8b3ad5b0da 100644 --- a/libgimp/gimptextlayer_pdb.h +++ b/libgimp/gimptextlayer_pdb.h @@ -32,58 +32,58 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -G_GNUC_INTERNAL 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); +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 0183162852..8094790f32 100644 --- a/pdb/groups/text_layer.pdb +++ b/pdb/groups/text_layer.pdb @@ -22,17 +22,23 @@ sub text_layer_new { $blurb = 'Creates a new text layer.'; $help = <<'HELP'; -This procedure creates a new text layer. The arguments are kept as -simple as necessary for the normal case. All text attributes, however, -can be modified with the appropriate gimp_text_layer_set_*() -procedures. The new layer still needs to be added to the image, as -this is not automatic. Add the new layer using gimp_image_insert_layer(). +This procedure creates a new text layer displaying the specified @text. By +default the width and height of the layer will be determined by the @text +contents, the @font, @size and @unit. + + +The new layer still needs to be added to the image as this is not +automatic. Add the new layer with the [method@Image.insert_layer] +method. + + +The arguments are kept as simple as necessary for the basic case. All +text attributes, however, can be modified with the appropriate +`gimp_text_layer_set_*()` procedures. HELP &marcus_pdb_misc('2008', '2.6'); - $lib_private = 1; - @inargs = ( { name => 'image', type => 'image', desc => 'The image' }, @@ -48,7 +54,7 @@ HELP @outargs = ( { name => 'layer', type => 'text_layer', - desc => 'The new text layer.' } + desc => 'The new text layer. The object belongs to libgimp and you should not free it.' } ); %invoke = (