summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--docs/pango-sections.txt1
-rw-r--r--docs/tmpl/glyphs.sgml9
-rw-r--r--docs/tmpl/main.sgml13
-rw-r--r--pango/pango-context.c2
-rw-r--r--pango/pango-item.h9
-rw-r--r--pango/pango-layout.c4
-rw-r--r--pango/pango-renderer.c4
8 files changed, 45 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ba33af31..a605fe53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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.
+
2007-01-07 Behdad Esfahbod <behdad@gnome.org>
* docs/tmpl/engines.sgml:
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index 271d4597..462eb458 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -5,6 +5,7 @@
PangoContext
PangoItem
PangoAnalysis
+PANGO_ANALYSIS_FLAG_CENTERED_BASELINE
PangoDirection
PANGO_TYPE_DIRECTION
PangoGravity
diff --git a/docs/tmpl/glyphs.sgml b/docs/tmpl/glyphs.sgml
index fde3dd26..b0be55da 100644
--- a/docs/tmpl/glyphs.sgml
+++ b/docs/tmpl/glyphs.sgml
@@ -254,6 +254,15 @@ horizontal origin.
@rect:
+<!-- ##### FUNCTION pango_matrix_transform_pixel_rectangle ##### -->
+<para>
+
+</para>
+
+@matrix:
+@rect:
+
+
<!-- ##### FUNCTION pango_matrix_get_font_scale_factor ##### -->
<para>
diff --git a/docs/tmpl/main.sgml b/docs/tmpl/main.sgml
index 204c5de4..dbd69100 100644
--- a/docs/tmpl/main.sgml
+++ b/docs/tmpl/main.sgml
@@ -51,11 +51,20 @@ fields:
@font: the font for this segment.
@level: the bidirectional level for this segment.
@gravity: the glyph orientation for this segment.
-@centered_baseline: whether this segment should be shifted to center around
-the baseline.
+@flags: boolean flags for this segment (currently only one) (Since: 1.16).
@language: the detected language for this segment.
@extra_attrs: extra attributes for this segment.
+<!-- ##### MACRO PANGO_ANALYSIS_FLAG_CENTERED_BASELINE ##### -->
+<para>
+Whether the segment should be shifted to center around the baseline.
+Used in vertical writing directions mostly.
+
+Since: 1.16
+</para>
+
+
+
<!-- ##### ENUM PangoDirection ##### -->
<para>
</para>
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;