static gboolean fullscreen_timeout_cb (AnypaperPreview *preview) { gtk_widget_hide (preview->priv->hbox); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(preview->priv->window2), GTK_POLICY_NEVER, GTK_POLICY_NEVER); timeout_destroy (preview->priv->source); return FALSE; }
static void image_fullscreen ( GtkWidget *widget, AnypaperPreview *preview) { if (preview->priv->state == WINDOW_NORMAL_STATE) gtk_window_fullscreen (GTK_WINDOW(preview->priv->window)); if (preview->priv->state == WINDOW_FULLSCREEN_STATE) { timeout_destroy(preview->priv->source); gtk_window_unfullscreen (GTK_WINDOW(preview->priv->window)); } }
static gboolean window_key_press (GtkWidget *widget, GdkEventKey *event, AnypaperPreview *preview) { switch (event->keyval) { case GDK_Escape: { if (preview->priv->state == 1) gtk_widget_activate(GTK_WIDGET(preview->priv->button)); else gtk_object_destroy(GTK_OBJECT(widget)); timeout_destroy(preview->priv->source); } break; } }
static gboolean stop_timeout(gpointer data) { int fd; struct timeout *to = data; fd = open(to->device, CDOPENFLAGS); if (fd != -1) { ioctl(fd, XMMS_STOP, 0); close(fd); } timeout_destroy(to); return FALSE; }
static void timeout_remove_for_device(char *device) { GList *node; for (node = timeout_list; node; node = node->next) { struct timeout *t = node->data; if (!strcmp(t->device, device)) { gtk_timeout_remove(t->id); timeout_destroy(t); return; } } }
static gboolean mouse_motion (GtkWidget *widget, GdkEventMotion *event, AnypaperPreview *preview) { if (!GTK_WIDGET_VISIBLE (preview->priv->hbox)) { gtk_widget_show(preview->priv->hbox); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(preview->priv->window2), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); } if (preview->priv->state == WINDOW_FULLSCREEN_STATE) { timeout_destroy(preview->priv->source); preview->priv->source = g_timeout_source_new_seconds (WINDOW_FULLSCREEN_TIMEOUT); g_source_set_callback (preview->priv->source, fullscreen_timeout_cb, preview, NULL); g_source_attach (preview->priv->source, NULL); } }
static void show_preview_quit ( GtkWidget *widget, AnypaperPreview *preview) { timeout_destroy(preview->priv->source); gtk_object_destroy(GTK_OBJECT(preview->priv->window)); }