diff options
author | Owen Taylor <otaylor@redhat.com> | 2003-08-03 21:57:35 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2003-08-03 21:57:35 +0000 |
commit | 2584212cd0976f5f95d9381e829917e7d2a10d28 (patch) | |
tree | 5773e9f6802f8316c5c7463aa55677babe67343c /modules/basic/basic-win32.c | |
parent | 95a8d1788e884b7d8d29d4171a1adc51c61e880e (diff) | |
download | pango-2584212cd0976f5f95d9381e829917e7d2a10d28.tar.gz |
Make PangoEngine{,Lang,Shape} GObjects, and use a GTypeModule-based
Sat Aug 2 23:19:16 2003 Owen Taylor <otaylor@redhat.com>
* pango/pango-engine.[ch] modules/*/*-{fc,win32,x}.c
pango/modules.c pango/break.c pango/pango-context.c
pango/pango-layout.c pango/pango-modules.h
pango/querymodules.c pango/shape.c: Make
PangoEngine{,Lang,Shape} GObjects, and use a
GTypeModule-based module-loading system closely based
on the one used for GtkIMContext and GtkThemeEngine.
* pango/pango-impl-utils.h: OK, I'm tired of typing
in get_type() functions.
* pango/pango-script.[ch] pango/pango-script-table.h
tests/testscript.c tools/gen-script-table.pl: Add port
of script-range code from ICU in preparation for future
use. (#91542)
* tools/gen-script-for-lang.c: Utility program to determine
the script for each fontconfig .orth file.
* docs/tmpl/{scripts.sgml,pango-engine-lang.sgml,
pango-engine-shape.sgml} docs/pango-sections.txt docs/pango-docs.sgml:
Redo to go along with the above changes.
* configure.in: chmod +x tests/runtests.sh
Diffstat (limited to 'modules/basic/basic-win32.c')
-rw-r--r-- | modules/basic/basic-win32.c | 75 |
1 files changed, 34 insertions, 41 deletions
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index c63a016a..9e00139c 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -34,6 +34,10 @@ #include "basic-common.h" +/* No extra fields needed */ +typedef PangoEngineShape BasicEngineWin32; +typedef PangoEngineShapeClass BasicEngineWin32Class ; + #define SCRIPT_ENGINE_NAME "BasicScriptEngineWin32" static gboolean pango_win32_debug = FALSE; @@ -971,7 +975,8 @@ uniscribe_shape (PangoFont *font, #endif /* HAVE_USP10_H */ static void -basic_engine_shape (PangoFont *font, +basic_engine_shape (PangoEngineShape *engine, + PangoFont *font, const char *text, gint length, PangoAnalysis *analysis, @@ -1075,29 +1080,6 @@ basic_engine_shape (PangoFont *font, } } -static PangoCoverage * -basic_engine_get_coverage (PangoFont *font, - PangoLanguage *lang) -{ - return pango_font_get_coverage (font, lang); -} - -static PangoEngine * -basic_engine_win32_new (void) -{ - PangoEngineShape *result; - - result = g_new (PangoEngineShape, 1); - - result->engine.id = SCRIPT_ENGINE_NAME; - result->engine.type = PANGO_ENGINE_TYPE_SHAPE; - result->engine.length = sizeof (result); - result->script_shape = basic_engine_shape; - result->get_coverage = basic_engine_get_coverage; - - return (PangoEngine *)result; -} - static void init_uniscribe (void) { @@ -1133,13 +1115,34 @@ init_uniscribe (void) #endif } -/* The following three functions provide the public module API for - * Pango - */ +static void +basic_engine_win32_class_init (PangoEngineShapeClass *class) +{ + class->script_shape = basic_engine_shape; +} + +PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineWin32, basic_engine_win32, + basic_engine_win32_class_init, NULL); + +void +PANGO_MODULE_ENTRY(init) (GTypeModule *module) +{ + init_uniscribe (); -void + if (pango_win32_get_debug_flag ()) + pango_win32_debug = TRUE; + + basic_engine_register_type (module); +} + +void +PANGO_MODULE_ENTRY(exit) (void) +{ +} + +void PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, - gint *n_engines) + int *n_engines) { init_uniscribe (); @@ -1176,20 +1179,10 @@ PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, } PangoEngine * -PANGO_MODULE_ENTRY(load) (const char *id) +PANGO_MODULE_ENTRY(create) (const char *id) { - init_uniscribe (); - - if (pango_win32_get_debug_flag ()) - pango_win32_debug = TRUE; - if (!strcmp (id, SCRIPT_ENGINE_NAME)) - return basic_engine_win32_new (); + return g_object_new (basic_engine_win32_type, NULL); else return NULL; } - -void -PANGO_MODULE_ENTRY(unload) (PangoEngine *engine) -{ -} |