diff --git a/ChangeLog b/ChangeLog index e0118971c9..fdf2605464 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Mon Feb 18 23:16:16 2002 Owen Taylor + + * gtk/gtkmain.[ch]: Add routines _gtk_find_module(), + _gtk_get_module_path() to look up a module of an arbitrary type in + a standard fashion. (#68474) + + * gtk/gtkrc.c: Make module_path keyword warn and do + nothing. Remove the im_module_path keyword. + + * gtk/gtkrc.c (gtk_rc_get_im_module_path): Fix + to return the standard path instead of one determined + from im_module_path and GTK_IM_MODULE_PATH. + + * gtk+-2.0.pc.in: Add gtk_host to go along with gtk_binary_version. + 2002-02-19 Matthias Clasen * docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index e0118971c9..fdf2605464 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,18 @@ +Mon Feb 18 23:16:16 2002 Owen Taylor + + * gtk/gtkmain.[ch]: Add routines _gtk_find_module(), + _gtk_get_module_path() to look up a module of an arbitrary type in + a standard fashion. (#68474) + + * gtk/gtkrc.c: Make module_path keyword warn and do + nothing. Remove the im_module_path keyword. + + * gtk/gtkrc.c (gtk_rc_get_im_module_path): Fix + to return the standard path instead of one determined + from im_module_path and GTK_IM_MODULE_PATH. + + * gtk+-2.0.pc.in: Add gtk_host to go along with gtk_binary_version. + 2002-02-19 Matthias Clasen * docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e0118971c9..fdf2605464 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,18 @@ +Mon Feb 18 23:16:16 2002 Owen Taylor + + * gtk/gtkmain.[ch]: Add routines _gtk_find_module(), + _gtk_get_module_path() to look up a module of an arbitrary type in + a standard fashion. (#68474) + + * gtk/gtkrc.c: Make module_path keyword warn and do + nothing. Remove the im_module_path keyword. + + * gtk/gtkrc.c (gtk_rc_get_im_module_path): Fix + to return the standard path instead of one determined + from im_module_path and GTK_IM_MODULE_PATH. + + * gtk+-2.0.pc.in: Add gtk_host to go along with gtk_binary_version. + 2002-02-19 Matthias Clasen * docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index e0118971c9..fdf2605464 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,18 @@ +Mon Feb 18 23:16:16 2002 Owen Taylor + + * gtk/gtkmain.[ch]: Add routines _gtk_find_module(), + _gtk_get_module_path() to look up a module of an arbitrary type in + a standard fashion. (#68474) + + * gtk/gtkrc.c: Make module_path keyword warn and do + nothing. Remove the im_module_path keyword. + + * gtk/gtkrc.c (gtk_rc_get_im_module_path): Fix + to return the standard path instead of one determined + from im_module_path and GTK_IM_MODULE_PATH. + + * gtk+-2.0.pc.in: Add gtk_host to go along with gtk_binary_version. + 2002-02-19 Matthias Clasen * docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e0118971c9..fdf2605464 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,18 @@ +Mon Feb 18 23:16:16 2002 Owen Taylor + + * gtk/gtkmain.[ch]: Add routines _gtk_find_module(), + _gtk_get_module_path() to look up a module of an arbitrary type in + a standard fashion. (#68474) + + * gtk/gtkrc.c: Make module_path keyword warn and do + nothing. Remove the im_module_path keyword. + + * gtk/gtkrc.c (gtk_rc_get_im_module_path): Fix + to return the standard path instead of one determined + from im_module_path and GTK_IM_MODULE_PATH. + + * gtk+-2.0.pc.in: Add gtk_host to go along with gtk_binary_version. + 2002-02-19 Matthias Clasen * docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e0118971c9..fdf2605464 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,18 @@ +Mon Feb 18 23:16:16 2002 Owen Taylor + + * gtk/gtkmain.[ch]: Add routines _gtk_find_module(), + _gtk_get_module_path() to look up a module of an arbitrary type in + a standard fashion. (#68474) + + * gtk/gtkrc.c: Make module_path keyword warn and do + nothing. Remove the im_module_path keyword. + + * gtk/gtkrc.c (gtk_rc_get_im_module_path): Fix + to return the standard path instead of one determined + from im_module_path and GTK_IM_MODULE_PATH. + + * gtk+-2.0.pc.in: Add gtk_host to go along with gtk_binary_version. + 2002-02-19 Matthias Clasen * docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e0118971c9..fdf2605464 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,18 @@ +Mon Feb 18 23:16:16 2002 Owen Taylor + + * gtk/gtkmain.[ch]: Add routines _gtk_find_module(), + _gtk_get_module_path() to look up a module of an arbitrary type in + a standard fashion. (#68474) + + * gtk/gtkrc.c: Make module_path keyword warn and do + nothing. Remove the im_module_path keyword. + + * gtk/gtkrc.c (gtk_rc_get_im_module_path): Fix + to return the standard path instead of one determined + from im_module_path and GTK_IM_MODULE_PATH. + + * gtk+-2.0.pc.in: Add gtk_host to go along with gtk_binary_version. + 2002-02-19 Matthias Clasen * docs/tutorial/gtk-tut.sgml, docs/examples/*: Trivial formatting diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 13bc0125b3..0ae970070c 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 18 23:00:52 2002 Owen Taylor + + * gtk/running.sgml: Remove docs for GTK_IM_MODULE_PATH, + replace docs for GTK_MODULE_PATH with docs for GTK_PATH. + Sun Feb 17 21:33:33 2002 Owen Taylor * gtk/gtk-sections.txt: Updated for filesel changes. diff --git a/docs/reference/gtk/running.sgml b/docs/reference/gtk/running.sgml index 5365173543..8b78fedd53 100644 --- a/docs/reference/gtk/running.sgml +++ b/docs/reference/gtk/running.sgml @@ -205,18 +205,42 @@ or DISPLAY; mostly to determine paths to look for certain files. - <envar>GTK_MODULE_PATH</envar> + <envar>GTK_PATH</envar> - A list of directories to search for modules before the default module - directory, which is <libdir>/gtk-2.0/modules. - (If GTK_EXE_PREFIX is defined, <libdir> is + Specifies a list of directories to search when GTK+ is looking for + dynamically loaded objects such as the modules specified by + GTK_MODULES, theme engines, and input method + modules. If the path to the dynamically loaded object is given + as an absolute path name, then GTK+ loads it directly. Otherwise, + GTK+ goes in turn through the directories in GTK_PATH, followed + by the directory .gtk-2.0 in the user's home + directory, followed by the system default directory, + which is libdir/gtk-2.0/modules. + (If GTK_EXE_PREFIX is defined, libdir is $GTK_EXE_PREFIX/lib. Otherwise it is the libdir - specified when GTK+ was configured, usually - /usr/local/lib.) - For each directory in the list, GTK+ actually looks first in - a subdirectory named after the version number of GTK+, then in the - directory itself and finally in the system-specific library path. + specified when GTK+ was configured, usually + /usr/lib, or + /usr/local/lib.) + For each directory in this list, GTK+ actually looks in a + subdirectory + directory/version/host/type + Where version is derived from the + version of GTK+ (use pkg-config + --variable=gtk_binary_version gtk+-2.0 to determine this from a + script), host is the architecture on + which GTK+ was built. (use pkg-config + --variable=gtk_host gtk+-2.0 to determine this from a + script), and type is a directory + specific to the type of modules; currently it can be + modules, engines or + immodules corresponding to the three types of + modules above. Either version, + host, or both may be omitted. GTK+ looks + first in the most specific directory, then in directories with + fewer components. + The components of GTK_PATH are separated by the ':' character on + Linux and Unix, and the ';' character on Windows. @@ -229,19 +253,6 @@ or DISPLAY; mostly to determine paths to look for certain files. - - <envar>GTK_IM_MODULE_PATH</envar> - - - Specifies the path where GTK+ looks for IM modules. This environment - variable overwrites the im_module_path specified in the - RC files, which in turn overwrites the default - value $lt;libdir$gt;/gtk-2.0/immodules/<version> - (where <version> is the GTK+ version, and <libdir> is as - explained above). - - - <envar>GTK_IM_MODULE_FILE</envar> @@ -249,8 +260,8 @@ or DISPLAY; mostly to determine paths to look for certain files. Specifies the file listing the IM modules to load. This environment variable overwrites the im_module_file specified in the RC files, which in turn overwrites the default value - <sysconfdir>/gtk-2.0/gtk.immodules - (<sysconfdir> is the sysconfdir specified when GTK+ was configured, + sysconfdir/gtk-2.0/gtk.immodules + (sysconfdir is the sysconfdir specified when GTK+ was configured, usually /usr/local/etc.) @@ -294,7 +305,7 @@ nevertheless. Specifies the directory to look for GdkPixbuf loader modules. By default, GdkPixbuf looks for its loaders in - <libdir>/gtk-2.0/<version>/loaders. + libdir/gtk-2.0/version/loaders. diff --git a/docs/reference/gtk/tmpl/gtkrc.sgml b/docs/reference/gtk/tmpl/gtkrc.sgml index 58596be833..29bcfbdbf9 100644 --- a/docs/reference/gtk/tmpl/gtkrc.sgml +++ b/docs/reference/gtk/tmpl/gtkrc.sgml @@ -776,12 +776,10 @@ that was expected but not found. -Looks up a file in the current module path. @module_file: The name of the module to search for. -@Returns: The filename, if found (must be freed with g_free()), -otherwise %NULL. +@Returns: diff --git a/gtk+-2.0.pc.in b/gtk+-2.0.pc.in index 97bd6e649b..8cfa00af80 100644 --- a/gtk+-2.0.pc.in +++ b/gtk+-2.0.pc.in @@ -5,6 +5,7 @@ includedir=@includedir@ target=@gdktarget@ gtk_binary_version=@GTK_BINARY_VERSION@ +gtk_host=@host@ Name: GTK+ Description: GIMP Tool Kit (${target} target) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index f7c3145ced..57701300fd 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -10,6 +10,7 @@ INCLUDES = @STRIP_BEGIN@ \ -DGTK_LOCALEDIR=\"$(gtklocaledir)\" \ -DGTK_VERSION=\"@GTK_VERSION@\" \ -DGTK_BINARY_VERSION=\"@GTK_BINARY_VERSION@\" \ + -DGTK_HOST=\"@host@\" \ -DGTK_COMPILATION \ -I$(top_builddir)/gtk \ -I$(top_srcdir) -I../gdk \ diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index a6d5c1975a..2c3f202173 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -282,73 +282,158 @@ _gtk_get_data_prefix (void) static gchar ** get_module_path (void) { - const gchar *module_path_env = g_getenv ("GTK_MODULE_PATH"); - const gchar *exe_prefix = g_getenv ("GTK_EXE_PREFIX"); - gchar **result; + const gchar *module_path_env; + const gchar *exe_prefix; + const gchar *home_dir; + gchar *home_gtk_dir = NULL; gchar *module_path; gchar *default_dir; + static gchar **result = NULL; + + if (result) + return result; + + home_dir = g_get_home_dir(); + if (home_dir) + home_gtk_dir = g_build_filename (home_dir, ".gtk-2.0", NULL); + + module_path_env = g_getenv ("GTK_PATH"); + exe_prefix = g_getenv ("GTK_EXE_PREFIX"); if (exe_prefix) - default_dir = g_build_filename (exe_prefix, "lib", "gtk-2.0", "modules", NULL); + default_dir = g_build_filename (exe_prefix, "lib", "gtk-2.0", NULL); else - default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", "modules", NULL); + default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL); - module_path = g_strconcat (module_path_env ? module_path_env : "", - module_path_env ? G_SEARCHPATH_SEPARATOR_S : "", - default_dir, NULL); + if (module_path_env && home_gtk_dir) + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, + module_path_env, home_gtk_dir, default_dir, NULL); + else if (module_path_env) + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, + module_path_env, default_dir, NULL); + else if (home_gtk_dir) + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, + home_gtk_dir, default_dir, NULL); + else + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, + default_dir, NULL); + + g_free (home_gtk_dir); + g_free (default_dir); result = pango_split_file_list (module_path); - - g_free (default_dir); g_free (module_path); return result; } +/** + * _gtk_get_module_path: + * @type: the type of the module, for instance 'modules', 'engines', immodules' + * + * Determines the search path for a particular type of module. + * + * Return value: the search path for the module type. Free with g_strfreev(). + **/ +gchar ** +_gtk_get_module_path (const gchar *type) +{ + gchar **paths = get_module_path(); + gchar **path; + gchar **result; + gint count = 0; + + for (path = paths; *path; path++) + count++; + + result = g_new (gchar *, count * 4 + 1); + + count = 0; + for (path = get_module_path (); *path; path++) + { + gint use_version, use_host; + + for (use_version = TRUE; use_version >= FALSE; use_version--) + for (use_host = TRUE; use_host >= FALSE; use_host--) + { + gchar *tmp_dir; + + if (use_version && use_host) + tmp_dir = g_build_filename (*path, GTK_BINARY_VERSION, GTK_HOST, type, NULL); + else if (use_version) + tmp_dir = g_build_filename (*path, GTK_BINARY_VERSION, type, NULL); + else if (use_host) + tmp_dir = g_build_filename (*path, GTK_HOST, type, NULL); + else + tmp_dir = g_build_filename (*path, type, NULL); + + result[count++] = tmp_dir; + } + } + + result[count++] = NULL; + + return result; +} + +/** + * _gtk_find_module: + * @name: the name of the module + * @type: the type of the module, for instance 'modules', 'engines', immodules' + * + * Looks for a dynamically module named @name of type @type in the standard GTK+ + * module search path. + * + * Return value: the pathname to the found module, or %NULL if it wasn't found. + * Free with g_free(). + **/ +gchar * +_gtk_find_module (const gchar *name, + const gchar *type) +{ + gchar **paths; + gchar **path; + gchar *module_name = NULL; + + if (g_path_is_absolute (name)) + return g_strdup (name); + + paths = _gtk_get_module_path (type); + for (path = paths; *path; path++) + { + gchar *tmp_name = g_module_build_path (*path, name); + + if (g_file_test (tmp_name, G_FILE_TEST_EXISTS)) + { + module_name = tmp_name; + goto found; + } + else + g_free(tmp_name); + } + + g_strfreev (paths); + + found: + return module_name; +} + static GModule * find_module (gchar **module_path, const gchar *name) { GModule *module; gchar *module_name; - gint i; - if (g_path_is_absolute (name)) - return g_module_open (name, G_MODULE_BIND_LAZY); - - for (i = 0; module_path[i]; i++) + module_name = _gtk_find_module (name, "modules"); + if (!module_name) { - gchar *version_directory; - - version_directory = g_build_filename (module_path[i], GTK_BINARY_VERSION, NULL); - module_name = g_module_build_path (version_directory, name); - g_free (version_directory); - - if (g_file_test (module_name, G_FILE_TEST_EXISTS)) - { - module = g_module_open (module_name, G_MODULE_BIND_LAZY); - g_free (module_name); - return module; - } - - g_free (module_name); - - module_name = g_module_build_path (module_path[i], name); - - if (g_file_test (module_name, G_FILE_TEST_EXISTS)) - { - module = g_module_open (module_name, G_MODULE_BIND_LAZY); - g_free (module_name); - return module; - } - - g_free (module_name); + /* As last resort, try loading without an absolute path (using system + * library path) + */ + module_name = g_module_build_path (NULL, name); } - - /* As last resort, try loading without an absolute path (using system - * library path) - */ - module_name = g_module_build_path (NULL, name); + module = g_module_open (module_name, G_MODULE_BIND_LAZY); g_free(module_name); diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h index 97b24b98ae..1f010d4943 100644 --- a/gtk/gtkmain.h +++ b/gtk/gtkmain.h @@ -204,6 +204,9 @@ gboolean _gtk_boolean_handled_accumulator (GSignalInvocationHint *ihint, const GValue *handler_return, gpointer dummy); +gchar * _gtk_find_module (const gchar *name, + const gchar *type); +gchar **_gtk_get_module_path (const gchar *type); #ifdef __cplusplus } diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 8d3d7ec187..1aa56683a0 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -52,6 +52,7 @@ #include "gtkthemes.h" #include "gtkintl.h" #include "gtkiconfactory.h" +#include "gtkmain.h" #include "gtkprivate.h" #include "gtksettings.h" #include "gtkwindow.h" @@ -166,8 +167,6 @@ static void gtk_rc_parse_pixmap_path_string (GtkRcContext *context, GScanner *scanner, const gchar *pix_path); static guint gtk_rc_parse_module_path (GScanner *scanner); -static void gtk_rc_parse_module_path_string (const gchar *mod_path); -static guint gtk_rc_parse_im_module_path (GScanner *scanner); static guint gtk_rc_parse_im_module_file (GScanner *scanner); static guint gtk_rc_parse_path_pattern (GtkRcContext *context, GScanner *scanner); @@ -179,7 +178,6 @@ static void gtk_rc_clear_hash_node (gpointer key, gpointer data, gpointer user_data); static void gtk_rc_clear_styles (GtkRcContext *context); -static void gtk_rc_append_default_module_path (void); static void gtk_rc_add_initial_default_files (void); static void gtk_rc_style_init (GtkRcStyle *style); @@ -272,7 +270,6 @@ static const struct { "engine", GTK_RC_TOKEN_ENGINE }, { "module_path", GTK_RC_TOKEN_MODULE_PATH }, { "stock", GTK_RC_TOKEN_STOCK }, - { "im_module_path", GTK_RC_TOKEN_IM_MODULE_PATH }, { "im_module_file", GTK_RC_TOKEN_IM_MODULE_FILE }, { "LTR", GTK_RC_TOKEN_LTR }, { "RTL", GTK_RC_TOKEN_RTL } @@ -280,15 +277,11 @@ static const struct static GHashTable *realized_style_ht = NULL; -static gchar *im_module_path = NULL; static gchar *im_module_file = NULL; #define GTK_RC_MAX_DEFAULT_FILES 128 static gchar *gtk_rc_default_files[GTK_RC_MAX_DEFAULT_FILES]; -#define GTK_RC_MAX_MODULE_PATHS 128 -static gchar *module_path[GTK_RC_MAX_MODULE_PATHS]; - /* A stack of directories for RC files we are parsing currently. * these are implicitely added to the end of PIXMAP_PATHS */ @@ -317,29 +310,25 @@ gtk_rc_make_default_dir (const gchar *type) * look for IM modules. * * Obtains the path in which to look for IM modules. See the documentation - * of the GTK_IM_MODULE_PATH - * environment variable for more details. + * of the GTK_PATH + * environment variable for more details about looking up modules. This + * function is useful solely for utilities supplied with GTK+ and should + * not be used by applications under normal circumstances. */ gchar * gtk_rc_get_im_module_path (void) { - const gchar *result = g_getenv ("GTK_IM_MODULE_PATH"); + gchar **paths = _gtk_get_module_path ("immodules"); + gchar *result = g_strjoinv (G_SEARCHPATH_SEPARATOR_S, paths); + g_strfreev (paths); - if (!result) - { - if (im_module_path) - result = im_module_path; - else - return gtk_rc_make_default_dir ("immodules"); - } - - return g_strdup (result); + return result; } /** * gtk_rc_get_im_module_file: * @returns: a newly-allocated string containing the name of the file - * listing the IM modules to load + * listing the IM modules available for loading * * Obtains the path to the IM modules file. See the documentation * of the GTK_IM_MODULE_FILE @@ -382,33 +371,6 @@ gtk_rc_get_module_dir (void) return gtk_rc_make_default_dir ("engines"); } -static void -gtk_rc_append_default_module_path (void) -{ - const gchar *var; - gchar *path; - gint n; - - for (n = 0; module_path[n]; n++) ; - if (n >= GTK_RC_MAX_MODULE_PATHS - 1) - return; - - var = g_getenv ("GTK_EXE_PREFIX"); - if (var) - path = g_build_filename (var, "lib", "gtk-2.0", GTK_VERSION, "engines", NULL); - else - path = g_build_filename (GTK_LIBDIR, "gtk-2.0", GTK_VERSION, "engines", NULL); - module_path[n++] = path; - - var = g_get_home_dir (); - if (var) - { - path = g_build_filename (var, ".gtk-2.0", GTK_VERSION, "engines", NULL); - module_path[n++] = path; - } - module_path[n] = NULL; -} - static void gtk_rc_add_initial_default_files (void) { @@ -655,9 +617,6 @@ _gtk_rc_init (void) { initialized = TRUE; - module_path[0] = NULL; - gtk_rc_append_default_module_path(); - gtk_rc_add_initial_default_files (); } @@ -2265,9 +2224,6 @@ gtk_rc_parse_statement (GtkRcContext *context, case GTK_RC_TOKEN_MODULE_PATH: return gtk_rc_parse_module_path (scanner); - case GTK_RC_TOKEN_IM_MODULE_PATH: - return gtk_rc_parse_im_module_path (scanner); - case GTK_RC_TOKEN_IM_MODULE_FILE: return gtk_rc_parse_im_module_file (scanner); @@ -2873,28 +2829,20 @@ gtk_rc_find_pixmap_in_path (GtkSettings *settings, return NULL; } +/** + * gtk_rc_find_module_in_path: + * @module_file: name of a theme engine + * + * Searches for a theme engine in the GTK+ search path. This function + * is not useful for applications and should not be used. + * + * Return value: The filename, if found (must be freed with g_free()), + * otherwise %NULL. + **/ gchar* gtk_rc_find_module_in_path (const gchar *module_file) { - gint i; - gint fd; - gchar *buf; - - for (i = 0; (i < GTK_RC_MAX_MODULE_PATHS) && (module_path[i] != NULL); i++) - { - buf = g_build_filename (module_path[i], module_file, NULL); - - fd = open (buf, O_RDONLY); - if (fd >= 0) - { - close (fd); - return buf; - } - - g_free (buf); - } - - return NULL; + return _gtk_find_module (module_file, "engines"); } static guint @@ -3328,30 +3276,9 @@ gtk_rc_parse_module_path (GScanner *scanner) token = g_scanner_get_next_token (scanner); if (token != G_TOKEN_STRING) return G_TOKEN_STRING; - - gtk_rc_parse_module_path_string (scanner->value.v_string); - - return G_TOKEN_NONE; -} -static guint -gtk_rc_parse_im_module_path (GScanner *scanner) -{ - guint token; + g_warning ("module_path directive is now ignored\n"); - token = g_scanner_get_next_token (scanner); - if (token != GTK_RC_TOKEN_IM_MODULE_FILE) - return GTK_RC_TOKEN_IM_MODULE_FILE; - - token = g_scanner_get_next_token (scanner); - if (token != G_TOKEN_STRING) - return G_TOKEN_STRING; - - if (im_module_path) - g_free (im_module_path); - - im_module_path = g_strdup (scanner->value.v_string); - return G_TOKEN_NONE; } @@ -3376,39 +3303,6 @@ gtk_rc_parse_im_module_file (GScanner *scanner) return G_TOKEN_NONE; } -static void -gtk_rc_parse_module_path_string (const gchar *mod_path) -{ - gint end_offset; - gint start_offset = 0; - gint path_len; - gint path_num; - - /* free the old one, or just add to the old one ? */ - for (path_num=0; module_path[path_num]; path_num++) - { - g_free (module_path[path_num]); - module_path[path_num] = NULL; - } - - path_num = 0; - - path_len = strlen (mod_path); - - for (end_offset = 0; end_offset <= path_len; end_offset++) - { - if ((mod_path[end_offset] == G_SEARCHPATH_SEPARATOR) || - (end_offset == path_len)) - { - module_path[path_num] = g_strndup (mod_path + start_offset, end_offset - start_offset); - path_num++; - module_path[path_num] = NULL; - start_offset = end_offset + 1; - } - } - gtk_rc_append_default_module_path(); -} - static guint gtk_rc_parse_path_pattern (GtkRcContext *context, GScanner *scanner)