#include "gtkmodules.h"
#include "gtksettings.h"
#include "gtkdebug.h"
-#include "gtkprivate.h" /* GTK_LIBDIR */
-#include "gtkmainprivate.h"
+#include "gtkprivate.h"
+#include "gtkmodulesprivate.h"
#include "gtkintl.h"
#include <gmodule.h>
if (exe_prefix)
default_dir = g_build_filename (exe_prefix, "lib", "gtk-3.0", NULL);
else
- default_dir = g_build_filename (GTK_LIBDIR, "gtk-3.0", NULL);
+ default_dir = g_build_filename (_gtk_get_libdir (), "gtk-3.0", NULL);
if (module_path_env && home_gtk_dir)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
}
static gboolean
-module_is_blacklisted (const gchar *name)
+module_is_blacklisted (const gchar *name,
+ gboolean verbose)
{
if (g_str_equal (name, "gail"))
{
- g_message ("Not loading module \"gail\": The functionality is provided by GTK natively. Please try to not load it.");
+ if (verbose)
+ g_message ("Not loading module \"gail\": The functionality is provided by GTK natively. Please try to not load it.");
+
return TRUE;
}
info->ref_count++;
success = TRUE;
+ break;
}
+ info = NULL;
}
if (!success)
{
/* Do the check this late so we only warn about existing modules,
* not old modules that are still in the modules path. */
- if (module_is_blacklisted (name))
+ if (module_is_blacklisted (name, TRUE))
{
modinit_func = NULL;
success = TRUE;
}
}
- if (success)
+ if (success && info)
{
if (!g_slist_find (module_list, info))
{
}
else
{
- const gchar *error = g_module_error ();
+ if (!module_is_blacklisted (name, FALSE))
+ {
+ const gchar *error = g_module_error ();
- g_message ("Failed to load module \"%s\"%s%s",
- name, error ? ": " : "", error ? error : "");
+ g_message ("Failed to load module \"%s\"%s%s",
+ name, error ? ": " : "", error ? error : "");
+ }
}
return module_list;
for (i = 0; i < gdk_display_get_n_screens (display); i++)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_STRING);
new_modules,
settings_destroy_notify);
}
+
+/* Return TRUE if module_to_check causes version conflicts.
+ * If module_to_check is NULL, check the main module.
+ */
+gboolean
+_gtk_module_has_mixed_deps (GModule *module_to_check)
+{
+ GModule *module;
+ gpointer func;
+ gboolean result;
+
+ if (!module_to_check)
+ module = g_module_open (NULL, 0);
+ else
+ module = module_to_check;
+
+ if (g_module_symbol (module, "gtk_progress_get_type", &func))
+ result = TRUE;
+ else
+ result = FALSE;
+
+ if (!module_to_check)
+ g_module_close (module);
+
+ return result;
+}