summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2015-04-04 18:46:20 -0700
committerBehdad Esfahbod <behdad@behdad.org>2015-04-04 18:48:43 -0700
commit137832fa931e875b900dedd1c8909b46d1f7e8ad (patch)
treea9086e8e1f7707a4cc92369491c28d392f827018 /modules
parentef69cbb18b00d7e454cf881a8f58bdabad04ecef (diff)
downloadpango-137832fa931e875b900dedd1c8909b46d1f7e8ad.tar.gz
[modules] Move language modules in source tree and remove modules/
This should complete the kill-modules effort. What is left is leftover removal and unbreaking stuff. Bug 733882 - Kill Pango modules, engines, and config files
Diffstat (limited to 'modules')
-rw-r--r--modules/Makefile.am8
-rw-r--r--modules/arabic/Makefile.am14
-rw-r--r--modules/arabic/arabic-lang.c152
-rw-r--r--modules/indic/Makefile.am14
-rw-r--r--modules/indic/indic-lang.c309
-rw-r--r--modules/thai/Makefile.am17
-rw-r--r--modules/thai/thai-lang.c148
7 files changed, 0 insertions, 662 deletions
diff --git a/modules/Makefile.am b/modules/Makefile.am
deleted file mode 100644
index fa58389e..00000000
--- a/modules/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-## Process this file with automake to create Makefile.in.
-
-SUBDIRS = \
- arabic \
- indic \
- thai
-
--include $(top_srcdir)/git.mk
diff --git a/modules/arabic/Makefile.am b/modules/arabic/Makefile.am
deleted file mode 100644
index 7b800cfd..00000000
--- a/modules/arabic/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-INCLUDES = \
- -DG_LOG_DOMAIN=\"Pango\" \
- -DPANGO_ENABLE_ENGINE \
- $(PANGO_DEBUG_FLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/pango \
- $(GLIB_CFLAGS)
-
-noinst_LTLIBRARIES = libpango-arabic-lang.la
-
-libpango_arabic_lang_la_SOURCES = arabic-lang.c
-libpango_arabic_lang_la_CFLAGS = -DPANGO_MODULE_PREFIX=_pango_arabic_lang
-
--include $(top_srcdir)/git.mk
diff --git a/modules/arabic/arabic-lang.c b/modules/arabic/arabic-lang.c
deleted file mode 100644
index ee23bad1..00000000
--- a/modules/arabic/arabic-lang.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Pango
- * arabic-lang.c:
- *
- * Copyright (C) 2006 Red Hat Software
- * Copyright (C) 2006 Sharif FarsiWeb, Inc.
- * Authors: Behdad Esfahbod <besfahbo@redhat.com>
- * Roozbeh Pournader <roozbeh@farsiweb.info>
- *
- * 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 "config.h"
-#include <string.h>
-
-#include "pango-engine.h"
-#include "pango-break.h"
-
-/* No extra fields needed */
-typedef PangoEngineLang ArabicEngineLang;
-typedef PangoEngineLangClass ArabicEngineLangClass ;
-
-#define SCRIPT_ENGINE_NAME "ArabicScriptEngineLang"
-#define RENDER_TYPE PANGO_RENDER_TYPE_NONE
-
-static PangoEngineScriptInfo arabic_scripts[] = {
- { PANGO_SCRIPT_ARABIC, "*" },
-};
-
-static PangoEngineInfo script_engines[] = {
- {
- SCRIPT_ENGINE_NAME,
- PANGO_ENGINE_TYPE_LANG,
- RENDER_TYPE,
- arabic_scripts, G_N_ELEMENTS(arabic_scripts)
- }
-};
-
-
-#define ALEF_WITH_MADDA_ABOVE 0x0622
-#define YEH_WITH_HAMZA_ABOVE 0x0626
-#define ALEF 0x0627
-#define WAW 0x0648
-#define YEH 0x064A
-
-#define MADDAH_ABOVE 0x0653
-#define HAMZA_ABOVE 0x0654
-#define HAMZA_BELOW 0x0655
-
-/*
- * Arabic characters with canonical decompositions that are not just
- * ligatures. The characters U+06C0, U+06C2, and U+06D3 are intentionally
- * excluded as they are marked as "not an independent letter" in Unicode
- * Character Database's NamesList.txt
- */
-#define IS_COMPOSITE(c) (ALEF_WITH_MADDA_ABOVE <= (c) && (c) <= YEH_WITH_HAMZA_ABOVE)
-
-/* If a character is the second part of a composite Arabic character with an Alef */
-#define IS_COMPOSITE_WITH_ALEF(c) (MADDAH_ABOVE <= (c) && (c) <= HAMZA_BELOW)
-
-static void
-arabic_engine_break (PangoEngineLang *engine G_GNUC_UNUSED,
- const char *text,
- int length,
- PangoAnalysis *analysis G_GNUC_UNUSED,
- PangoLogAttr *attrs,
- int attrs_len G_GNUC_UNUSED)
-{
- int i;
- const char *p;
- gunichar prev_wc, this_wc;
-
- /* See http://bugzilla.gnome.org/show_bug.cgi?id=350132 for issues this
- * module tries to solve.
- */
-
- for (p = text, i = 0, prev_wc = 0;
- p < text + length;
- p = g_utf8_next_char (p), i++, prev_wc = this_wc)
- {
- this_wc = g_utf8_get_char (p);
-
- /*
- * Unset backspace_deletes_character for various combinations.
- *
- * A few more combinations may need to be handled here, but are not
- * handled yet, as expectations of users is not known or may differ
- * among different languages or users:
- * some letters combined with U+0658 ARABIC MARK NOON GHUNNA;
- * combinations considered one letter in Azerbaijani (WAW+SUKUN and
- * FARSI_YEH+HAMZA_ABOVE); combinations of YEH and ALEF_MAKSURA with
- * HAMZA_BELOW (Qur'anic); TATWEEL+HAMZA_ABOVE (Qur'anic).
- *
- * FIXME: Ordering these in some other way may lower the time spent here, or not.
- */
- if (G_UNLIKELY (
- IS_COMPOSITE (this_wc) ||
- (prev_wc == ALEF && IS_COMPOSITE_WITH_ALEF (this_wc)) ||
- (this_wc == HAMZA_ABOVE && (prev_wc == WAW || prev_wc == YEH))
- ))
- attrs[i+1].backspace_deletes_character = FALSE;
- }
-}
-
-static void
-arabic_engine_lang_class_init (PangoEngineLangClass *class)
-{
- class->script_break = arabic_engine_break;
-}
-
-PANGO_ENGINE_LANG_DEFINE_TYPE (ArabicEngineLang, arabic_engine_lang,
- arabic_engine_lang_class_init, NULL)
-
-void
-PANGO_MODULE_ENTRY(init) (GTypeModule *module)
-{
- arabic_engine_lang_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 (arabic_engine_lang_type, NULL);
- else
- return NULL;
-}
diff --git a/modules/indic/Makefile.am b/modules/indic/Makefile.am
deleted file mode 100644
index a3f23fd7..00000000
--- a/modules/indic/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-INCLUDES = \
- -DG_LOG_DOMAIN=\"Pango\" \
- -DPANGO_ENABLE_ENGINE \
- $(PANGO_DEBUG_FLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/pango \
- $(GLIB_CFLAGS)
-
-noinst_LTLIBRARIES = libpango-indic-lang.la
-
-libpango_indic_lang_la_SOURCES = indic-lang.c
-libpango_indic_lang_la_CFLAGS = -DPANGO_MODULE_PREFIX=_pango_indic_lang
-
--include $(top_srcdir)/git.mk
diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c
deleted file mode 100644
index dc01b6fe..00000000
--- a/modules/indic/indic-lang.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/* Pango
- * indic-lang.c:
- *
- * Copyright (C) 2006 Red Hat Software
- * Author: Akira TAGOH <tagoh@redhat.com>
- *
- * 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 "config.h"
-#include <string.h>
-
-#include "pango-engine.h"
-#include "pango-break.h"
-
-typedef PangoEngineLang IndicEngineLang;
-typedef PangoEngineLangClass IndicEngineLangClass;
-
-#define ENGINE_SUFFIX "IndicScriptEngineLang"
-#define RENDER_TYPE PANGO_RENDER_TYPE_NONE
-#define INDIC_ENGINE_INFO(script) \
- {#script ENGINE_SUFFIX, PANGO_ENGINE_TYPE_LANG, RENDER_TYPE, script##_scripts, G_N_ELEMENTS(script##_scripts)}
-
-#define DEV_RRA 0x0931 /* 0930 + 093c */
-#define DEV_QA 0x0958 /* 0915 + 093c */
-#define DEV_YA 0x095F /* 092f + 003c */
-#define DEV_KHHA 0x0959
-#define DEV_GHHA 0x095A
-#define DEV_ZA 0x095B
-#define DEV_DDDHA 0x095C
-#define DEV_RHA 0x095D
-#define DEV_FA 0x095E
-#define DEV_YYA 0x095F
-
-/* Bengali */
-/* for split matras in all brahmi based script */
-#define BENGALI_SIGN_O 0x09CB /* 09c7 + 09be */
-#define BENGALI_SIGN_AU 0x09CC /* 09c7 + 09d7 */
-#define BENGALI_RRA 0x09DC
-#define BENGALI_RHA 0x09DD
-#define BENGALI_YYA 0x09DF
-
-/* Gurumukhi */
-#define GURUMUKHI_LLA 0x0A33
-#define GURUMUKHI_SHA 0x0A36
-#define GURUMUKHI_KHHA 0x0A59
-#define GURUMUKHI_GHHA 0x0A5A
-#define GURUMUKHI_ZA 0x0A5B
-#define GURUMUKHI_RRA 0x0A5C
-#define GURUMUKHI_FA 0x0A5E
-
-/* Oriya */
-#define ORIYA_AI 0x0B48
-#define ORIYA_O 0x0B4B
-#define ORIYA_AU 0x0B4C
-
-/* Telugu */
-#define TELUGU_EE 0x0C47
-#define TELUGU_AI 0x0C48
-
-/* Tamil */
-#define TAMIL_O 0x0BCA
-#define TAMIL_OO 0x0BCB
-#define TAMIL_AU 0x0BCC
-
-/* Kannada */
-#define KNDA_EE 0x0CC7
-#define KNDA_AI 0x0CC8
-#define KNDA_O 0x0CCA
-#define KNDA_OO 0x0CCB
-
-/* Malayalam */
-#define MLYM_O 0x0D4A
-#define MLYM_OO 0x0D4B
-#define MLYM_AU 0x0D4C
-
-#define IS_COMPOSITE_WITH_BRAHMI_NUKTA(c) ( \
- (c >= BENGALI_RRA && c <= BENGALI_YYA) || \
- (c >= DEV_QA && c <= DEV_YA) || (c == DEV_RRA) || (c >= DEV_KHHA && c <= DEV_YYA) || \
- (c >= KNDA_EE && c <= KNDA_AI) ||(c >= KNDA_O && c <= KNDA_OO) || \
- (c == TAMIL_O) || (c == TAMIL_OO) || (c == TAMIL_AU) || \
- (c == TELUGU_EE) || (c == TELUGU_AI) || \
- (c == ORIYA_AI) || (c == ORIYA_O) || (c == ORIYA_AU) || \
- (c >= GURUMUKHI_KHHA && c <= GURUMUKHI_RRA) || (c == GURUMUKHI_FA)|| (c == GURUMUKHI_LLA)|| (c == GURUMUKHI_SHA) || \
- FALSE)
-#define IS_SPLIT_MATRA_BRAHMI(c) ( \
- (c == BENGALI_SIGN_O) || (c == BENGALI_SIGN_AU) || \
- (c >= MLYM_O && c <= MLYM_AU) || \
- FALSE)
-
-
-static PangoEngineScriptInfo deva_scripts[] = {
- { PANGO_SCRIPT_DEVANAGARI, "*" }
-};
-
-static PangoEngineScriptInfo beng_scripts[] = {
- { PANGO_SCRIPT_BENGALI, "*" }
-};
-
-static PangoEngineScriptInfo guru_scripts[] = {
- { PANGO_SCRIPT_GURMUKHI, "*" }
-};
-
-static PangoEngineScriptInfo gujr_scripts[] = {
- { PANGO_SCRIPT_GUJARATI, "*" }
-};
-
-static PangoEngineScriptInfo orya_scripts[] = {
- { PANGO_SCRIPT_ORIYA, "*" }
-};
-
-static PangoEngineScriptInfo taml_scripts[] = {
- { PANGO_SCRIPT_TAMIL, "*" }
-};
-
-static PangoEngineScriptInfo telu_scripts[] = {
- { PANGO_SCRIPT_TELUGU, "*" }
-};
-
-static PangoEngineScriptInfo knda_scripts[] = {
- { PANGO_SCRIPT_KANNADA, "*" }
-};
-
-static PangoEngineScriptInfo mlym_scripts[] = {
- { PANGO_SCRIPT_MALAYALAM, "*" }
-};
-
-static PangoEngineScriptInfo sinh_scripts[] = {
- { PANGO_SCRIPT_SINHALA, "*" }
-};
-
-static PangoEngineInfo script_engines[] = {
- INDIC_ENGINE_INFO(deva), INDIC_ENGINE_INFO(beng), INDIC_ENGINE_INFO(guru),
- INDIC_ENGINE_INFO(gujr), INDIC_ENGINE_INFO(orya), INDIC_ENGINE_INFO(taml),
- INDIC_ENGINE_INFO(telu), INDIC_ENGINE_INFO(knda), INDIC_ENGINE_INFO(mlym),
- INDIC_ENGINE_INFO(sinh)
-};
-
-static void
-not_cursor_position (PangoLogAttr *attr)
-{
- attr->is_cursor_position = FALSE;
- attr->is_char_break = FALSE;
- attr->is_line_break = FALSE;
- attr->is_mandatory_break = FALSE;
-}
-
-static void
-indic_engine_break (PangoEngineLang *engine G_GNUC_UNUSED,
- const char *text,
- int length,
- PangoAnalysis *analysis,
- PangoLogAttr *attrs,
- int attrs_len G_GNUC_UNUSED)
-{
- const gchar *p, *next = NULL, *next_next;
- gunichar prev_wc, this_wc, next_wc, next_next_wc;
- gboolean is_conjunct = FALSE;
- int i;
-
- for (p = text, prev_wc = 0, i = 0;
- p != NULL && p < (text + length);
- p = next, prev_wc = this_wc, i++)
- {
- this_wc = g_utf8_get_char (p);
- next = g_utf8_next_char (p);
-
- if (G_UNLIKELY (
- IS_COMPOSITE_WITH_BRAHMI_NUKTA(this_wc) || IS_SPLIT_MATRA_BRAHMI(this_wc))) {
- attrs[i+1].backspace_deletes_character = FALSE;
- }
-
- if (next != NULL && next < (text + length))
- {
- next_wc = g_utf8_get_char (next);
- next_next = g_utf8_next_char (next);
- }
- else
- {
- next_wc = 0;
- next_next = NULL;
- }
- if (next_next != NULL && next_next < (text + length))
- next_next_wc = g_utf8_get_char (next_next);
- else
- next_next_wc = 0;
-
- switch (analysis->script)
- {
- case PANGO_SCRIPT_SINHALA:
- /*
- * TODO: The cursor position should be based on the state table.
- * This is the wrong place to be doing this.
- */
-
- /*
- * The cursor should treat as a single glyph:
- * SINHALA CONS + 0x0DCA + 0x200D + SINHALA CONS
- * SINHALA CONS + 0x200D + 0x0DCA + SINHALA CONS
- */
- if ((this_wc == 0x0DCA && next_wc == 0x200D)
- || (this_wc == 0x200D && next_wc == 0x0DCA))
- {
- not_cursor_position(&attrs[i]);
- not_cursor_position(&attrs[i + 1]);
- is_conjunct = TRUE;
- }
- else if (is_conjunct
- && (prev_wc == 0x200D || prev_wc == 0x0DCA)
- && this_wc >= 0x0D9A
- && this_wc <= 0x0DC6)
- {
- not_cursor_position(&attrs[i]);
- is_conjunct = FALSE;
- }
- /*
- * Consonant clusters do NOT result in implicit conjuncts
- * in SINHALA orthography.
- */
- else if (!is_conjunct && prev_wc == 0x0DCA && this_wc != 0x200D)
- {
- attrs[i].is_cursor_position = TRUE;
- }
-
- break;
-
- default:
-
- if (prev_wc != 0 && (this_wc == 0x200D || this_wc == 0x200C))
- {
- not_cursor_position(&attrs[i]);
- if (next_wc != 0)
- {
- not_cursor_position(&attrs[i+1]);
- if ((next_next_wc != 0) &&
- (next_wc == 0x09CD || /* Bengali */
- next_wc == 0x0ACD || /* Gujarati */
- next_wc == 0x094D || /* Hindi */
- next_wc == 0x0CCD || /* Kannada */
- next_wc == 0x0D4D || /* Malayalam */
- next_wc == 0x0B4D || /* Oriya */
- next_wc == 0x0A4D || /* Punjabi */
- next_wc == 0x0BCD || /* Tamil */
- next_wc == 0x0C4D)) /* Telugu */
- {
- not_cursor_position(&attrs[i+2]);
- }
- }
- }
-
- break;
- }
- }
-}
-
-static void
-indic_engine_lang_class_init (PangoEngineLangClass *klass)
-{
- klass->script_break = indic_engine_break;
-}
-
-PANGO_ENGINE_LANG_DEFINE_TYPE (IndicEngineLang, indic_engine_lang,
- indic_engine_lang_class_init, NULL)
-
-void
-PANGO_MODULE_ENTRY(init) (GTypeModule *module)
-{
- indic_engine_lang_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)
-{
- guint i;
-
- for (i = 0; i < G_N_ELEMENTS(script_engines); i++)
- {
- if (!strcmp (id, script_engines[i].id))
- return g_object_new (indic_engine_lang_type, NULL);
- }
-
- return NULL;
-}
diff --git a/modules/thai/Makefile.am b/modules/thai/Makefile.am
deleted file mode 100644
index 4345845d..00000000
--- a/modules/thai/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-INCLUDES = \
- -DG_LOG_DOMAIN=\"Pango\" \
- -DPANGO_ENABLE_ENGINE \
- $(PANGO_DEBUG_FLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/pango \
- $(GLIB_CFLAGS)
-
-if HAVE_LIBTHAI
-noinst_LTLIBRARIES = libpango-thai-lang.la
-endif
-
-libpango_thai_lang_la_SOURCES = thai-lang.c
-libpango_thai_lang_la_CFLAGS = -DPANGO_MODULE_PREFIX=_pango_thai_lang $(LIBTHAI_CFLAGS)
-libpango_thai_lang_la_LIBADD = $(LIBTHAI_LIBS)
-
--include $(top_srcdir)/git.mk
diff --git a/modules/thai/thai-lang.c b/modules/thai/thai-lang.c
deleted file mode 100644
index 31571445..00000000
--- a/modules/thai/thai-lang.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Pango
- * thai-lang.c:
- *
- * Copyright (C) 2003 Theppitak Karoonboonyanan <thep@linux.thai.net>
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#include <string.h>
-#include <glib.h>
-#include <pango/pango-engine.h>
-#include <pango/pango-break.h>
-#include <thai/thwchar.h>
-#include <thai/thbrk.h>
-
-/* No extra fields needed */
-typedef PangoEngineLang ThaiEngineLang;
-typedef PangoEngineLangClass ThaiEngineLangClass;
-
-#define SCRIPT_ENGINE_NAME "ThaiScriptEngineLang"
-
-static PangoEngineScriptInfo thai_scripts[] = {
- { PANGO_SCRIPT_THAI, "*" }
-};
-
-static PangoEngineInfo script_engines[] = {
- {
- SCRIPT_ENGINE_NAME,
- PANGO_ENGINE_TYPE_LANG,
- PANGO_RENDER_TYPE_NONE,
- thai_scripts, G_N_ELEMENTS(thai_scripts)
- }
-};
-
-/*
- * tis_text is assumed to be large enough to hold the converted string,
- * i.e. it must be at least g_utf8_strlen(text, len)+1 bytes.
- */
-static thchar_t *
-utf8_to_tis (const char *text, int len, thchar_t *tis_text, int *tis_cnt)
-{
- thchar_t *tis_p;
- const char *text_p;
-
- tis_p = tis_text;
- for (text_p = text; text_p < text + len; text_p = g_utf8_next_char (text_p))
- *tis_p++ = th_uni2tis (g_utf8_get_char (text_p));
- *tis_p++ = '\0';
-
- *tis_cnt = tis_p - tis_text;
- return tis_text;
-}
-
-static void
-thai_engine_break (PangoEngineLang *engine G_GNUC_UNUSED,
- const char *text,
- int len,
- PangoAnalysis *analysis G_GNUC_UNUSED,
- PangoLogAttr *attrs,
- int attrs_len G_GNUC_UNUSED)
-{
- thchar_t tis_stack[512];
- int brk_stack[512];
- thchar_t *tis_text;
- int *brk_pnts;
- int cnt;
-
- if (len < 0)
- len = strlen (text);
- cnt = g_utf8_strlen (text, len) + 1;
-
- tis_text = tis_stack;
- if (cnt > (int) G_N_ELEMENTS (tis_stack))
- tis_text = g_new (thchar_t, cnt);
-
- utf8_to_tis (text, len, tis_text, &cnt);
-
- brk_pnts = brk_stack;
- if (cnt > (int) G_N_ELEMENTS (brk_stack))
- brk_pnts = g_new (int, cnt);
-
- /* find line break positions */
- len = th_brk (tis_text, brk_pnts, len);
- for (cnt = 0; cnt < len; cnt++)
- {
- attrs[brk_pnts[cnt]].is_line_break = TRUE;
- attrs[brk_pnts[cnt]].is_word_start = TRUE;
- attrs[brk_pnts[cnt]].is_word_end = TRUE;
- }
-
- if (brk_pnts != brk_stack)
- g_free (brk_pnts);
-
- if (tis_text != tis_stack)
- g_free (tis_text);
-}
-
-static void
-thai_engine_lang_class_init (PangoEngineLangClass *class)
-{
- class->script_break = thai_engine_break;
-}
-
-PANGO_ENGINE_LANG_DEFINE_TYPE (ThaiEngineLang, thai_engine_lang,
- thai_engine_lang_class_init, NULL);
-
-void
-PANGO_MODULE_ENTRY(init) (GTypeModule *module)
-{
- thai_engine_lang_register_type (module);
-}
-
-void
-PANGO_MODULE_ENTRY(exit) (void)
-{
-}
-
-void
-PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, gint *n_engines)
-{
- *engines = script_engines;
- *n_engines = G_N_ELEMENTS (script_engines);
-}
-
-/* Load a particular engine given the ID for the engine
- */
-PangoEngine *
-PANGO_MODULE_ENTRY(create) (const char *id)
-{
- if (!strcmp (id, SCRIPT_ENGINE_NAME))
- return g_object_new (thai_engine_lang_type, NULL);
- else
- return NULL;
-}
-