Upload tizen 2.0 beta source
[external/pango1.0.git] / pango / pango-glyph-item.h
1 /* Pango
2  * pango-glyph-item.h: Pair of PangoItem and a glyph string
3  *
4  * Copyright (C) 2002 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_GLYPH_ITEM_H__
23 #define __PANGO_GLYPH_ITEM_H__
24
25 #include <pango/pango-attributes.h>
26 #include <pango/pango-break.h>
27 #include <pango/pango-item.h>
28 #include <pango/pango-glyph.h>
29
30 G_BEGIN_DECLS
31
32 typedef struct _PangoGlyphItem PangoGlyphItem;
33
34 struct _PangoGlyphItem
35 {
36   PangoItem        *item;
37   PangoGlyphString *glyphs;
38 };
39
40 #define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type ())
41
42 GType pango_glyph_item_get_type (void) G_GNUC_CONST;
43
44 PangoGlyphItem *pango_glyph_item_split        (PangoGlyphItem *orig,
45                                                const char     *text,
46                                                int             split_index);
47 PangoGlyphItem *pango_glyph_item_copy         (PangoGlyphItem *orig);
48 void            pango_glyph_item_free         (PangoGlyphItem *glyph_item);
49 GSList *        pango_glyph_item_apply_attrs  (PangoGlyphItem *glyph_item,
50                                                const char     *text,
51                                                PangoAttrList  *list);
52 void            pango_glyph_item_letter_space (PangoGlyphItem *glyph_item,
53                                                const char     *text,
54                                                PangoLogAttr   *log_attrs,
55                                                int             letter_spacing);
56 void      pango_glyph_item_get_logical_widths (PangoGlyphItem *glyph_item,
57                                                const char     *text,
58                                                int            *logical_widths);
59
60
61 typedef struct _PangoGlyphItemIter PangoGlyphItemIter;
62
63 struct _PangoGlyphItemIter
64 {
65   PangoGlyphItem *glyph_item;
66   const gchar *text;
67
68   int start_glyph;
69   int start_index;
70   int start_char;
71
72   int end_glyph;
73   int end_index;
74   int end_char;
75 };
76
77 #define PANGO_TYPE_GLYPH_ITEM_ITER (pango_glyph_item_iter_get_type ())
78
79 GType               pango_glyph_item_iter_get_type (void) G_GNUC_CONST;
80 PangoGlyphItemIter *pango_glyph_item_iter_copy (PangoGlyphItemIter *orig);
81 void                pango_glyph_item_iter_free (PangoGlyphItemIter *iter);
82
83 gboolean pango_glyph_item_iter_init_start   (PangoGlyphItemIter *iter,
84                                              PangoGlyphItem     *glyph_item,
85                                              const char         *text);
86 gboolean pango_glyph_item_iter_init_end     (PangoGlyphItemIter *iter,
87                                              PangoGlyphItem     *glyph_item,
88                                              const char         *text);
89 gboolean pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter);
90 gboolean pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter);
91
92 G_END_DECLS
93
94 #endif /* __PANGO_GLYPH_ITEM_H__ */