diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2008-09-18 00:26:07 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2008-09-18 00:26:07 -0400 |
commit | 1fe7088a113f8a9cb40d436f10af4967662cd02a (patch) | |
tree | c4174320064ac9c9e3b77ce5ae6db93106f98c29 /src/cairo-pdf-operators.c | |
parent | a8cd426a4c79a7165b312f550ecc6a87b61303a3 (diff) | |
download | cairo-1fe7088a113f8a9cb40d436f10af4967662cd02a.tar.gz |
[show_text_glyphs] Replace the bool backward with cairo_text_cluster_flags
Chris rightfully complained that having a boolean function argument is
new in cairo_show_text_glyphs, and indeed avoiding them has been one
of the API design criteria for cairo. Trying to come up with alternatives,
Owen suggested using a flag type which nicely solves the problem AND
future-proofs such a complex API.
Please welcome _flags_t APIs to cairo.h
Diffstat (limited to 'src/cairo-pdf-operators.c')
-rw-r--r-- | src/cairo-pdf-operators.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c index 435503cab..0b6c00e51 100644 --- a/src/cairo-pdf-operators.c +++ b/src/cairo-pdf-operators.c @@ -1251,7 +1251,7 @@ _cairo_pdf_operators_emit_cluster (cairo_pdf_operators_t *pdf_operators, int utf8_len, cairo_glyph_t *glyphs, int num_glyphs, - cairo_bool_t backward, + cairo_text_cluster_flags_t cluster_flags, cairo_scaled_font_t *scaled_font) { cairo_scaled_font_subsets_glyph_t subset_glyph; @@ -1316,7 +1316,7 @@ _cairo_pdf_operators_emit_cluster (cairo_pdf_operators_t *pdf_operators, if (status) return status; - if (backward) + if ((cluster_flags & CAIRO_TEXT_CLUSTER_FLAG_BACKWARD)) cur_glyph--; else cur_glyph++; @@ -1338,7 +1338,7 @@ _cairo_pdf_operators_show_text_glyphs (cairo_pdf_operators_t *pdf_operators, int num_glyphs, const cairo_text_cluster_t *clusters, int num_clusters, - cairo_bool_t backward, + cairo_text_cluster_flags_t cluster_flags, cairo_scaled_font_t *scaled_font) { cairo_status_t status; @@ -1391,25 +1391,25 @@ _cairo_pdf_operators_show_text_glyphs (cairo_pdf_operators_t *pdf_operators, if (num_clusters > 0) { cur_text = utf8; - if (backward) + if ((cluster_flags & CAIRO_TEXT_CLUSTER_FLAG_BACKWARD)) cur_glyph = glyphs + num_glyphs; else cur_glyph = glyphs; for (i = 0; i < num_clusters; i++) { - if (backward) + if ((cluster_flags & CAIRO_TEXT_CLUSTER_FLAG_BACKWARD)) cur_glyph -= clusters[i].num_glyphs; status = _cairo_pdf_operators_emit_cluster (pdf_operators, cur_text, clusters[i].num_bytes, cur_glyph, clusters[i].num_glyphs, - backward, + cluster_flags, scaled_font); if (status) return status; cur_text += clusters[i].num_bytes; - if (!backward) + if (!(cluster_flags & CAIRO_TEXT_CLUSTER_FLAG_BACKWARD)) cur_glyph += clusters[i].num_glyphs; } } else { |