static void gtkam_save_init (GTypeInstance *instance, gpointer g_class) { GtkamSave *save = GTKAM_SAVE (instance); save->priv = g_new0 (GtkamSavePrivate, 1); }
static void gtkam_save_finalize (GObject *object) { GtkamSave *save = GTKAM_SAVE (object); g_free (save->priv); G_OBJECT_CLASS (parent_class)->finalize (object); }
static void gtkam_save_destroy (GtkObject *object) { GtkamSave *save = GTKAM_SAVE (object); gint i; GtkamSaveData *data; if (save->priv->data) { for (i = g_slist_length (save->priv->data) - 1; i >= 0; i--) { data = g_slist_nth_data (save->priv->data, i); g_object_unref (G_OBJECT (data->camera)); g_free (data->folder); g_free (data->name); g_free (data); } g_slist_free (save->priv->data); save->priv->data = NULL; } GTK_OBJECT_CLASS (parent_class)->destroy (object); }
static void action_save (gpointer callback_data, guint callback_action, GtkWidget *widget) { GtkWidget *s; GtkamList *list = GTKAM_LIST (callback_data); GtkamCamera *camera; gchar *folder; gchar *name; camera = gtkam_list_get_camera_from_iter (list, &list->priv->iter); folder = gtkam_list_get_folder_from_iter (list, &list->priv->iter); name = gtkam_list_get_name_from_iter (list, &list->priv->iter); s = gtkam_save_new (GTK_WINDOW (gtk_widget_get_toplevel( GTK_WIDGET(list) ))); gtkam_save_add (GTKAM_SAVE (s), camera, folder, name); g_free (folder); g_free (name); g_signal_emit (G_OBJECT (list), signals[NEW_DIALOG], 0, s); g_object_unref (G_OBJECT (s)); }