1/* Pango
2 * pangofc-decoder.h: Custom encoders/decoders on a per-font basis.
3 *
4 * Copyright (C) 2004 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_DECODER_H_
23#define __PANGO_DECODER_H_
24
25#include <pango/pangofc-font.h>
26
27G_BEGIN_DECLS
28
29#ifdef __GI_SCANNER__
30#define PANGO_FC_TYPE_DECODER (pango_fc_decoder_get_type())
31#define PANGO_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FC_TYPE_DECODER, PangoFcDecoder))
32#define PANGO_FC_IS_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FC_TYPE_DECODER))
33#define PANGO_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_FC_TYPE_DECODER, PangoFcDecoderClass))
34#define PANGO_FC_IS_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_FC_TYPE_DECODER))
35#define PANGO_FC_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_FC_TYPE_DECODER, PangoFcDecoderClass))
36#else
37#define PANGO_TYPE_FC_DECODER (pango_fc_decoder_get_type())
38#define PANGO_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_DECODER, PangoFcDecoder))
39#define PANGO_IS_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_DECODER))
40#define PANGO_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
41#define PANGO_IS_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_DECODER))
42#define PANGO_FC_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
43#endif
44
45typedef struct _PangoFcDecoder PangoFcDecoder;
46typedef struct _PangoFcDecoderClass PangoFcDecoderClass;
47
48/**
49 * PangoFcDecoder:
50 *
51 * `PangoFcDecoder` is a virtual base class that implementations will
52 * inherit from.
53 *
54 * It's the interface that is used to define a custom encoding for a font.
55 * These objects are created in your code from a function callback that was
56 * originally registered with [method@PangoFc.FontMap.add_decoder_find_func].
57 * Pango requires information about the supported charset for a font as well
58 * as the individual character to glyph conversions. Pango gets that
59 * information via the #get_charset and #get_glyph callbacks into your
60 * object implementation.
61 *
62 * Since: 1.6
63 **/
64struct _PangoFcDecoder
65{
66 /*< private >*/
67 GObject parent_instance;
68};
69
70/**
71 * PangoFcDecoderClass:
72 * @get_charset: This returns an `FcCharset` given a `PangoFcFont` that
73 * includes a list of supported characters in the font. The
74 * #FcCharSet that is returned should be an internal reference to your
75 * code. Pango will not free this structure. It is important that
76 * you make this callback fast because this callback is called
77 * separately for each character to determine Unicode coverage.
78 * @get_glyph: This returns a single `PangoGlyph` for a given Unicode
79 * code point.
80 *
81 * Class structure for `PangoFcDecoder`.
82 *
83 * Since: 1.6
84 **/
85struct _PangoFcDecoderClass
86{
87 /*< private >*/
88 GObjectClass parent_class;
89
90 /* vtable - not signals */
91 /*< public >*/
92 FcCharSet *(*get_charset) (PangoFcDecoder *decoder,
93 PangoFcFont *fcfont);
94 PangoGlyph (*get_glyph) (PangoFcDecoder *decoder,
95 PangoFcFont *fcfont,
96 guint32 wc);
97
98 /*< private >*/
99
100 /* Padding for future expansion */
101 void (*_pango_reserved1) (void);
102 void (*_pango_reserved2) (void);
103 void (*_pango_reserved3) (void);
104 void (*_pango_reserved4) (void);
105};
106
107PANGO_AVAILABLE_IN_1_6
108GType pango_fc_decoder_get_type (void) G_GNUC_CONST;
109
110PANGO_AVAILABLE_IN_1_6
111FcCharSet *pango_fc_decoder_get_charset (PangoFcDecoder *decoder,
112 PangoFcFont *fcfont);
113
114PANGO_AVAILABLE_IN_1_6
115PangoGlyph pango_fc_decoder_get_glyph (PangoFcDecoder *decoder,
116 PangoFcFont *fcfont,
117 guint32 wc);
118
119G_END_DECLS
120
121#endif /* __PANGO_DECODER_H_ */
122
123

source code of gtk/subprojects/pango/pango/pangofc-decoder.h