1 /*
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
5 */
6 module pango.c.item;
7
8 import pango.c.types;
9 import pango.c.font;
10 import pango.c.engine;
11
12 import glib;
13 import gobject;
14
15 extern (C):
16
17 /**
18 * PANGO_ANALYSIS_FLAG_CENTERED_BASELINE:
19 *
20 * Whether the segment should be shifted to center around the baseline.
21 * Used in vertical writing directions mostly.
22 *
23 * Since: 1.16
24 */
25 enum PANGO_ANALYSIS_FLAG_CENTERED_BASELINE = (1 << 0);
26
27 /**
28 * PANGO_ANALYSIS_FLAG_IS_ELLIPSIS:
29 *
30 * This flag is used to mark runs that hold ellipsized text,
31 * in an ellipsized layout.
32 *
33 * Since: 1.36.7
34 */
35 enum PANGO_ANALYSIS_FLAG_IS_ELLIPSIS = (1 << 1);
36
37 /**
38 * PangoAnalysis:
39 * @shape_engine: the engine for doing rendering-system-dependent processing.
40 * @lang_engine: the engine for doing rendering-system-independent processing.
41 * @font: the font for this segment.
42 * @level: the bidirectional level for this segment.
43 * @gravity: the glyph orientation for this segment (A #PangoGravity).
44 * @flags: boolean flags for this segment (currently only one) (Since: 1.16).
45 * @script: the detected script for this segment (A #PangoScript) (Since: 1.18).
46 * @language: the detected language for this segment.
47 * @extra_attrs: extra attributes for this segment.
48 *
49 * The #PangoAnalysis structure stores information about
50 * the properties of a segment of text.
51 */
52 struct PangoAnalysis
53 {
54 PangoEngineShape *shape_engine;
55 PangoEngineLang *lang_engine;
56 PangoFont *font;
57
58 guint8 level;
59 guint8 gravity; /* PangoGravity */
60 guint8 flags;
61
62 guint8 script; /* PangoScript */
63 PangoLanguage *language;
64
65 GSList *extra_attrs;
66 }
67
68 /**
69 * PangoItem:
70 *
71 * The #PangoItem structure stores information about a segment of text.
72 */
73 struct PangoItem
74 {
75 gint offset;
76 gint length;
77 gint num_chars;
78 PangoAnalysis analysis;
79 }
80
81
82 pure GType pango_item_get_type ();
83
84 PangoItem *pango_item_new ();
85 PangoItem *pango_item_copy (PangoItem *item);
86 void pango_item_free (PangoItem *item);
87 PangoItem *pango_item_split (PangoItem *orig,
88 int split_index,
89 int split_offset);
90