diff options
author | Tor Lillqvist <tml@iki.fi> | 2001-11-03 00:44:35 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2001-11-03 00:44:35 +0000 |
commit | bee6f66b5e393213d328afd14a9ac4cb926a0b9f (patch) | |
tree | 4d3686e4570f05d4da5c4b7f596a5087ed8bf164 /gtk/gtkimmodule.c | |
parent | 1d15be159965ca4465127a3d1f7833a47080fa5a (diff) | |
download | gtk+-bee6f66b5e393213d328afd14a9ac4cb926a0b9f.tar.gz |
Correct some renamed functions.
2001-11-03 Tor Lillqvist <tml@iki.fi>
* gtk/gtk.def: Correct some renamed functions.
* gtk/gtkimmodule.c (correct_libdir_prefix): New function, used on
Windows to turn build-time paths from a gtk.immodules distributed
as part of a binary package into runtime ones in the
end-user-chosen installation directory.
(gtk_im_module_init): Use it for module path and domain
directory.
Diffstat (limited to 'gtk/gtkimmodule.c')
-rw-r--r-- | gtk/gtkimmodule.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c index ea40819e37..1be18f554d 100644 --- a/gtk/gtkimmodule.c +++ b/gtk/gtkimmodule.c @@ -33,6 +33,7 @@ #include <pango/pango-utils.h> #include "gtkimmodule.h" #include "gtkimcontextsimple.h" +#include "gtkprivate.h" #include "gtkrc.h" #include "config.h" #include "gtkintl.h" @@ -222,6 +223,28 @@ add_module (GtkIMModule *module, GSList *infos) modules_list = g_slist_prepend (modules_list, module); } +#ifdef G_OS_WIN32 +static void +correct_libdir_prefix (gchar **path) +{ + if (strncmp (*path, GTK_LIBDIR, strlen (GTK_LIBDIR)) == 0) + { + /* This is an entry put there by make install on the + * packager's system. On Windows a prebuilt GTK+ + * package can be installed in a random + * location. The gtk.immodules file distributed in + * such a package contains paths from the package + * builder's machine. Replace the path with the real + * one on this machine. + */ + gchar *tem = *path; + *path = g_strconcat (GTK_LIBDIR, tem + strlen (GTK_LIBDIR), NULL); + g_free (tem); + } +} +#endif + + static void gtk_im_module_init () { @@ -280,6 +303,9 @@ gtk_im_module_init () } module->path = g_strdup (tmp_buf->str); +#ifdef G_OS_WIN32 + correct_libdir_prefix (&module->path); +#endif g_type_module_set_name (G_TYPE_MODULE (module), module->path); } else @@ -303,6 +329,9 @@ gtk_im_module_init () if (!pango_scan_string (&p, tmp_buf)) goto context_error; info->domain_dirname = g_strdup (tmp_buf->str); +#ifdef G_OS_WIN32 + correct_libdir_prefix (&info->domain_dirname); +#endif if (!pango_scan_string (&p, tmp_buf)) goto context_error; |