[gthumb: 1/14] find duplicates: started work to add the "find duplicates" command



commit f70eaef9a5f7af342b116978a9308157c745e2df
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jan 23 13:25:44 2011 +0100

    find duplicates: started work to add the "find duplicates" command

 configure.ac                                       |    3 +
 extensions/Makefile.am                             |   46 +++++--
 extensions/find_duplicates/Makefile.am             |   31 +++++
 extensions/find_duplicates/actions.c               |   34 ++++++
 extensions/find_duplicates/actions.h               |   31 +++++
 extensions/find_duplicates/callbacks.c             |  126 ++++++++++++++++++++
 extensions/find_duplicates/callbacks.h             |   30 +++++
 extensions/find_duplicates/data/Makefile.am        |    2 +
 extensions/find_duplicates/data/ui/Makefile.am     |    5 +
 .../find_duplicates/data/ui/find-duplicates.ui     |  126 ++++++++++++++++++++
 extensions/find_duplicates/dlg-find-duplicates.c   |  121 +++++++++++++++++++
 extensions/find_duplicates/dlg-find-duplicates.h   |   31 +++++
 .../find_duplicates.extension.in.in                |   12 ++
 extensions/find_duplicates/main.c                  |   53 ++++++++
 14 files changed, 637 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7e2df80..c2d4495 100644
--- a/configure.ac
+++ b/configure.ac
@@ -558,6 +558,9 @@ extensions/file_tools/Makefile
 extensions/file_tools/data/Makefile
 extensions/file_tools/data/ui/Makefile
 extensions/file_viewer/Makefile
+extensions/find_duplicates/Makefile
+extensions/find_duplicates/data/Makefile
+extensions/find_duplicates/data/ui/Makefile
 extensions/flicker/Makefile
 extensions/flicker/data/Makefile
 extensions/flicker/data/ui/Makefile
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index dce6130..e253c2a 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -1,3 +1,27 @@
+EXPORTERS = 			\
+	burn_disc		\
+	contact_sheet		\
+	facebook		\
+	flicker			\
+	photobucket		\
+	picasaweb		\
+	webalbums		\
+	$(NULL)
+	
+IMPORTERS = 			\
+	photo_importer		\
+	$(NULL)
+
+IMAGE_VIEWER_TOOLS = 		\
+	desktop_background	\
+	file_tools		\
+	red_eye_removal		\
+	$(NULL)
+
+JPEG_TOOLS = 			\
+	image_rotation		\
+	$(NULL)
+
 SUBDIRS = 			\
 	bookmarks		\
 	catalogs		\
@@ -7,34 +31,28 @@ SUBDIRS = 			\
 	edit_metadata		\
 	exiv2_tools		\
 	export_tools		\
-	facebook		\
-	image_viewer		\
+	find_duplicates		\
 	file_manager		\
-	file_tools		\
 	file_viewer		\
+	find_duplicates		\
 	gstreamer_utils		\
 	gstreamer_tools		\
 	image_print		\
-	jpeg_utils		\
-	image_rotation		\
+	image_viewer		\
 	importer		\
+	jpeg_utils		\
+	$(JPEG_TOOLS)		\
 	list_tools		\
 	oauth			\
-	photo_importer		\
-	photobucket		\
-	picasaweb		\
 	pixbuf_savers		\
 	raw_files		\
-	red_eye_removal		\
 	rename_series 		\
 	resize_images		\
 	search			\
 	slideshow		\
-	webalbums		\
-	flicker			\
-	burn_disc		\
-	desktop_background	\
-	contact_sheet		\
+	$(EXPORTERS)		\
+	$(IMAGE_VIEWER_TOOLS)	\
+	$(IMPORTERS)		\
 	$(NULL)
 
 EXTRA_DIST = example
