summaryrefslogtreecommitdiff
path: root/pango/pangofc-decoder.c
diff options
context:
space:
mode:
authorChristopher Blizzard <blizzard@redhat.com>2004-06-09 22:03:18 +0000
committerChristopher Blizzard <blizzard@src.gnome.org>2004-06-09 22:03:18 +0000
commit5ca931f88a431fa7158a8e406d3bf92a1bdafd07 (patch)
treeef7933a8755cd870fa96267cab67ce9d0f4d280f /pango/pangofc-decoder.c
parentd2f58271eab023e452d84a8dd855ad06151d0eb6 (diff)
downloadpango-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.c')
-rw-r--r--pango/pangofc-decoder.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/pango/pangofc-decoder.c b/pango/pangofc-decoder.c
new file mode 100644
index 00000000..41e8c141
--- /dev/null
+++ b/pango/pangofc-decoder.c
@@ -0,0 +1,88 @@
+/* Pango
+ * pangofc-decoder.c: Custom font encoder/decoders
+ *
+ * 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.
+ */
+
+#include "pangofc-decoder.h"
+
+G_DEFINE_ABSTRACT_TYPE (PangoFcDecoder, pango_fc_decoder, G_TYPE_OBJECT)
+
+static void
+pango_fc_decoder_init (PangoFcDecoder *decoder);
+
+static void
+pango_fc_decoder_class_init (PangoFcDecoderClass *klass);
+
+void
+pango_fc_decoder_init (PangoFcDecoder *decoder)
+{
+}
+
+void
+pango_fc_decoder_class_init (PangoFcDecoderClass *klass)
+{
+}
+
+/**
+ * pango_fc_decoder_get_charset:
+ * @decoder: A #PangoFcDecoder to use when querying the font for a
+ * supported #FcCharSet.
+ * @fcfont: The #PangoFcFont to query.
+ *
+ * Generates an #FcCharSet of supported characters for the fcfont
+ * given. The returned #FcCharSet should be a reference to an
+ * internal value stored by the #PangoFcDecoder and will not be freed
+ * by Pango.
+ *
+ * Since: 1.6
+ *
+ */
+
+FcCharSet *
+pango_fc_decoder_get_charset (PangoFcDecoder *decoder,
+ PangoFcFont *fcfont)
+{
+ g_return_val_if_fail (PANGO_IS_FC_DECODER (decoder), NULL);
+
+ return PANGO_FC_DECODER_GET_CLASS (decoder)->get_charset (fcfont);
+}
+
+/**
+ * pango_fc_decoder_get_glyph:
+ * @decoder: A #PangoFcDecoder to use when querying the font.
+ * @fcfont: The #PangoFcFont to query.
+ * @wc: The unicode code point that you would like to see converted to
+ * a single #PangoGlyph.
+ *
+ * Generates a #PangoGlyph for the given unicode point with the custom
+ * decoder.
+ *
+ * Since: 1.6
+ *
+ */
+
+PangoGlyph
+pango_fc_decoder_get_glyph (PangoFcDecoder *decoder,
+ PangoFcFont *fcfont,
+ guint32 wc)
+{
+ g_return_val_if_fail (PANGO_IS_FC_DECODER (decoder), 0);
+
+ return PANGO_FC_DECODER_GET_CLASS (decoder)->get_glyph (fcfont, wc);
+}