1 /* Eye Of Gnome - Image Store 2 * 3 * Copyright (C) 2006-2007 The Free Software Foundation 4 * 5 * Author: Claudio Saavedra <csaavedra@alumnos.utalca.cl> 6 * 7 * Based on code by: Jens Finke <jens@triq.net> 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 2 of the License, or 12 * (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License along 20 * with this program; if not, write to the Free Software Foundation, Inc., 21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 */ 23 24 #ifndef EOG_LIST_STORE_H 25 #define EOG_LIST_STORE_H 26 27 #include <gtk/gtk.h> 28 #include <glib-object.h> 29 #include <gio/gio.h> 30 31 G_BEGIN_DECLS 32 33 #ifndef __EOG_IMAGE_DECLR__ 34 #define __EOG_IMAGE_DECLR__ 35 typedef struct _EogImage EogImage; 36 #endif 37 38 typedef struct _EogListStore EogListStore; 39 typedef struct _EogListStoreClass EogListStoreClass; 40 typedef struct _EogListStorePrivate EogListStorePrivate; 41 42 #define EOG_TYPE_LIST_STORE eog_list_store_get_type() 43 #define EOG_LIST_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOG_TYPE_LIST_STORE, EogListStore)) 44 #define EOG_LIST_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EOG_TYPE_LIST_STORE, EogListStoreClass)) 45 #define EOG_IS_LIST_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOG_TYPE_LIST_STORE)) 46 #define EOG_IS_LIST_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EOG_TYPE_LIST_STORE)) 47 #define EOG_LIST_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EOG_TYPE_LIST_STORE, EogListStoreClass)) 48 49 #define EOG_LIST_STORE_THUMB_SIZE 90 50 51 typedef enum { 52 EOG_LIST_STORE_THUMBNAIL = 0, 53 EOG_LIST_STORE_THUMB_SET, 54 EOG_LIST_STORE_EOG_IMAGE, 55 EOG_LIST_STORE_EOG_JOB, 56 EOG_LIST_STORE_NUM_COLUMNS 57 } EogListStoreColumn; 58 59 struct _EogListStore { 60 GtkListStore parent; 61 EogListStorePrivate *priv; 62 }; 63 64 struct _EogListStoreClass { 65 GtkListStoreClass parent_class; 66 67 /* Padding for future expansion */ 68 void (* _eog_reserved1) (void); 69 void (* _eog_reserved2) (void); 70 void (* _eog_reserved3) (void); 71 void (* _eog_reserved4) (void); 72 }; 73 74 GType eog_list_store_get_type (void) G_GNUC_CONST; 75 76 GtkListStore *eog_list_store_new (void); 77 78 GtkListStore *eog_list_store_new_from_glist (GList *list); 79 80 void eog_list_store_append_image (EogListStore *store, 81 EogImage *image); 82 83 void eog_list_store_add_files (EogListStore *store, 84 GList *file_list); 85 86 void eog_list_store_remove_image (EogListStore *store, 87 EogImage *image); 88 89 gint eog_list_store_get_pos_by_image (EogListStore *store, 90 EogImage *image); 91 92 EogImage *eog_list_store_get_image_by_pos (EogListStore *store, 93 gint pos); 94 95 gint eog_list_store_get_pos_by_iter (EogListStore *store, 96 GtkTreeIter *iter); 97 98 gint eog_list_store_length (EogListStore *store); 99 100 gint eog_list_store_get_initial_pos (EogListStore *store); 101 102 void eog_list_store_thumbnail_set (EogListStore *store, 103 GtkTreeIter *iter); 104 105 void eog_list_store_thumbnail_unset (EogListStore *store, 106 GtkTreeIter *iter); 107 108 void eog_list_store_thumbnail_refresh (EogListStore *store, 109 GtkTreeIter *iter); 110 111 G_END_DECLS 112 113 #endif 114