gnome-control-center/capplets/background/gnome-wp-item.h
Rodney Dawes f69be2bd96 Add an Apply button
2006-01-26  Rodney Dawes  <dobey@novell.com>

	* gnome-background-properties.glade: Add an Apply button

	* gnome-wp-capplet.[ch]: Replace old_filename with an old_item struct
	(gnome_wp_props_wp_set): Set the filename key to empty string when
	setting the background to "No Wallpaper"
	(gnome_wp_props_revert): New method to revert changes in the dialog
	when the Cancel button is clicked
	(gnome_wp_main_quit): Free the old_item structure
	(wallpaper_properties_clicked): Handle the Apply button
	Handle closing the dialog for OK separately from Cancel/delete_event
	Revert the settings when Cancel or wm "x" or ESC are clicked
	(gnome_wp_load_stuffs): Set the old_item to the currently selected
	background setting, whether it be an image or "No Wallpaper"

	* gnome-wp-info.c (gnome_wp_info_dup): If info is NULL, just return
	NULL rather than trying to access members of an empty struct

	* gnome-wp-item.[ch] (gnome_wp_item_dup): New method to create a
	duplicate and newly allocated GnomeWPItem structure

	Fixes #327335
2006-01-27 03:01:58 +00:00

71 lines
1.9 KiB
C

/*
* Authors: Rodney Dawes <dobey@ximian.com>
*
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*
*/
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtktreeview.h>
#include <libgnomeui/gnome-thumbnail.h>
#include <gnome-wp-info.h>
#include <libgnomevfs/gnome-vfs.h>
#ifndef _GNOME_WP_ITEM_H_
#define _GNOME_WP_ITEM_H_
typedef struct _GnomeWPItem GnomeWPItem;
struct _GnomeWPItem {
gchar * name;
gchar * filename;
gchar * description;
gchar * imguri;
gchar * options;
gchar * shade_type;
gchar * pri_color;
gchar * sec_color;
/* Where the Item is in the List */
GtkTreeRowReference * rowref;
/* Real colors */
GdkColor * pcolor;
GdkColor * scolor;
GnomeWPInfo * fileinfo;
GnomeWPInfo * uriinfo;
/* Did the user remove us? */
gboolean deleted;
/* Width and Height of the original image */
gint width;
gint height;
};
GnomeWPItem * gnome_wp_item_new (const gchar * filename,
GHashTable * wallpapers,
GnomeThumbnailFactory * thumbnails);
void gnome_wp_item_free (GnomeWPItem * item);
GnomeWPItem * gnome_wp_item_dup (GnomeWPItem * item);
GdkPixbuf * gnome_wp_item_get_thumbnail (GnomeWPItem * item,
GnomeThumbnailFactory * thumbs);
void gnome_wp_item_update_description (GnomeWPItem * item);
#endif