diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-09-11 16:51:34 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-09-11 16:52:33 -0400 |
commit | ce01a496c7dad90c672e673c0e7ba8c5de350137 (patch) | |
tree | 7dfdcc988f95f1a544123ed9baf54f1552dfcf11 /pango/pango-layout-private.h | |
parent | 33bb108bd8c053de4ce37c6db26dd32ea20f46e2 (diff) | |
download | pango-ce01a496c7dad90c672e673c0e7ba8c5de350137.tar.gz |
Bug 594934 - pango_layout_copy
Use memcpy() to copy value fields so we don't miss any.
Diffstat (limited to 'pango/pango-layout-private.h')
-rw-r--r-- | pango/pango-layout-private.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/pango/pango-layout-private.h b/pango/pango-layout-private.h index 99d0efbc..dc4f3d4c 100644 --- a/pango/pango-layout-private.h +++ b/pango/pango-layout-private.h @@ -30,48 +30,51 @@ struct _PangoLayout { GObject parent_instance; - /* If you add fields to PangoLayout, be sure to update both - * the _copy function + /* If you add fields to PangoLayout be sure to update _copy() + * unless you add a value between copy_begin and copy_end. */ + /* Referenced items */ PangoContext *context; PangoAttrList *attrs; PangoFontDescription *font_desc; + PangoTabArray *tabs; + /* Dupped */ gchar *text; + + /* Value fields. These will be memcpy'd in _copy() */ + int copy_begin; + int length; /* length of text in bytes */ + int n_chars; /* number of characters in layout */ int width; /* wrap/ellipsize width, in device units, or -1 if not set */ int height; /* ellipsize width, in device units if positive, number of lines if negative */ int indent; /* amount by which first line should be shorter */ int spacing; /* spacing between lines */ - int unknown_glyphs_count; /* number of unknown glyphs */ - guint justify : 1; guint alignment : 2; - guint single_paragraph : 1; guint auto_dir : 1; - guint wrap : 2; /* PangoWrapMode */ guint is_wrapped : 1; /* Whether the layout has any wrapped lines */ guint ellipsize : 2; /* PangoEllipsizeMode */ guint is_ellipsized : 1; /* Whether the layout has any ellipsized lines */ + int unknown_glyphs_count; /* number of unknown glyphs */ /* some caching */ guint logical_rect_cached : 1; guint ink_rect_cached : 1; PangoRectangle logical_rect; PangoRectangle ink_rect; - - - gint n_chars; /* Total number of characters in layout */ - PangoLogAttr *log_attrs; /* Logical attributes for layout's text */ - int tab_width; /* Cached width of a tab. -1 == not yet calculated */ - PangoTabArray *tabs; + int copy_end; + + /* Not copied during _copy() */ + PangoLogAttr *log_attrs; /* Logical attributes for layout's text */ GSList *lines; guint line_count; /* Number of lines in @lines. 0 if lines is %NULL */ }; |