summaryrefslogtreecommitdiff
path: root/modules/thai
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-08-03 21:57:35 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-08-03 21:57:35 +0000
commit2584212cd0976f5f95d9381e829917e7d2a10d28 (patch)
tree5773e9f6802f8316c5c7463aa55677babe67343c /modules/thai
parent95a8d1788e884b7d8d29d4171a1adc51c61e880e (diff)
downloadpango-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/thai')
-rw-r--r--modules/thai/thai-fc.c49
-rw-r--r--modules/thai/thai-shaper.c3
-rw-r--r--modules/thai/thai-shaper.h3
3 files changed, 25 insertions, 30 deletions
diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c
index 6c537639..9a9839a9 100644
--- a/modules/thai/thai-fc.c
+++ b/modules/thai/thai-fc.c
@@ -31,9 +31,14 @@
#include <glib.h>
#include "pango-engine.h"
+#include "pangofc-font.h"
+
#include "thai-shaper.h"
-#include "pangofc-font.h"
+/* No extra fields needed */
+typedef PangoEngineShape ThaiEngineFc;
+typedef PangoEngineShapeClass ThaiEngineFcClass ;
+
#define SCRIPT_ENGINE_NAME "ThaiScriptEngineFc"
#define RENDER_TYPE PANGO_RENDER_TYPE_FC
@@ -199,31 +204,26 @@ thai_has_glyph (ThaiFontInfo *font_info, PangoGlyph glyph)
return TRUE;
}
-static PangoCoverage *
-thai_engine_get_coverage (PangoFont *font,
- PangoLanguage *lang)
+static void
+thai_engine_fc_class_init (PangoEngineShapeClass *class)
{
- return pango_font_get_coverage (font, lang);
+ class->script_shape = thai_engine_shape;
}
-static PangoEngine *
-thai_engine_fc_new ()
-{
- PangoEngineShape *result;
-
- result = g_new (PangoEngineShape, 1);
+PANGO_ENGINE_SHAPE_DEFINE_TYPE (ThaiEngineFc, thai_engine_fc,
+ thai_engine_fc_class_init, NULL);
- result->engine.id = SCRIPT_ENGINE_NAME;
- result->engine.type = PANGO_ENGINE_TYPE_SHAPE;
- result->engine.length = sizeof (result);
- result->script_shape = thai_engine_shape;
- result->get_coverage = thai_engine_get_coverage;
+void
+PANGO_MODULE_ENTRY(init) (GTypeModule *module)
+{
+ thai_engine_fc_register_type (module);
+}
- return (PangoEngine *)result;
+void
+PANGO_MODULE_ENTRY(exit) (void)
+{
}
-/* List the engines contained within this module
- */
void
PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines,
int *n_engines)
@@ -232,18 +232,11 @@ PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines,
*n_engines = G_N_ELEMENTS (script_engines);
}
-/* Load a particular engine given the ID for the engine
- */
PangoEngine *
-PANGO_MODULE_ENTRY(load) (const char *id)
+PANGO_MODULE_ENTRY(create) (const char *id)
{
if (!strcmp (id, SCRIPT_ENGINE_NAME))
- return thai_engine_fc_new ();
+ return g_object_new (thai_engine_fc_type, NULL);
else
return NULL;
}
-
-void
-PANGO_MODULE_ENTRY(unload) (PangoEngine *engine)
-{
-}
diff --git a/modules/thai/thai-shaper.c b/modules/thai/thai-shaper.c
index fd052dd3..4cd98283 100644
--- a/modules/thai/thai-shaper.c
+++ b/modules/thai/thai-shaper.c
@@ -692,7 +692,8 @@ get_next_cluster(const char *text,
}
void
-thai_engine_shape (PangoFont *font,
+thai_engine_shape (PangoEngineShape *engine,
+ PangoFont *font,
const char *text,
gint length,
PangoAnalysis *analysis,
diff --git a/modules/thai/thai-shaper.h b/modules/thai/thai-shaper.h
index 7a9bb31e..b745da86 100644
--- a/modules/thai/thai-shaper.h
+++ b/modules/thai/thai-shaper.h
@@ -54,7 +54,8 @@ thai_has_glyph (ThaiFontInfo *font_info, PangoGlyph glyph);
* Public functions
*/
void
-thai_engine_shape (PangoFont *font,
+thai_engine_shape (PangoEngineShape *engine,
+ PangoFont *font,
const char *text,
gint length,
PangoAnalysis *analysis,