]> Pileus Git - ~andy/gtk/commitdiff
gdk-pixbuf/gdk-pixbuf-io.c Don't use the deprectated
authorTor Lillqvist <tml@novell.com>
Sat, 13 Sep 2008 19:31:29 +0000 (19:31 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 13 Sep 2008 19:31:29 +0000 (19:31 +0000)
2008-09-13  Tor Lillqvist  <tml@novell.com>

* gdk-pixbuf/gdk-pixbuf-io.c
* gtk/gtkmain.c: Don't use the deprectated
g_win32_get_package_installation_directory() and
g_win32_get_package_installation_subdirectory() functions. Use
g_win32_get_package_installation_directory_of_module()
instead. Also, don't use the deprecated silly
G_WIN32_DLLMAIN_FOR_DLL_NAME macro, but an explicit minimal
DllMain() that just saves the DLL handle.

svn path=/trunk/; revision=21381

ChangeLog
gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-io.c
gtk/gtkmain.c

index b3ad4e4ee38546419ebdc06912b1c1cdcdb1ff0d..fd82a4f3f87f69074e734cef167cf3b35d386765 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-09-13  Tor Lillqvist  <tml@novell.com>
+
+       * gtk/gtkmain.c: Don't use the deprectated
+       g_win32_get_package_installation_directory() and
+       g_win32_get_package_installation_subdirectory() functions. Use
+       g_win32_get_package_installation_directory_of_module()
+       instead. Also, don't use the deprecated silly
+       G_WIN32_DLLMAIN_FOR_DLL_NAME() macro, but an explicit minimal
+       DllMain() that just saves the DLL handle.
+
 2008-09-13  Cosimo Cecchi  <cosimoc@gnome.org>
 
        Bug 552153 – GtkModules loading with XSettings doesn't work if the
@@ -8,12 +18,6 @@
        Call _gtk_modules_init () even if gtk_modules_string is NULL, so
        that GtkModules specified with XSettings could be loaded.
 
-2008-09-13  Tor Lillqvist  <tml@novell.com>
-
-       * gtk/gtkmain.c: Do as the docs for
-       g_win32_get_package_installation_directory() say and pass NULL as
-       the first parameter.
-
 2008-09-11  Cosimo Cecchi  <cosimoc@gnome.org>
 
        Bug 536542 – gtk_list_store_set() documentation doesn't say whether
index 841ff5e629bf77fa4fbc6b4e7e8e1cf31bef1f19..946f9004a23c69432bc4c6c0532299459a6a2c34 100644 (file)
@@ -1,8 +1,11 @@
 2008-09-13  Tor Lillqvist  <tml@novell.com>
 
-       * gdk-pixbuf-io.c: Do as the docs for
-       g_win32_get_package_installation_directory() say and pass NULL as
-       the first parameter.
+       * gdk-pixbuf-io.c: Don't use the deprectated
+       g_win32_get_package_installation_subdirectory(). Use
+       g_win32_get_package_installation_directory_of_module()
+       instead. Also, don't use the deprecated silly
+       G_WIN32_DLLMAIN_FOR_DLL_NAME() macro, but an explicit minimal
+       DllMain() that just saves the DLL handle.
 
 2008-09-07  Matthias Clasen  <mclasen@redhat.com>
 
index 967febbbd6d798a5fe014e50c0aac6cb17646dee..d6ddce76a22448ba1b94701201f997fc599f951f 100644 (file)
@@ -228,8 +228,23 @@ skip_space (const char **pos)
   
 #ifdef G_OS_WIN32
 
-/* DllMain function needed to tuck away the gdk-pixbuf DLL name */
-G_WIN32_DLLMAIN_FOR_DLL_NAME (static, dll_name)
+/* DllMain function needed to tuck away the gdk-pixbuf DLL handle */
+
+static HMODULE gdk_pixbuf_dll;
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+        DWORD     fdwReason,
+        LPVOID    lpvReserved)
+{
+       switch (fdwReason) {
+       case DLL_PROCESS_ATTACH:
+               gdk_pixbuf_dll = (HMODULE) hinstDLL;
+               break;
+       }
+
+  return TRUE;
+}
 
 static char *
 get_toplevel (void)
