summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2000-12-15 19:47:45 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-12-15 19:47:45 +0000
commitf4c71c29b3b9b67d746ea23b17ce28b126911f54 (patch)
tree5fc26aaaeca165ebce07cf0dd3d20243bd19cbd3 /pango
parenta8ea5ad3907b28d0361957a4f165cf31cc4fc2fc (diff)
downloadpango-f4c71c29b3b9b67d746ea23b17ce28b126911f54.tar.gz
touch sysconfdir/pango/pango.modules even if there are no dynamic modules,
2000-12-15 Havoc Pennington <hp@redhat.com> * modules/Makefile.am (install-data-local): touch sysconfdir/pango/pango.modules even if there are no dynamic modules, so pango won't spew warnings about pango.modules not existing, and to simplify RPM file lists * pango/pango-context.c (fallback_engine_shape): fix this to avoid incrementing i twice (fallback_shaper): fix initializer * pango/querymodules.c (query_module): don't call g_module_close() on a module that doesn't get opened successfully * pango/modules.c: do not include modules.h (init_modules): do not do the builtin modules here, they are done by pangox * pango/pangox.c (pango_x_get_context): register included modules here * pango/pangoxft-font.c: do not include modules.h * pango/Makefile.am (libpango_la_SOURCES): move modules.c, back in here (but not modules.h, which actually goes with module-defs.c)
Diffstat (limited to 'pango')
-rw-r--r--pango/Makefile.am2
-rw-r--r--pango/modules.c17
-rw-r--r--pango/pango-context.c15
-rw-r--r--pango/pangox.c17
-rw-r--r--pango/pangoxft-font.c2
-rw-r--r--pango/querymodules.c3
6 files changed, 29 insertions, 27 deletions
diff --git a/pango/Makefile.am b/pango/Makefile.am
index 7ffb4114..02e2a871 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -28,6 +28,7 @@ libpango_la_SOURCES = \
fonts.c \
glyphstring.c \
mapping.c \
+ modules.c \
pango-attributes.c \
pango-context.c \
pango-coverage.c \
@@ -43,7 +44,6 @@ libpango_la_SOURCES = \
shape.c
libpangox_la_SOURCES = \
- modules.c \
modules.h \
module-defs.c \
pangox.c \
diff --git a/pango/modules.c b/pango/modules.c
index 6e95027f..7e5c7ec5 100644
--- a/pango/modules.c
+++ b/pango/modules.c
@@ -31,7 +31,6 @@
#include "pango-modules.h"
#include "pango-utils.h"
-#include "modules.h"
typedef struct _PangoMapInfo PangoMapInfo;
typedef struct _PangoEnginePair PangoEnginePair;
@@ -199,22 +198,11 @@ handle_included_module (PangoIncludedModule *module,
pair->included = TRUE;
pair->load_info = module;
pair->engine = NULL;
-
+
*engine_list = g_slist_prepend (*engine_list, pair);
}
}
-static void
-add_builtin_modules (void)
-{
- int i;
-
- for (i = 0; _pango_included_modules[i].list; i++)
- handle_included_module (&_pango_included_modules[i], &builtin_engines);
-
- builtin_engines = g_slist_reverse (builtin_engines);
-}
-
static gboolean /* Returns true if succeeded, false if failed */
process_module_file (FILE *module_file)
{
@@ -392,8 +380,7 @@ init_modules (void)
return;
else
init = TRUE;
-
- add_builtin_modules ();
+
read_modules ();
}
diff --git a/pango/pango-context.c b/pango/pango-context.c
index fb1e71e9..26bd386f 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -666,7 +666,7 @@ fallback_engine_shape (PangoFont *font,
{
int n_chars;
int i;
- char *p;
+ const char *p;
g_return_if_fail (font != NULL);
g_return_if_fail (text != NULL);
@@ -675,9 +675,10 @@ fallback_engine_shape (PangoFont *font,
n_chars = g_utf8_strlen (text, length);
pango_glyph_string_set_size (glyphs, n_chars);
-
+
p = text;
- for (i = 0; i < n_chars; i++)
+ i = 0;
+ while (i < n_chars)
{
glyphs->glyphs[i].glyph = 0;
@@ -707,9 +708,11 @@ fallback_engine_get_coverage (PangoFont *font,
}
static PangoEngineShape fallback_shaper = {
- "FallbackScriptEngine",
- PANGO_ENGINE_TYPE_SHAPE,
- sizeof (PangoEngineShape),
+ {
+ "FallbackScriptEngine",
+ PANGO_ENGINE_TYPE_SHAPE,
+ sizeof (PangoEngineShape)
+ },
fallback_engine_shape,
fallback_engine_get_coverage
};
diff --git a/pango/pangox.c b/pango/pangox.c
index fe72da5e..7dd7f00c 100644
--- a/pango/pangox.c
+++ b/pango/pangox.c
@@ -29,6 +29,7 @@
#include "pango-utils.h"
#include "pangox-private.h"
#include "pango-intset.h"
+#include "modules.h"
#define PANGO_LIGATURE_HACK_DEBUG
@@ -246,9 +247,19 @@ pango_x_get_context (Display *display)
{
PangoContext *result;
PangoXContextInfo *info;
-
- g_return_val_if_fail (display != NULL, NULL);
-
+ int i;
+ static gboolean registered_modules = FALSE;
+
+ g_return_val_if_fail (display != NULL, NULL);
+
+ if (!registered_modules)
+ {
+ registered_modules = TRUE;
+
+ for (i = 0; _pango_included_modules[i].list; i++)
+ pango_module_register (&_pango_included_modules[i]);
+ }
+
result = pango_context_new ();
info = g_new (PangoXContextInfo, 1);
diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c
index 1c9330bb..38857564 100644
--- a/pango/pangoxft-font.c
+++ b/pango/pangoxft-font.c
@@ -21,7 +21,7 @@
#include "pangoxft-private.h"
#include "X11/Xft/XftFreetype.h"
-#include "modules.h"
+#include "pango-modules.h"
#define PANGO_XFT_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_FONT, PangoXftFont))
#define PANGO_XFT_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_XFT_FONT, PangoXftFontClass))
diff --git a/pango/querymodules.c b/pango/querymodules.c
index 7ce2feb5..58945522 100644
--- a/pango/querymodules.c
+++ b/pango/querymodules.c
@@ -102,7 +102,8 @@ query_module (const char *dir, const char *name)
}
g_free (path);
- g_module_close (module);
+ if (module)
+ g_module_close (module);
}
int main (int argc, char **argv)