2 * pangofc-decoder.h: Custom encoders/decoders on a per-font basis.
4 * Copyright (C) 2004 Red Hat Software
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.
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.
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.
22 #ifndef __PANGO_DECODER_H_
23 #define __PANGO_DECODER_H_
25 #include <pango/pangofc-font.h>
29 #define PANGO_TYPE_FC_DECODER (pango_fc_decoder_get_type())
30 #define PANGO_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_DECODER, PangoFcDecoder))
31 #define PANGO_IS_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_DECODER))
33 typedef struct _PangoFcDecoder PangoFcDecoder;
34 typedef struct _PangoFcDecoderClass PangoFcDecoderClass;
36 #define PANGO_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
37 #define PANGO_IS_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_DECODER))
38 #define PANGO_FC_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass))
43 * #PangoFcDecoder is a virtual base class that implementations will
44 * inherit from. It's the interface that is used to define a custom
45 * encoding for a font. These objects are created in your code from a
46 * function callback that was originally registered with
47 * pango_fc_font_map_add_decoder_find_func(). Pango requires
48 * information about the supported charset for a font as well as the
49 * individual character to glyph conversions. Pango gets that
50 * information via the #get_charset and #get_glyph callbacks into your
51 * object implementation.
55 struct _PangoFcDecoder
58 GObject parent_instance;
62 * PangoFcDecoderClass:
63 * @get_charset: This returns an #FcCharset given a #PangoFcFont that
64 * includes a list of supported characters in the font. The
65 * #FcCharSet that is returned should be an internal reference to your
66 * code. Pango will not free this structure. It is important that
67 * you make this callback fast because this callback is called
68 * separately for each character to determine Unicode coverage.
69 * @get_glyph: This returns a single #PangoGlyph for a given Unicode
72 * Class structure for #PangoFcDecoder.
76 struct _PangoFcDecoderClass
79 GObjectClass parent_class;
81 /* vtable - not signals */
83 FcCharSet *(*get_charset) (PangoFcDecoder *decoder,
85 PangoGlyph (*get_glyph) (PangoFcDecoder *decoder,
91 /* Padding for future expansion */
92 void (*_pango_reserved1) (void);
93 void (*_pango_reserved2) (void);
94 void (*_pango_reserved3) (void);
95 void (*_pango_reserved4) (void);
98 GType pango_fc_decoder_get_type (void) G_GNUC_CONST;
100 FcCharSet *pango_fc_decoder_get_charset (PangoFcDecoder *decoder,
101 PangoFcFont *fcfont);
103 PangoGlyph pango_fc_decoder_get_glyph (PangoFcDecoder *decoder,
109 #endif /* __PANGO_DECODER_H_ */