1 | /* Pango |
2 | * pango-item.h: Structure for storing run information |
3 | * |
4 | * Copyright (C) 2000 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_ITEM_H__ |
23 | #define __PANGO_ITEM_H__ |
24 | |
25 | #include <pango/pango-types.h> |
26 | |
27 | G_BEGIN_DECLS |
28 | |
29 | typedef struct _PangoAnalysis PangoAnalysis; |
30 | typedef struct _PangoItem PangoItem; |
31 | |
32 | /** |
33 | * PANGO_ANALYSIS_FLAG_CENTERED_BASELINE: |
34 | * |
35 | * Whether the segment should be shifted to center around the baseline. |
36 | * Used in vertical writing directions mostly. |
37 | * |
38 | * Since: 1.16 |
39 | */ |
40 | #define PANGO_ANALYSIS_FLAG_CENTERED_BASELINE (1 << 0) |
41 | |
42 | /** |
43 | * PANGO_ANALYSIS_FLAG_IS_ELLIPSIS: |
44 | * |
45 | * This flag is used to mark runs that hold ellipsized text, |
46 | * in an ellipsized layout. |
47 | * |
48 | * Since: 1.36.7 |
49 | */ |
50 | #define PANGO_ANALYSIS_FLAG_IS_ELLIPSIS (1 << 1) |
51 | |
52 | /** |
53 | * PangoAnalysis: |
54 | * @shape_engine: the engine for doing rendering-system-dependent processing. |
55 | * @lang_engine: the engine for doing rendering-system-independent processing. |
56 | * @font: the font for this segment. |
57 | * @level: the bidirectional level for this segment. |
58 | * @gravity: the glyph orientation for this segment (A #PangoGravity). |
59 | * @flags: boolean flags for this segment (currently only one) (Since: 1.16). |
60 | * @script: the detected script for this segment (A #PangoScript) (Since: 1.18). |
61 | * @language: the detected language for this segment. |
62 | * @extra_attrs: extra attributes for this segment. |
63 | * |
64 | * The #PangoAnalysis structure stores information about |
65 | * the properties of a segment of text. |
66 | */ |
67 | struct _PangoAnalysis |
68 | { |
69 | PangoEngineShape *shape_engine; |
70 | PangoEngineLang *lang_engine; |
71 | PangoFont *font; |
72 | |
73 | guint8 level; |
74 | guint8 gravity; /* PangoGravity */ |
75 | guint8 flags; |
76 | |
77 | guint8 script; /* PangoScript */ |
78 | PangoLanguage *language; |
79 | |
80 | GSList *; |
81 | }; |
82 | |
83 | /** |
84 | * PangoItem: |
85 | * @offset: byte offset of the start of this item in text. |
86 | * @length: length of this item in bytes. |
87 | * @num_chars: number of Unicode characters in the item. |
88 | * @analysis: analysis results for the item. |
89 | * |
90 | * The #PangoItem structure stores information about a segment of text. |
91 | */ |
92 | struct _PangoItem |
93 | { |
94 | gint offset; |
95 | gint length; |
96 | gint num_chars; |
97 | PangoAnalysis analysis; |
98 | }; |
99 | |
100 | #define PANGO_TYPE_ITEM (pango_item_get_type ()) |
101 | |
102 | PANGO_AVAILABLE_IN_ALL |
103 | GType pango_item_get_type (void) G_GNUC_CONST; |
104 | |
105 | PANGO_AVAILABLE_IN_ALL |
106 | PangoItem *pango_item_new (void); |
107 | PANGO_AVAILABLE_IN_ALL |
108 | PangoItem *pango_item_copy (PangoItem *item); |
109 | PANGO_AVAILABLE_IN_ALL |
110 | void pango_item_free (PangoItem *item); |
111 | PANGO_AVAILABLE_IN_ALL |
112 | PangoItem *pango_item_split (PangoItem *orig, |
113 | int split_index, |
114 | int split_offset); |
115 | |
116 | G_END_DECLS |
117 | |
118 | #endif /* __PANGO_ITEM_H__ */ |
119 | |