diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-01-08 22:45:51 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-01-08 22:45:51 +0000 |
commit | 82cc8362b2a84b3a6f8e584a6a8b53e68fa1cc61 (patch) | |
tree | d6ee06b6ad294fac6cbd2d9d42dc23c6fbb60bf5 /pango | |
parent | 8e88fecfffdc0a5f25dc98bcc2fa79dac0938670 (diff) | |
download | pango-82cc8362b2a84b3a6f8e584a6a8b53e68fa1cc61.tar.gz |
Don't introduce bitfields in public struct and rename PangoAnalysis.
2007-01-08 Behdad Esfahbod <behdad@gnome.org>
* docs/pango-sections.txt:
* docs/tmpl/glyphs.sgml:
* docs/tmpl/main.sgml:
* pango/pango-context.c (itemize_state_add_character):
* pango/pango-item.h:
* pango/pango-layout.c (pango_layout_run_get_extents):
* pango/pango-renderer.c (pango_renderer_draw_layout_line):
Don't introduce bitfields in public struct and rename PangoAnalysis.
centered_baseline to PangoAnalysis.flags and introduce
PANGO_ANALYSIS_FLAGS_CENTERED_BASELINE.
svn path=/trunk/; revision=2134
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-context.c | 2 | ||||
-rw-r--r-- | pango/pango-item.h | 9 | ||||
-rw-r--r-- | pango/pango-layout.c | 4 | ||||
-rw-r--r-- | pango/pango-renderer.c | 4 |
4 files changed, 11 insertions, 8 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c index 5875fb72..533929d6 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -959,7 +959,7 @@ itemize_state_add_character (ItemizeState *state, break; } - state->item->analysis.centered_baseline = state->centered_baseline; + state->item->analysis.flags = state->centered_baseline ? PANGO_ANALYSIS_FLAG_CENTERED_BASELINE : 0; state->item->analysis.language = state->derived_lang; diff --git a/pango/pango-item.h b/pango/pango-item.h index cf9bfe84..cdc887e4 100644 --- a/pango/pango-item.h +++ b/pango/pango-item.h @@ -29,15 +29,18 @@ G_BEGIN_DECLS typedef struct _PangoAnalysis PangoAnalysis; typedef struct _PangoItem PangoItem; +/* TODO: if more flags are needed, turn this into a real PangoAnalysisFlags enum */ +#define PANGO_ANALYSIS_FLAG_CENTERED_BASELINE (1 << 0) + struct _PangoAnalysis { PangoEngineShape *shape_engine; PangoEngineLang *lang_engine; PangoFont *font; - guint level : 8; - guint gravity : 3; /* PangoGravity */ - guint centered_baseline : 1; /* gboolean */ + guint8 level; + guint8 gravity; /* PangoGravity */ + guint8 flags; PangoLanguage *language; GSList *extra_attrs; diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 2ea3a8c6..eab30f8a 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -4107,7 +4107,7 @@ pango_layout_run_get_extents (PangoLayoutRun *run, pango_layout_get_item_properties (run->item, &properties); - if (!run_logical && run->item->analysis.centered_baseline) + if (!run_logical && (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE)) run_logical = &logical; if (!run_logical && (properties.uline != PANGO_UNDERLINE_NONE || properties.strikethrough)) @@ -4180,7 +4180,7 @@ pango_layout_run_get_extents (PangoLayoutRun *run, pango_font_metrics_unref (metrics); } - if (run->item->analysis.centered_baseline) + if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) properties.rise += run_logical->y + run_logical->height / 2; if (properties.rise != 0) diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c index b4c4728e..5b5b71ba 100644 --- a/pango/pango-renderer.c +++ b/pango/pango-renderer.c @@ -481,7 +481,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer, PangoRectangle ink_rect, *ink = NULL; PangoRectangle logical_rect, *logical = NULL; - if (run->item->analysis.centered_baseline) + if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) logical = &logical_rect; pango_renderer_prepare_run (renderer, run); @@ -515,7 +515,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer, state.logical_rect_end = x + x_off + glyph_string_width; - if (run->item->analysis.centered_baseline) + if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) rise += logical_rect.y + logical_rect.height / 2; |