1 /* -*- Mode: C; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 3 -*- */ 2 3 /* 4 * GImageView 5 * Copyright (C) 2001-2003 Takuro Ashie 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 * 21 * $Id: gimv_dupl_finder.h,v 1.3 2004/09/21 08:44:31 makeinu Exp $ 22 */ 23 24 #ifndef __GIMV_DUPL_FINDER_H__ 25 #define __GIMV_DUPL_FINDER_H__ 26 27 #include "gimageview.h" 28 29 #include <glib.h> 30 31 #define GIMV_TYPE_DUPL_FINDER (gimv_dupl_finder_get_type ()) 32 #define GIMV_DUPL_FINDER(obj) (GTK_CHECK_CAST (obj, gimv_dupl_finder_get_type (), GimvDuplFinder)) 33 #define GIMV_DUPL_FINDER_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, gimv_dupl_finder_get_type, GimvDuplFinderClass)) 34 #define GIMV_IS_DUPL_FINDER(obj) (GTK_CHECK_TYPE (obj, gimv_dupl_finder_get_type ())) 35 #define GIMV_IS_DUPL_FINDER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMV_TYPE_DUPL_FINDER)) 36 37 38 typedef struct GimvDuplFinder_Tag GimvDuplFinder; 39 typedef struct GimvDuplFinderPriv_Tag GimvDuplFinderPriv; 40 typedef struct GimvDuplFinderClass_Tag GimvDuplFinderClass; 41 typedef struct GimvDuplPair_Tag GimvDuplPair; 42 typedef struct GimvDuplCompFuncTable_Tag GimvDuplCompFuncTable; 43 44 45 struct GimvDuplFinder_Tag 46 { 47 GtkObject parent; 48 49 GList *src_list, *dest_list; 50 GList *cur1, *cur2; 51 52 GHashTable *table; 53 54 GimvDuplCompFuncTable *funcs; 55 56 gfloat progress; 57 gint len, pos; 58 59 gint pairs_found; 60 61 gint refresh_rate; 62 gint timer_rate; 63 64 guint timer_id; 65 guint idle_id; 66 }; 67 68 69 struct GimvDuplFinderClass_Tag 70 { 71 GtkObjectClass parent_class; 72 73 void (*start) (GimvDuplFinder *finder); 74 void (*stop) (GimvDuplFinder *finder); 75 void (*progress_update) (GimvDuplFinder *finder); 76 void (*found) (GimvDuplFinder *finder, 77 GimvDuplPair *pair); 78 }; 79 80 81 struct GimvDuplPair_Tag 82 { 83 GimvThumb *thumb1; 84 GimvThumb *thumb2; 85 gfloat similarity; 86 }; 87 88 89 struct GimvDuplCompFuncTable_Tag 90 { 91 const gchar * const label; 92 93 gpointer (*get_data) (GimvThumb *thumb); 94 gint (*compare) (gpointer data1, 95 gpointer data2, 96 gfloat *similarity); 97 void (*data_delete) (gpointer data); 98 }; 99 100 101 GtkType gimv_dupl_finder_get_type (void); 102 103 const gchar **gimv_dupl_finder_get_algol_types (void); 104 105 GimvDuplFinder * 106 gimv_dupl_finder_new (const gchar *type); 107 108 void gimv_dupl_finder_set_algol_type (GimvDuplFinder *finder, 109 const gchar *type); 110 /* souce doesn't work yet */ 111 void gimv_dupl_finder_append_source (GimvDuplFinder *finder, 112 GimvThumb *thumb1); 113 void gimv_dupl_finder_append_src (GimvDuplFinder *finder, 114 GimvThumb *thumb); 115 void gimv_dupl_finder_append_dest (GimvDuplFinder *finder, 116 GimvThumb *thumb1); 117 void gimv_dupl_finder_start (GimvDuplFinder *finder); 118 void gimv_dupl_finder_stop (GimvDuplFinder *finder); 119 gfloat gimv_dupl_finder_get_progress (GimvDuplFinder *finder); 120 121 #endif /* __GIMV_DUPL_FINDER_H__ */ 122