diff --git a/extensions/find_duplicates/Makefile.am b/extensions/find_duplicates/Makefile.am
new file mode 100644
index 0000000..ef673e2
--- /dev/null
+++ b/extensions/find_duplicates/Makefile.am
@@ -0,0 +1,31 @@
+SUBDIRS = data
+
+extensiondir = $(pkglibdir)/extensions
+extension_LTLIBRARIES = libfind_duplicates.la
+
+libfind_duplicates_la_SOURCES = 	\
+	actions.c			\
+	actions.h			\
+	callbacks.c			\
+	callbacks.h			\
+	dlg-find-duplicates.c		\
+	dlg-find-duplicates.h		\
+	main.c
+
+libfind_duplicates_la_CFLAGS = $(GTHUMB_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb 
+libfind_duplicates_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
+libfind_duplicates_la_LIBADD = $(GTHUMB_LIBS) ../catalogs/libcatalogs.la
+libfind_duplicates_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
+
+extensioninidir = $(extensiondir)
+extensionini_in_files = find_duplicates.extension.in.in
+extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
+
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
+
+EXTRA_DIST = $(extensionini_in_files) 
+
+DISTCLEANFILES = $(extensionini_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/extensions/find_duplicates/actions.c b/extensions/find_duplicates/actions.c
new file mode 100644
index 0000000..68ef434
--- /dev/null
+++ b/extensions/find_duplicates/actions.c
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2008 Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <config.h>
+#include <glib/gi18n.h>
+#include <gthumb.h>
+#include "dlg-find-duplicates.h"
+
+
+void
+gth_browser_activate_action_edit_find_duplicates (GtkAction  *action,
+						  GthBrowser *browser)
+{
+	dlg_find_duplicates (browser);
+}
diff --git a/extensions/find_duplicates/actions.h b/extensions/find_duplicates/actions.h
new file mode 100644
index 0000000..cce9215
--- /dev/null
+++ b/extensions/find_duplicates/actions.h
@@ -0,0 +1,31 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ACTIONS_H
+#define ACTIONS_H
+
+#include <gtk/gtk.h>
+
+#define DEFINE_ACTION(x) void x (GtkAction *action, gpointer data);
+
+DEFINE_ACTION(gth_browser_activate_action_edit_find_duplicates)
+
+#endif /* ACTIONS_H */
diff --git a/extensions/find_duplicates/callbacks.c b/extensions/find_duplicates/callbacks.c
new file mode 100644
index 0000000..cbb1c49
--- /dev/null
+++ b/extensions/find_duplicates/callbacks.c
@@ -0,0 +1,126 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <config.h>
+#include <glib/gi18n.h>
+#include <glib-object.h>
+#include <gthumb.h>
+#include "actions.h"
+#include "callbacks.h"
+
+
+#define BROWSER_DATA_KEY "find-duplicates-browser-data"
+
+
+static const char *find_ui_info =
+"<ui>"
+"  <menubar name='MenuBar'>"
+"    <menu name='Edit' action='EditMenu'>"
+"      <placeholder name='Edit_Actions'>"
+"        <menuitem action='Edit_Find_Duplicates'/>"
+"      </placeholder>"
+"    </menu>"
+"  </menubar>"
+"</ui>";
+
+
+static GtkActionEntry find_action_entries[] = {
+	{ "Edit_Find_Duplicates", NULL,
+	  N_("Find _Duplicates..."), NULL,
+	  N_("Find duplicated files in the current location"),
+	  G_CALLBACK (gth_browser_activate_action_edit_find_duplicates) }
+};
+static guint find_action_entries_size = G_N_ELEMENTS (find_action_entries);
+
+
+typedef struct {
+	GtkActionGroup *find_action;
+	guint           find_merge_id;
+	GtkWidget      *refresh_button;
+} BrowserData;
+
+
+static void
+browser_data_free (BrowserData *data)
+{
+	g_free (data);
+}
+
+
+void
+find_dup__gth_browser_construct_cb (GthBrowser *browser)
+{
+	BrowserData *data;
+	GError      *error = NULL;
+
+	g_return_if_fail (GTH_IS_BROWSER (browser));
+
+	data = g_new0 (BrowserData, 1);
+
+	data->find_action = gtk_action_group_new ("Find Duplicates Action");
+	gtk_action_group_set_translation_domain (data->find_action, NULL);
+	gtk_action_group_add_actions (data->find_action,
+				      find_action_entries,
+				      find_action_entries_size,
+				      browser);
+	gtk_ui_manager_insert_action_group (gth_browser_get_ui_manager (browser), data->find_action, 0);
+
+	data->find_merge_id = gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (browser), find_ui_info, -1, &error);
+	if (data->find_merge_id == 0) {
+		g_warning ("building menus failed: %s", error->message);
+		g_error_free (error);
+	}
+
+	g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) browser_data_free);
+}
+
+
+void
+find_dup__gth_browser_update_extra_widget_cb (GthBrowser *browser)
+{
+	/* FIXME
+	GthFileData *location_data;
+	BrowserData *data;
+
+	location_data = gth_browser_get_location_data (browser);
+	if (! _g_content_type_is_a (g_file_info_get_content_type (location_data->info), "gthumb/search"))
+		return;
+
+	data = g_object_get_data (G_OBJECT (browser), BROWSER_DATA_KEY);
+
+	if (data->refresh_button == NULL) {
+		data->refresh_button = gtk_button_new ();
+		gtk_container_add (GTK_CONTAINER (data->refresh_button), gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON));
+		g_object_add_weak_pointer (G_OBJECT (data->refresh_button), (gpointer *)&data->refresh_button);
+		gtk_button_set_relief (GTK_BUTTON (data->refresh_button), GTK_RELIEF_NONE);
+		gtk_widget_set_tooltip_text (data->refresh_button, _("Search again"));
+		gtk_widget_show_all (data->refresh_button);
+		gedit_message_area_add_action_widget (GEDIT_MESSAGE_AREA (gth_browser_get_list_extra_widget (browser)),
+					              data->refresh_button,
+					              _RESPONSE_REFRESH);
+		g_signal_connect (data->refresh_button,
+				  "clicked",
+				  G_CALLBACK (refresh_button_clicked_cb),
+				  browser);
+	}
+	*/
+}
diff --git a/extensions/find_duplicates/callbacks.h b/extensions/find_duplicates/callbacks.h
new file mode 100644
index 0000000..b12facc
--- /dev/null
+++ b/extensions/find_duplicates/callbacks.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CALLBACKS_H
+#define CALLBACKS_H
+
+#include <gthumb.h>
+
+void  find_dup__gth_browser_construct_cb            (GthBrowser *browser);
+void  find_dup__gth_browser_update_extra_widget_cb  (GthBrowser *browser);
+
+#endif /* CALLBACKS_H */
diff --git a/extensions/find_duplicates/data/Makefile.am b/extensions/find_duplicates/data/Makefile.am
new file mode 100644
index 0000000..4d5385d
--- /dev/null
+++ b/extensions/find_duplicates/data/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = ui
+-include $(top_srcdir)/git.mk
diff --git a/extensions/find_duplicates/data/ui/Makefile.am b/extensions/find_duplicates/data/ui/Makefile.am
new file mode 100644
index 0000000..14253ad
--- /dev/null
+++ b/extensions/find_duplicates/data/ui/Makefile.am
@@ -0,0 +1,5 @@
+uidir = $(pkgdatadir)/ui
+ui_DATA = find-duplicates.ui
+EXTRA_DIST = $(ui_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/extensions/find_duplicates/data/ui/find-duplicates.ui b/extensions/find_duplicates/data/ui/find-duplicates.ui
new file mode 100644
index 0000000..1626cad
--- /dev/null
+++ b/extensions/find_duplicates/data/ui/find-duplicates.ui
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkDialog" id="find_duplicates_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Find Duplicates</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">normal</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkVBox" id="vbox1">
+            <property name="visible">True</property>
+            <property name="border_width">6</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkHBox" id="location_box">
+                <property name="visible">True</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="start_at_label">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Start _at:</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="include_subfolder_checkbutton">
+                <property name="label" translatable="yes">_Include sub-folders</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="help_button">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_button">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="ok_button">
+                <property name="label">gtk-find</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">help_button</action-widget>
+      <action-widget response="0">cancel_button</action-widget>
+      <action-widget response="0">ok_button</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/extensions/find_duplicates/dlg-find-duplicates.c b/extensions/find_duplicates/dlg-find-duplicates.c
new file mode 100644
index 0000000..35471b3
--- /dev/null
+++ b/extensions/find_duplicates/dlg-find-duplicates.c
@@ -0,0 +1,121 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2005-2009 Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <gtk/gtk.h>
+#include <gthumb.h>
+#include "dlg-find-duplicates.h"
+
+
+#define GET_WIDGET(name) _gtk_builder_get_widget (data->builder, (name))
+
+
+typedef struct {
+	GthBrowser *browser;
+	GtkBuilder *builder;
+	GtkWidget  *dialog;
+	GtkWidget  *location_chooser;
+} DialogData;
+
+
+static void
+destroy_cb (GtkWidget  *widget,
+	    DialogData *data)
+{
+	gth_browser_set_dialog (data->browser, "find_duplicates", NULL);
+
+	g_object_unref (data->builder);
+	g_free (data);
+}
+
+
+static void
+help_clicked_cb (GtkWidget  *widget,
+		 DialogData *data)
+{
+	show_help_dialog (GTK_WINDOW (data->dialog), "gthumb-find-duplicates");
+}
+
+
+static void
+ok_clicked_cb (GtkWidget  *widget,
+	       DialogData *data)
+{
+	/* FIXME */
+	gtk_widget_destroy (data->dialog);
+}
+
+
+void
+dlg_find_duplicates (GthBrowser *browser)
+{
+	DialogData *data;
+
+	if (gth_browser_get_dialog (browser, "find_duplicates") != NULL) {
+		gtk_window_present (GTK_WINDOW (gth_browser_get_dialog (browser, "find_duplicates")));
+		return;
+	}
+
+	data = g_new0 (DialogData, 1);
+	data->browser = browser;
+	data->builder = _gtk_builder_new_from_file ("find-duplicates.ui", "find_duplicates");
+
+	/* Get the widgets. */
+
+	data->dialog = _gtk_builder_get_widget (data->builder, "find_duplicates_dialog");
+	gth_browser_set_dialog (browser, "find_duplicates", data->dialog);
+	g_object_set_data (G_OBJECT (data->dialog), "dialog_data", data);
+
+	data->location_chooser = gth_location_chooser_new ();
+	gtk_widget_show (data->location_chooser);
+  	gtk_box_pack_start (GTK_BOX (GET_WIDGET ("location_box")), data->location_chooser, TRUE, TRUE, 0);
+  	gtk_label_set_mnemonic_widget (GTK_LABEL (GET_WIDGET ("start_at_label")), data->location_chooser);
+
+	/* Set widgets data. */
+
+	gth_location_chooser_set_current (GTH_LOCATION_CHOOSER (data->location_chooser), gth_browser_get_location (browser));
+
+	/* Set the signals handlers. */
+
+	g_signal_connect (G_OBJECT (data->dialog),
+			  "destroy",
+			  G_CALLBACK (destroy_cb),
+			  data);
+	g_signal_connect (GET_WIDGET ("ok_button"),
+			  "clicked",
+			  G_CALLBACK (ok_clicked_cb),
+			  data);
+        g_signal_connect (GET_WIDGET ("help_button"),
+                          "clicked",
+                          G_CALLBACK (help_clicked_cb),
+                          data);
+	g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
+				  "clicked",
+				  G_CALLBACK (gtk_widget_destroy),
+				  G_OBJECT (data->dialog));
+
+	/* Run dialog. */
+
+
+	gtk_window_set_transient_for (GTK_WINDOW (data->dialog), GTK_WINDOW (browser));
+	gtk_window_set_modal (GTK_WINDOW (data->dialog), FALSE);
+	gtk_widget_show (data->dialog);
+}
diff --git a/extensions/find_duplicates/dlg-find-duplicates.h b/extensions/find_duplicates/dlg-find-duplicates.h
new file mode 100644
index 0000000..126d74e
--- /dev/null
+++ b/extensions/find_duplicates/dlg-find-duplicates.h
@@ -0,0 +1,31 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2005-2009 The Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DLG_FIND_DUPLICATES_H
+#define DLG_FIND_DUPLICATES_H
+
+#include <gthumb.h>
+
+
+void  dlg_find_duplicates  (GthBrowser *browser);
+
+
+#endif /* DLG_FIND_DUPLICATES_H */
diff --git a/extensions/find_duplicates/find_duplicates.extension.in.in b/extensions/find_duplicates/find_duplicates.extension.in.in
new file mode 100644
index 0000000..92f3652
--- /dev/null
+++ b/extensions/find_duplicates/find_duplicates.extension.in.in
@@ -0,0 +1,12 @@
+[Extension]
+_Name=Find Duplicates
+_Description=Find duplicated files.
+_Authors=gthumb development team
+Copyright=Copyright © 2010 The Free Software Foundation, Inc.
+Version=%VERSION%
+Category=Browser
+
+[Loader]
+Type=module
+File=%LIBRARY%
+Requires=catalogs
diff --git a/extensions/find_duplicates/main.c b/extensions/find_duplicates/main.c
new file mode 100644
index 0000000..483ae42
--- /dev/null
+++ b/extensions/find_duplicates/main.c
@@ -0,0 +1,53 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  GThumb
+ *
+ *  Copyright (C) 2008 Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <config.h>
+#include <gtk/gtk.h>
+#include <gthumb.h>
+#include "callbacks.h"
+
+
+G_MODULE_EXPORT void
+gthumb_extension_activate (void)
+{
+	gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (find_dup__gth_browser_construct_cb), NULL);
+	gth_hook_add_callback ("gth-browser-update-extra-widget", 20, G_CALLBACK (find_dup__gth_browser_update_extra_widget_cb), NULL);
+}
+
+
+G_MODULE_EXPORT void
+gthumb_extension_deactivate (void)
+{
+}
+
+
+G_MODULE_EXPORT gboolean
+gthumb_extension_is_configurable (void)
+{
+	return FALSE;
+}
+
+
+G_MODULE_EXPORT void
+gthumb_extension_configure (GtkWindow *parent)
+{
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]