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