diff options
author | Andrea Canciani <ranma42@gmail.com> | 2012-03-27 11:48:19 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2012-03-29 11:03:18 +0200 |
commit | 1d3d64469f3ddac282860f66b24a35cf2253fa46 (patch) | |
tree | b9547d1352d4afbab644a618c70785f6d754a524 /src/cairo-scaled-font.c | |
parent | 79740139e05375c4ce3542b571bc6a1e9d9137a7 (diff) |
doc: Add "since" tag to documentation
The following Python script was used to compute "Since: 1.X" tags,
based on the first version where a symbol became officially supported.
This script requires a concatenation of the the cairo public headers
for the officially supported beckends to be available as
"../../includes/1.X.0.h".
from sys import argv
import re
syms = {}
def stripcomments(text):
def replacer(match):
s = match.group(0)
if s.startswith('/'):
return ""
else:
return s
pattern = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
)
return re.sub(pattern, replacer, text)
for minor in range(12,-2,-2):
version = "1.%d" % minor
names = re.split('([A-Za-z0-9_]+)', stripcomments(open("../../includes/%s.0.h" % version).read()))
for s in names: syms[s] = version
for filename in argv[1:]:
is_public = False
lines = open(filename, "r").read().split("\n")
newlines = []
for i in range(len(lines)):
if lines[i] == "/**":
last_sym = lines[i+1][2:].strip().replace(":", "")
is_public = last_sym.lower().startswith("cairo")
elif is_public and lines[i] == " **/":
if last_sym in syms:
v = syms[last_sym]
if re.search("Since", newlines[-1]): newlines = newlines[:-1]
if newlines[-1].strip() != "*": newlines.append(" *")
newlines.append(" * Since: %s" % v)
else:
print "%s (%d): Cannot determine the version in which '%s' was introduced" % (filename, i, last_sym)
newlines.append(lines[i])
out = open(filename, "w")
out.write("\n".join(newlines))
out.close()
Diffstat (limited to 'src/cairo-scaled-font.c')
-rw-r--r-- | src/cairo-scaled-font.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index 29cea063e..e6552ec67 100644 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -317,6 +317,8 @@ cairo_scaled_font_get_type (cairo_scaled_font_t *scaled_font) * * Return value: %CAIRO_STATUS_SUCCESS or another error such as * %CAIRO_STATUS_NO_MEMORY. + * + * Since: 1.0 **/ cairo_status_t cairo_scaled_font_status (cairo_scaled_font_t *scaled_font) @@ -959,6 +961,8 @@ _cairo_scaled_glyph_find_private (cairo_scaled_glyph_t *scaled_glyph, * * Return value: a newly created #cairo_scaled_font_t. Destroy with * cairo_scaled_font_destroy() + * + * Since: 1.0 **/ cairo_scaled_font_t * cairo_scaled_font_create (cairo_font_face_t *font_face, @@ -1236,6 +1240,8 @@ _cairo_scaled_font_reset_static_data (void) * cairo_scaled_font_get_reference_count(). * * Returns: the referenced #cairo_scaled_font_t + * + * Since: 1.0 **/ cairo_scaled_font_t * cairo_scaled_font_reference (cairo_scaled_font_t *scaled_font) @@ -1259,6 +1265,8 @@ slim_hidden_def (cairo_scaled_font_reference); * Decreases the reference count on @font by one. If the result * is zero, then @font and all associated resources are freed. * See cairo_scaled_font_reference(). + * + * Since: 1.0 **/ void cairo_scaled_font_destroy (cairo_scaled_font_t *scaled_font) @@ -1415,6 +1423,8 @@ slim_hidden_def (cairo_scaled_font_set_user_data); * @extents: a #cairo_font_extents_t which to store the retrieved extents. * * Gets the metrics for a #cairo_scaled_font_t. + * + * Since: 1.0 **/ void cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font, @@ -1512,6 +1522,8 @@ ZERO_EXTENTS: * * Note that whitespace glyphs do not contribute to the size of the * rectangle (extents.width and extents.height). + * + * Since: 1.0 **/ void cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, |