1/* Pango
2 * pango-font.h: Font handling
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_FONTMAP_H__
23#define __PANGO_FONTMAP_H__
24
25#include <pango/pango-font.h>
26#include <pango/pango-fontset.h>
27
28G_BEGIN_DECLS
29
30/**
31 * PANGO_TYPE_FONT_MAP:
32 *
33 * The #GObject type for #PangoFontMap.
34 */
35/**
36 * PANGO_FONT_MAP:
37 * @object: a #GObject.
38 *
39 * Casts a #GObject to a #PangoFontMap.
40 */
41/**
42 * PANGO_IS_FONT_MAP:
43 * @object: a #GObject.
44 *
45 * Returns: %TRUE if @object is a #PangoFontMap.
46 */
47#define PANGO_TYPE_FONT_MAP (pango_font_map_get_type ())
48#define PANGO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_MAP, PangoFontMap))
49#define PANGO_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_MAP))
50
51typedef struct _PangoContext PangoContext;
52
53GType pango_font_map_get_type (void) G_GNUC_CONST;
54PangoContext * pango_font_map_create_context (PangoFontMap *fontmap);
55PangoFont * pango_font_map_load_font (PangoFontMap *fontmap,
56 PangoContext *context,
57 const PangoFontDescription *desc);
58PangoFontset *pango_font_map_load_fontset (PangoFontMap *fontmap,
59 PangoContext *context,
60 const PangoFontDescription *desc,
61 PangoLanguage *language);
62void pango_font_map_list_families (PangoFontMap *fontmap,
63 PangoFontFamily ***families,
64 int *n_families);
65guint pango_font_map_get_serial (PangoFontMap *fontmap);
66void pango_font_map_changed (PangoFontMap *fontmap);
67
68#ifdef PANGO_ENABLE_BACKEND
69
70/**
71 * PANGO_FONT_MAP_CLASS:
72 * @klass: a #GObject.
73 *
74 * Casts a #GObject to a #PangoFontMapClass.
75 */
76/**
77 * PANGO_IS_FONT_MAP_CLASS:
78 * @klass: a #GObject.
79 *
80 * Returns: %TRUE if @klass is a subtype of #PangoFontMapClass.
81 */
82/**
83 * PANGO_FONT_MAP_GET_CLASS:
84 * @obj: a #PangoFontMap.
85 *
86 * Returns: class of @obj
87 */
88#define PANGO_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
89#define PANGO_IS_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_MAP))
90#define PANGO_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
91
92typedef struct _PangoFontMapClass PangoFontMapClass;
93
94/**
95 * PangoFontMap:
96 *
97 * The #PangoFontMap represents the set of fonts available for a
98 * particular rendering system. This is a virtual object with
99 * implementations being specific to particular rendering systems. To
100 * create an implementation of a #PangoFontMap, the rendering-system
101 * specific code should allocate a larger structure that contains a nested
102 * #PangoFontMap, fill in the <structfield>klass</structfield> member of the nested #PangoFontMap with a
103 * pointer to a appropriate #PangoFontMapClass, then call
104 * pango_font_map_init() on the structure.
105 *
106 * The #PangoFontMap structure contains one member which the implementation
107 * fills in.
108 */
109struct _PangoFontMap
110{
111 GObject parent_instance;
112};
113
114/**
115 * PangoFontMapClass:
116 * @parent_class: parent #GObjectClass.
117 * @load_font: a function to load a font with a given description. See
118 * pango_font_map_load_font().
119 * @list_families: A function to list available font families. See
120 * pango_font_map_list_families().
121 * @load_fontset: a function to load a fontset with a given given description
122 * suitable for a particular language. See pango_font_map_load_fontset().
123 * @shape_engine_type: the type of rendering-system-dependent engines that
124 * can handle fonts of this fonts loaded with this fontmap.
125 * @get_serial: a function to get the serial number of the fontmap.
126 * See pango_font_map_get_serial().
127 * @changed: See pango_font_map_changed()
128 *
129 * The #PangoFontMapClass structure holds the virtual functions for
130 * a particular #PangoFontMap implementation.
131 */
132struct _PangoFontMapClass
133{
134 GObjectClass parent_class;
135
136 /*< public >*/
137
138 PangoFont * (*load_font) (PangoFontMap *fontmap,
139 PangoContext *context,
140 const PangoFontDescription *desc);
141 void (*list_families) (PangoFontMap *fontmap,
142 PangoFontFamily ***families,
143 int *n_families);
144 PangoFontset *(*load_fontset) (PangoFontMap *fontmap,
145 PangoContext *context,
146 const PangoFontDescription *desc,
147 PangoLanguage *language);
148
149 const char *shape_engine_type;
150
151 guint (*get_serial) (PangoFontMap *fontmap);
152 void (*changed) (PangoFontMap *fontmap);
153
154 /*< private >*/
155
156 /* Padding for future expansion */
157 void (*_pango_reserved1) (void);
158 void (*_pango_reserved2) (void);
159};
160
161const char *pango_font_map_get_shape_engine_type (PangoFontMap *fontmap);
162
163#endif /* PANGO_ENABLE_BACKEND */
164
165G_END_DECLS
166
167#endif /* __PANGO_FONTMAP_H__ */
168