diff options
author | Christopher Blizzard <blizzard@redhat.com> | 2004-06-09 22:03:18 +0000 |
---|---|---|
committer | Christopher Blizzard <blizzard@src.gnome.org> | 2004-06-09 22:03:18 +0000 |
commit | 5ca931f88a431fa7158a8e406d3bf92a1bdafd07 (patch) | |
tree | ef7933a8755cd870fa96267cab67ce9d0f4d280f /pango/pangofc-decoder.h | |
parent | d2f58271eab023e452d84a8dd855ad06151d0eb6 (diff) | |
download | pango-5ca931f88a431fa7158a8e406d3bf92a1bdafd07.tar.gz |
Add export of pangofc-decoder.h. Build pangofc-decoder.c.
Wed Jun 9 17:32:59 2004 Christopher Blizzard <blizzard@redhat.com>
* pango/Makefile.am: Add export of pangofc-decoder.h. Build
pangofc-decoder.c.
* pango/pangofc-decoder.h pango/pangofc-decoder.c: New files.
Virtual base class for any custom font decoders.
* pango/pangofc-font.c: Add new PangoFcFontPrivate structure.
* pango/pangofc-font.c (pango_fc_font_class_init): Attach new
private structure using g_type_class_add_private().
* pango/pangofc-font.c (pango_fc_font_finalize): Make sure to
unset any decoders that are attached to the font.
* pango/pangofc-font.c (pango_fc_font_get_coverage): When
determining coverage, use a custom decoder if available.
* pango/pangofc-font.c (pango_fc_font_has_char): When determining
if a font has a character, use a custom decoder if available.
* pango/pangofc-font.c (pango_fc_font_get_glyph): When doing
single character to glyph convertions, use a custom decoder if
available.
* pango/pangofc-font.c (_pango_fc_font_get_decoder): New
function. Get the custom decoder for the given font.
* pango/pangofc-font.c (_pango_fc_font_set_decoder): New
function. Set a custom decoder for the given font.
* pango/pangofc-fontmap.c: Add structure PangoFcFindFuncInfo to
keep track of callbacks to create custom decoders. Modify
PangoFcFontMapPrivate by adding a list of PangoFcFontFuncInfo
callbacks that have been registered.
* pango/pangofc-fontmap.c (pango_fc_font_map_add_find_func): New
function. Add callbacks to the fontmap that will create custom
decoders when pango creates new fonts.
* pango/pangofc-fontmap.c (pango_fc_font_map_finalize): Clear out
any findfuncs that have been registered and notify them about
destruction.
* pango/pangofc-fontmap.c (pango_fc_font_map_new_font): When
creating new fonts, call back to any registered find functions so
they can create custom decoders for those fonts. Attach those
custom decoders to the newly created fonts.
* pango/pangofc-fontmap.c (_pango_fc_font_map_get_coverage):
Change the argument to take a PangoFcFont instead of an FcPattern.
Call _pango_fc_font_map_fc_to_coverage instead of doing the
conversion inline.
* pango/pangofc-fontmap.c (_pango_fc_font_map_fc_to_coverage): New
function. Convert an FcCharSet to a PangoCoverage object.
* pango/pangofc-fontmap.h: New declarations for
pango_fc_font_map_add_decoder_find_func and
PangoFcDecoderFindFunc.
* pango/pangofc-private.h: New declarations for
_pango_fc_font_map_fc_to_coverage, _pango_fc_font_get_decoder and
_pango_fc_font_set_decoder.
Diffstat (limited to 'pango/pangofc-decoder.h')
-rw-r--r-- | pango/pangofc-decoder.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/pango/pangofc-decoder.h b/pango/pangofc-decoder.h new file mode 100644 index 00000000..34b5f180 --- /dev/null +++ b/pango/pangofc-decoder.h @@ -0,0 +1,112 @@ +/* Pango + * pangofc-decoder.h: Custom encoders/decoders on a per-font basis. + * + * Copyright (C) 2004 Red Hat Software + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_DECODER_H_ +#define __PANGO_DECODER_H_ + +#include <pango/pangofc-font.h> + +G_BEGIN_DECLS + +#define PANGO_TYPE_FC_DECODER (pango_fc_decoder_get_type()) +#define PANGO_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_DECODER, PangoFcDecoder)) +#define PANGO_IS_FC_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_DECODER)) + +typedef struct _PangoFcDecoder PangoFcDecoder; +typedef struct _PangoFcDecoderClass PangoFcDecoderClass; + +#define PANGO_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass)) +#define PANGO_IS_FC_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_DECODER)) +#define PANGO_FC_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_DECODER, PangoFcDecoderClass)) + +/** + * PangoFcDecoder: + * + * #PangoFcDecoder is a virtual base class that implementations will + * inherit from. It's the interface that is used to define a custom + * encoding for a font. These objects are created in your code from a + * function callback that was originally registered with + * pango_fc_font_map_add_decoder_find_func(). Pango requires + * information about the supported charset for a font as well as the + * indivdual character to glyph conversions. Pango gets that + * information via the #get_charset and #get_glyph callbacks into your + * object implementation. + * + * Since: 1.6 + * + **/ + +struct _PangoFcDecoder +{ + GObject parent_instance; +}; + +/** + * PangoFcDecoderClass: + * + * @get_charset: This returns an #FcCharset given a #PangoFcFont that + * includes a list of supported characters in the font. The + * #FcCharSet that is returned should be an internal reference to your + * code. Pango will not free this structure. It is also important + * that you make this callback very fast because this callback is also + * used to determine unicode coverage on a per-character basis. + * @get_glyph: This returns a single #PangoGlyph for a given unicode + * code point. + * + * Class structure for #PangoFcDecoder. + * + * Since: 1.6 + * + **/ + +struct _PangoFcDecoderClass +{ + /*< private >*/ + GObjectClass parent_class; + + /* vtable - not signals */ + /*< public >*/ + FcCharSet *(*get_charset) (PangoFcFont *fcfont); + PangoGlyph (*get_glyph) (PangoFcFont *fcfont, + guint32 wc); + + /*< private >*/ + + /* Padding for future expansion */ + void (*_pango_reserved1) (void); + void (*_pango_reserved2) (void); + void (*_pango_reserved3) (void); + void (*_pango_reserved4) (void); +}; + +GType pango_fc_decoder_get_type (void); + +FcCharSet *pango_fc_decoder_get_charset (PangoFcDecoder *decoder, + PangoFcFont *fcfont); + +PangoGlyph pango_fc_decoder_get_glyph (PangoFcDecoder *decoder, + PangoFcFont *fcfont, + guint32 wc); + +G_END_DECLS + +#endif /* __PANGO_DECODER_H_ */ + |