summaryrefslogtreecommitdiff
path: root/pango
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 /pango
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 'pango')
-rw-r--r--pango/Makefile.am46
-rw-r--r--pango/break-arabic.c91
-rw-r--r--pango/break-indic.c208
-rw-r--r--pango/break-thai.c90
-rw-r--r--pango/break.c86
-rw-r--r--pango/module-defs-fc.c.win329
-rw-r--r--pango/module-defs-lang.c.win3211
-rw-r--r--pango/module-defs-win32.c.win329
-rw-r--r--pango/module-defs.h.win3229
-rw-r--r--pango/pango-context.c19
-rw-r--r--pango/pango-engine-private.h4
11 files changed, 472 insertions, 130 deletions
diff --git a/pango/Makefile.am b/pango/Makefile.am
index d1561e23..f5ad2d0b 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -46,13 +46,10 @@ INTROSPECTION_GIRS += Pango-1.0.gir
libpango_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS)
libpango_1_0_la_LIBADD = \
$(GLIB_LIBS) \
- $(libm) \
- $(INCLUDED_LANG_MODULES)
-libpango_1_0_la_DEPENDENCIES = \
- $(INCLUDED_LANG_MODULES)
+ $(libm)
libpango_1_0_la_LIBADD += mini-fribidi/libmini-fribidi.la
-libpango_1_0_la_DEPENDENCIES += mini-fribidi/libmini-fribidi.la
+libpango_1_0_la_DEPENDENCIES = mini-fribidi/libmini-fribidi.la
if PLATFORM_WIN32
libpango_1_0_la_LDFLAGS += -export-symbols $(srcdir)/pango.def -Wl,pango-win32-res.o
@@ -95,8 +92,7 @@ libpango_1_0_la_SOURCES = \
pango-utils.c \
reorder-items.c \
shape.c \
- pango-enum-types.c \
- module-defs-lang.c
+ pango-enum-types.c
pango_headers = \
pango.h \
@@ -189,18 +185,15 @@ pangoft2_public_sources = \
libpangoft2_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS)
libpangoft2_1_0_la_LIBADD = \
libpango-$(PANGO_API_VERSION).la \
- $(INCLUDED_FC_MODULES) \
$(GLIB_LIBS) \
$(HARFBUZZ_LIBS) \
$(FREETYPE_LIBS) \
$(libm)
libpangoft2_1_0_la_DEPENDENCIES = \
- libpango-$(PANGO_API_VERSION).la \
- $(INCLUDED_FC_MODULES)
+ libpango-$(PANGO_API_VERSION).la
libpangoft2_1_0_la_SOURCES = \
$(pangoft2_public_sources) \
modules.h \
- module-defs-fc.c \
pangofc-private.h \
pangoft2.h \
pangoft2-private.h \
@@ -343,7 +336,6 @@ if HAVE_CAIRO_QUARTZ
if HAVE_CORE_TEXT
libpangocairo_1_0_la_SOURCES += \
modules.h \
- module-defs-coretext.c \
pangocoretext.h \
pangocoretext.c \
pangocoretext-private.h \
@@ -356,7 +348,6 @@ libpangocairo_1_0_la_SOURCES += \
pangoinclude_HEADERS += pangocoretext.h
libpangocairo_1_0_la_LDFLAGS += -framework CoreFoundation -framework ApplicationServices
-libpangocairo_1_0_la_LIBADD += $(INCLUDED_CORE_TEXT_MODULES)
# We don't have an CoreText GIR right now, so this is just hypothetical
# PANGOCAIRO_FONT_BACKEND_GI_MODULE = PangoCoreText-1.0.gir
endif
@@ -391,15 +382,12 @@ endif
libpangowin32_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS)
libpangowin32_1_0_la_LIBADD = \
libpango-$(PANGO_API_VERSION).la \
- $(INCLUDED_WIN32_MODULES) \
$(GLIB_LIBS) \
-lgdi32 -lusp10
libpangowin32_1_0_la_DEPENDENCIES = \
- libpango-$(PANGO_API_VERSION).la \
- $(INCLUDED_WIN32_MODULES)
+ libpango-$(PANGO_API_VERSION).la
libpangowin32_1_0_la_SOURCES = \
modules.h \
- module-defs-win32.c \
pangowin32.h \
pangowin32.c \
pangowin32-private.h \
@@ -432,11 +420,6 @@ EXTRA_DIST = \
pango-enum-types.h \
pango-enum-types.h.template \
pango-enum-types.c.template \
- module-defs.h \
- module-defs.h.win32 \
- module-defs-lang.c.win32 \
- module-defs-fc.c.win32 \
- module-defs-win32.c.win32 \
pango.def \
pangocairo.def \
pangowin32.def \
@@ -455,24 +438,6 @@ EXTRA_DIST = \
check.defs
-modules:
- $(AM_V_GEN) cd $(top_builddir)/modules && $(MAKE) $(AM_MAKEFLAGS)
-
-$(INCLUDED_LANG_MODULES) $(INCLUDED_FC_MODULES) $(INCLUDED_WIN32_MODULES) $(INCLUDED_CORE_TEXT_MODULES): modules
- $(AM_V_GEN) true
-
-.PHONY: modules
-
-MODULE_DEF_FILES = \
- module-defs.h \
- module-defs-lang.c \
- module-defs-fc.c \
- module-defs-win32.c \
- module-defs-coretext.c
-
-$(MODULE_DEF_FILES): $(top_builddir)/config.status
- $(AM_V_GEN) cd $(top_builddir) && $(SHELL) ./config.status pango/$@
-
include $(top_srcdir)/build/Makefile-msvcproj.am
dist-hook: $(pango_vcproj_stuff)
@@ -491,7 +456,6 @@ MOSTLYCLEANFILES = \
DISTCLEANFILES = \
pango-features.h \
- $(MODULE_DEF_FILES) \
$(pango_vcproj_stuff)
install-exec-hook:
diff --git a/pango/break-arabic.c b/pango/break-arabic.c
new file mode 100644
index 00000000..5e2f6068
--- /dev/null
+++ b/pango/break-arabic.c
@@ -0,0 +1,91 @@
+/* Pango
+ * break-arabic.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 "pango-break.h"
+
+#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
+break_arabic (const char *text,
+ int length,
+ const 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;
+ }
+}
diff --git a/pango/break-indic.c b/pango/break-indic.c
new file mode 100644
index 00000000..bb44d64c
--- /dev/null
+++ b/pango/break-indic.c
@@ -0,0 +1,208 @@
+/* Pango
+ * break-indic.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 "pango-break.h"
+
+#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 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
+break_indic (const char *text,
+ int length,
+ const 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;
+ }
+ }
+}
diff --git a/pango/break-thai.c b/pango/break-thai.c
new file mode 100644
index 00000000..e7462999
--- /dev/null
+++ b/pango/break-thai.c
@@ -0,0 +1,90 @@
+/* Pango
+ * break-thai.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 "config.h"
+
+#include <pango/pango-break.h>
+
+#ifdef HAVE_LIBTHAI
+#include <thai/thwchar.h>
+#include <thai/thbrk.h>
+
+/*
+ * 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;
+}
+
+#endif
+static void
+break_thai (const char *text,
+ int len,
+ const PangoAnalysis *analysis G_GNUC_UNUSED,
+ PangoLogAttr *attrs,
+ int attrs_len G_GNUC_UNUSED)
+{
+#ifdef HAVE_LIBTHAI
+ thchar_t tis_stack[512];
+ int brk_stack[512];
+ thchar_t *tis_text;
+ int *brk_pnts;
+ int cnt;
+
+ 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);
+#endif
+}
diff --git a/pango/break.c b/pango/break.c
index 4076d9fb..64b6d370 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -22,7 +22,7 @@
#include "config.h"
#include "pango-break.h"
-#include "pango-modules.h"
+#include "pango-engine-private.h"
#include "pango-script-private.h"
#include "pango-impl-utils.h"
#include <string.h>
@@ -1849,10 +1849,7 @@ pango_get_log_attrs (const char *text,
PangoLogAttr *log_attrs,
int attrs_len)
{
- PangoMap *lang_map;
int chars_broken;
- static guint engine_type_id = 0; /* MT-safe */
- static guint render_type_id = 0; /* MT-safe */
PangoAnalysis analysis = { NULL };
PangoScriptIter iter;
@@ -1863,13 +1860,6 @@ pango_get_log_attrs (const char *text,
pango_default_break (text, length, &analysis, log_attrs, attrs_len);
- if (engine_type_id == 0)
- engine_type_id = g_quark_from_static_string (PANGO_ENGINE_TYPE_LANG);
- if (render_type_id == 0)
- render_type_id = g_quark_from_static_string (PANGO_RENDER_TYPE_NONE);
-
- lang_map = pango_find_map (language, engine_type_id, render_type_id);
-
chars_broken = 0;
_pango_script_iter_init (&iter, text, length);
@@ -1880,7 +1870,7 @@ pango_get_log_attrs (const char *text,
pango_script_iter_get_range (&iter, &run_start, &run_end, &script);
analysis.script = script;
- analysis.lang_engine = (PangoEngineLang*) pango_map_get_engine (lang_map, analysis.script);
+ analysis.lang_engine = _pango_get_language_engine ();
chars_broken += tailor_segment (run_start, run_end, chars_broken, &analysis, log_attrs);
}
@@ -1891,3 +1881,75 @@ pango_get_log_attrs (const char *text,
chars_broken + 1,
attrs_len);
}
+
+#include "break-arabic.c"
+#include "break-indic.c"
+#include "break-thai.c"
+
+static void
+break_script (const char *item_text,
+ unsigned int item_length,
+ const PangoAnalysis *analysis,
+ PangoLogAttr *attrs,
+ int attrs_len)
+{
+ switch (analysis->script)
+ {
+ case PANGO_SCRIPT_ARABIC:
+ break_arabic (item_text, item_length, analysis, attrs, attrs_len);
+ break;
+
+ case PANGO_SCRIPT_DEVANAGARI:
+ case PANGO_SCRIPT_BENGALI:
+ case PANGO_SCRIPT_GURMUKHI:
+ case PANGO_SCRIPT_GUJARATI:
+ case PANGO_SCRIPT_ORIYA:
+ case PANGO_SCRIPT_TAMIL:
+ case PANGO_SCRIPT_TELUGU:
+ case PANGO_SCRIPT_KANNADA:
+ case PANGO_SCRIPT_MALAYALAM:
+ case PANGO_SCRIPT_SINHALA:
+ break_indic (item_text, item_length, analysis, attrs, attrs_len);
+ break;
+
+ case PANGO_SCRIPT_THAI:
+ break_thai (item_text, item_length, analysis, attrs, attrs_len);
+ break;
+ }
+}
+
+
+/* Wrap language breaker in PangoEngineLang to pass it through old API,
+ * from times when there were modules and engines. */
+typedef PangoEngineLang PangoLanguageEngine;
+typedef PangoEngineLangClass PangoLanguageEngineClass;
+static GType pango_language_engine_get_type (void) G_GNUC_CONST;
+G_DEFINE_TYPE (PangoLanguageEngine, pango_language_engine, PANGO_TYPE_ENGINE_LANG);
+static void
+_pango_language_engine_break (PangoEngineLang *engine G_GNUC_UNUSED,
+ const char *item_text,
+ int item_length,
+ PangoAnalysis *analysis,
+ PangoLogAttr *attrs,
+ int attrs_len)
+{
+ break_script (item_text, item_length, analysis, attrs, attrs_len);
+}
+static void
+pango_language_engine_class_init (PangoEngineLangClass *class)
+{
+ class->script_break = _pango_language_engine_break;
+}
+static void
+pango_language_engine_init (PangoEngineLang *object)
+{
+}
+
+PangoEngineLang *
+_pango_get_language_engine (void)
+{
+ static PangoEngineLang *engine;
+ if (g_once_init_enter (&engine))
+ g_once_init_leave (&engine, g_object_new (pango_language_engine_get_type(), NULL));
+ return engine;
+}
diff --git a/pango/module-defs-fc.c.win32 b/pango/module-defs-fc.c.win32
deleted file mode 100644
index 2fe0cfb9..00000000
--- a/pango/module-defs-fc.c.win32
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Autogenerated by configure and then saved for use when compiling with
- Visual C. */
-
-#include "module-defs.h"
-
-PangoIncludedModule _pango_included_fc_modules[] = {
- { _pango_basic_fc_script_engine_list, _pango_basic_fc_script_engine_init, _pango_basic_fc_script_engine_exit, _pango_basic_fc_script_engine_create },
- { NULL, NULL, NULL, NULL },
-};
diff --git a/pango/module-defs-lang.c.win32 b/pango/module-defs-lang.c.win32
deleted file mode 100644
index d1fe979d..00000000
--- a/pango/module-defs-lang.c.win32
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Autogenerated and saved for builds using Microsoft's compiler,
- * when the configure mechanism isn't used.
- */
-
-#include "module-defs.h"
-
-PangoIncludedModule _pango_included_lang_modules[] = {
- { _pango_arabic_lang_script_engine_list, _pango_arabic_lang_script_engine_init, _pango_arabic_lang_script_engine_exit, _pango_arabic_lang_script_engine_create },
- { _pango_indic_lang_script_engine_list, _pango_indic_lang_script_engine_init, _pango_indic_lang_script_engine_exit, _pango_indic_lang_script_engine_create },
- { NULL, NULL, NULL, NULL },
-};
diff --git a/pango/module-defs-win32.c.win32 b/pango/module-defs-win32.c.win32
deleted file mode 100644
index 5c1698c6..00000000
--- a/pango/module-defs-win32.c.win32
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Autogenerated by configure and then saved for use when compiling with
- Visual C. */
-
-#include "module-defs.h"
-
-PangoIncludedModule _pango_included_win32_modules[] = {
- { _pango_basic_win32_script_engine_list, _pango_basic_win32_script_engine_init, _pango_basic_win32_script_engine_exit, _pango_basic_win32_script_engine_create },
- { NULL, NULL, NULL, NULL },
-};
diff --git a/pango/module-defs.h.win32 b/pango/module-defs.h.win32
deleted file mode 100644
index ff982698..00000000
--- a/pango/module-defs.h.win32
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Autogenerated by configure. Do not edit */
-
-#include "modules.h"
-
-extern void _pango_arabic_lang_script_engine_list (PangoEngineInfo **engines, int *n_engines);
-extern void _pango_arabic_lang_script_engine_init (GTypeModule *module);
-extern void _pango_arabic_lang_script_engine_exit (void);
-extern PangoEngine *_pango_arabic_lang_script_engine_create (const char *id);
-
-extern void _pango_basic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
-extern void _pango_basic_fc_script_engine_init (GTypeModule *module);
-extern void _pango_basic_fc_script_engine_exit (void);
-extern PangoEngine *_pango_basic_fc_script_engine_create (const char *id);
-
-extern void _pango_basic_win32_script_engine_list (PangoEngineInfo **engines, int *n_engines);
-extern void _pango_basic_win32_script_engine_init (GTypeModule *module);
-extern void _pango_basic_win32_script_engine_exit (void);
-extern PangoEngine *_pango_basic_win32_script_engine_create (const char *id);
-
-extern void _pango_basic_coretext_script_engine_list (PangoEngineInfo **engines, int *n_engines);
-extern void _pango_basic_coretext_script_engine_init (GTypeModule *module);
-extern void _pango_basic_coretext_script_engine_exit (void);
-extern PangoEngine *_pango_basic_coretext_script_engine_create (const char *id);
-
-extern void _pango_indic_lang_script_engine_list (PangoEngineInfo **engines, int *n_engines);
-extern void _pango_indic_lang_script_engine_init (GTypeModule *module);
-extern void _pango_indic_lang_script_engine_exit (void);
-extern PangoEngine *_pango_indic_lang_script_engine_create (const char *id);
-
diff --git a/pango/pango-context.c b/pango/pango-context.c
index b353d8ef..dafc5dd1 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -36,9 +36,7 @@
#include "pango-context.h"
#include "pango-impl-utils.h"
-#include "pango-engine.h"
#include "pango-engine-private.h"
-#include "pango-modules.h"
#include "pango-script-private.h"
/**
@@ -1279,20 +1277,6 @@ compute_derived_language (PangoLanguage *lang,
return derived_lang;
}
-static PangoMap *
-get_lang_map (PangoLanguage *lang)
-{
- static guint engine_type_id = 0; /* MT-safe */
- static guint render_type_id = 0; /* MT-safe */
-
- if (engine_type_id == 0)
- engine_type_id = g_quark_from_static_string (PANGO_ENGINE_TYPE_LANG);
- if (render_type_id == 0)
- render_type_id = g_quark_from_static_string (PANGO_RENDER_TYPE_NONE);
-
- return pango_find_map (lang, engine_type_id, render_type_id);
-}
-
static void
itemize_state_update_for_new_run (ItemizeState *state)
{
@@ -1338,8 +1322,7 @@ itemize_state_update_for_new_run (ItemizeState *state)
if ((state->changed & DERIVED_LANG_CHANGED) || !state->lang_engine)
{
- PangoMap *lang_map = get_lang_map (state->derived_lang);
- state->lang_engine = (PangoEngineLang *)pango_map_get_engine (lang_map, state->script);
+ state->lang_engine = _pango_get_language_engine ();
}
if (state->changed & (FONT_CHANGED | DERIVED_LANG_CHANGED) &&
diff --git a/pango/pango-engine-private.h b/pango/pango-engine-private.h
index 760144ec..de54ee09 100644
--- a/pango/pango-engine-private.h
+++ b/pango/pango-engine-private.h
@@ -40,7 +40,9 @@ PangoCoverageLevel _pango_engine_shape_covers (PangoEngineShape *engine,
PangoLanguage *language,
gunichar wc);
-PangoEngineShape *_pango_get_fallback_shaper (void);
+PangoEngineShape *_pango_get_fallback_shaper (void) /* XXX got to go when we switch to harfbuzz-only. */;
+
+PangoEngineLang *_pango_get_language_engine (void);
G_END_DECLS