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
29G_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 */
36typedef 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
50PANGO_AVAILABLE_IN_ALL
51GType pango_context_get_type (void) G_GNUC_CONST;
52
53PANGO_AVAILABLE_IN_ALL
54PangoContext *pango_context_new (void);
55PANGO_AVAILABLE_IN_1_32
56void pango_context_changed (PangoContext *context);
57PANGO_AVAILABLE_IN_ALL
58void pango_context_set_font_map (PangoContext *context,
59 PangoFontMap *font_map);
60PANGO_AVAILABLE_IN_1_6
61PangoFontMap *pango_context_get_font_map (PangoContext *context);
62PANGO_AVAILABLE_IN_1_32
63guint pango_context_get_serial (PangoContext *context);
64PANGO_AVAILABLE_IN_ALL
65void pango_context_list_families (PangoContext *context,
66 PangoFontFamily ***families,
67 int *n_families);
68PANGO_AVAILABLE_IN_ALL
69PangoFont * pango_context_load_font (PangoContext *context,
70 const PangoFontDescription *desc);
71PANGO_AVAILABLE_IN_ALL
72PangoFontset *pango_context_load_fontset (PangoContext *context,
73 const PangoFontDescription *desc,
74 PangoLanguage *language);
75
76PANGO_AVAILABLE_IN_ALL
77PangoFontMetrics *pango_context_get_metrics (PangoContext *context,
78 const PangoFontDescription *desc,
79 PangoLanguage *language);
80
81PANGO_AVAILABLE_IN_ALL
82void pango_context_set_font_description (PangoContext *context,
83 const PangoFontDescription *desc);
84PANGO_AVAILABLE_IN_ALL
85PangoFontDescription * pango_context_get_font_description (PangoContext *context);
86PANGO_AVAILABLE_IN_ALL
87PangoLanguage *pango_context_get_language (PangoContext *context);
88PANGO_AVAILABLE_IN_ALL
89void pango_context_set_language (PangoContext *context,
90 PangoLanguage *language);
91PANGO_AVAILABLE_IN_ALL
92void pango_context_set_base_dir (PangoContext *context,
93 PangoDirection direction);
94PANGO_AVAILABLE_IN_ALL
95PangoDirection pango_context_get_base_dir (PangoContext *context);
96PANGO_AVAILABLE_IN_1_16
97void pango_context_set_base_gravity (PangoContext *context,
98 PangoGravity gravity);
99PANGO_AVAILABLE_IN_1_16
100PangoGravity pango_context_get_base_gravity (PangoContext *context);
101PANGO_AVAILABLE_IN_1_16
102PangoGravity pango_context_get_gravity (PangoContext *context);
103PANGO_AVAILABLE_IN_1_16
104void pango_context_set_gravity_hint (PangoContext *context,
105 PangoGravityHint hint);
106PANGO_AVAILABLE_IN_1_16
107PangoGravityHint pango_context_get_gravity_hint (PangoContext *context);
108
109PANGO_AVAILABLE_IN_1_6
110void pango_context_set_matrix (PangoContext *context,
111 const PangoMatrix *matrix);
112PANGO_AVAILABLE_IN_1_6
113const PangoMatrix * pango_context_get_matrix (PangoContext *context);
114
115/* Break a string of Unicode characters into segments with
116 * consistent shaping/language engine and bidrectional level.
117 * Returns a #GList of #PangoItem's
118 */
119PANGO_AVAILABLE_IN_ALL
120GList *pango_itemize (PangoContext *context,
121 const char *text,
122 int start_index,
123 int length,
124 PangoAttrList *attrs,
125 PangoAttrIterator *cached_iter);
126PANGO_AVAILABLE_IN_1_4
127GList *pango_itemize_with_base_dir (PangoContext *context,
128 PangoDirection base_dir,
129 const char *text,
130 int start_index,
131 int length,
132 PangoAttrList *attrs,
133 PangoAttrIterator *cached_iter);
134
135G_END_DECLS
136
137#endif /* __PANGO_CONTEXT_H__ */
138