]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkmodules.c
Change FSF Address
[~andy/gtk] / gtk / gtkmodules.c
index d4135f0f7c5fca65cc5fe39cb521222d545ece7d..0308ce842ba11448c3ff4cc980afde79d59c1e5a 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser 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.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -25,8 +23,8 @@
 #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>
@@ -74,7 +72,7 @@ get_module_path (void)
   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,
@@ -295,7 +293,9 @@ load_module (GSList      *module_list,
              info->ref_count++;
              
              success = TRUE;
+              break;
            }
+          info = NULL;
        }
 
       if (!success)
@@ -377,7 +377,7 @@ load_module (GSList      *module_list,
        }
     }
 
-  if (success)
+  if (success && info)
     {
       if (!g_slist_find (module_list, info))
        {
@@ -508,7 +508,7 @@ display_opened_cb (GdkDisplayManager *display_manager,
   
   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);
 
@@ -596,3 +596,29 @@ _gtk_modules_settings_changed (GtkSettings *settings,
                          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;
+}