Git init
[external/pango1.0.git] / pango / pango-layout-private.h
1 /* Pango
2  * pango-layout-private.h: Internal structures of PangoLayout
3  *
4  * Copyright (C) 2004 Red Hat Software
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __PANGO_LAYOUT_PRIVATE_H__
23 #define __PANGO_LAYOUT_PRIVATE_H__
24
25 #include <pango/pango-layout.h>
26
27 G_BEGIN_DECLS
28
29 struct _PangoLayout
30 {
31   GObject parent_instance;
32
33   /* If you add fields to PangoLayout be sure to update _copy()
34    * unless you add a value between copy_begin and copy_end.
35    */
36
37   /* Referenced items */
38   PangoContext *context;
39   PangoAttrList *attrs;
40   PangoFontDescription *font_desc;
41   PangoTabArray *tabs;
42
43   /* Dupped */
44   gchar *text;
45
46   /* Value fields.  These will be memcpy'd in _copy() */
47   int copy_begin;
48
49   int length;                   /* length of text in bytes */
50   int n_chars;                  /* number of characters in layout */
51   int width;                    /* wrap/ellipsize width, in device units, or -1 if not set */
52   int height;                   /* ellipsize width, in device units if positive, number of lines if negative */
53   int indent;                   /* amount by which first line should be shorter */
54   int spacing;                  /* spacing between lines */
55
56   guint justify : 1;
57   guint alignment : 2;
58   guint single_paragraph : 1;
59   guint auto_dir : 1;
60   guint wrap : 2;               /* PangoWrapMode */
61   guint is_wrapped : 1;         /* Whether the layout has any wrapped lines */
62   guint ellipsize : 2;          /* PangoEllipsizeMode */
63   guint is_ellipsized : 1;      /* Whether the layout has any ellipsized lines */
64   int unknown_glyphs_count;     /* number of unknown glyphs */
65
66   /* some caching */
67   guint logical_rect_cached : 1;
68   guint ink_rect_cached : 1;
69   PangoRectangle logical_rect;
70   PangoRectangle ink_rect;
71   int tab_width;                /* Cached width of a tab. -1 == not yet calculated */
72
73   int copy_end;
74
75   /* Not copied during _copy() */
76
77   PangoLogAttr *log_attrs;      /* Logical attributes for layout's text */
78   GSList *lines;
79   guint line_count;             /* Number of lines in @lines. 0 if lines is %NULL */
80 };
81
82 gboolean _pango_layout_line_ellipsize (PangoLayoutLine *line,
83                                        PangoAttrList   *attrs,
84                                        int              goal_width);
85
86 G_END_DECLS
87
88 #endif /* __PANGO_LAYOUT_PRIVATE_H__ */