Commit d3aeccf7 authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Emmanuele Bassi

Add search file support in the GtkFileChooser. Original patch by Federico

2007-05-02  Emmanuele Bassi  <ebassi@gnome.org>

	Add search file support in the GtkFileChooser. Original patch
	by Federico Mena Quintero; patch updated by Matthias Clasen.
	See bug #344785.

	* gtk/gtksearchengine.[ch]: Private search engine abstraction
	object.

	* gtk/gtksearchenginebeagle.[ch]: Private search engine
	implementation using libbeagle (via g_module_open()).

	* gtk/gtksearchenginesimple.[ch]: Private search engine
	implementation using file tree walking.

	* gtk/gtksearchenginetracker.[ch]: Private earch engine
	implementation using libtracker (via g_module_open()).

	* gtk/gtkquery.[ch]: Private query object for the search
	engines.

	* gtk/gtkfilechooserprivate.h:
	* gtk/gtkfilechooserdefault.c: Use the GtkSearchEngine to
	query a search engine backend using GtkQuery; create a new
	operating mode, OPERATION_MODE_SEARCH, and call the common
	operating mode OPERATION_MODE_BROWSE; add support for virtual
	shortcuts inside the shortcuts model and create a new "Search"
	virtual shortcut.

	* gtk/Makefile.am: Update the build with the new files

