summaryrefslogtreecommitdiff
path: root/pango/pango-layout-private.h
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-10-07 18:15:29 +0200
committerMatthias Clasen <mclasen@redhat.com>2017-10-27 16:29:14 -0400
commitfa79c5fc004b8a852074fe63670b55129f81f52e (patch)
tree5ac0bdd1f7854c034d202a40088aadbc6cfb75cb /pango/pango-layout-private.h
parentc53d56212a3491ea3eeb49f7e38391eb95dfe671 (diff)
downloadpango-fa79c5fc004b8a852074fe63670b55129f81f52e.tar.gz
layout: Move PangoLayouIter struct to private header
And add _pango_layout_get_iter as well as _pango_layout_iter_destroy that can be used for internal, stack allocated PangoLayoutIters. https://bugzilla.gnome.org/show_bug.cgi?id=788643
Diffstat (limited to 'pango/pango-layout-private.h')
-rw-r--r--pango/pango-layout-private.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/pango/pango-layout-private.h b/pango/pango-layout-private.h
index d0bf93eb..9a23d9e7 100644
--- a/pango/pango-layout-private.h
+++ b/pango/pango-layout-private.h
@@ -82,10 +82,63 @@ struct _PangoLayout
guint line_count; /* Number of lines in @lines. 0 if lines is %NULL */
};
+struct _PangoLayoutIter
+{
+ PangoLayout *layout;
+ GSList *line_list_link;
+ PangoLayoutLine *line;
+
+ /* If run is NULL, it means we're on a "virtual run"
+ * at the end of the line with 0 width
+ */
+ GSList *run_list_link;
+ PangoLayoutRun *run; /* FIXME nuke this, just keep the link */
+ int index;
+
+ /* list of Extents for each line in layout coordinates */
+ GSList *line_extents;
+ GSList *line_extents_link;
+
+ /* X position of the current run */
+ int run_x;
+
+ /* Width of the current run */
+ int run_width;
+
+ /* this run is left-to-right */
+ gboolean ltr;
+
+ /* X position of the left side of the current cluster */
+ int cluster_x;
+
+ /* The width of the current cluster */
+ int cluster_width;
+
+ /* glyph offset to the current cluster start */
+ int cluster_start;
+
+ /* first glyph in the next cluster */
+ int next_cluster_glyph;
+
+ /* number of Unicode chars in current cluster */
+ int cluster_num_chars;
+
+ /* visual position of current character within the cluster */
+ int character_position;
+
+ /* the real width of layout */
+ int layout_width;
+};
+
gboolean _pango_layout_line_ellipsize (PangoLayoutLine *line,
PangoAttrList *attrs,
int goal_width);
+void _pango_layout_get_iter (PangoLayout *layout,
+ PangoLayoutIter *iter);
+
+void _pango_layout_iter_destroy (PangoLayoutIter *iter);
+
G_END_DECLS
#endif /* __PANGO_LAYOUT_PRIVATE_H__ */