summaryrefslogtreecommitdiff
path: root/pango/pangocoretext.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2014-07-28 18:37:36 -0400
committerBehdad Esfahbod <behdad@behdad.org>2015-04-04 16:13:40 -0700
commit7d30b3f91958a3ff45ee2b8e5de2b6186cadfb72 (patch)
treec598289612344faffb3b0225707f1c2ed2282de8 /pango/pangocoretext.c
parent14c11dd96e1547aaede1bb05a0243f5b0b53186e (diff)
downloadpango-7d30b3f91958a3ff45ee2b8e5de2b6186cadfb72.tar.gz
Deprecate module system, skip it for shaper modules
Now shaper is discovered via (previously unused!) font->find_shaper(). I'm keeping that just to allow clients override shaping. Though, even that I'm not sure we want to keep. Wraps shaper in PangoEngineShape structs to keep PangoAnalysis API intact. Deprecated pango-modules.h and some pango-engine.h. Language modules are not moved yet. Wired up PangoFc, PangoWin32, and PangoCoretext shapers.
Diffstat (limited to 'pango/pangocoretext.c')
-rw-r--r--pango/pangocoretext.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/pango/pangocoretext.c b/pango/pangocoretext.c
index d75b2e8d..dc5769bc 100644
--- a/pango/pangocoretext.c
+++ b/pango/pangocoretext.c
@@ -137,13 +137,44 @@ pango_core_text_font_get_coverage (PangoFont *font,
return pango_coverage_ref (priv->coverage);
}
+/* Wrap shaper in PangoEngineShape to pass it through old API,
+ * from times when there were modules and engines. */
+typedef PangoEngineShape PangoCoreTextShapeEngine;
+typedef PangoEngineShapeClass PangoCoreTextShapeEngineClass;
+static GType pango_core_text_shape_engine_get_type (void) G_GNUC_CONST;
+G_DEFINE_TYPE (PangoCoreTextShapeEngine, pango_core_text_shape_engine, PANGO_TYPE_ENGINE_SHAPE);
+static void
+_pango_core_text_shape_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
+ PangoFont *font,
+ const char *item_text,
+ unsigned int item_length,
+ const PangoAnalysis *analysis,
+ PangoGlyphString *glyphs,
+ const char *paragraph_text,
+ unsigned int paragraph_length)
+{
+ _pango_core_text_shape (font, item_text, item_length, analysis, glyphs,
+ paragraph_text, paragraph_length);
+}
+static void
+pango_core_text_shape_engine_class_init (PangoEngineShapeClass *class)
+{
+ class->script_shape = _pango_core_text_shape_engine_shape;
+}
+static void
+pango_core_text_shape_engine_init (PangoEngineShape *object)
+{
+}
+
static PangoEngineShape *
pango_core_text_font_find_shaper (PangoFont *font,
PangoLanguage *language,
guint32 ch)
{
- /* FIXME: Implement */
- return NULL;
+ static PangoEngineShape *shaper;
+ if (!shaper)
+ shaper = g_object_new (pango_core_text_shape_engine_get_type(), NULL); /* XXX MT-unsafe */
+ return shaper;
}
static PangoFontMap *