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#include <pango/pango-direction.h>
29
30G_BEGIN_DECLS
31
32/* Sort of like a GC - application set information about how
33 * to handle scripts
34 */
35
36/* PangoContext typedefed in pango-fontmap.h */
37typedef struct _PangoContextClass PangoContextClass;
38
39#define PANGO_TYPE_CONTEXT (pango_context_get_type ())
40#define PANGO_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CONTEXT, PangoContext))
41#define PANGO_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CONTEXT, PangoContextClass))
42#define PANGO_IS_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CONTEXT))
43#define PANGO_IS_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CONTEXT))
44#define PANGO_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CONTEXT, PangoContextClass))
45
46
47/* The PangoContext and PangoContextClass structs are private; if you
48 * need to create a subclass of these, file a bug.
49 */
50
51PANGO_AVAILABLE_IN_ALL
52GType pango_context_get_type (void) G_GNUC_CONST;
53
54PANGO_AVAILABLE_IN_ALL
55PangoContext *pango_context_new (void);
56PANGO_AVAILABLE_IN_1_32
57void pango_context_changed (PangoContext *context);
58PANGO_AVAILABLE_IN_ALL
59void pango_context_set_font_map (PangoContext *context,
60 PangoFontMap *font_map);
61PANGO_AVAILABLE_IN_1_6
62PangoFontMap *pango_context_get_font_map (PangoContext *context);
63PANGO_AVAILABLE_IN_1_32
64guint pango_context_get_serial (PangoContext *context);
65PANGO_AVAILABLE_IN_ALL
66void pango_context_list_families (PangoContext *context,
67 PangoFontFamily ***families,
68 int *n_families);
69PANGO_AVAILABLE_IN_ALL
70PangoFont * pango_context_load_font (PangoContext *context,
71 const PangoFontDescription *desc);
72PANGO_AVAILABLE_IN_ALL
73PangoFontset *pango_context_load_fontset (PangoContext *context,
74 const PangoFontDescription *desc,
75 PangoLanguage *language);
76
77PANGO_AVAILABLE_IN_ALL
78PangoFontMetrics *pango_context_get_metrics (PangoContext *context,
79 const PangoFontDescription *desc,
80 PangoLanguage *language);
81
82PANGO_AVAILABLE_IN_ALL
83void pango_context_set_font_description (PangoContext *context,
84 const PangoFontDescription *desc);
85PANGO_AVAILABLE_IN_ALL
86PangoFontDescription * pango_context_get_font_description (PangoContext *context);
87PANGO_AVAILABLE_IN_ALL
88PangoLanguage *pango_context_get_language (PangoContext *context);
89PANGO_AVAILABLE_IN_ALL
90void pango_context_set_language (PangoContext *context,
91 PangoLanguage *language);
92PANGO_AVAILABLE_IN_ALL
93void pango_context_set_base_dir (PangoContext *context,
94 PangoDirection direction);
95PANGO_AVAILABLE_IN_ALL
96PangoDirection pango_context_get_base_dir (PangoContext *context);
97PANGO_AVAILABLE_IN_1_16
98void pango_context_set_base_gravity (PangoContext *context,
99 PangoGravity gravity);
100PANGO_AVAILABLE_IN_1_16
101PangoGravity pango_context_get_base_gravity (PangoContext *context);
102PANGO_AVAILABLE_IN_1_16
103PangoGravity pango_context_get_gravity (PangoContext *context);
104PANGO_AVAILABLE_IN_1_16
105void pango_context_set_gravity_hint (PangoContext *context,
106 PangoGravityHint hint);
107PANGO_AVAILABLE_IN_1_16
108PangoGravityHint pango_context_get_gravity_hint (PangoContext *context);
109
110PANGO_AVAILABLE_IN_1_6
111void pango_context_set_matrix (PangoContext *context,
112 const PangoMatrix *matrix);
113PANGO_AVAILABLE_IN_1_6
114const PangoMatrix * pango_context_get_matrix (PangoContext *context);
115
116/* Break a string of Unicode characters into segments with
117 * consistent shaping/language engine and bidrectional level.
118 * Returns a #GList of #PangoItem's
119 */
120PANGO_AVAILABLE_IN_ALL
121GList *pango_itemize (PangoContext *context,
122 const char *text,
123 int start_index,
124 int length,
125 PangoAttrList *attrs,
126 PangoAttrIterator *cached_iter);
127PANGO_AVAILABLE_IN_1_4
128GList *pango_itemize_with_base_dir (PangoContext *context,
129 PangoDirection base_dir,
130 const char *text,
131 int start_index,
132 int length,
133 PangoAttrList *attrs,
134 PangoAttrIterator *cached_iter);
135
136G_END_DECLS
137
138#endif /* __PANGO_CONTEXT_H__ */
139