-#include <stdlib.h> /* putenv */
+/* testdnd.c
+ * Copyright (C) 1998 Red Hat, Inc.
+ * Author: Owen Taylor
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <config.h>
#include "gtk/gtk.h"
/* Target side drag signals */
static GtkTargetEntry target_table[] = {
{ "STRING", 0, TARGET_STRING },
{ "text/plain", 0, TARGET_STRING },
- { "application/x-rootwin-drop", 0, TARGET_ROOTWIN }
+ { "application/x-rootwindow-drop", 0, TARGET_ROOTWIN }
};
static guint n_targets = sizeof(target_table) / sizeof(target_table[0]);
{
have_drag = TRUE;
gtk_image_set_from_pixmap (GTK_IMAGE (widget),
- trashcan_closed, trashcan_closed_mask);
+ trashcan_open, trashcan_open_mask);
}
source_widget = gtk_drag_get_source_widget (context);
if (!popdown_timer)
{
g_print ("added popdown\n");
- popdown_timer = g_timeout_add (500, popdown_cb, NULL);
+ popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
}
}
}
-gint
+gboolean
popup_cb (gpointer data)
{
if (!popped_up)
popped_up = TRUE;
}
- popdown_timer = g_timeout_add (500, popdown_cb, NULL);
+ popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
g_print ("added popdown\n");
popup_timer = FALSE;
guint time)
{
if (!popup_timer)
- popup_timer = g_timeout_add (500, popup_cb, NULL);
+ popup_timer = gdk_threads_add_timeout (500, popup_cb, NULL);
return TRUE;
}
}
void
-test_init ()
+test_init (void)
{
if (g_file_test ("../gdk-pixbuf/libpixbufloader-pnm.la",
G_FILE_TEST_EXISTS))
{
- putenv ("GDK_PIXBUF_MODULE_FILE=../gdk-pixbuf/gdk-pixbuf.loaders");
- 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);
}
}