summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c132
1 files changed, 3 insertions, 129 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index d0cf62ea..4444bfd0 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -91,35 +91,9 @@
#include "pango-font-private.h"
-typedef struct _ItemProperties ItemProperties;
typedef struct _ParaBreakState ParaBreakState;
typedef struct _LastTabState LastTabState;
-/* Note that letter_spacing and shape are constant across items,
- * since we pass them into itemization.
- *
- * uline and strikethrough can vary across an item, so we collect
- * all the values that we find.
- *
- * See pango_layout_get_item_properties for details.
- */
-struct _ItemProperties
-{
- guint uline_single : 1;
- guint uline_double : 1;
- guint uline_low : 1;
- guint uline_error : 1;
- guint strikethrough : 1;
- guint oline_single : 1;
- guint showing_space : 1;
- gint letter_spacing;
- gboolean shape_set;
- PangoRectangle *shape_ink_rect;
- PangoRectangle *shape_logical_rect;
- double line_height;
- int absolute_line_height;
-};
-
typedef struct _PangoLayoutLinePrivate PangoLayoutLinePrivate;
struct _PangoLayoutLinePrivate
@@ -191,9 +165,6 @@ static void pango_layout_line_leaked (PangoLayoutLine *line);
static PangoLayoutLine * _pango_layout_iter_get_line (PangoLayoutIter *iter);
static PangoLayoutRun * _pango_layout_iter_get_run (PangoLayoutIter *iter);
-static void pango_layout_get_item_properties (PangoItem *item,
- ItemProperties *properties);
-
static void pango_layout_get_empty_extents_and_height_at_index (PangoLayout *layout,
int index,
PangoRectangle *logical_rect,
@@ -4040,7 +4011,7 @@ process_item (PangoLayout *layout,
*/
if (!state->glyphs)
{
- pango_layout_get_item_properties (item, &state->properties);
+ pango_item_get_properties (item, &state->properties);
state->glyphs = shape_run (line, state, item);
state->log_widths_offset = 0;
processing_new_item = TRUE;
@@ -5616,7 +5587,7 @@ pango_layout_run_get_extents_and_height (PangoLayoutRun *run,
if (G_UNLIKELY (!run_ink && !run_logical && !line_logical && !height))
return;
- pango_layout_get_item_properties (run->item, &properties);
+ pango_item_get_properties (run->item, &properties);
has_underline = properties.uline_single || properties.uline_double ||
properties.uline_low || properties.uline_error;
@@ -6094,7 +6065,7 @@ get_item_letter_spacing (PangoItem *item)
{
ItemProperties properties;
- pango_layout_get_item_properties (item, &properties);
+ pango_item_get_properties (item, &properties);
return properties.letter_spacing;
}
@@ -6783,103 +6754,6 @@ pango_layout_line_postprocess (PangoLayoutLine *line,
line->layout->is_ellipsized |= ellipsized;
}
-static void
-pango_layout_get_item_properties (PangoItem *item,
- ItemProperties *properties)
-{
- GSList *tmp_list = item->analysis.extra_attrs;
-
- properties->uline_single = FALSE;
- properties->uline_double = FALSE;
- properties->uline_low = FALSE;
- properties->uline_error = FALSE;
- properties->oline_single = FALSE;
- properties->strikethrough = FALSE;
- properties->showing_space = FALSE;
- properties->letter_spacing = 0;
- properties->shape_set = FALSE;
- properties->shape_ink_rect = NULL;
- properties->shape_logical_rect = NULL;
- properties->line_height = 0.0;
- properties->absolute_line_height = 0;
-
- while (tmp_list)
- {
- PangoAttribute *attr = tmp_list->data;
-
- switch ((int) attr->klass->type)
- {
- case PANGO_ATTR_UNDERLINE:
- switch (((PangoAttrInt *)attr)->value)
- {
- case PANGO_UNDERLINE_NONE:
- break;
- case PANGO_UNDERLINE_SINGLE:
- case PANGO_UNDERLINE_SINGLE_LINE:
- properties->uline_single = TRUE;
- break;
- case PANGO_UNDERLINE_DOUBLE:
- case PANGO_UNDERLINE_DOUBLE_LINE:
- properties->uline_double = TRUE;
- break;
- case PANGO_UNDERLINE_LOW:
- properties->uline_low = TRUE;
- break;
- case PANGO_UNDERLINE_ERROR:
- case PANGO_UNDERLINE_ERROR_LINE:
- properties->uline_error = TRUE;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- break;
-
- case PANGO_ATTR_OVERLINE:
- switch (((PangoAttrInt *)attr)->value)
- {
- case PANGO_OVERLINE_SINGLE:
- properties->oline_single = TRUE;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- break;
-
- case PANGO_ATTR_STRIKETHROUGH:
- properties->strikethrough = ((PangoAttrInt *)attr)->value;
- break;
-
- case PANGO_ATTR_LETTER_SPACING:
- properties->letter_spacing = ((PangoAttrInt *)attr)->value;
- break;
-
- case PANGO_ATTR_SHAPE:
- properties->shape_set = TRUE;
- properties->shape_logical_rect = &((PangoAttrShape *)attr)->logical_rect;
- properties->shape_ink_rect = &((PangoAttrShape *)attr)->ink_rect;
- break;
-
- case PANGO_ATTR_LINE_HEIGHT:
- properties->line_height = ((PangoAttrFloat *)attr)->value;
- break;
-
- case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
- properties->absolute_line_height = ((PangoAttrInt *)attr)->value;
- break;
-
- case PANGO_ATTR_SHOW:
- properties->showing_space = (((PangoAttrInt *)attr)->value & PANGO_SHOW_SPACES) != 0;
- break;
-
- default:
- break;
- }
- tmp_list = tmp_list->next;
- }
-}
-
static int
next_cluster_start (PangoGlyphString *gs,
int cluster_start)