Git init
[external/pango1.0.git] / pango / pango-context.h
1 /* Pango
2  * pango-context.h: Rendering contexts
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_CONTEXT_H__
23 #define __PANGO_CONTEXT_H__
24
25 #include <pango/pango-font.h>
26 #include <pango/pango-fontmap.h>
27 #include <pango/pango-attributes.h>
28
29 G_BEGIN_DECLS
30
31 /* Sort of like a GC - application set information about how
32  * to handle scripts
33  */
34
35 /* PangoContext typedefed in pango-fontmap.h */
36 typedef struct _PangoContextClass PangoContextClass;
37
38 #define PANGO_TYPE_CONTEXT              (pango_context_get_type ())
39 #define PANGO_CONTEXT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CONTEXT, PangoContext))
40 #define PANGO_CONTEXT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CONTEXT, PangoContextClass))
41 #define PANGO_IS_CONTEXT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CONTEXT))
42 #define PANGO_IS_CONTEXT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CONTEXT))
43 #define PANGO_CONTEXT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CONTEXT, PangoContextClass))
44
45
46 /* The PangoContext and PangoContextClass structs are private; if you
47  * need to create a subclass of these, file a bug.
48  */
49
50 GType         pango_context_get_type      (void) G_GNUC_CONST;
51
52 PangoContext *pango_context_new           (void);
53 void          pango_context_set_font_map  (PangoContext                 *context,
54                                            PangoFontMap                 *font_map);
55 PangoFontMap *pango_context_get_font_map  (PangoContext                 *context);
56
57 void          pango_context_list_families (PangoContext                 *context,
58                                            PangoFontFamily            ***families,
59                                            int                          *n_families);
60 PangoFont *   pango_context_load_font     (PangoContext                 *context,
61                                            const PangoFontDescription   *desc);
62 PangoFontset *pango_context_load_fontset  (PangoContext                 *context,
63                                            const PangoFontDescription   *desc,
64                                            PangoLanguage                *language);
65
66 PangoFontMetrics *pango_context_get_metrics   (PangoContext                 *context,
67                                                const PangoFontDescription   *desc,
68                                                PangoLanguage                *language);
69
70 void                      pango_context_set_font_description (PangoContext               *context,
71                                                               const PangoFontDescription *desc);
72 PangoFontDescription *    pango_context_get_font_description (PangoContext               *context);
73 PangoLanguage            *pango_context_get_language         (PangoContext               *context);
74 void                      pango_context_set_language         (PangoContext               *context,
75                                                               PangoLanguage              *language);
76 void                      pango_context_set_base_dir         (PangoContext               *context,
77                                                               PangoDirection              direction);
78 PangoDirection            pango_context_get_base_dir         (PangoContext               *context);
79 void                      pango_context_set_base_gravity     (PangoContext               *context,
80                                                               PangoGravity                gravity);
81 PangoGravity              pango_context_get_base_gravity     (PangoContext               *context);
82 PangoGravity              pango_context_get_gravity          (PangoContext               *context);
83 void                      pango_context_set_gravity_hint     (PangoContext               *context,
84                                                               PangoGravityHint            hint);
85 PangoGravityHint          pango_context_get_gravity_hint     (PangoContext               *context);
86
87 void                        pango_context_set_matrix (PangoContext      *context,
88                                                       const PangoMatrix *matrix);
89 G_CONST_RETURN PangoMatrix *pango_context_get_matrix (PangoContext      *context);
90
91 /* Break a string of Unicode characters into segments with
92  * consistent shaping/language engine and bidrectional level.
93  * Returns a #GList of #PangoItem's
94  */
95 GList *pango_itemize                (PangoContext      *context,
96                                      const char        *text,
97                                      int                start_index,
98                                      int                length,
99                                      PangoAttrList     *attrs,
100                                      PangoAttrIterator *cached_iter);
101 GList *pango_itemize_with_base_dir  (PangoContext      *context,
102                                      PangoDirection     base_dir,
103                                      const char        *text,
104                                      int                start_index,
105                                      int                length,
106                                      PangoAttrList     *attrs,
107                                      PangoAttrIterator *cached_iter);
108
109 G_END_DECLS
110
111 #endif /* __PANGO_CONTEXT_H__ */