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