@@ -237,8 +252,7 @@ get_toplevel (void)
   static char *toplevel = NULL;
 
   if (toplevel == NULL)
-    toplevel = g_win32_get_package_installation_subdirectory
-      (NULL, dll_name, "");
+         toplevel = g_win32_get_package_installation_directory_of_module (gdk_pixbuf_dll);
 
   return toplevel;
 }
@@ -249,8 +263,7 @@ get_sysconfdir (void)
   static char *sysconfdir = NULL;
 
   if (sysconfdir == NULL)
-    sysconfdir = g_win32_get_package_installation_subdirectory
-      (NULL, dll_name, "etc");
+         sysconfdir = g_build_filename (get_toplevel (), "etc", NULL);
 
   return sysconfdir;
 }
index cb2929eb82cb4b4425e9afc9fb6edb49e41e3aba..58373a368cd67a04c6f96f01a37387f7fdefecc3 100644 (file)
 
 #ifdef G_OS_WIN32
 
-G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
+static HMODULE gtk_dll;
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+        DWORD     fdwReason,
+        LPVOID    lpvReserved)
+{
+  switch (fdwReason)
+    {
+    case DLL_PROCESS_ATTACH:
+      gtk_dll = (HMODULE) hinstDLL;
+      break;
+    }
+
+  return TRUE;
+}
 
 /* This here before inclusion of gtkprivate.h so that it sees the
  * original GTK_LOCALEDIR definition. Yeah, this is a bit sucky.
@@ -80,7 +95,7 @@ _gtk_get_localedir (void)
   if (gtk_localedir == NULL)
     {
       const gchar *p;
-      gchar *temp;
+      gchar *root, *temp;
       
       /* GTK_LOCALEDIR ends in either /lib/locale or
        * /share/locale. Scan for that slash.
@@ -91,8 +106,9 @@ _gtk_get_localedir (void)
       while (*--p != '/')
        ;
 
-      temp = g_win32_get_package_installation_subdirectory
-        (NULL, dll_name, p);
+      root = g_win32_get_package_installation_directory_of_module (gtk_dll);
+      temp = g_build_filename (root, p, NULL);
+      g_free (root);
 
       /* gtk_localedir is passed to bindtextdomain() which isn't
        * UTF-8-aware.
@@ -307,8 +323,11 @@ _gtk_get_datadir (void)
 {
   static char *gtk_datadir = NULL;
   if (gtk_datadir == NULL)
-    gtk_datadir = g_win32_get_package_installation_subdirectory
-      (NULL, dll_name, "share");
+    {
+      gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll);
+      gtk_datadir = g_build_filename (root, "share", NULL);
+      g_free (root);
+    }
 
   return gtk_datadir;
 }
@@ -318,8 +337,11 @@ _gtk_get_libdir (void)
 {
   static char *gtk_libdir = NULL;
   if (gtk_libdir == NULL)
-    gtk_libdir = g_win32_get_package_installation_subdirectory
-      (NULL, dll_name, "lib");
+    {
+      gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll);
+      gtk_libdir = g_build_filename (root, "lib", NULL);
+      g_free (root);
+    }
 
   return gtk_libdir;
 }
@@ -329,8 +351,11 @@ _gtk_get_sysconfdir (void)
 {
   static char *gtk_sysconfdir = NULL;
   if (gtk_sysconfdir == NULL)
-    gtk_sysconfdir = g_win32_get_package_installation_subdirectory
-      (NULL, dll_name, "etc");
+    {
+      gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll);
+      gtk_sysconfdir = g_build_filename (root, "etc", NULL);
+      g_free (root);
+    }
 
   return gtk_sysconfdir;
 }
@@ -340,8 +365,7 @@ _gtk_get_data_prefix (void)
 {
   static char *gtk_data_prefix = NULL;
   if (gtk_data_prefix == NULL)
-    gtk_data_prefix = g_win32_get_package_installation_directory
-      (NULL, dll_name);
+    gtk_data_prefix = g_win32_get_package_installation_directory_of_module (gtk_dll);
 
   return gtk_data_prefix;
 }