From 7070931e6a0e17a0449ef16bb20cc158a52e51c9 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 15 Jun 2004 21:44:19 +0000 Subject: [PATCH] deprecate the XLFD-based API gimp_text() and gimp_text_get_extents(). 2004-06-15 Sven Neumann * tools/pdbgen/pdb/text_tool.pdb: deprecate the XLFD-based API gimp_text() and gimp_text_get_extents(). * app/pdb/text_tool_cmds.c * libgimp/gimptexttool_pdb.[ch]: regenerated. --- ChangeLog | 8 ++++++++ app/pdb/text_tool_cmds.c | 5 ++--- libgimp/gimptexttool_pdb.c | 23 +++-------------------- libgimp/gimptexttool_pdb.h | 4 ++++ tools/pdbgen/pdb/text_tool.pdb | 24 ++++++------------------ 5 files changed, 23 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index e16a6a7e51..e5c95bc287 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-06-15 Sven Neumann + + * tools/pdbgen/pdb/text_tool.pdb: deprecate the XLFD-based API + gimp_text() and gimp_text_get_extents(). + + * app/pdb/text_tool_cmds.c + * libgimp/gimptexttool_pdb.[ch]: regenerated. + 2004-06-15 Manish Singh * tools/pdbgen/pdbgen.pl diff --git a/app/pdb/text_tool_cmds.c b/app/pdb/text_tool_cmds.c index ea55b6d186..f108be6568 100644 --- a/app/pdb/text_tool_cmds.c +++ b/app/pdb/text_tool_cmds.c @@ -542,8 +542,7 @@ static ProcRecord text_proc = { "gimp_text", "Add text at the specified location as a floating selection or a new layer.", - "This tool requires font information in the form of nine parameters: size, foundry, family, weight, slant, set_width, spacing, registry, encoding. The font size can either be specified in units of pixels or points, and the appropriate metric is specified using the size_type argument. The x and y parameters together control the placement of the new text by specifying the upper left corner of the text bounding box. If the antialias parameter is non-zero, the generated text will blend more smoothly with underlying layers. This option requires more time and memory to compute than non-antialiased text; the resulting floating selection or layer, however, will require the same amount of memory with or without antialiasing. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified around the final rendered text." - "The border is measured in pixels. If the border is specified as -1, empty spaces around the text will not be cropped.", + "This function is deprecated, use gimp_get_text_fontname() instead.", "Martin Edlman", "Spencer Kimball & Peter Mattis", "1998", @@ -734,7 +733,7 @@ static ProcRecord text_get_extents_proc = { "gimp_text_get_extents", "Get extents of the bounding box for the specified text.", - "This tool returns the width and height of a bounding box for the specified text string with the specified font information. Ascent and descent for the specified font are returned as well.", + "This function is deprecated, use gimp_get_text_extents_fontname() instead.", "Martin Edlman", "Spencer Kimball & Peter Mattis", "1998", diff --git a/libgimp/gimptexttool_pdb.c b/libgimp/gimptexttool_pdb.c index 2563ea317d..88d8b0e484 100644 --- a/libgimp/gimptexttool_pdb.c +++ b/libgimp/gimptexttool_pdb.c @@ -176,23 +176,7 @@ gimp_text_get_extents_fontname (const gchar *text, * Add text at the specified location as a floating selection or a new * layer. * - * This tool requires font information in the form of nine parameters: - * size, foundry, family, weight, slant, set_width, spacing, registry, - * encoding. The font size can either be specified in units of pixels - * or points, and the appropriate metric is specified using the - * size_type argument. The x and y parameters together control the - * placement of the new text by specifying the upper left corner of the - * text bounding box. If the antialias parameter is non-zero, the - * generated text will blend more smoothly with underlying layers. This - * option requires more time and memory to compute than non-antialiased - * text; the resulting floating selection or layer, however, will - * require the same amount of memory with or without antialiasing. If - * the specified drawable parameter is valid, the text will be created - * as a floating selection attached to the drawable. If the drawable - * parameter is not valid (-1), the text will appear as a new layer. - * Finally, a border can be specified around the final rendered text. - * The border is measured in pixels. If the border is specified as -1, - * empty spaces around the text will not be cropped. + * This function is deprecated, use gimp_get_text_fontname() instead. * * Returns: The new text layer. */ @@ -268,9 +252,8 @@ gimp_text (gint32 image_ID, * * Get extents of the bounding box for the specified text. * - * This tool returns the width and height of a bounding box for the - * specified text string with the specified font information. Ascent - * and descent for the specified font are returned as well. + * This function is deprecated, use gimp_get_text_extents_fontname() + * instead. * * Returns: TRUE on success. */ diff --git a/libgimp/gimptexttool_pdb.h b/libgimp/gimptexttool_pdb.h index c014499254..51e77ff5f4 100644 --- a/libgimp/gimptexttool_pdb.h +++ b/libgimp/gimptexttool_pdb.h @@ -47,6 +47,7 @@ gboolean gimp_text_get_extents_fontname (const gchar *text, gint *height, gint *ascent, gint *descent); +#ifndef GIMP_DISABLE_DEPRECATED gint32 gimp_text (gint32 image_ID, gint32 drawable_ID, gdouble x, @@ -64,6 +65,8 @@ gint32 gimp_text (gint32 image_ID, const gchar *spacing, const gchar *registry, const gchar *encoding); +#endif /* GIMP_DISABLE_DEPRECATED */ +#ifndef GIMP_DISABLE_DEPRECATED gboolean gimp_text_get_extents (const gchar *text, gdouble size, GimpSizeType size_type, @@ -79,6 +82,7 @@ gboolean gimp_text_get_extents (const gchar *text, gint *height, gint *ascent, gint *descent); +#endif /* GIMP_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb index 6c395883e1..f685932342 100644 --- a/tools/pdbgen/pdb/text_tool.pdb +++ b/tools/pdbgen/pdb/text_tool.pdb @@ -182,23 +182,11 @@ Add text at the specified location as a floating selection or a new layer. BLURB $help = <<'HELP'; -This tool requires font information in the form of nine parameters: size, -foundry, family, weight, slant, set_width, spacing, registry, encoding. The -font size can either be specified in units of pixels or points, and the -appropriate metric is specified using the size_type argument. The x and y -parameters together control the placement of the new text by specifying the -upper left corner of the text bounding box. If the antialias parameter is -non-zero, the generated text will blend more smoothly with underlying layers. -This option requires more time and memory to compute than non-antialiased text; -the resulting floating selection or layer, however, will require the same -amount of memory with or without antialiasing. If the specified drawable -parameter is valid, the text will be created as a floating selection attached -to the drawable. If the drawable parameter is not valid (-1), the text will -appear as a new layer. Finally, a border can be specified around the final -rendered text. The border is measured in pixels. If the border is specified -as -1, empty spaces around the text will not be cropped. +This function is deprecated, use gimp_get_text_fontname() instead. HELP + $deprecated = 1; + &pdb_misc; @inargs = ( @@ -235,11 +223,11 @@ sub text_get_extents { $blurb = 'Get extents of the bounding box for the specified text.'; $help = <<'HELP'; -This tool returns the width and height of a bounding box for the specified text -string with the specified font information. Ascent and descent for the -specified font are returned as well. +This function is deprecated, use gimp_get_text_extents_fontname() instead. HELP + $deprecated = 1; + &pdb_misc; @inargs = (