GtkTreePath *path;
};
+#ifdef G_OS_WIN32
+
+#undef DEMOCODEDIR
+
+static char *
+get_democodedir (void)
+{
+ static char *result = NULL;
+
+ if (result == NULL)
+ {
+ result = g_win32_get_package_installation_directory (NULL, NULL);
+ if (result == NULL)
+ result = "unknown-location";
+
+ result = g_strconcat (result, "\\share\\gtk-2.0\\demo", NULL);
+ }
+
+ return result;
+}
+
+#define DEMOCODEDIR get_democodedir ()
+
+#endif
+
/**
* demo_find_file:
* @base: base filename
demo_find_file (const char *base,
GError **err)
{
- g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+ g_return_val_if_fail (err == NULL || *err == NULL, NULL);
- if (g_file_test (base, G_FILE_TEST_EXISTS))
+ if (g_file_test ("gtk-logo-rgb.gif", G_FILE_TEST_EXISTS) &&
+ g_file_test (base, G_FILE_TEST_EXISTS))
return g_strdup (base);
else
{
{
int n_read = 0;
-#ifndef G_OS_WIN32
+#ifdef HAVE_FLOCKFILE
flockfile (stream);
#endif
case '\r':
case '\n':
{
-#ifndef G_OS_WIN32
+#ifdef HAVE_FLOCKFILE
int next_c = getc_unlocked (stream);
#else
int next_c = getc (stream);
done:
-#ifndef G_OS_WIN32
+#ifdef HAVE_FLOCKFILE
funlockfile (stream);
#endif
cell = gtk_cell_renderer_text_new ();
- g_object_set (G_OBJECT (cell),
+ g_object_set (cell,
"style", PANGO_STYLE_ITALIC,
NULL);
list = g_list_append (list, transparent);
gtk_window_set_default_icon_list (list);
g_list_free (list);
- g_object_unref (G_OBJECT (pixbuf));
- g_object_unref (G_OBJECT (transparent));
+ g_object_unref (pixbuf);
+ g_object_unref (transparent);
}
}
* these few lines, which are just a hack so gtk-demo will work
* in the GTK tree without installing it.
*/
- if (g_file_test ("../../gdk-pixbuf/.libs/libpixbufloader-pnm.so",
+ if (g_file_test ("../../gdk-pixbuf/libpixbufloader-pnm.la",
G_FILE_TEST_EXISTS))
{
- putenv ("GDK_PIXBUF_MODULEDIR=../../gdk-pixbuf/.libs");
- putenv ("GTK_IM_MODULE_FILE=../../modules/input/gtk.immodules");
+ g_setenv ("GDK_PIXBUF_MODULE_FILE", "../../gdk-pixbuf/gdk-pixbuf.loaders", TRUE);
+ g_setenv ("GTK_IM_MODULE_FILE", "../../modules/input/gtk.immodules", TRUE);
}
/* -- End of hack -- */