svn path=/trunk/; revision=17783
parent e82e337e
2007-05-02 Emmanuele Bassi <ebassi@gnome.org>
Add search file support in the GtkFileChooser. Original patch
by Federico Mena Quintero; patch updated by Matthias Clasen.
See bug #344785.
* gtk/gtksearchengine.[ch]: Private search engine abstraction
object.
* gtk/gtksearchenginebeagle.[ch]: Private search engine
implementation using libbeagle (via g_module_open()).
* gtk/gtksearchenginesimple.[ch]: Private search engine
implementation using file tree walking.
* gtk/gtksearchenginetracker.[ch]: Private earch engine
implementation using libtracker (via g_module_open()).
* gtk/gtkquery.[ch]: Private query object for the search
engines.
* gtk/gtkfilechooserprivate.h:
* gtk/gtkfilechooserdefault.c: Use the GtkSearchEngine to
query a search engine backend using GtkQuery; create a new
operating mode, OPERATION_MODE_SEARCH, and call the common
operating mode OPERATION_MODE_BROWSE; add support for virtual
shortcuts inside the shortcuts model and create a new "Search"
virtual shortcut.
* gtk/Makefile.am: Update the build with the new files
2007-05-02 Armin Burgmeier <armin@openismus.com>
* gtk/gtkcombobox.c: Destroy the menu in dispose instead of
......
......@@ -335,6 +335,11 @@ gtk_semi_private_h_sources = \
# GTK+ header files that don't get installed
gtk_private_h_sources = \
gtkquery.h \
gtksearchengine.h \
gtksearchenginebeagle.h \
gtksearchenginetracker.h\
gtksearchenginesimple.h \
gtkdndcursors.h \
gtkentryprivate.h \
gtkfilechooserdefault.h \
......@@ -376,6 +381,11 @@ gtk_private_h_sources = \
# GTK+ C sources to build the library from
gtk_base_c_sources = \
gtkquery.c \
gtksearchengine.c \
gtksearchenginebeagle.c \
gtksearchenginetracker.c\
gtksearchenginesimple.c \
fnmatch.c \
gtkaboutdialog.c \
gtkaccelgroup.c \
......
This diff is collapsed.
......@@ -25,6 +25,8 @@
#include "gtkfilesystem.h"
#include "gtkfilesystemmodel.h"
#include "gtkliststore.h"
#include "gtksearchengine.h"
#include "gtkquery.h"
#include "gtktooltips.h"
#include "gtktreemodelsort.h"
#include "gtktreestore.h"
......@@ -147,6 +149,11 @@ typedef enum {
LOCATION_MODE_FILENAME_ENTRY
} LocationMode;
typedef enum {
OPERATION_MODE_BROWSE,
OPERATION_MODE_SEARCH
} OperationMode;
struct _GtkFileChooserDefault
{
GtkVBox parent_instance;
......@@ -175,11 +182,19 @@ struct _GtkFileChooserDefault
GtkWidget *browse_files_popup_menu_add_shortcut_item;
GtkWidget *browse_files_popup_menu_hidden_files_item;
GtkWidget *browse_new_folder_button;
GtkWidget *browse_path_bar_hbox;
GtkWidget *browse_path_bar;
GtkFileSystemModel *browse_files_model;
char *browse_files_last_selected_name;
/* Widgets for searching */
GtkWidget *search_hbox;
GtkWidget *search_entry;
GtkSearchEngine *search_engine;
GtkQuery *search_query;
GtkListStore *search_model;
GtkWidget *filter_combo_hbox;
GtkWidget *filter_combo;
GtkWidget *preview_box;
......@@ -195,7 +210,16 @@ struct _GtkFileChooserDefault
LocationMode location_mode;
GtkListStore *shortcuts_model;
GtkTreeModel *shortcuts_filter_model;
/* Filter for the shortcuts pane. We filter out the "current folder" row and
* the separator that we use for the "Save in folder" combo.
*/
GtkTreeModel *shortcuts_pane_filter_model;
/* Filter for the "Save in folder" combo. We filter out the Search row and
* its separator.
*/
GtkTreeModel *shortcuts_combo_filter_model;
GtkTreeModelSort *sort_model;
......@@ -215,6 +239,8 @@ struct _GtkFileChooserDefault
ReloadState reload_state;
guint load_timeout_id;
OperationMode operation_mode;
GSList *pending_select_paths;
GtkFileFilter *current_filter;
......@@ -222,9 +248,6 @@ struct _GtkFileChooserDefault
GtkTooltips *tooltips;
gboolean has_home;
gboolean has_desktop;
int num_volumes;
int num_shortcuts;
int num_bookmarks;
......@@ -239,6 +262,7 @@ struct _GtkFileChooserDefault
GtkTreeViewColumn *list_name_column;
GtkCellRenderer *list_name_renderer;
GtkTreeViewColumn *list_mtime_column;
GSource *edited_idle;
char *edited_new_text;
......@@ -266,6 +290,9 @@ struct _GtkFileChooserDefault
guint changing_folder : 1;
guint shortcuts_current_folder_active : 1;
guint expand_folders : 1;
guint has_home : 1;
guint has_desktop : 1;
guint has_search : 1;
#if 0
guint shortcuts_drag_outside : 1;
......
/*
* Copyright (C) 2005 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
*
* Author: Anders Carlsson <andersca@imendio.com>
*
* Based on nautilus-query.c
*/
#include <config.h>
#include <string.h>
#include "gtkquery.h"
struct _GtkQueryPrivate
{
gchar *text;
gchar *location_uri;
GList *mime_types;
};
G_DEFINE_TYPE (GtkQuery, _gtk_query, G_TYPE_OBJECT);
static void
finalize (GObject *object)
{
GtkQuery *query;
query = GTK_QUERY (object);
g_free (query->priv->text);
G_OBJECT_CLASS (_gtk_query_parent_class)->finalize (object);
}
static void
_gtk_query_class_init (GtkQueryClass *class)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (class);
gobject_class->finalize = finalize;
g_type_class_add_private (gobject_class, sizeof (GtkQueryPrivate));
}
static void
_gtk_query_init (GtkQuery *query)
{
query->priv = G_TYPE_INSTANCE_GET_PRIVATE (query, GTK_TYPE_QUERY, GtkQueryPrivate);
}
GtkQuery *
_gtk_query_new (void)
{
return g_object_new (GTK_TYPE_QUERY, NULL);
}
gchar *
_gtk_query_get_text (GtkQuery *query)
{
return g_strdup (query->priv->text);
}
void
_gtk_query_set_text (GtkQuery *query,
const gchar *text)
{
g_free (query->priv->text);
query->priv->text = g_strdup (text);
}
gchar *
_gtk_query_get_location (GtkQuery *query)
{
return g_strdup (query->priv->location_uri);
}
void
_gtk_query_set_location (GtkQuery *query,
const gchar *uri)
{
g_free (query->priv->location_uri);
query->priv->location_uri = g_strdup (uri);
}
GList *
_gtk_query_get_mime_types (GtkQuery *query)
{
GList *list, *l;
gchar *mime_type;
list = NULL;
for (l = query->priv->mime_types; l; l = l->next)
{
mime_type = (gchar*)l->data;
list = g_list_prepend (list, g_strdup (mime_type));
}
return list;
}
void
_gtk_query_set_mime_types (GtkQuery *query,
GList *mime_types)
{
GList *l;
gchar *mime_type;
g_list_foreach (query->priv->mime_types, (GFunc)g_free, NULL);
g_list_free (query->priv->mime_types);
query->priv->mime_types = NULL;
for (l = mime_types; l; l = l->next)
{
mime_type = (gchar*)l->data;
query->priv->mime_types = g_list_prepend (query->priv->mime_types, g_strdup (mime_type));
}
}
void
_gtk_query_add_mime_type (GtkQuery *query,
const gchar *mime_type)
{
query->priv->mime_types = g_list_prepend (query->priv->mime_types,
g_strdup (mime_type));
}
/*
* Copyright (C) 2005 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
*
* Author: Anders Carlsson <andersca@imendio.com>
*
* Based on nautilus-query.h
*/
#ifndef __GTK_QUERY_H__
#define __GTK_QUERY_H__
#include <glib-object.h>
G_BEGIN_DECLS
#define GTK_TYPE_QUERY (_gtk_query_get_type ())
#define GTK_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_QUERY, GtkQuery))
#define GTK_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_QUERY, GtkQueryClass))
#define GTK_IS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_QUERY))
#define GTK_IS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_QUERY))
#define GTK_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_QUERY, GtkQueryClass))
typedef struct _GtkQuery GtkQuery;
typedef struct _GtkQueryClass GtkQueryClass;
typedef struct _GtkQueryPrivate GtkQueryPrivate;
struct _GtkQuery
{
GObject parent;
GtkQueryPrivate *priv;
};
struct _GtkQueryClass
{
GObjectClass parent_class;
};
GType _gtk_query_get_type (void);
gboolean _gtk_query_enabled (void);
GtkQuery* _gtk_query_new (void);
gchar* _gtk_query_get_text (GtkQuery *query);
void _gtk_query_set_text (GtkQuery *query,
const gchar *text);
gchar* _gtk_query_get_location (GtkQuery *query);
void _gtk_query_set_location (GtkQuery *query,
const gchar *uri);
GList* _gtk_query_get_mime_types (GtkQuery *query);
void _gtk_query_set_mime_types (GtkQuery *query,
GList *mime_types);
void _gtk_query_add_mime_type (GtkQuery *query,
const gchar *mime_type);
G_END_DECLS
#endif /* __GTK_QUERY_H__ */
/*
* Copyright (C) 2005 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
*
* Author: Anders Carlsson <andersca@imendio.com>
*
* Based on nautilus-search-engine.c
*/
#include <config.h>
#include "gtksearchengine.h"
#include "gtksearchenginebeagle.h"
#include "gtksearchenginesimple.h"
#include "gtksearchenginetracker.h"
#define HAVE_BEAGLE 1
#define HAVE_TRACKER 1
enum
{
HITS_ADDED,
HITS_SUBTRACTED,
FINISHED,
ERROR,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
G_DEFINE_ABSTRACT_TYPE (GtkSearchEngine, _gtk_search_engine, G_TYPE_OBJECT);
static void
finalize (GObject *object)
{
G_OBJECT_CLASS (_gtk_search_engine_parent_class)->finalize (object);
}
static void
_gtk_search_engine_class_init (GtkSearchEngineClass *class)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (class);
gobject_class->finalize = finalize;
signals[HITS_ADDED] =
g_signal_new ("hits-added",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkSearchEngineClass, hits_added),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
G_TYPE_POINTER);
signals[HITS_SUBTRACTED] =
g_signal_new ("hits-subtracted",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkSearchEngineClass, hits_subtracted),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
G_TYPE_POINTER);
signals[FINISHED] =
g_signal_new ("finished",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkSearchEngineClass, finished),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[ERROR] =
g_signal_new ("error",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkSearchEngineClass, error),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
}
static void
_gtk_search_engine_init (GtkSearchEngine *engine)
{
}
GtkSearchEngine *
_gtk_search_engine_new (void)
{
GtkSearchEngine *engine;
#ifdef HAVE_TRACKER
engine = _gtk_search_engine_tracker_new ();
if (engine)
return engine;
#endif
#ifdef HAVE_BEAGLE
engine = _gtk_search_engine_beagle_new ();
if (engine)
return engine;
#endif
engine = _gtk_search_engine_simple_new ();
return engine;
}
void
_gtk_search_engine_set_query (GtkSearchEngine *engine,
GtkQuery *query)
{
g_return_if_fail (GTK_IS_SEARCH_ENGINE (engine));
g_return_if_fail (GTK_SEARCH_ENGINE_GET_CLASS (engine)->set_query != NULL);
GTK_SEARCH_ENGINE_GET_CLASS (engine)->set_query (engine, query);
}
void
_gtk_search_engine_start (GtkSearchEngine *engine)
{
g_return_if_fail (GTK_IS_SEARCH_ENGINE (engine));
g_return_if_fail (GTK_SEARCH_ENGINE_GET_CLASS (engine)->start != NULL);
GTK_SEARCH_ENGINE_GET_CLASS (engine)->start (engine);
}
void
_gtk_search_engine_stop (GtkSearchEngine *engine)
{
g_return_if_fail (GTK_IS_SEARCH_ENGINE (engine));
g_return_if_fail (GTK_SEARCH_ENGINE_GET_CLASS (engine)->stop != NULL);
GTK_SEARCH_ENGINE_GET_CLASS (engine)->stop (engine);
}
gboolean
_gtk_search_engine_is_indexed (GtkSearchEngine *engine)
{
g_return_val_if_fail (GTK_IS_SEARCH_ENGINE (engine), FALSE);
g_return_val_if_fail (GTK_SEARCH_ENGINE_GET_CLASS (engine)->is_indexed != NULL, FALSE);
return GTK_SEARCH_ENGINE_GET_CLASS (engine)->is_indexed (engine);
}
void
_gtk_search_engine_hits_added (GtkSearchEngine *engine,
GList *hits)
{
g_return_if_fail (GTK_IS_SEARCH_ENGINE (engine));
g_signal_emit (engine, signals[HITS_ADDED], 0, hits);
}
void
_gtk_search_engine_hits_subtracted (GtkSearchEngine *engine,
GList *hits)
{
g_return_if_fail (GTK_IS_SEARCH_ENGINE (engine));
g_signal_emit (engine, signals[HITS_SUBTRACTED], 0, hits);
}
void
_gtk_search_engine_finished (GtkSearchEngine *engine)
{
g_return_if_fail (GTK_IS_SEARCH_ENGINE (engine));
g_signal_emit (engine, signals[FINISHED], 0);
}
void
_gtk_search_engine_error (GtkSearchEngine *engine,
const gchar *error_message)
{
g_return_if_fail (GTK_IS_SEARCH_ENGINE (engine));
g_signal_emit (engine, signals[ERROR], 0, error_message);
}
/*
* Copyright (C) 2005 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
*
* Author: Anders Carlsson <andersca@imendio.com>
*
* Based on nautilus-search-engine.h
*/
#ifndef __GTK_SEARCH_ENGINE_H__
#define __GTK_SEARCH_ENGINE_H__
#include <glib-object.h>
#include "gtkquery.h"
G_BEGIN_DECLS
#define GTK_TYPE_SEARCH_ENGINE (_gtk_search_engine_get_type ())
#define GTK_SEARCH_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngine))
#define GTK_SEARCH_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngineClass))
#define GTK_IS_SEARCH_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SEARCH_ENGINE))
#define GTK_IS_SEARCH_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SEARCH_ENGINE))
#define GTK_SEARCH_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SEARCH_ENGINE, GtkSearchEngineClass))
typedef struct _GtkSearchEngine GtkSearchEngine;
typedef struct _GtkSearchEngineClass GtkSearchEngineClass;
typedef struct _GtkSearchEnginePrivate GtkSearchEnginePrivate;
struct _GtkSearchEngine
{
GObject parent;
GtkSearchEnginePrivate *priv;
};
struct _GtkSearchEngineClass
{
GObjectClass parent_class;
/* VTable */
void (*set_query) (GtkSearchEngine *engine,
GtkQuery *query);
void (*start) (GtkSearchEngine *engine);
void (*stop) (GtkSearchEngine *engine);
gboolean (*is_indexed) (GtkSearchEngine *engine);
/* Signals */
void (*hits_added) (GtkSearchEngine *engine,
GList *hits);
void (*hits_subtracted) (GtkSearchEngine *engine,
GList *hits);
void (*finished) (GtkSearchEngine *engine);
void (*error) (GtkSearchEngine *engine,
const gchar *error_message);
};
GType _gtk_search_engine_get_type (void);
gboolean _gtk_search_engine_enabled (void);
GtkSearchEngine* _gtk_search_engine_new (void);
void _gtk_search_engine_set_query (GtkSearchEngine *engine,
GtkQuery *query);
void _gtk_search_engine_start (GtkSearchEngine *engine);
void _gtk_search_engine_stop (GtkSearchEngine *engine);
gboolean _gtk_search_engine_is_indexed (GtkSearchEngine *engine);
void _gtk_search_engine_hits_added (GtkSearchEngine *engine,
GList *hits);
void _gtk_search_engine_hits_subtracted (GtkSearchEngine *engine,
GList *hits);
void _gtk_search_engine_finished (GtkSearchEngine *engine);
void _gtk_search_engine_error (GtkSearchEngine *engine,
const gchar *error_message);
G_END_DECLS
#endif /* __GTK_SEARCH_ENGINE_H__ */
This diff is collapsed.
/*
* Copyright (C) 2005 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
*
* Author: Anders Carlsson <andersca@imendio.com>
*
* Based on nautilus-search-engine-beagle.h
*/
#ifndef __GTK_SEARCH_ENGINE_BEAGLE_H__
#define __GTK_SEARCH_ENGINE_BEAGLE_H__
#include "gtksearchengine.h"
G_BEGIN_DECLS
#define GTK_TYPE_SEARCH_ENGINE_BEAGLE (_gtk_search_engine_beagle_get_type ())
#define GTK_SEARCH_ENGINE_BEAGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SEARCH_ENGINE_BEAGLE, GtkSearchEngineBeagle))
#define GTK_SEARCH_ENGINE_BEAGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SEARCH_ENGINE_BEAGLE, GtkSearchEngineBeagleClass))
#define GTK_IS_SEARCH_ENGINE_BEAGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SEARCH_ENGINE_BEAGLE))
#define GTK_IS_SEARCH_ENGINE_BEAGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SEARCH_ENGINE_BEAGLE))
#define GTK_SEARCH_ENGINE_BEAGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SEARCH_ENGINE_BEAGLE, GtkSearchEngineBeagleClass))
typedef struct _GtkSearchEngineBeagle GtkSearchEngineBeagle;
typedef struct _GtkSearchEngineBeagleClass GtkSearchEngineBeagleClass;
typedef struct _GtkSearchEngineBeaglePrivate GtkSearchEngineBeaglePrivate;
struct _GtkSearchEngineBeagle
{
GtkSearchEngine parent;
GtkSearchEngineBeaglePrivate *priv;
};
struct _GtkSearchEngineBeagleClass
{
GtkSearchEngineClass parent_class;
};
GType _gtk_search_engine_beagle_get_type (void);
GtkSearchEngine* _gtk_search_engine_beagle_new (void);
G_END_DECLS
#endif /* __GTK_SEARCH_ENGINE_BEAGLE_H__ */
/*
* Copyright (C) 2005 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
*
* Author: Alexander Larsson <alexl@redhat.com>
*
* Based on nautilus-search-engine-simple.c
*/
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
#include <config.h>
#include "gtksearchenginesimple.h"
#define XDG_PREFIX _gtk_xdg
#include "xdgmime/xdgmime.h"
#include <string.h>
#include <ftw.h>
#include <glib/gstrfuncs.h>
#define BATCH_SIZE 500
typedef struct
{