diff options
author | Tor Lillqvist <tml@iki.fi> | 2001-01-17 22:26:19 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2001-01-17 22:26:19 +0000 |
commit | 576ef7f29addee34537305723645a26987da7615 (patch) | |
tree | 3fe80883369163a47b32bc8be42c075cca395501 /gtk | |
parent | 18fb9bcd5356221120a87ba33832ed3d95c2e026 (diff) | |
download | gtk+-576ef7f29addee34537305723645a26987da7615.tar.gz |
gtk/gtkmain.c Use the new
2001-01-18 Tor Lillqvist <tml@iki.fi>
* gtk/gtkmain.c
* gtk/gtkrc.c: (Win32) Use the new
g_win32_get_package_installation_(sub)directory() functions.
* config.h.win32.in: New file.
* config.h.win32: Removed.
* configure.in: Output config.h.win32.
* Makefile.am: Add it to EXTRA_DIST.
* gtk/gtk.def: Update.
2001-01-16 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkwindow-win32.c (gdk_window_show, gdk_window_hide):
Eliminate redraws when input-only windows are shown or
hidden. Thanks to jpe@archaeopteryx.com.
2001-01-18 Tor Lillqvist <tml@iki.fi>
* gdk-pixbuf-io.c (get_libdir): (Win32) Use the new
g_win32_get_package_installation_subdirectory() function.
(gtk_win32_get_installation_directory): Remove this then.
Diffstat (limited to 'gtk')
-rwxr-xr-x | gtk/gtk.def | 1 | ||||
-rw-r--r-- | gtk/gtkmain.c | 8 | ||||
-rw-r--r-- | gtk/gtkrc.c | 46 |
3 files changed, 15 insertions, 40 deletions
diff --git a/gtk/gtk.def b/gtk/gtk.def index 9430d1f704..a73b96fffc 100755 --- a/gtk/gtk.def +++ b/gtk/gtk.def @@ -1555,7 +1555,6 @@ EXPORTS gtk_widget_unparent gtk_widget_unrealize gtk_widget_unref - gtk_win32_get_installation_directory gtk_window_activate_default gtk_window_activate_focus gtk_window_add_accel_group diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index c66f4922d2..d3ba241d4c 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -406,12 +406,10 @@ gtk_init_check (int *argc, # endif # else /* !G_OS_WIN32 */ { - /* GTk+ locale dir is %WinDir%\gtk+\locale */ bindtextdomain (GETTEXT_PACKAGE, - g_strconcat (gtk_win32_get_installation_directory (), - G_DIR_SEPARATOR_S, - "locale", - NULL)); + g_win32_get_package_installation_subdirectory (GETTEXT_PACKAGE, + g_strdup_printf ("gtk-%d.%d.dll", GTK_MAJOR_VERSION, GTK_MINOR_VERSION), + "locale")); } #endif #endif diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 18ea5a6dbd..03a12b3bfe 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -51,6 +51,7 @@ #include <glib.h> #include "gdkconfig.h" +#include "gtkcompat.h" #include "gtkrc.h" #include "gtkbindings.h" #include "gtkthemes.h" @@ -58,7 +59,6 @@ #include "gtkiconfactory.h" #ifdef G_OS_WIN32 -#include <windows.h> /* For GetWindowsDirectory */ #include <io.h> #endif @@ -268,45 +268,23 @@ static GtkImageLoader image_loader = NULL; #ifdef G_OS_WIN32 -gchar * -gtk_win32_get_installation_directory (void) +static gchar * +get_gtk_dll_name (void) { - static gboolean been_here = FALSE; - static gchar gtk_installation_dir[200]; - gchar win_dir[100]; - HKEY reg_key = NULL; - DWORD type; - DWORD nbytes = sizeof (gtk_installation_dir); - - if (been_here) - return gtk_installation_dir; - - been_here = TRUE; + static gchar *gtk_dll = NULL; - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Software\\GNU\\GTk+", 0, - KEY_QUERY_VALUE, ®_key) != ERROR_SUCCESS - || RegQueryValueEx (reg_key, "InstallationDirectory", 0, - &type, gtk_installation_dir, &nbytes) != ERROR_SUCCESS - || type != REG_SZ) - { - /* Uh oh. Use the old hard-coded %WinDir%\GTk+ value */ - GetWindowsDirectory (win_dir, sizeof (win_dir)); - sprintf (gtk_installation_dir, "%s\\gtk+", win_dir); - } + if (!gtk_dll) + gtk_dll = g_strdup_printf ("gtk-%d.%d.dll", GTK_MAJOR_VERSION, GTK_MINOR_VERSION); - if (reg_key != NULL) - RegCloseKey (reg_key); - - return gtk_installation_dir; + return gtk_dll; } static gchar * get_themes_directory (void) { - static gchar themes_dir[200]; - - sprintf (themes_dir, "%s\\themes", gtk_win32_get_installation_directory ()); - return themes_dir; + return g_win32_get_package_installation_subdirectory (GETTEXT_PACKAGE, + get_gtk_dll_name (), + "themes"); } #endif @@ -358,7 +336,7 @@ gtk_rc_get_im_module_file (void) #ifndef G_OS_WIN32 result = g_strdup (GTK_SYSCONFDIR G_DIR_SEPARATOR_S "gtk-2.0" G_DIR_SEPARATOR_S "gtk.immodules"); #else - result = g_strdup_printf ("%s\\gtk.immodules", gtk_win32_get_installation_directory ()); + result = g_strdup_printf ("%s\\gtk.immodules", g_win32_get_package_installation_directory (GETTEXT_PACKAGE, get_gtk_dll_name ())); #endif } @@ -462,7 +440,7 @@ gtk_rc_add_initial_default_files (void) #ifndef G_OS_WIN32 str = g_strdup (GTK_SYSCONFDIR G_DIR_SEPARATOR_S "gtk-2.0" G_DIR_SEPARATOR_S "gtkrc"); #else - str = g_strdup_printf ("%s\\gtkrc", gtk_win32_get_installation_directory ()); + str = g_strdup_printf ("%s\\gtkrc", g_win32_get_package_installation_directory (GETTEXT_PACKAGE, get_gtk_dll_name ())); #endif gtk_rc_add_default_file (str); |