#include "config.h"
-#include "gdk/gdkx.h"
+#include "gdkx.h"
-#if GDK_WINDOWING == GDK_WINDOWING_X11
+#ifdef GDK_WINDOWING_X11
#include <X11/Xlocale.h> /* so we get the right setlocale */
#else
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
-#ifdef _MSC_VER
+#ifndef HAVE_LSTAT
+#define lstat stat
+#endif
+
+#ifdef G_OS_WIN32
#include <io.h>
#endif
/* RC file handling */
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
-static gchar *
-get_gtk_sysconf_directory ()
+gchar *
+get_gtk_sysconf_directory (void)
{
static gchar gtk_sysconf_dir[200];
gchar win_dir[100];
GetWindowsDirectory (win_dir, sizeof (win_dir));
- sprintf (gtk_sysconf_dir, "%s\\gtk", win_dir);
+ sprintf (gtk_sysconf_dir, "%s\\gtk+", win_dir);
return gtk_sysconf_dir;
}
static gchar *
-get_themes_directory ()
+get_themes_directory (void)
{
/* We really should fetch this from the Registry. The GIMP
* installation program stores the Themes installation
{
gchar *var, *path;
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
var = getenv("GTK_DATA_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/share/themes");
{
gchar *var, *path;
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
var = getenv("GTK_EXE_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/lib/gtk/themes/engines");
gchar *var, *path;
gint n;
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
var = getenv("GTK_DATA_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/share/gtk/themes");
if (n >= GTK_RC_MAX_MODULE_PATHS - 1)
return;
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
var = getenv("GTK_EXE_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/lib/gtk/themes/engines");
var = g_get_home_dir ();
if (var)
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
path = g_strdup_printf ("%s%s", var, "/.gtk/lib/themes/engines");
#else
path = g_strdup_printf ("%s%s", var, "\\_gtk\\themes\\engines");
}
else
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
str = g_strdup (GTK_SYSCONFDIR G_DIR_SEPARATOR_S "gtk" G_DIR_SEPARATOR_S "gtkrc");
#else
str = g_strdup_printf ("%s\\gtkrc", get_gtk_sysconf_directory ());
gchar *locale_suffixes[3];
gint n_locale_suffixes = 0;
gint i, j;
+#ifdef G_OS_WIN32
+ char *locale = gwin_getlocale ();
+#else
#ifdef HAVE_LC_MESSAGES
char *locale = setlocale (LC_MESSAGES, NULL);
#else
char *locale = setlocale (LC_CTYPE, NULL);
+#endif
#endif
guint length;
char *p;
dir = g_strdup(rc_file->canonical_name);
for (i = strlen(dir) - 1; (i >= 0) && (dir[i] != G_DIR_SEPARATOR); i--)
dir[i] = 0;
+ if (i >= 0 && dir[i] == G_DIR_SEPARATOR)
+ dir[i] = 0;
gtk_rc_append_pixmap_path(dir);
g_free(dir);
}