]> saetta.ns0.it Git - nautilus-search-tool/commitdiff
Initial import
authorAndrea Zagli <azagli@libero.it>
Sun, 26 Apr 2009 06:12:56 +0000 (06:12 +0000)
committerAndrea Zagli <azagli@libero.it>
Sun, 26 Apr 2009 06:12:56 +0000 (06:12 +0000)
git-svn-id: http://saetta.homelinux.org/svn/nautilus-search-tool/trunk@1 20f00ee0-92f8-4baf-bd23-f7db83d90979

18 files changed:
AUTHORS [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
NEWS [new file with mode: 0644]
README [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
po/ChangeLog [new file with mode: 0644]
po/POTFILES.in [new file with mode: 0644]
po/es.po [new file with mode: 0644]
po/fr.po [new file with mode: 0644]
po/it.po [new file with mode: 0644]
po/sv.po [new file with mode: 0644]
po/tr.po [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/nautilus-search-tool.c [new file with mode: 0644]
src/nautilus-search-tool.h [new file with mode: 0644]
src/search-tool.c [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..ad1de0f
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Andrea Zagli <azagli@libero.it>
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..9397eec
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,37 @@
+2009-04-12  Andrea Zagli <azagli@libero.it>
+
+       * added turkish translation (thanks to Yavuz Selim)
+       * fixes to work with nautilus >= 2.22 (thanks to nautilus-open-terminal
+         authors)
+       * fixes to work with gnome-utils => 2.22
+       * version 0.3.0
+
+2007-07-01  Andrea Zagli <azagli@inwind.it>
+
+       * added french translation (thanks to RenZO)
+       * version 0.2.2
+
+2006-12-22  Andrea Zagli <azagli@inwind.it>
+
+       * general package's files adjustments
+       * added swedish translation (thanks to Daniel Nylander)
+
+2006-12-22  gettextize  <bug-gnu-gettext@gnu.org>
+
+       * Makefile.am (EXTRA_DIST): Add config.rpath, m4/ChangeLog.
+       * configure.ac (AC_CONFIG_FILES): Add po/Makefile.in.
+
+2006-10-21  gettextize  <bug-gnu-gettext@gnu.org>
+
+       * Makefile.am (EXTRA_DIST): Add m4/ChangeLog.
+
+2006-10-21  Andrea Zagli <azagli@inwind.it>
+
+       * some adjustments on autotools files 
+       * added spanish translation (thanks to Paco Avila)
+
+2006-02-17  Andrea Zagli <azagli@inwind.it>
+
+       * some adjustments on autotools files
+       * added possibility to search on current folder when right clicking a file
+       * added possibility to search on Desktop (thanks to Rork)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..4fc571d
--- /dev/null
@@ -0,0 +1,14 @@
+SUBDIRS = po \
+          src
+
+EXTRA_DIST = \
+             intltool-extract.in \
+             intltool-update.in \
+             intltool-merge.in
+
+DISTCLEANFILES = intltool-extract \
+                 intltool-update \
+                 intltool-merge \
+                 po/.intltool-merge-cache
+
+ACLOCAL_AMFLAGS = -I m4
diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..2de1cb9
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKGNAME=nautilus-search-tool
+REQUIRED_AUTOMAKE_VERSION=1.7
+
+(test -f $srcdir/configure.in) || {
+       echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+       echo " top-level $PKG_NAME directory"
+       exit 1
+}
+
+which gnome-autogen.sh || {
+       echo "You need to install gnome-common from the GNOME CVS"
+       exit 1
+}
+
+USE_GNOME2_MACROS=1 . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..f721cc1
--- /dev/null
@@ -0,0 +1,84 @@
+AC_PREREQ(2.59)
+AC_INIT([nautilus-search-tool], [0.3.0], [azagli@libero.it])
+AC_CONFIG_SRCDIR([src/search-tool.c])
+AM_CONFIG_HEADER(config.h)
+
+AM_INIT_AUTOMAKE
+
+NAUTILUS_REQUIRED=2.10.0
+EEL_REQUIRED=2.10.0
+GNOME_DESKTOP_REQUIRED=2.10.0
+GLIB_REQUIRED=2.6.0
+GNOME_VFS_REQUIRED=2.10.0
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_PROG_INTLTOOL([0.22])
+
+# Check for pkg-config
+AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test "x$HAVE_PKGCONFIG" = "xno"; then
+       AC_MSG_ERROR(You need to have pkgconfig installed)
+fi
+
+# Check for gnome-search-tool
+AC_CHECK_PROG(HAVE_GNOMESEARCHTOOL, gnome-search-tool, yes, no)
+AC_PATH_PROG(GNOME_SEARCH_TOOL, gnome-search-tool, no)
+if test "x$HAVE_GNOMESEARCHTOOL" = "xno"; then
+       AC_MSG_ERROR(You need to have gnome-search-tool installed, that it is inside gnome-utils)
+fi
+
+# Checks for libraries.
+PKG_CHECK_MODULES(NAUTILUS, libnautilus-extension >= $NAUTILUS_REQUIRED)
+PKG_CHECK_MODULES(GLIB, glib-2.0)
+PKG_CHECK_MODULES(GCONF, gconf-2.0)
+PKG_CHECK_MODULES(EEL, eel-2.0 >= $EEL_REQUIRED)
+PKG_CHECK_MODULES(GNOMEDESKTOP, gnome-desktop-2.0 >= $GNOME_DESKTOP_REQUIRED)
+PKG_CHECK_MODULES(GNOMEVFS, gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED)
+
+AC_SUBST(NAUTILUS_CFLAGS)
+AC_SUBST(NAUTILUS_LIBS)
+
+AC_SUBST(GCONF_CFLAGS)
+AC_SUBST(GCONF_LIBS)
+
+AC_SUBST(EEL_CFLAGS)
+AC_SUBST(EEL_LIBS)
+
+AC_SUBST(GNOMEDESKTOP_CFLAGS)
+AC_SUBST(GNOMEDESKTOP_LIBS)
+
+AC_SUBST(GNOMEVFS_CFLAGS)
+AC_SUBST(GNOMEVFS_LIBS)
+
+# Get nautilus extensions directory
+NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
+AC_SUBST(NAUTILUS_EXTENSION_DIR)
+
+# Get gnome-search-tool version
+GNOME_SEARCH_TOOL_VERSION=`$GNOME_SEARCH_TOOL --version`
+AC_SUBST(GNOME_SEARCH_TOOL_VERSION)
+AC_DEFINE_UNQUOTED(GNOME_SEARCH_TOOL_VERSION, "$GNOME_SEARCH_TOOL_VERSION", [gnome-search-tool version])
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+
+GETTEXT_PACKAGE=nautilus-search-tool
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext package])
+AC_DEFINE_UNQUOTED(GNOME_EXPLICIT_TRANSLATION_DOMAIN, "$GETTEXT_PACKAGE", [library gettext package])
+ALL_LINGUAS="es fr it sv tr"
+AM_GLIB_GNU_GETTEXT
+AM_GLIB_DEFINE_LOCALEDIR([GNOMELOCALEDIR])
+
+AC_CONFIG_FILES([
+       Makefile 
+       src/Makefile
+       po/Makefile.in 
+])
+AC_OUTPUT
diff --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644 (file)
index 0000000..4d14c63
--- /dev/null
@@ -0,0 +1,23 @@
+2008-04-28  gettextize  <bug-gnu-gettext@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.17.
+
+2007-07-01  gettextize  <bug-gnu-gettext@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.16.1.
+
+2007-07-01  Andrea Zagli <azagli@inwind.it>
+
+        * added french translation (thanks to RenZO)
+
+2006-12-22  gettextize  <bug-gnu-gettext@gnu.org>
+
+       * Makefile.in.in: New file, from gettext-0.16.1.
+       * boldquot.sed: New file, from gettext-0.16.1.
+       * en@boldquot.header: New file, from gettext-0.16.1.
+       * en@quot.header: New file, from gettext-0.16.1.
+       * insert-header.sin: New file, from gettext-0.16.1.
+       * quot.sed: New file, from gettext-0.16.1.
+       * remove-potcdate.sin: New file, from gettext-0.16.1.
+       * Rules-quot: New file, from gettext-0.16.1.
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644 (file)
index 0000000..f0a1fb0
--- /dev/null
@@ -0,0 +1,3 @@
+# List of source files containing translatable strings.
+# Please keep this list in alphabetic order.
+src/nautilus-search-tool.c
diff --git a/po/es.po b/po/es.po
new file mode 100644 (file)
index 0000000..ba6f98a
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,25 @@
+# Spanish translation of nautilus-search-tool.
+# Copyright (C) 2006 Paco Avila
+# This file is distributed under the same license as the nautilus-search-tool package.
+# Paco Avila <monkiki@gmail.com>, 2005-2006.
+# 
+# 
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-search-tool 0.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-09-22 09:55+0100\n"
+"PO-Revision-Date: 2006-09-22 09:17+0200\n"
+"Last-Translator: Paco Avila <monkiki@gmail.com>\n"
+"Language-Team: Spanish <Spanish <tp@lists.linux.es>>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/nautilus-search-tool.c:100
+msgid "Search for Files..."
+msgstr "Buscar archivos..."
+
+#: src/nautilus-search-tool.c:101
+msgid "Find files, folders, and documents on selected position"
+msgstr "Encuentra archivos, directorios y documentos en la ubicación indicada"
diff --git a/po/fr.po b/po/fr.po
new file mode 100644 (file)
index 0000000..6dbb5c6
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,26 @@
+# French translation of nautilus-search-tool.
+# Copyright (C) 2007 RenZO
+# This file is distributed under the same license as the nautilus-search-tool package.
+# RenZO <renzokiller@free.fr>, 2007.
+# 
+# 
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-search-tool 0.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-09-22 09:55+0100\n"
+"PO-Revision-Date: 2007-06-26 01:14+0200\n"
+"Last-Translator: RenZO <renzokiller@free.fr>\n"
+"Language-Team: French <gnomefr@traduc.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit"
+
+#: src/nautilus-search-tool.c:100
+msgid "Search for Files..."
+msgstr "Rechercher des fichiers..."
+
+#: src/nautilus-search-tool.c:101
+msgid "Find files, folders, and documents on selected position"
+msgstr "Rechercher des fichiers, des dossiers et des documents dans l'emplacement sélectionné"
+
diff --git a/po/it.po b/po/it.po
new file mode 100644 (file)
index 0000000..6a085b4
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,25 @@
+# Italian translation of nautilus-search-tool.
+# Copyright (C) 2005 Andrea Zagli
+# This file is distributed under the same license as the nautilus-search-tool package.
+# Andrea Zagli <azagli@inwind.it>, 2005-2006.
+# 
+# 
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-search-tool 0.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-02-17 17:55+0100\n"
+"PO-Revision-Date: 2006-02-17 17:17+0200\n"
+"Last-Translator: Andrea Zagli <azagli@inwind.it>\n"
+"Language-Team: Italian <Italian <tp@lists.linux.it>>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/nautilus-search-tool.c:100
+msgid "Search for Files..."
+msgstr "Cerca file..."
+
+#: src/nautilus-search-tool.c:101
+msgid "Find files, folders, and documents on selected position"
+msgstr "Trova file, cartelle e documenti nella posizione selezionata"
diff --git a/po/sv.po b/po/sv.po
new file mode 100644 (file)
index 0000000..94f5223
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,26 @@
+# Swedish translation of nautilus-search-tool.
+# Copyright (C) 2005 Andrea Zagli
+# This file is distributed under the same license as the nautilus-search-tool package.
+# Daniel Nylander <po@danielnylander.se>, 2006.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-search-tool 0.21\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-02-17 17:55+0100\n"
+"PO-Revision-Date: 2006-11-04 23:14+0100\n"
+"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
+"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/nautilus-search-tool.c:100
+msgid "Search for Files..."
+msgstr "Sök efter filer..."
+
+#: src/nautilus-search-tool.c:101
+msgid "Find files, folders, and documents on selected position"
+msgstr "Hitta filer, mappar, och dokument på markerad position"
+
diff --git a/po/tr.po b/po/tr.po
new file mode 100644 (file)
index 0000000..9a11980
--- /dev/null
+++ b/po/tr.po
@@ -0,0 +1,25 @@
+# Spanish translation of nautilus-search-tool.
+# Copyright (C) 2006 Paco Avila
+# This file is distributed under the same license as the nautilus-search-tool package.
+# Paco Avila <monkiki@gmail.com>, 2005-2006.
+# 
+# 
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-search-tool 0.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-09-22 09:55+0100\n"
+"PO-Revision-Date: 2006-09-22 09:17+0200\n"
+"Last-Translator: yavuz selim burgu <turkalinux@gmail.com>\n"
+"Language-Team: Lapis Linux-Sevenler <>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/nautilus-search-tool.c:100
+msgid "Search for Files..."
+msgstr "Dosya Ara "
+
+#: src/nautilus-search-tool.c:101
+msgid "Find files, folders, and documents on selected position"
+msgstr "Dosyaları, dizinleri ve belgeleri seçilen konumda bul"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..c41c45a
--- /dev/null
@@ -0,0 +1,28 @@
+INCLUDES = -DG_LOG_DOMAIN=\"Nautilus-Search-Tool\" \
+           -DDATADIR=\"$(datadir)\" \
+           -I$(top_srcdir) \
+           -I$(top_builddir) \
+           $(WARN_CFLAGS) \
+           -Werror \
+           $(DISABLE_DEPRECATED_CFLAGS) \
+           $(NAUTILUS_CFLAGS) \
+           $(GCONF_CFLAGS) \
+           $(EEL_CFLAGS) \
+           $(GNOMEDESKTOP_CFLAGS) \
+           $(GNOMEVFS_CFALGS)
+
+nautilus_extensiondir=$(NAUTILUS_EXTENSION_DIR)
+
+nautilus_extension_LTLIBRARIES=libnautilus-search-tool.la
+
+libnautilus_search_tool_la_SOURCES = \
+                                     nautilus-search-tool.c \
+                                     nautilus-search-tool.h \
+                                     search-tool.c
+
+libnautilus_search_tool_la_LDFLAGS = -module -avoid-version
+libnautilus_search_tool_la_LIBADD  = $(NAUTILUS_LIBS) \
+                                     $(EEL_LIBS) \
+                                     $(GNOMEVFS_LIBS) \
+                                     $(GCONF_LIBS) \
+                                     $(GNOMEDESKTOP_LIBS)
diff --git a/src/nautilus-search-tool.c b/src/nautilus-search-tool.c
new file mode 100644 (file)
index 0000000..476a1f0
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ *  nautilus-search-tool.c
+ * 
+ *  Copyright (C) 2005-2009 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of nautilus-search-tool.
+ *  
+ *  nautilus-search-tool 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.
+ *  
+ *  nautilus-search-tool 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 nautilus-search-tool; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ */
+
+#ifdef HAVE_CONFIG_H
+       #include <config.h> /* for GETTEXT_PACKAGE */
+#endif
+
+#include "nautilus-search-tool.h"
+
+#include <libnautilus-extension/nautilus-menu-provider.h>
+
+#include <glib/gi18n-lib.h>
+#include <gtk/gtkicontheme.h>
+#include <gtk/gtkwidget.h>
+#include <gconf/gconf-client.h>
+#include <libgnome/gnome-desktop-item.h>
+
+static void nautilus_search_tool_instance_init (NautilusSearchTool *cvs);
+static void nautilus_search_tool_class_init    (NautilusSearchToolClass *class);
+
+static GType search_tool_type = 0;
+
+static void
+search_tool_callback (NautilusMenuItem *item,
+                      NautilusFileInfo *file_info)
+{
+       gchar *uri,
+             *argv[3],
+             *working_directory,
+             *quoted_directory;
+
+       g_print ("Search Tool selected\n");
+
+       uri = nautilus_file_info_get_uri (file_info);
+
+       if (uri)
+               {
+                       if (strcmp (nautilus_file_info_get_uri_scheme (file_info), "x-nautilus-desktop") == 0)
+                               {
+                                       working_directory = g_strdup_printf ("%s/Desktop", g_get_home_dir ());
+                               }
+                       else
+                               {
+                                       working_directory = g_filename_from_uri (uri, NULL, NULL);
+                               }
+               }
+       else
+               {
+                       working_directory = g_strdup (g_get_home_dir ());
+               }
+
+       if (!nautilus_file_info_is_directory (file_info))
+               working_directory = g_path_get_dirname (working_directory);
+
+       g_free (uri);
+
+       argv[0] = g_strdup ("gnome-search-tool");
+       quoted_directory = g_shell_quote (working_directory);
+
+#ifdef GNOME_SEARCH_TOOL_VERSION
+       guint i;
+       gchar *version;
+
+       gchar **array_version = g_strsplit (GNOME_SEARCH_TOOL_VERSION, " ", -1);
+       guint array_lenght = g_strv_length (array_version);
+
+       for (i = 0; i < array_lenght; i++)
+               {
+                       if (isdigit (array_version[i][0]))
+                               {
+                                       version = g_strdup (array_version[i]);
+                                       g_strfreev (array_version);
+
+                                       array_version = g_strsplit (version, ".", -1);
+                                       break;
+                               }
+               }
+
+       if (atoi (array_version[0]) == 2 && atoi (array_version[1]) >= 22)
+               {
+                       argv[1] = NULL;
+               }
+       else
+               {
+                       argv[1] = g_strdup_printf ("--path=%s", quoted_directory);
+                       argv[2] = NULL;
+               }
+
+       g_free (version);
+       g_strfreev (array_version);
+#else
+       argv[1] = NULL;
+#endif /* GNOME_SEARCH_TOOL */
+
+       g_spawn_async (working_directory,
+                      argv,
+                      NULL,
+                      G_SPAWN_SEARCH_PATH,
+                      NULL,
+                      NULL,
+                      NULL,
+                      NULL);
+
+       g_free (quoted_directory);
+       g_free (working_directory);
+       g_free (argv[0]);
+       g_free (argv[1]);
+}
+
+static NautilusMenuItem *
+search_tool_menu_item_new ()
+{
+       return nautilus_menu_item_new ("NautilusSearchTool::search_tool",
+                                      _("Search for Files..."),
+                                      _("Find files, folders, and documents on selected position"),
+                                      "gnome-searchtool");
+}
+
+static GList *
+nautilus_search_tool_get_background_items (NautilusMenuProvider *provider,
+                                           GtkWidget            *window,
+                                           NautilusFileInfo     *file_info)
+{
+       NautilusMenuItem *item;
+
+       item = search_tool_menu_item_new ();
+       g_signal_connect (item, "activate",
+                         G_CALLBACK (search_tool_callback),
+                         file_info);
+
+       return g_list_append (NULL, item);
+}
+
+GList *
+nautilus_search_tool_get_file_items (NautilusMenuProvider *provider,
+                                     GtkWidget            *window,
+                                     GList                *files)
+{
+       NautilusMenuItem *item;
+
+       if (g_list_length (files) != 1)
+               return NULL;
+
+       item = search_tool_menu_item_new ();
+       g_signal_connect (item, "activate",
+                         G_CALLBACK (search_tool_callback),
+                         files->data);
+
+       return g_list_append (NULL, item);
+}
+
+static void
+nautilus_search_tool_menu_provider_iface_init (NautilusMenuProviderIface *iface)
+{
+       iface->get_background_items = nautilus_search_tool_get_background_items;
+       iface->get_file_items = nautilus_search_tool_get_file_items;
+}
+
+static void 
+nautilus_search_tool_instance_init (NautilusSearchTool *cvs)
+{
+}
+
+static void
+nautilus_search_tool_class_init (NautilusSearchToolClass *class)
+{
+}
+
+GType
+nautilus_search_tool_get_type (void) 
+{
+       return search_tool_type;
+}
+
+void
+nautilus_search_tool_register_type (GTypeModule *module)
+{
+       static const GTypeInfo info = {
+               sizeof (NautilusSearchToolClass),
+               (GBaseInitFunc) NULL,
+               (GBaseFinalizeFunc) NULL,
+               (GClassInitFunc) nautilus_search_tool_class_init,
+               NULL, 
+               NULL,
+               sizeof (NautilusSearchTool),
+               0,
+               (GInstanceInitFunc) nautilus_search_tool_instance_init,
+       };
+
+       static const GInterfaceInfo menu_provider_iface_info = {
+               (GInterfaceInitFunc) nautilus_search_tool_menu_provider_iface_init,
+               NULL,
+               NULL
+       };
+
+       search_tool_type = g_type_module_register_type (module,
+                                                       G_TYPE_OBJECT,
+                                                       "NautilusSearchTool",
+                                                       &info, 0);
+
+       g_type_module_add_interface (module,
+                                    search_tool_type,
+                                    NAUTILUS_TYPE_MENU_PROVIDER,
+                                    &menu_provider_iface_info);
+}
diff --git a/src/nautilus-search-tool.h b/src/nautilus-search-tool.h
new file mode 100644 (file)
index 0000000..889c9fd
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *  nautilus-search-tool.h
+ * 
+ *  Copyright (C) 2005-2009 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of nautilus-search-tool.
+ *  
+ *  nautilus-search-tool 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.
+ *  
+ *  nautilus-search-tool 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 nautilus-search-tool; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ */
+
+#ifndef NAUTILUS_SEARCH_TOOL_H
+#define NAUTILUS_SEARCH_TOOL_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* Declarations for the search tool extension object.  This object will be
+ * instantiated by nautilus.  It implements the GInterfaces 
+ * exported by libnautilus. */
+#define NAUTILUS_TYPE_SEARCH_TOOL        (nautilus_search_tool_get_type ())
+#define NAUTILUS_SEARCH_TOOL(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), NAUTILUS_TYPE_SEARCH_TOOL, NautilusSearchTool))
+#define NAUTILUS_IS_SEARCH_TOOL(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), NAUTILUS_TYPE_SEARCH_TOOL))
+
+typedef struct _NautilusSearchTool NautilusSearchTool;
+typedef struct _NautilusSearchToolClass NautilusSearchToolClass;
+
+struct _NautilusSearchTool {
+       GObject parent_slot;
+};
+
+struct _NautilusSearchToolClass {
+       GObjectClass parent_slot;
+};
+
+GType nautilus_search_tool_get_type (void);
+void  nautilus_search_tool_register_type (GTypeModule *module);
+
+G_END_DECLS
+
+#endif
diff --git a/src/search-tool.c b/src/search-tool.c
new file mode 100644 (file)
index 0000000..2c5b0be
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ *  search-tool.c
+ * 
+ *  Copyright (C) 2005-2009 Andrea Zagli <azagli@libero.it>
+ *
+ *  This file is part of nautilus-search-tool.
+ *  
+ *  nautilus-search-tool 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.
+ *  
+ *  nautilus-search-tool 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 nautilus-search-tool; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ */
+
+#ifdef HAVE_CONFIG_H
+       #include <config.h>
+#endif
+
+#include "nautilus-search-tool.h"
+
+#include <libintl.h>
+
+static GType type_list[1];
+
+void
+nautilus_module_initialize (GTypeModule *module)
+{
+       g_print ("Initializing nautilus-search-tool extension\n");
+
+       nautilus_search_tool_register_type (module);
+       type_list[0] = NAUTILUS_TYPE_SEARCH_TOOL;
+
+       bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+       bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+}
+
+void
+nautilus_module_shutdown (void)
+{
+       g_print ("Shutting down nautilus-search-tool extension\n");
+}
+
+void 
+nautilus_module_list_types (const GType **types,
+                           int          *num_types)
+{
+       *types = type_list;
+       *num_types = G_N_ELEMENTS (type_list);
+}