diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2014-07-28 18:37:36 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-04-04 16:13:40 -0700 |
commit | 7d30b3f91958a3ff45ee2b8e5de2b6186cadfb72 (patch) | |
tree | c598289612344faffb3b0225707f1c2ed2282de8 /pango/pangocoretext-shape.c | |
parent | 14c11dd96e1547aaede1bb05a0243f5b0b53186e (diff) | |
download | pango-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-shape.c')
-rw-r--r-- | pango/pangocoretext-shape.c | 89 |
1 files changed, 14 insertions, 75 deletions
diff --git a/pango/pangocoretext-shape.c b/pango/pangocoretext-shape.c index ce6a62a5..4be12159 100644 --- a/pango/pangocoretext-shape.c +++ b/pango/pangocoretext-shape.c @@ -1,5 +1,5 @@ /* Pango - * basic-coretext.c + * pangocoretext-shape.c * * Copyright (C) 2005 Imendio AB * Copyright (C) 2010 Kristian Rietveld <kris@gtk.org> @@ -25,31 +25,8 @@ #include <glib.h> #include <string.h> #include <Carbon/Carbon.h> -#include "pango-engine.h" #include "pango-utils.h" -#include "pango-fontmap.h" -#include "pangocoretext.h" -#include "pango-impl-utils.h" - -/* No extra fields needed */ -typedef PangoEngineShape BasicEngineCoreText; -typedef PangoEngineShapeClass BasicEngineCoreTextClass ; - -#define SCRIPT_ENGINE_NAME "BasicScriptEngineCoreText" -#define RENDER_TYPE PANGO_RENDER_TYPE_CORE_TEXT - -static PangoEngineScriptInfo basic_scripts[] = { - { PANGO_SCRIPT_COMMON, "" } -}; - -static PangoEngineInfo script_engines[] = { - { - SCRIPT_ENGINE_NAME, - PANGO_ENGINE_TYPE_SHAPE, - RENDER_TYPE, - basic_scripts, G_N_ELEMENTS(basic_scripts) - } -}; +#include "pangocoretext-private.h" static void set_glyph (PangoFont *font, @@ -73,10 +50,10 @@ set_glyph (PangoFont *font, /* The "RunIterator" helps us to iterate over the array of runs that is obtained from * the CoreText type setter. Even though Pango considers the string that is passed to - * the shaping engine a single run, CoreText might consider it to consist out of + * the shape function a single run, CoreText might consider it to consist out of * multiple runs. Because of this, we have an interface around the CoreText array of - * runs that works like iterating a single array, which makes our job in the shaping - * engine function easier. + * runs that works like iterating a single array, which makes our job in the shape + * function easier. */ struct RunIterator @@ -155,7 +132,7 @@ run_iterator_get_glyph_count (struct RunIterator *iter) /* These functions are commented out to silence the compiler, but * kept around because they might be of use when fixing the more * intricate issues noted in the comment in the function - * basic_engine_shape() below. + * pangocoretext_shape() below. */ #if 0 static gboolean @@ -367,15 +344,14 @@ create_core_text_glyph_list (const char *text, } -static void -basic_engine_shape (PangoEngineShape *engine, - PangoFont *font, - const char *text, - gint length, - const PangoAnalysis *analysis, - PangoGlyphString *glyphs, - const char *paragraph_text G_GNUC_UNUSED, - unsigned int paragraph_length G_GNUC_UNUSED) +void +_pango_core_text_shape (PangoFont *font, + const char *text, + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text G_GNUC_UNUSED, + unsigned int paragraph_length G_GNUC_UNUSED) { const char *p; gulong n_chars, gs_i, gs_prev_i; @@ -507,40 +483,3 @@ basic_engine_shape (PangoEngineShape *engine, if (analysis->level & 1) pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); } - -static void -basic_engine_core_text_class_init (PangoEngineShapeClass *class) -{ - class->script_shape = basic_engine_shape; -} - -PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineCoreText, basic_engine_core_text, - basic_engine_core_text_class_init, NULL); - -void -PANGO_MODULE_ENTRY(init) (GTypeModule *module) -{ - basic_engine_core_text_register_type (module); -} - -void -PANGO_MODULE_ENTRY(exit) (void) -{ -} - -void -PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, - int *n_engines) -{ - *engines = script_engines; - *n_engines = G_N_ELEMENTS (script_engines); -} - -PangoEngine * -PANGO_MODULE_ENTRY(create) (const char *id) -{ - if (!strcmp (id, SCRIPT_ENGINE_NAME)) - return g_object_new (basic_engine_core_text_type, NULL); - else - return NULL; -} |