summaryrefslogtreecommitdiff
path: root/gtk/gtkrc.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-04-13 21:29:11 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-04-13 21:29:11 +0000
commita61a5ffe80e24dac108977a869630bef8393ef76 (patch)
tree3ba6be03ab1637a16e707b4b4199915e03da8fe3 /gtk/gtkrc.c
parentcf1a251f35d27607eb5af24a1f48d33eafc23114 (diff)
downloadgtk+-a61a5ffe80e24dac108977a869630bef8393ef76.tar.gz
Export the gtk_private_signals and gtk_private_n_signals variables, they
2000-04-14 Tor Lillqvist <tml@iki.fi> * gtk/gtksignal.c: (Win32:) Export the gtk_private_signals and gtk_private_n_signals variables, they are used by some software, sigh. * gtk/gtkrc.c (get_gtk_sysconf_directory): (Win32:) Fetch the installation directory from the Registry, where the installer should have put it.
Diffstat (limited to 'gtk/gtkrc.c')
-rw-r--r--gtk/gtkrc.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index cf97c48ae8..aed1588f01 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -251,22 +251,38 @@ static GtkImageLoader image_loader = NULL;
gchar *
get_gtk_sysconf_directory (void)
{
+ static gboolean been_here = FALSE;
static gchar gtk_sysconf_dir[200];
gchar win_dir[100];
+ HKEY reg_key = NULL;
+ DWORD type;
+ DWORD nbytes = sizeof (gtk_sysconf_dir);
+
+ if (been_here)
+ return gtk_sysconf_dir;
+
+ been_here = TRUE;
+
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Software\\GNU\\GTk+", 0,
+ KEY_QUERY_VALUE, &reg_key) != ERROR_SUCCESS
+ || RegQueryValueEx (reg_key, "InstallationDirectory", 0,
+ &type, gtk_sysconf_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_sysconf_dir, "%s\\gtk+", win_dir);
+ }
+
+ if (reg_key != NULL)
+ RegCloseKey (reg_key);
- GetWindowsDirectory (win_dir, sizeof (win_dir));
- sprintf (gtk_sysconf_dir, "%s\\gtk+", win_dir);
return gtk_sysconf_dir;
}
static gchar *
get_themes_directory (void)
{
- /* We really should fetch this from the Registry. The GIMP
- * installation program stores the Themes installation
- * directory in HKLM\Software\GNU\GTk+\Themes\InstallDirectory.
- * Later.
- */
static gchar themes_dir[200];
sprintf (themes_dir, "%s\\themes", get_gtk_sysconf_directory ());