summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2008-09-13 19:39:57 +0000
committerTor Lillqvist <tml@src.gnome.org>2008-09-13 19:39:57 +0000
commit42a4368d768e0eedcf279a3f1bf83b0f31835d6c (patch)
treece2aba9e0e39102393e69f465dd2ea13cb9d9d26
parent6325fb2c602a3044fdea68b9ea5703e1be582dfc (diff)
downloadatk-42a4368d768e0eedcf279a3f1bf83b0f31835d6c.tar.gz
Don't use the deprectated g_win32_get_package_installation_subdirectory().
2008-09-13 Tor Lillqvist <tml@novell.com> * atk/atkobject.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. svn path=/trunk/; revision=1274
-rw-r--r--ChangeLog9
-rwxr-xr-xatk/atkobject.c44
2 files changed, 43 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 9f3739a..63c9d74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
2008-09-13 Tor Lillqvist <tml@novell.com>
- * atk/atkobject.c (get_atk_locale_dir): Do as the docs for
- g_win32_get_package_installation_directory() say and pass NULL as
- the first parameter.
+ * atk/atkobject.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-09 Li Yuan <li.yuan@sun.com>
diff --git a/atk/atkobject.c b/atk/atkobject.c
index 9f39ccf..80af514 100755
--- a/atk/atkobject.c
+++ b/atk/atkobject.c
@@ -235,11 +235,22 @@ static const gchar* const atk_object_name_property_hypertext_num_links = "access
#ifdef G_OS_WIN32
-#undef ATK_LOCALEDIR
+static HMODULE atk_dll;
-#define ATK_LOCALEDIR get_atk_locale_dir()
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ atk_dll = (HMODULE) hinstDLL;
+ break;
+ }
-G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
+ return TRUE;
+}
static const char *
get_atk_locale_dir (void)
@@ -248,16 +259,35 @@ get_atk_locale_dir (void)
if (!atk_localedir)
{
- gchar *temp;
-
- temp = g_win32_get_package_installation_subdirectory
- (NULL, dll_name, "lib\\locale");
+ const gchar *p;
+ gchar *root, *temp;
+
+ /* ATK_LOCALEDIR might end in either /lib/locale or
+ * /share/locale. Scan for that slash.
+ */
+ p = ATK_LOCALEDIR + strlen (ATK_LOCALEDIR);
+ while (*--p != '/')
+ ;
+ while (*--p != '/')
+ ;
+
+ root = g_win32_get_package_installation_directory_of_module (atk_dll);
+ temp = g_build_filename (root, p, NULL);
+ g_free (root);
+
+ /* atk_localedir is passed to bindtextdomain() which isn't
+ * UTF-8-aware.
+ */
atk_localedir = g_win32_locale_filename_from_utf8 (temp);
g_free (temp);
}
return atk_localedir;
}
+#undef ATK_LOCALEDIR
+
+#define ATK_LOCALEDIR get_atk_locale_dir()
+
#endif
static void