/* gnome-bookmarks-plugin.c generated by valac 0.56.17, the Vala compiler
 * generated from gnome-bookmarks-plugin.vala, do not modify */

/*
 * Copyright (C) 2014 Rico Tzschichholz <ricotz@ubuntu.com>
 *
 * 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 3 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 "plugins.h"
#include <glib.h>
#include <synapse-core.h>
#include <glib-object.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gstdio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH (synapse_gnome_bookmarks_plugin_bookmark_match_get_type ())
#define SYNAPSE_GNOME_BOOKMARKS_PLUGIN_BOOKMARK_MATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH, SynapseGnomeBookmarksPluginBookmarkMatch))
#define SYNAPSE_GNOME_BOOKMARKS_PLUGIN_BOOKMARK_MATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH, SynapseGnomeBookmarksPluginBookmarkMatchClass))
#define SYNAPSE_GNOME_BOOKMARKS_PLUGIN_IS_BOOKMARK_MATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH))
#define SYNAPSE_GNOME_BOOKMARKS_PLUGIN_IS_BOOKMARK_MATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH))
#define SYNAPSE_GNOME_BOOKMARKS_PLUGIN_BOOKMARK_MATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH, SynapseGnomeBookmarksPluginBookmarkMatchClass))

typedef struct _SynapseGnomeBookmarksPluginBookmarkMatch SynapseGnomeBookmarksPluginBookmarkMatch;
typedef struct _SynapseGnomeBookmarksPluginBookmarkMatchClass SynapseGnomeBookmarksPluginBookmarkMatchClass;
enum  {
	SYNAPSE_GNOME_BOOKMARKS_PLUGIN_0_PROPERTY,
	SYNAPSE_GNOME_BOOKMARKS_PLUGIN_ENABLED_PROPERTY,
	SYNAPSE_GNOME_BOOKMARKS_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* synapse_gnome_bookmarks_plugin_properties[SYNAPSE_GNOME_BOOKMARKS_PLUGIN_NUM_PROPERTIES];
#define _synapse_utils_async_once_unref0(var) ((var == NULL) ? NULL : (var = (synapse_utils_async_once_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _SynapseGnomeBookmarksPluginSearchData SynapseGnomeBookmarksPluginSearchData;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _SynapseGnomeBookmarksPluginParseBookmarksData SynapseGnomeBookmarksPluginParseBookmarksData;
typedef struct _SynapseGnomeBookmarksPluginBookmarkMatchPrivate SynapseGnomeBookmarksPluginBookmarkMatchPrivate;
enum  {
	SYNAPSE_GNOME_BOOKMARKS_PLUGIN_BOOKMARK_MATCH_0_PROPERTY,
	SYNAPSE_GNOME_BOOKMARKS_PLUGIN_BOOKMARK_MATCH_NUM_PROPERTIES
};
static GParamSpec* synapse_gnome_bookmarks_plugin_bookmark_match_properties[SYNAPSE_GNOME_BOOKMARKS_PLUGIN_BOOKMARK_MATCH_NUM_PROPERTIES];

struct _SynapseGnomeBookmarksPluginPrivate {
	gboolean _enabled;
	SynapseUtilsAsyncOnce* bookmarks_once;
};

struct _SynapseGnomeBookmarksPluginSearchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SynapseGnomeBookmarksPlugin* self;
	SynapseQuery q;
	SynapseResultSet* result;
	SynapseResultSet* _result_;
	SynapseResultSet* _tmp0_;
	SynapseUtilsAsyncOnce* _tmp1_;
	SynapseQuery _tmp2_;
	const gchar* _tmp3_;
	SynapseMatcherFlags flags;
	SynapseQuery _tmp4_;
	SynapseResultSet* _tmp5_;
	SynapseQuery _tmp6_;
	SynapseResultSet* _tmp7_;
	GError* _inner_error0_;
};

struct _SynapseGnomeBookmarksPluginParseBookmarksData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SynapseGnomeBookmarksPlugin* self;
	gboolean is_locked;
	SynapseUtilsAsyncOnce* _tmp0_;
	GeeArrayList* bookmarks;
	GeeArrayList* _tmp1_;
	gchar* filename;
	gchar* _tmp2_;
	gchar* contents;
	gchar** lines;
	gint lines_length1;
	gint _lines_size_;
	gboolean _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	const gchar* _tmp7_;
	gchar** _tmp8_;
	gchar** _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gchar** line_collection;
	gint line_collection_length1;
	gint _line_collection_size_;
	gint line_it;
	const gchar* line;
	gchar** parts;
	const gchar* _tmp11_;
	gchar** _tmp12_;
	gchar** _tmp13_;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	const gchar* _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	const gchar* _tmp17_;
	gchar** _tmp18_;
	gint _tmp18__length1;
	gchar** _tmp19_;
	gint _tmp19__length1;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar** _tmp23_;
	gint _tmp23__length1;
	const gchar* _tmp24_;
	gchar** _tmp25_;
	gint _tmp25__length1;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	GeeArrayList* _tmp28_;
	gchar** _tmp29_;
	gint _tmp29__length1;
	const gchar* _tmp30_;
	gchar** _tmp31_;
	gint _tmp31__length1;
	const gchar* _tmp32_;
	SynapseGnomeBookmarksPluginBookmarkMatch* _tmp33_;
	SynapseGnomeBookmarksPluginBookmarkMatch* _tmp34_;
	GError* err;
	GError* _tmp35_;
	const gchar* _tmp36_;
	SynapseUtilsAsyncOnce* _tmp37_;
	GeeArrayList* _tmp38_;
	GError* _inner_error0_;
};

struct _SynapseGnomeBookmarksPluginBookmarkMatch {
	SynapseUriMatch parent_instance;
	SynapseGnomeBookmarksPluginBookmarkMatchPrivate * priv;
};

struct _SynapseGnomeBookmarksPluginBookmarkMatchClass {
	SynapseUriMatchClass parent_class;
};

struct _SynapseGnomeBookmarksPluginBookmarkMatchPrivate {
	gchar* title_folded;
	gchar* uri_folded;
};

static gint SynapseGnomeBookmarksPlugin_private_offset;
static gpointer synapse_gnome_bookmarks_plugin_parent_class = NULL;
static gint SynapseGnomeBookmarksPluginBookmarkMatch_private_offset;
static gpointer synapse_gnome_bookmarks_plugin_bookmark_match_parent_class = NULL;
static SynapseActivatableIface * synapse_gnome_bookmarks_plugin_synapse_activatable_parent_iface = NULL;
static SynapseItemProviderIface * synapse_gnome_bookmarks_plugin_synapse_item_provider_parent_iface = NULL;

static GType synapse_gnome_bookmarks_plugin_bookmark_match_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void synapse_gnome_bookmarks_plugin_real_activate (SynapseActivatable* base);
static void synapse_gnome_bookmarks_plugin_real_deactivate (SynapseActivatable* base);
static void synapse_gnome_bookmarks_plugin_register_plugin (void);
static void _synapse_gnome_bookmarks_plugin_register_plugin_synapse_plugin_register_func (void);
static void synapse_gnome_bookmarks_plugin_full_search (SynapseGnomeBookmarksPlugin* self,
                                                 SynapseQuery* q,
                                                 SynapseResultSet* results,
                                                 SynapseMatcherFlags flags);
static const gchar* synapse_gnome_bookmarks_plugin_bookmark_match_get_title_folded (SynapseGnomeBookmarksPluginBookmarkMatch* self);
static const gchar* synapse_gnome_bookmarks_plugin_bookmark_match_get_uri_folded (SynapseGnomeBookmarksPluginBookmarkMatch* self);
static gboolean synapse_gnome_bookmarks_plugin_real_handles_query (SynapseItemProvider* base,
                                                            SynapseQuery* query);
static void synapse_gnome_bookmarks_plugin_real_search_data_free (gpointer _data);
static void synapse_gnome_bookmarks_plugin_real_search (SynapseItemProvider* base,
                                                 SynapseQuery* q,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static gboolean synapse_gnome_bookmarks_plugin_real_search_co (SynapseGnomeBookmarksPluginSearchData* _data_);
static void synapse_gnome_bookmarks_plugin_parse_bookmarks (SynapseGnomeBookmarksPlugin* self,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static void synapse_gnome_bookmarks_plugin_parse_bookmarks_finish (SynapseGnomeBookmarksPlugin* self,
                                                            GAsyncResult* _res_);
static void synapse_gnome_bookmarks_plugin_search_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void synapse_gnome_bookmarks_plugin_parse_bookmarks_data_free (gpointer _data);
static gboolean synapse_gnome_bookmarks_plugin_parse_bookmarks_co (SynapseGnomeBookmarksPluginParseBookmarksData* _data_);
static void synapse_gnome_bookmarks_plugin_parse_bookmarks_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static gchar* synapse_gnome_bookmarks_plugin_get_bookmarks_filename (void);
static SynapseGnomeBookmarksPluginBookmarkMatch* synapse_gnome_bookmarks_plugin_bookmark_match_new (const gchar* name,
                                                                                             const gchar* url,
                                                                                             const gchar* description);
static SynapseGnomeBookmarksPluginBookmarkMatch* synapse_gnome_bookmarks_plugin_bookmark_match_construct (GType object_type,
                                                                                                   const gchar* name,
                                                                                                   const gchar* url,
                                                                                                   const gchar* description);
static void synapse_gnome_bookmarks_plugin_bookmark_match_finalize (GObject * obj);
static GType synapse_gnome_bookmarks_plugin_bookmark_match_get_type_once (void);
static GObject * synapse_gnome_bookmarks_plugin_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties);
static void synapse_gnome_bookmarks_plugin_finalize (GObject * obj);
static GType synapse_gnome_bookmarks_plugin_get_type_once (void);
static void _vala_synapse_gnome_bookmarks_plugin_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_synapse_gnome_bookmarks_plugin_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
synapse_gnome_bookmarks_plugin_get_instance_private (SynapseGnomeBookmarksPlugin* self)
{
	return G_STRUCT_MEMBER_P (self, SynapseGnomeBookmarksPlugin_private_offset);
}

static void
synapse_gnome_bookmarks_plugin_real_activate (SynapseActivatable* base)
{
	SynapseGnomeBookmarksPlugin * self;
#line 24 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPlugin*) base;
#line 265 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_real_deactivate (SynapseActivatable* base)
{
	SynapseGnomeBookmarksPlugin * self;
#line 28 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPlugin*) base;
#line 274 "gnome-bookmarks-plugin.c"
}

static void
_synapse_gnome_bookmarks_plugin_register_plugin_synapse_plugin_register_func (void)
{
#line 59 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_register_plugin ();
#line 282 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_register_plugin (void)
{
	SynapsePluginRegistry* _tmp0_;
	SynapsePluginRegistry* _tmp1_;
#line 59 "gnome-bookmarks-plugin.vala"
	_tmp0_ = synapse_plugin_registry_get_default ();
#line 59 "gnome-bookmarks-plugin.vala"
	_tmp1_ = _tmp0_;
#line 59 "gnome-bookmarks-plugin.vala"
	synapse_plugin_registry_register_plugin (_tmp1_, SYNAPSE_TYPE_GNOME_BOOKMARKS_PLUGIN, _ ("GNOME Bookmarks Plugin"), _ ("Browse and open GNOME bookmarks."), "bookmark-new", _synapse_gnome_bookmarks_plugin_register_plugin_synapse_plugin_register_func, TRUE, "");
#line 59 "gnome-bookmarks-plugin.vala"
	_g_object_unref0 (_tmp1_);
#line 298 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_full_search (SynapseGnomeBookmarksPlugin* self,
                                            SynapseQuery* q,
                                            SynapseResultSet* results,
                                            SynapseMatcherFlags flags)
{
	GeeList* matchers = NULL;
	SynapseQuery _tmp0_;
	const gchar* _tmp1_;
	GeeList* _tmp2_;
#line 80 "gnome-bookmarks-plugin.vala"
	g_return_if_fail (self != NULL);
#line 80 "gnome-bookmarks-plugin.vala"
	g_return_if_fail (q != NULL);
#line 80 "gnome-bookmarks-plugin.vala"
	g_return_if_fail (results != NULL);
#line 82 "gnome-bookmarks-plugin.vala"
	_tmp0_ = *q;
#line 82 "gnome-bookmarks-plugin.vala"
	_tmp1_ = _tmp0_.query_string_folded;
#line 82 "gnome-bookmarks-plugin.vala"
	_tmp2_ = synapse_query_get_matchers_for_query (_tmp1_, flags, G_REGEX_OPTIMIZE);
#line 82 "gnome-bookmarks-plugin.vala"
	matchers = _tmp2_;
#line 325 "gnome-bookmarks-plugin.c"
	{
		GeeList* _bmk_list = NULL;
		SynapseUtilsAsyncOnce* _tmp3_;
		gconstpointer _tmp4_;
		gint _bmk_size = 0;
		GeeList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _bmk_index = 0;
#line 84 "gnome-bookmarks-plugin.vala"
		_tmp3_ = self->priv->bookmarks_once;
#line 84 "gnome-bookmarks-plugin.vala"
		_tmp4_ = synapse_utils_async_once_get_data (_tmp3_);
#line 84 "gnome-bookmarks-plugin.vala"
		_bmk_list = (GeeList*) _tmp4_;
#line 84 "gnome-bookmarks-plugin.vala"
		_tmp5_ = _bmk_list;
#line 84 "gnome-bookmarks-plugin.vala"
		_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
#line 84 "gnome-bookmarks-plugin.vala"
		_tmp7_ = _tmp6_;
#line 84 "gnome-bookmarks-plugin.vala"
		_bmk_size = _tmp7_;
#line 84 "gnome-bookmarks-plugin.vala"
		_bmk_index = -1;
#line 84 "gnome-bookmarks-plugin.vala"
		while (TRUE) {
#line 353 "gnome-bookmarks-plugin.c"
			gint _tmp8_;
			gint _tmp9_;
			SynapseGnomeBookmarksPluginBookmarkMatch* bmk = NULL;
			GeeList* _tmp10_;
			gpointer _tmp11_;
			const gchar* name = NULL;
			SynapseGnomeBookmarksPluginBookmarkMatch* _tmp12_;
			const gchar* _tmp13_;
			const gchar* url = NULL;
			SynapseGnomeBookmarksPluginBookmarkMatch* _tmp14_;
			const gchar* _tmp15_;
#line 84 "gnome-bookmarks-plugin.vala"
			_bmk_index = _bmk_index + 1;
#line 84 "gnome-bookmarks-plugin.vala"
			_tmp8_ = _bmk_index;
#line 84 "gnome-bookmarks-plugin.vala"
			_tmp9_ = _bmk_size;
#line 84 "gnome-bookmarks-plugin.vala"
			if (!(_tmp8_ < _tmp9_)) {
#line 84 "gnome-bookmarks-plugin.vala"
				break;
#line 375 "gnome-bookmarks-plugin.c"
			}
#line 84 "gnome-bookmarks-plugin.vala"
			_tmp10_ = _bmk_list;
#line 84 "gnome-bookmarks-plugin.vala"
			_tmp11_ = gee_list_get (_tmp10_, _bmk_index);
#line 84 "gnome-bookmarks-plugin.vala"
			bmk = (SynapseGnomeBookmarksPluginBookmarkMatch*) _tmp11_;
#line 86 "gnome-bookmarks-plugin.vala"
			_tmp12_ = bmk;
#line 86 "gnome-bookmarks-plugin.vala"
			_tmp13_ = synapse_gnome_bookmarks_plugin_bookmark_match_get_title_folded (_tmp12_);
#line 86 "gnome-bookmarks-plugin.vala"
			name = _tmp13_;
#line 87 "gnome-bookmarks-plugin.vala"
			_tmp14_ = bmk;
#line 87 "gnome-bookmarks-plugin.vala"
			_tmp15_ = synapse_gnome_bookmarks_plugin_bookmark_match_get_uri_folded (_tmp14_);
#line 87 "gnome-bookmarks-plugin.vala"
			url = _tmp15_;
#line 395 "gnome-bookmarks-plugin.c"
			{
				GeeList* _matcher_list = NULL;
				GeeList* _tmp16_;
				gint _matcher_size = 0;
				GeeList* _tmp17_;
				gint _tmp18_;
				gint _tmp19_;
				gint _matcher_index = 0;
#line 89 "gnome-bookmarks-plugin.vala"
				_tmp16_ = matchers;
#line 89 "gnome-bookmarks-plugin.vala"
				_matcher_list = _tmp16_;
#line 89 "gnome-bookmarks-plugin.vala"
				_tmp17_ = _matcher_list;
#line 89 "gnome-bookmarks-plugin.vala"
				_tmp18_ = gee_collection_get_size ((GeeCollection*) _tmp17_);
#line 89 "gnome-bookmarks-plugin.vala"
				_tmp19_ = _tmp18_;
#line 89 "gnome-bookmarks-plugin.vala"
				_matcher_size = _tmp19_;
#line 89 "gnome-bookmarks-plugin.vala"
				_matcher_index = -1;
#line 89 "gnome-bookmarks-plugin.vala"
				while (TRUE) {
#line 420 "gnome-bookmarks-plugin.c"
					gint _tmp20_;
					gint _tmp21_;
					GeeMapEntry* matcher = NULL;
					GeeList* _tmp22_;
					gpointer _tmp23_;
					GeeMapEntry* _tmp24_;
					gconstpointer _tmp25_;
					gconstpointer _tmp26_;
					const gchar* _tmp27_;
					gboolean _tmp32_ = FALSE;
					const gchar* _tmp33_;
#line 89 "gnome-bookmarks-plugin.vala"
					_matcher_index = _matcher_index + 1;
#line 89 "gnome-bookmarks-plugin.vala"
					_tmp20_ = _matcher_index;
#line 89 "gnome-bookmarks-plugin.vala"
					_tmp21_ = _matcher_size;
#line 89 "gnome-bookmarks-plugin.vala"
					if (!(_tmp20_ < _tmp21_)) {
#line 89 "gnome-bookmarks-plugin.vala"
						break;
#line 442 "gnome-bookmarks-plugin.c"
					}
#line 89 "gnome-bookmarks-plugin.vala"
					_tmp22_ = _matcher_list;
#line 89 "gnome-bookmarks-plugin.vala"
					_tmp23_ = gee_list_get (_tmp22_, _matcher_index);
#line 89 "gnome-bookmarks-plugin.vala"
					matcher = (GeeMapEntry*) _tmp23_;
#line 91 "gnome-bookmarks-plugin.vala"
					_tmp24_ = matcher;
#line 91 "gnome-bookmarks-plugin.vala"
					_tmp25_ = gee_map_entry_get_key (_tmp24_);
#line 91 "gnome-bookmarks-plugin.vala"
					_tmp26_ = _tmp25_;
#line 91 "gnome-bookmarks-plugin.vala"
					_tmp27_ = name;
#line 91 "gnome-bookmarks-plugin.vala"
					if (g_regex_match ((GRegex*) _tmp26_, _tmp27_, 0, NULL)) {
#line 460 "gnome-bookmarks-plugin.c"
						SynapseGnomeBookmarksPluginBookmarkMatch* _tmp28_;
						GeeMapEntry* _tmp29_;
						gconstpointer _tmp30_;
						gconstpointer _tmp31_;
#line 93 "gnome-bookmarks-plugin.vala"
						_tmp28_ = bmk;
#line 93 "gnome-bookmarks-plugin.vala"
						_tmp29_ = matcher;
#line 93 "gnome-bookmarks-plugin.vala"
						_tmp30_ = gee_map_entry_get_value (_tmp29_);
#line 93 "gnome-bookmarks-plugin.vala"
						_tmp31_ = _tmp30_;
#line 93 "gnome-bookmarks-plugin.vala"
						synapse_result_set_add (results, (SynapseMatch*) _tmp28_, (gint) ((gintptr) _tmp31_));
#line 94 "gnome-bookmarks-plugin.vala"
						_g_object_unref0 (matcher);
#line 94 "gnome-bookmarks-plugin.vala"
						break;
#line 479 "gnome-bookmarks-plugin.c"
					}
#line 96 "gnome-bookmarks-plugin.vala"
					_tmp33_ = url;
#line 96 "gnome-bookmarks-plugin.vala"
					if (_tmp33_ != NULL) {
#line 485 "gnome-bookmarks-plugin.c"
						GeeMapEntry* _tmp34_;
						gconstpointer _tmp35_;
						gconstpointer _tmp36_;
						const gchar* _tmp37_;
#line 96 "gnome-bookmarks-plugin.vala"
						_tmp34_ = matcher;
#line 96 "gnome-bookmarks-plugin.vala"
						_tmp35_ = gee_map_entry_get_key (_tmp34_);
#line 96 "gnome-bookmarks-plugin.vala"
						_tmp36_ = _tmp35_;
#line 96 "gnome-bookmarks-plugin.vala"
						_tmp37_ = url;
#line 96 "gnome-bookmarks-plugin.vala"
						_tmp32_ = g_regex_match ((GRegex*) _tmp36_, _tmp37_, 0, NULL);
#line 500 "gnome-bookmarks-plugin.c"
					} else {
#line 96 "gnome-bookmarks-plugin.vala"
						_tmp32_ = FALSE;
#line 504 "gnome-bookmarks-plugin.c"
					}
#line 96 "gnome-bookmarks-plugin.vala"
					if (_tmp32_) {
#line 508 "gnome-bookmarks-plugin.c"
						SynapseGnomeBookmarksPluginBookmarkMatch* _tmp38_;
						GeeMapEntry* _tmp39_;
						gconstpointer _tmp40_;
						gconstpointer _tmp41_;
#line 98 "gnome-bookmarks-plugin.vala"
						_tmp38_ = bmk;
#line 98 "gnome-bookmarks-plugin.vala"
						_tmp39_ = matcher;
#line 98 "gnome-bookmarks-plugin.vala"
						_tmp40_ = gee_map_entry_get_value (_tmp39_);
#line 98 "gnome-bookmarks-plugin.vala"
						_tmp41_ = _tmp40_;
#line 98 "gnome-bookmarks-plugin.vala"
						synapse_result_set_add (results, (SynapseMatch*) _tmp38_, (gint) ((gintptr) _tmp41_));
#line 99 "gnome-bookmarks-plugin.vala"
						_g_object_unref0 (matcher);
#line 99 "gnome-bookmarks-plugin.vala"
						break;
#line 527 "gnome-bookmarks-plugin.c"
					}
#line 89 "gnome-bookmarks-plugin.vala"
					_g_object_unref0 (matcher);
#line 531 "gnome-bookmarks-plugin.c"
				}
			}
#line 84 "gnome-bookmarks-plugin.vala"
			_g_object_unref0 (bmk);
#line 536 "gnome-bookmarks-plugin.c"
		}
	}
#line 80 "gnome-bookmarks-plugin.vala"
	_g_object_unref0 (matchers);
#line 541 "gnome-bookmarks-plugin.c"
}

static gboolean
synapse_gnome_bookmarks_plugin_real_handles_query (SynapseItemProvider* base,
                                                   SynapseQuery* query)
{
	SynapseGnomeBookmarksPlugin * self;
	SynapseQuery _tmp0_;
	gboolean result;
#line 105 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPlugin*) base;
#line 105 "gnome-bookmarks-plugin.vala"
	g_return_val_if_fail (query != NULL, FALSE);
#line 107 "gnome-bookmarks-plugin.vala"
	_tmp0_ = *query;
#line 107 "gnome-bookmarks-plugin.vala"
	result = (_tmp0_.query_type & SYNAPSE_QUERY_FLAGS_PLACES) == SYNAPSE_QUERY_FLAGS_PLACES;
#line 107 "gnome-bookmarks-plugin.vala"
	return result;
#line 561 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_real_search_data_free (gpointer _data)
{
	SynapseGnomeBookmarksPluginSearchData* _data_;
	_data_ = _data;
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_query_destroy (&_data_->q);
#line 20 "gnome-bookmarks-plugin.vala"
	_g_object_unref0 (_data_->result);
#line 20 "gnome-bookmarks-plugin.vala"
	_g_object_unref0 (_data_->self);
#line 20 "gnome-bookmarks-plugin.vala"
	g_slice_free (SynapseGnomeBookmarksPluginSearchData, _data_);
#line 577 "gnome-bookmarks-plugin.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 20 "gnome-bookmarks-plugin.vala"
	return self ? g_object_ref (self) : NULL;
#line 585 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_real_search (SynapseItemProvider* base,
                                            SynapseQuery* q,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	SynapseGnomeBookmarksPlugin * self;
	SynapseGnomeBookmarksPluginSearchData* _data_;
	SynapseGnomeBookmarksPlugin* _tmp0_;
	SynapseQuery _tmp1_;
	SynapseQuery _tmp2_;
	SynapseQuery _tmp3_ = {0};
#line 20 "gnome-bookmarks-plugin.vala"
	g_return_if_fail (q != NULL);
#line 20 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPlugin*) base;
#line 20 "gnome-bookmarks-plugin.vala"
	_data_ = g_slice_new0 (SynapseGnomeBookmarksPluginSearchData);
#line 20 "gnome-bookmarks-plugin.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 20 "gnome-bookmarks-plugin.vala"
	g_task_set_task_data (_data_->_async_result, _data_, synapse_gnome_bookmarks_plugin_real_search_data_free);
#line 20 "gnome-bookmarks-plugin.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 20 "gnome-bookmarks-plugin.vala"
	_data_->self = _tmp0_;
#line 20 "gnome-bookmarks-plugin.vala"
	_tmp1_ = *q;
#line 20 "gnome-bookmarks-plugin.vala"
	_tmp2_ = _tmp1_;
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_query_copy (&_tmp2_, &_tmp3_);
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_query_destroy (&_data_->q);
#line 20 "gnome-bookmarks-plugin.vala"
	_data_->q = _tmp3_;
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_real_search_co (_data_);
#line 626 "gnome-bookmarks-plugin.c"
}

static SynapseResultSet*
synapse_gnome_bookmarks_plugin_search_finish (SynapseItemProvider* base,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	SynapseResultSet* result;
	SynapseGnomeBookmarksPluginSearchData* _data_;
#line 20 "gnome-bookmarks-plugin.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 20 "gnome-bookmarks-plugin.vala"
	if (NULL == _data_) {
#line 20 "gnome-bookmarks-plugin.vala"
		return NULL;
#line 642 "gnome-bookmarks-plugin.c"
	}
#line 20 "gnome-bookmarks-plugin.vala"
	result = _data_->result;
#line 20 "gnome-bookmarks-plugin.vala"
	_data_->result = NULL;
#line 20 "gnome-bookmarks-plugin.vala"
	return result;
#line 650 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_search_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	SynapseGnomeBookmarksPluginSearchData* _data_;
#line 116 "gnome-bookmarks-plugin.vala"
	_data_ = _user_data_;
#line 116 "gnome-bookmarks-plugin.vala"
	_data_->_source_object_ = source_object;
#line 116 "gnome-bookmarks-plugin.vala"
	_data_->_res_ = _res_;
#line 116 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_real_search_co (_data_);
#line 667 "gnome-bookmarks-plugin.c"
}

static gboolean
synapse_gnome_bookmarks_plugin_real_search_co (SynapseGnomeBookmarksPluginSearchData* _data_)
{
#line 110 "gnome-bookmarks-plugin.vala"
	switch (_data_->_state_) {
#line 110 "gnome-bookmarks-plugin.vala"
		case 0:
#line 677 "gnome-bookmarks-plugin.c"
		goto _state_0;
#line 110 "gnome-bookmarks-plugin.vala"
		case 1:
#line 681 "gnome-bookmarks-plugin.c"
		goto _state_1;
		default:
#line 110 "gnome-bookmarks-plugin.vala"
		g_assert_not_reached ();
#line 686 "gnome-bookmarks-plugin.c"
	}
	_state_0:
#line 112 "gnome-bookmarks-plugin.vala"
	_data_->_tmp0_ = synapse_result_set_new ();
#line 112 "gnome-bookmarks-plugin.vala"
	_data_->_result_ = _data_->_tmp0_;
#line 114 "gnome-bookmarks-plugin.vala"
	_data_->_tmp1_ = _data_->self->priv->bookmarks_once;
#line 114 "gnome-bookmarks-plugin.vala"
	if (!synapse_utils_async_once_is_initialized (_data_->_tmp1_)) {
#line 116 "gnome-bookmarks-plugin.vala"
		_data_->_state_ = 1;
#line 116 "gnome-bookmarks-plugin.vala"
		synapse_gnome_bookmarks_plugin_parse_bookmarks (_data_->self, synapse_gnome_bookmarks_plugin_search_ready, _data_);
#line 116 "gnome-bookmarks-plugin.vala"
		return FALSE;
#line 703 "gnome-bookmarks-plugin.c"
		_state_1:
#line 116 "gnome-bookmarks-plugin.vala"
		synapse_gnome_bookmarks_plugin_parse_bookmarks_finish (_data_->self, _data_->_res_);
#line 707 "gnome-bookmarks-plugin.c"
	}
#line 119 "gnome-bookmarks-plugin.vala"
	_data_->_tmp2_ = _data_->q;
#line 119 "gnome-bookmarks-plugin.vala"
	_data_->_tmp3_ = _data_->_tmp2_.query_string;
#line 119 "gnome-bookmarks-plugin.vala"
	if (g_utf8_strlen (_data_->_tmp3_, (gssize) -1) == 1) {
#line 121 "gnome-bookmarks-plugin.vala"
		_data_->flags = (SYNAPSE_MATCHER_FLAGS_NO_SUBSTRING | SYNAPSE_MATCHER_FLAGS_NO_PARTIAL) | SYNAPSE_MATCHER_FLAGS_NO_FUZZY;
#line 123 "gnome-bookmarks-plugin.vala"
		_data_->_tmp4_ = _data_->q;
#line 123 "gnome-bookmarks-plugin.vala"
		_data_->_tmp5_ = _data_->_result_;
#line 123 "gnome-bookmarks-plugin.vala"
		synapse_gnome_bookmarks_plugin_full_search (_data_->self, &_data_->_tmp4_, _data_->_tmp5_, _data_->flags);
#line 723 "gnome-bookmarks-plugin.c"
	} else {
#line 127 "gnome-bookmarks-plugin.vala"
		_data_->_tmp6_ = _data_->q;
#line 127 "gnome-bookmarks-plugin.vala"
		_data_->_tmp7_ = _data_->_result_;
#line 127 "gnome-bookmarks-plugin.vala"
		synapse_gnome_bookmarks_plugin_full_search (_data_->self, &_data_->_tmp6_, _data_->_tmp7_, 0);
#line 731 "gnome-bookmarks-plugin.c"
	}
#line 130 "gnome-bookmarks-plugin.vala"
	synapse_query_check_cancellable (&_data_->q, &_data_->_inner_error0_);
#line 130 "gnome-bookmarks-plugin.vala"
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 130 "gnome-bookmarks-plugin.vala"
		if (_data_->_inner_error0_->domain == SYNAPSE_SEARCH_ERROR) {
#line 130 "gnome-bookmarks-plugin.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
#line 130 "gnome-bookmarks-plugin.vala"
			_g_object_unref0 (_data_->_result_);
#line 130 "gnome-bookmarks-plugin.vala"
			g_object_unref (_data_->_async_result);
#line 130 "gnome-bookmarks-plugin.vala"
			return FALSE;
#line 747 "gnome-bookmarks-plugin.c"
		} else {
#line 130 "gnome-bookmarks-plugin.vala"
			_g_object_unref0 (_data_->_result_);
#line 130 "gnome-bookmarks-plugin.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
#line 130 "gnome-bookmarks-plugin.vala"
			g_clear_error (&_data_->_inner_error0_);
#line 130 "gnome-bookmarks-plugin.vala"
			g_object_unref (_data_->_async_result);
#line 130 "gnome-bookmarks-plugin.vala"
			return FALSE;
#line 759 "gnome-bookmarks-plugin.c"
		}
	}
#line 132 "gnome-bookmarks-plugin.vala"
	_data_->result = _data_->_result_;
#line 132 "gnome-bookmarks-plugin.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 132 "gnome-bookmarks-plugin.vala"
	if (_data_->_state_ != 0) {
#line 132 "gnome-bookmarks-plugin.vala"
		while (!g_task_get_completed (_data_->_async_result)) {
#line 132 "gnome-bookmarks-plugin.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 772 "gnome-bookmarks-plugin.c"
		}
	}
#line 132 "gnome-bookmarks-plugin.vala"
	g_object_unref (_data_->_async_result);
#line 132 "gnome-bookmarks-plugin.vala"
	return FALSE;
#line 779 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_parse_bookmarks_data_free (gpointer _data)
{
	SynapseGnomeBookmarksPluginParseBookmarksData* _data_;
	_data_ = _data;
#line 20 "gnome-bookmarks-plugin.vala"
	_g_object_unref0 (_data_->self);
#line 20 "gnome-bookmarks-plugin.vala"
	g_slice_free (SynapseGnomeBookmarksPluginParseBookmarksData, _data_);
#line 791 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_parse_bookmarks (SynapseGnomeBookmarksPlugin* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	SynapseGnomeBookmarksPluginParseBookmarksData* _data_;
	SynapseGnomeBookmarksPlugin* _tmp0_;
#line 20 "gnome-bookmarks-plugin.vala"
	g_return_if_fail (self != NULL);
#line 20 "gnome-bookmarks-plugin.vala"
	_data_ = g_slice_new0 (SynapseGnomeBookmarksPluginParseBookmarksData);
#line 20 "gnome-bookmarks-plugin.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 20 "gnome-bookmarks-plugin.vala"
	g_task_set_task_data (_data_->_async_result, _data_, synapse_gnome_bookmarks_plugin_parse_bookmarks_data_free);
#line 20 "gnome-bookmarks-plugin.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 20 "gnome-bookmarks-plugin.vala"
	_data_->self = _tmp0_;
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_parse_bookmarks_co (_data_);
#line 815 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_parse_bookmarks_finish (SynapseGnomeBookmarksPlugin* self,
                                                       GAsyncResult* _res_)
{
	SynapseGnomeBookmarksPluginParseBookmarksData* _data_;
#line 20 "gnome-bookmarks-plugin.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 825 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_parse_bookmarks_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	SynapseGnomeBookmarksPluginParseBookmarksData* _data_;
#line 137 "gnome-bookmarks-plugin.vala"
	_data_ = _user_data_;
#line 137 "gnome-bookmarks-plugin.vala"
	_data_->_source_object_ = source_object;
#line 137 "gnome-bookmarks-plugin.vala"
	_data_->_res_ = _res_;
#line 137 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_parse_bookmarks_co (_data_);
#line 842 "gnome-bookmarks-plugin.c"
}

static gboolean
synapse_gnome_bookmarks_plugin_parse_bookmarks_co (SynapseGnomeBookmarksPluginParseBookmarksData* _data_)
{
#line 135 "gnome-bookmarks-plugin.vala"
	switch (_data_->_state_) {
#line 135 "gnome-bookmarks-plugin.vala"
		case 0:
#line 852 "gnome-bookmarks-plugin.c"
		goto _state_0;
#line 135 "gnome-bookmarks-plugin.vala"
		case 1:
#line 856 "gnome-bookmarks-plugin.c"
		goto _state_1;
		default:
#line 135 "gnome-bookmarks-plugin.vala"
		g_assert_not_reached ();
#line 861 "gnome-bookmarks-plugin.c"
	}
	_state_0:
#line 137 "gnome-bookmarks-plugin.vala"
	_data_->_tmp0_ = _data_->self->priv->bookmarks_once;
#line 137 "gnome-bookmarks-plugin.vala"
	_data_->_state_ = 1;
#line 137 "gnome-bookmarks-plugin.vala"
	synapse_utils_async_once_enter (_data_->_tmp0_, synapse_gnome_bookmarks_plugin_parse_bookmarks_ready, _data_);
#line 137 "gnome-bookmarks-plugin.vala"
	return FALSE;
#line 872 "gnome-bookmarks-plugin.c"
	_state_1:
#line 137 "gnome-bookmarks-plugin.vala"
	_data_->is_locked = synapse_utils_async_once_enter_finish (_data_->_tmp0_, _data_->_res_);
#line 138 "gnome-bookmarks-plugin.vala"
	if (!_data_->is_locked) {
#line 138 "gnome-bookmarks-plugin.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 138 "gnome-bookmarks-plugin.vala"
		if (_data_->_state_ != 0) {
#line 138 "gnome-bookmarks-plugin.vala"
			while (!g_task_get_completed (_data_->_async_result)) {
#line 138 "gnome-bookmarks-plugin.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 886 "gnome-bookmarks-plugin.c"
			}
		}
#line 138 "gnome-bookmarks-plugin.vala"
		g_object_unref (_data_->_async_result);
#line 138 "gnome-bookmarks-plugin.vala"
		return FALSE;
#line 893 "gnome-bookmarks-plugin.c"
	}
#line 140 "gnome-bookmarks-plugin.vala"
	_data_->_tmp1_ = gee_array_list_new (SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 140 "gnome-bookmarks-plugin.vala"
	_data_->bookmarks = _data_->_tmp1_;
#line 141 "gnome-bookmarks-plugin.vala"
	_data_->_tmp2_ = synapse_gnome_bookmarks_plugin_get_bookmarks_filename ();
#line 141 "gnome-bookmarks-plugin.vala"
	_data_->filename = _data_->_tmp2_;
#line 903 "gnome-bookmarks-plugin.c"
	{
#line 146 "gnome-bookmarks-plugin.vala"
		_data_->lines_length1 = 0;
#line 146 "gnome-bookmarks-plugin.vala"
		_data_->_lines_size_ = 0;
#line 147 "gnome-bookmarks-plugin.vala"
		_data_->_tmp4_ = _data_->filename;
#line 147 "gnome-bookmarks-plugin.vala"
		_data_->_tmp5_ = NULL;
#line 147 "gnome-bookmarks-plugin.vala"
		_data_->_tmp6_ = g_file_get_contents (_data_->_tmp4_, &_data_->_tmp5_, NULL, &_data_->_inner_error0_);
#line 147 "gnome-bookmarks-plugin.vala"
		_g_free0 (_data_->contents);
#line 147 "gnome-bookmarks-plugin.vala"
		_data_->contents = _data_->_tmp5_;
#line 147 "gnome-bookmarks-plugin.vala"
		_data_->_tmp3_ = _data_->_tmp6_;
#line 147 "gnome-bookmarks-plugin.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 147 "gnome-bookmarks-plugin.vala"
			_data_->lines = (_vala_array_free (_data_->lines, _data_->lines_length1, (GDestroyNotify) g_free), NULL);
#line 147 "gnome-bookmarks-plugin.vala"
			_g_free0 (_data_->contents);
#line 927 "gnome-bookmarks-plugin.c"
			goto __catch0_g_error;
		}
#line 147 "gnome-bookmarks-plugin.vala"
		if (_data_->_tmp3_) {
#line 149 "gnome-bookmarks-plugin.vala"
			_data_->_tmp7_ = _data_->contents;
#line 149 "gnome-bookmarks-plugin.vala"
			_data_->_tmp9_ = _data_->_tmp8_ = g_strsplit (_data_->_tmp7_, "\n", 0);
#line 149 "gnome-bookmarks-plugin.vala"
			_data_->lines = (_vala_array_free (_data_->lines, _data_->lines_length1, (GDestroyNotify) g_free), NULL);
#line 149 "gnome-bookmarks-plugin.vala"
			_data_->lines = _data_->_tmp9_;
#line 149 "gnome-bookmarks-plugin.vala"
			_data_->lines_length1 = _vala_array_length (_data_->_tmp8_);
#line 149 "gnome-bookmarks-plugin.vala"
			_data_->_lines_size_ = _data_->lines_length1;
#line 150 "gnome-bookmarks-plugin.vala"
			_data_->_tmp10_ = _data_->lines;
#line 150 "gnome-bookmarks-plugin.vala"
			_data_->_tmp10__length1 = _data_->lines_length1;
#line 948 "gnome-bookmarks-plugin.c"
			{
#line 150 "gnome-bookmarks-plugin.vala"
				_data_->line_collection_length1 = 0;
#line 150 "gnome-bookmarks-plugin.vala"
				_data_->_line_collection_size_ = 0;
#line 150 "gnome-bookmarks-plugin.vala"
				_data_->line_collection = _data_->_tmp10_;
#line 150 "gnome-bookmarks-plugin.vala"
				_data_->line_collection_length1 = _data_->_tmp10__length1;
#line 150 "gnome-bookmarks-plugin.vala"
				for (_data_->line_it = 0; _data_->line_it < _data_->line_collection_length1; _data_->line_it = _data_->line_it + 1) {
#line 150 "gnome-bookmarks-plugin.vala"
					_data_->line = _data_->line_collection[_data_->line_it];
#line 962 "gnome-bookmarks-plugin.c"
					{
#line 152 "gnome-bookmarks-plugin.vala"
						_data_->_tmp11_ = _data_->line;
#line 152 "gnome-bookmarks-plugin.vala"
						_data_->_tmp13_ = _data_->_tmp12_ = g_strsplit (_data_->_tmp11_, " ", 2);
#line 152 "gnome-bookmarks-plugin.vala"
						_data_->parts = _data_->_tmp13_;
#line 152 "gnome-bookmarks-plugin.vala"
						_data_->parts_length1 = _vala_array_length (_data_->_tmp12_);
#line 152 "gnome-bookmarks-plugin.vala"
						_data_->_parts_size_ = _data_->parts_length1;
#line 153 "gnome-bookmarks-plugin.vala"
						_data_->_tmp14_ = _data_->parts;
#line 153 "gnome-bookmarks-plugin.vala"
						_data_->_tmp14__length1 = _data_->parts_length1;
#line 153 "gnome-bookmarks-plugin.vala"
						_data_->_tmp15_ = _data_->_tmp14_[0];
#line 153 "gnome-bookmarks-plugin.vala"
						if (_data_->_tmp15_ == NULL) {
#line 154 "gnome-bookmarks-plugin.vala"
							_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
#line 154 "gnome-bookmarks-plugin.vala"
							continue;
#line 986 "gnome-bookmarks-plugin.c"
						}
#line 155 "gnome-bookmarks-plugin.vala"
						_data_->_tmp16_ = _data_->parts;
#line 155 "gnome-bookmarks-plugin.vala"
						_data_->_tmp16__length1 = _data_->parts_length1;
#line 155 "gnome-bookmarks-plugin.vala"
						_data_->_tmp17_ = _data_->_tmp16_[1];
#line 155 "gnome-bookmarks-plugin.vala"
						if (_data_->_tmp17_ == NULL) {
#line 156 "gnome-bookmarks-plugin.vala"
							_data_->_tmp18_ = _data_->parts;
#line 156 "gnome-bookmarks-plugin.vala"
							_data_->_tmp18__length1 = _data_->parts_length1;
#line 156 "gnome-bookmarks-plugin.vala"
							_data_->_tmp19_ = _data_->parts;
#line 156 "gnome-bookmarks-plugin.vala"
							_data_->_tmp19__length1 = _data_->parts_length1;
#line 156 "gnome-bookmarks-plugin.vala"
							_data_->_tmp20_ = _data_->_tmp19_[0];
#line 156 "gnome-bookmarks-plugin.vala"
							_data_->_tmp21_ = g_path_get_basename (_data_->_tmp20_);
#line 156 "gnome-bookmarks-plugin.vala"
							_g_free0 (_data_->_tmp18_[1]);
#line 156 "gnome-bookmarks-plugin.vala"
							_data_->_tmp18_[1] = _data_->_tmp21_;
#line 1012 "gnome-bookmarks-plugin.c"
						}
#line 159 "gnome-bookmarks-plugin.vala"
						_data_->_tmp23_ = _data_->parts;
#line 159 "gnome-bookmarks-plugin.vala"
						_data_->_tmp23__length1 = _data_->parts_length1;
#line 159 "gnome-bookmarks-plugin.vala"
						_data_->_tmp24_ = _data_->_tmp23_[0];
#line 159 "gnome-bookmarks-plugin.vala"
						if (g_str_has_prefix (_data_->_tmp24_, "file://")) {
#line 159 "gnome-bookmarks-plugin.vala"
							_data_->_tmp25_ = _data_->parts;
#line 159 "gnome-bookmarks-plugin.vala"
							_data_->_tmp25__length1 = _data_->parts_length1;
#line 159 "gnome-bookmarks-plugin.vala"
							_data_->_tmp26_ = _data_->_tmp25_[0];
#line 159 "gnome-bookmarks-plugin.vala"
							_data_->_tmp27_ = g_filename_from_uri (_data_->_tmp26_, NULL, &_data_->_inner_error0_);
#line 159 "gnome-bookmarks-plugin.vala"
							_g_free0 (_data_->_tmp22_);
#line 159 "gnome-bookmarks-plugin.vala"
							_data_->_tmp22_ = _data_->_tmp27_;
#line 159 "gnome-bookmarks-plugin.vala"
							if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 159 "gnome-bookmarks-plugin.vala"
								_g_free0 (_data_->_tmp22_);
#line 159 "gnome-bookmarks-plugin.vala"
								_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
#line 159 "gnome-bookmarks-plugin.vala"
								_data_->lines = (_vala_array_free (_data_->lines, _data_->lines_length1, (GDestroyNotify) g_free), NULL);
#line 159 "gnome-bookmarks-plugin.vala"
								_g_free0 (_data_->contents);
#line 1044 "gnome-bookmarks-plugin.c"
								goto __catch0_g_error;
							}
						} else {
#line 159 "gnome-bookmarks-plugin.vala"
							_g_free0 (_data_->_tmp22_);
#line 159 "gnome-bookmarks-plugin.vala"
							_data_->_tmp22_ = NULL;
#line 1052 "gnome-bookmarks-plugin.c"
						}
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp28_ = _data_->bookmarks;
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp29_ = _data_->parts;
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp29__length1 = _data_->parts_length1;
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp30_ = _data_->_tmp29_[1];
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp31_ = _data_->parts;
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp31__length1 = _data_->parts_length1;
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp32_ = _data_->_tmp31_[0];
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp33_ = synapse_gnome_bookmarks_plugin_bookmark_match_new (_data_->_tmp30_, _data_->_tmp32_, _data_->_tmp22_);
#line 158 "gnome-bookmarks-plugin.vala"
						_data_->_tmp34_ = _data_->_tmp33_;
#line 158 "gnome-bookmarks-plugin.vala"
						gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp28_, _data_->_tmp34_);
#line 158 "gnome-bookmarks-plugin.vala"
						_g_object_unref0 (_data_->_tmp34_);
#line 150 "gnome-bookmarks-plugin.vala"
						_g_free0 (_data_->_tmp22_);
#line 150 "gnome-bookmarks-plugin.vala"
						_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
#line 1080 "gnome-bookmarks-plugin.c"
					}
				}
			}
		}
#line 143 "gnome-bookmarks-plugin.vala"
		_data_->lines = (_vala_array_free (_data_->lines, _data_->lines_length1, (GDestroyNotify) g_free), NULL);
#line 143 "gnome-bookmarks-plugin.vala"
		_g_free0 (_data_->contents);
#line 1089 "gnome-bookmarks-plugin.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 143 "gnome-bookmarks-plugin.vala"
		_data_->err = _data_->_inner_error0_;
#line 143 "gnome-bookmarks-plugin.vala"
		_data_->_inner_error0_ = NULL;
#line 165 "gnome-bookmarks-plugin.vala"
		_data_->_tmp35_ = _data_->err;
#line 165 "gnome-bookmarks-plugin.vala"
		_data_->_tmp36_ = _data_->_tmp35_->message;
#line 165 "gnome-bookmarks-plugin.vala"
		g_warning ("gnome-bookmarks-plugin.vala:165: %s", _data_->_tmp36_);
#line 143 "gnome-bookmarks-plugin.vala"
		_g_error_free0 (_data_->err);
#line 1106 "gnome-bookmarks-plugin.c"
	}
	__finally0:
#line 143 "gnome-bookmarks-plugin.vala"
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 143 "gnome-bookmarks-plugin.vala"
		_g_free0 (_data_->filename);
#line 143 "gnome-bookmarks-plugin.vala"
		_g_object_unref0 (_data_->bookmarks);
#line 143 "gnome-bookmarks-plugin.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
#line 143 "gnome-bookmarks-plugin.vala"
		g_clear_error (&_data_->_inner_error0_);
#line 143 "gnome-bookmarks-plugin.vala"
		g_object_unref (_data_->_async_result);
#line 143 "gnome-bookmarks-plugin.vala"
		return FALSE;
#line 1123 "gnome-bookmarks-plugin.c"
	}
#line 168 "gnome-bookmarks-plugin.vala"
	_data_->_tmp37_ = _data_->self->priv->bookmarks_once;
#line 168 "gnome-bookmarks-plugin.vala"
	_data_->_tmp38_ = _data_->bookmarks;
#line 168 "gnome-bookmarks-plugin.vala"
	synapse_utils_async_once_leave (_data_->_tmp37_, (GeeList*) _data_->_tmp38_);
#line 135 "gnome-bookmarks-plugin.vala"
	_g_free0 (_data_->filename);
#line 135 "gnome-bookmarks-plugin.vala"
	_g_object_unref0 (_data_->bookmarks);
#line 135 "gnome-bookmarks-plugin.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 135 "gnome-bookmarks-plugin.vala"
	if (_data_->_state_ != 0) {
#line 135 "gnome-bookmarks-plugin.vala"
		while (!g_task_get_completed (_data_->_async_result)) {
#line 135 "gnome-bookmarks-plugin.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1143 "gnome-bookmarks-plugin.c"
		}
	}
#line 135 "gnome-bookmarks-plugin.vala"
	g_object_unref (_data_->_async_result);
#line 135 "gnome-bookmarks-plugin.vala"
	return FALSE;
#line 1150 "gnome-bookmarks-plugin.c"
}

static gchar*
synapse_gnome_bookmarks_plugin_get_bookmarks_filename (void)
{
	gchar* filename = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean exists = FALSE;
	const gchar* _tmp2_;
	gchar* legacy_filename = NULL;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean legacy_exists = FALSE;
	const gchar* _tmp5_;
	gchar* result;
#line 173 "gnome-bookmarks-plugin.vala"
	_tmp0_ = g_get_user_config_dir ();
#line 173 "gnome-bookmarks-plugin.vala"
	_tmp1_ = g_build_filename (_tmp0_, "gtk-3.0", "bookmarks", NULL);
#line 173 "gnome-bookmarks-plugin.vala"
	filename = _tmp1_;
#line 174 "gnome-bookmarks-plugin.vala"
	_tmp2_ = filename;
#line 174 "gnome-bookmarks-plugin.vala"
	exists = g_file_test (_tmp2_, G_FILE_TEST_EXISTS);
#line 176 "gnome-bookmarks-plugin.vala"
	if (exists) {
#line 177 "gnome-bookmarks-plugin.vala"
		result = filename;
#line 177 "gnome-bookmarks-plugin.vala"
		return result;
#line 1183 "gnome-bookmarks-plugin.c"
	}
#line 179 "gnome-bookmarks-plugin.vala"
	_tmp3_ = g_get_home_dir ();
#line 179 "gnome-bookmarks-plugin.vala"
	_tmp4_ = g_build_filename (_tmp3_, ".gtk-bookmarks", NULL);
#line 179 "gnome-bookmarks-plugin.vala"
	legacy_filename = _tmp4_;
#line 180 "gnome-bookmarks-plugin.vala"
	_tmp5_ = legacy_filename;
#line 180 "gnome-bookmarks-plugin.vala"
	legacy_exists = g_file_test (_tmp5_, G_FILE_TEST_EXISTS);
#line 182 "gnome-bookmarks-plugin.vala"
	if (legacy_exists) {
#line 183 "gnome-bookmarks-plugin.vala"
		result = legacy_filename;
#line 183 "gnome-bookmarks-plugin.vala"
		_g_free0 (filename);
#line 183 "gnome-bookmarks-plugin.vala"
		return result;
#line 1203 "gnome-bookmarks-plugin.c"
	}
#line 185 "gnome-bookmarks-plugin.vala"
	result = filename;
#line 185 "gnome-bookmarks-plugin.vala"
	_g_free0 (legacy_filename);
#line 185 "gnome-bookmarks-plugin.vala"
	return result;
#line 1211 "gnome-bookmarks-plugin.c"
}

SynapseGnomeBookmarksPlugin*
synapse_gnome_bookmarks_plugin_construct (GType object_type)
{
	SynapseGnomeBookmarksPlugin * self = NULL;
#line 20 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPlugin*) g_object_new (object_type, NULL);
#line 20 "gnome-bookmarks-plugin.vala"
	return self;
#line 1222 "gnome-bookmarks-plugin.c"
}

SynapseGnomeBookmarksPlugin*
synapse_gnome_bookmarks_plugin_new (void)
{
#line 20 "gnome-bookmarks-plugin.vala"
	return synapse_gnome_bookmarks_plugin_construct (SYNAPSE_TYPE_GNOME_BOOKMARKS_PLUGIN);
#line 1230 "gnome-bookmarks-plugin.c"
}

static gboolean
synapse_gnome_bookmarks_plugin_real_get_enabled (SynapseActivatable* base)
{
	gboolean result;
	SynapseGnomeBookmarksPlugin* self;
#line 22 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPlugin*) base;
#line 22 "gnome-bookmarks-plugin.vala"
	result = self->priv->_enabled;
#line 22 "gnome-bookmarks-plugin.vala"
	return result;
#line 1244 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_real_set_enabled (SynapseActivatable* base,
                                                 gboolean value)
{
	SynapseGnomeBookmarksPlugin* self;
	gboolean old_value;
#line 22 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPlugin*) base;
#line 22 "gnome-bookmarks-plugin.vala"
	old_value = synapse_gnome_bookmarks_plugin_real_get_enabled (base);
#line 22 "gnome-bookmarks-plugin.vala"
	if (old_value != value) {
#line 22 "gnome-bookmarks-plugin.vala"
		self->priv->_enabled = value;
#line 22 "gnome-bookmarks-plugin.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_gnome_bookmarks_plugin_properties[SYNAPSE_GNOME_BOOKMARKS_PLUGIN_ENABLED_PROPERTY]);
#line 1263 "gnome-bookmarks-plugin.c"
	}
}

static inline gpointer
synapse_gnome_bookmarks_plugin_bookmark_match_get_instance_private (SynapseGnomeBookmarksPluginBookmarkMatch* self)
{
	return G_STRUCT_MEMBER_P (self, SynapseGnomeBookmarksPluginBookmarkMatch_private_offset);
}

static SynapseGnomeBookmarksPluginBookmarkMatch*
synapse_gnome_bookmarks_plugin_bookmark_match_construct (GType object_type,
                                                         const gchar* name,
                                                         const gchar* url,
                                                         const gchar* description)
{
	SynapseGnomeBookmarksPluginBookmarkMatch * self = NULL;
	const gchar* _tmp0_ = NULL;
#line 34 "gnome-bookmarks-plugin.vala"
	g_return_val_if_fail (name != NULL, NULL);
#line 34 "gnome-bookmarks-plugin.vala"
	g_return_val_if_fail (url != NULL, NULL);
#line 36 "gnome-bookmarks-plugin.vala"
	_tmp0_ = description;
#line 36 "gnome-bookmarks-plugin.vala"
	if (_tmp0_ == NULL) {
#line 36 "gnome-bookmarks-plugin.vala"
		_tmp0_ = url;
#line 1291 "gnome-bookmarks-plugin.c"
	}
#line 36 "gnome-bookmarks-plugin.vala"
	self = (SynapseGnomeBookmarksPluginBookmarkMatch*) g_object_new (object_type, "title", name, "description", _tmp0_, "uri", url, "mime-type", "", "has-thumbnail", FALSE, "icon-name", "bookmark-new", NULL);
#line 34 "gnome-bookmarks-plugin.vala"
	return self;
#line 1297 "gnome-bookmarks-plugin.c"
}

static SynapseGnomeBookmarksPluginBookmarkMatch*
synapse_gnome_bookmarks_plugin_bookmark_match_new (const gchar* name,
                                                   const gchar* url,
                                                   const gchar* description)
{
#line 34 "gnome-bookmarks-plugin.vala"
	return synapse_gnome_bookmarks_plugin_bookmark_match_construct (SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH, name, url, description);
#line 1307 "gnome-bookmarks-plugin.c"
}

static const gchar*
synapse_gnome_bookmarks_plugin_bookmark_match_get_title_folded (SynapseGnomeBookmarksPluginBookmarkMatch* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp4_;
	const gchar* result;
#line 44 "gnome-bookmarks-plugin.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 46 "gnome-bookmarks-plugin.vala"
	_tmp0_ = self->priv->title_folded;
#line 46 "gnome-bookmarks-plugin.vala"
	if (_tmp0_ == NULL) {
#line 1322 "gnome-bookmarks-plugin.c"
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
#line 46 "gnome-bookmarks-plugin.vala"
		_tmp1_ = synapse_match_get_title ((SynapseMatch*) self);
#line 46 "gnome-bookmarks-plugin.vala"
		_tmp2_ = _tmp1_;
#line 46 "gnome-bookmarks-plugin.vala"
		_tmp3_ = g_utf8_casefold (_tmp2_, (gssize) -1);
#line 46 "gnome-bookmarks-plugin.vala"
		_g_free0 (self->priv->title_folded);
#line 46 "gnome-bookmarks-plugin.vala"
		self->priv->title_folded = _tmp3_;
#line 1336 "gnome-bookmarks-plugin.c"
	}
#line 47 "gnome-bookmarks-plugin.vala"
	_tmp4_ = self->priv->title_folded;
#line 47 "gnome-bookmarks-plugin.vala"
	result = _tmp4_;
#line 47 "gnome-bookmarks-plugin.vala"
	return result;
#line 1344 "gnome-bookmarks-plugin.c"
}

static const gchar*
synapse_gnome_bookmarks_plugin_bookmark_match_get_uri_folded (SynapseGnomeBookmarksPluginBookmarkMatch* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp4_;
	const gchar* result;
#line 50 "gnome-bookmarks-plugin.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 52 "gnome-bookmarks-plugin.vala"
	_tmp0_ = self->priv->uri_folded;
#line 52 "gnome-bookmarks-plugin.vala"
	if (_tmp0_ == NULL) {
#line 1359 "gnome-bookmarks-plugin.c"
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
#line 52 "gnome-bookmarks-plugin.vala"
		_tmp1_ = synapse_uri_match_get_uri ((SynapseUriMatch*) self);
#line 52 "gnome-bookmarks-plugin.vala"
		_tmp2_ = _tmp1_;
#line 52 "gnome-bookmarks-plugin.vala"
		_tmp3_ = g_utf8_casefold (_tmp2_, (gssize) -1);
#line 52 "gnome-bookmarks-plugin.vala"
		_g_free0 (self->priv->uri_folded);
#line 52 "gnome-bookmarks-plugin.vala"
		self->priv->uri_folded = _tmp3_;
#line 1373 "gnome-bookmarks-plugin.c"
	}
#line 53 "gnome-bookmarks-plugin.vala"
	_tmp4_ = self->priv->uri_folded;
#line 53 "gnome-bookmarks-plugin.vala"
	result = _tmp4_;
#line 53 "gnome-bookmarks-plugin.vala"
	return result;
#line 1381 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_bookmark_match_class_init (SynapseGnomeBookmarksPluginBookmarkMatchClass * klass,
                                                          gpointer klass_data)
{
#line 32 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_bookmark_match_parent_class = g_type_class_peek_parent (klass);
#line 32 "gnome-bookmarks-plugin.vala"
	g_type_class_adjust_private_offset (klass, &SynapseGnomeBookmarksPluginBookmarkMatch_private_offset);
#line 32 "gnome-bookmarks-plugin.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_gnome_bookmarks_plugin_bookmark_match_finalize;
#line 1394 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_bookmark_match_instance_init (SynapseGnomeBookmarksPluginBookmarkMatch * self,
                                                             gpointer klass)
{
#line 32 "gnome-bookmarks-plugin.vala"
	self->priv = synapse_gnome_bookmarks_plugin_bookmark_match_get_instance_private (self);
#line 41 "gnome-bookmarks-plugin.vala"
	self->priv->title_folded = NULL;
#line 42 "gnome-bookmarks-plugin.vala"
	self->priv->uri_folded = NULL;
#line 1407 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_bookmark_match_finalize (GObject * obj)
{
	SynapseGnomeBookmarksPluginBookmarkMatch * self;
#line 32 "gnome-bookmarks-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_GNOME_BOOKMARKS_PLUGIN_TYPE_BOOKMARK_MATCH, SynapseGnomeBookmarksPluginBookmarkMatch);
#line 41 "gnome-bookmarks-plugin.vala"
	_g_free0 (self->priv->title_folded);
#line 42 "gnome-bookmarks-plugin.vala"
	_g_free0 (self->priv->uri_folded);
#line 32 "gnome-bookmarks-plugin.vala"
	G_OBJECT_CLASS (synapse_gnome_bookmarks_plugin_bookmark_match_parent_class)->finalize (obj);
#line 1422 "gnome-bookmarks-plugin.c"
}

static GType
synapse_gnome_bookmarks_plugin_bookmark_match_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseGnomeBookmarksPluginBookmarkMatchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_gnome_bookmarks_plugin_bookmark_match_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseGnomeBookmarksPluginBookmarkMatch), 0, (GInstanceInitFunc) synapse_gnome_bookmarks_plugin_bookmark_match_instance_init, NULL };
	GType synapse_gnome_bookmarks_plugin_bookmark_match_type_id;
	synapse_gnome_bookmarks_plugin_bookmark_match_type_id = g_type_register_static (SYNAPSE_TYPE_URI_MATCH, "SynapseGnomeBookmarksPluginBookmarkMatch", &g_define_type_info, 0);
	SynapseGnomeBookmarksPluginBookmarkMatch_private_offset = g_type_add_instance_private (synapse_gnome_bookmarks_plugin_bookmark_match_type_id, sizeof (SynapseGnomeBookmarksPluginBookmarkMatchPrivate));
	return synapse_gnome_bookmarks_plugin_bookmark_match_type_id;
}

static GType
synapse_gnome_bookmarks_plugin_bookmark_match_get_type (void)
{
	static volatile gsize synapse_gnome_bookmarks_plugin_bookmark_match_type_id__once = 0;
	if (g_once_init_enter (&synapse_gnome_bookmarks_plugin_bookmark_match_type_id__once)) {
		GType synapse_gnome_bookmarks_plugin_bookmark_match_type_id;
		synapse_gnome_bookmarks_plugin_bookmark_match_type_id = synapse_gnome_bookmarks_plugin_bookmark_match_get_type_once ();
		g_once_init_leave (&synapse_gnome_bookmarks_plugin_bookmark_match_type_id__once, synapse_gnome_bookmarks_plugin_bookmark_match_type_id);
	}
	return synapse_gnome_bookmarks_plugin_bookmark_match_type_id__once;
}

static GObject *
synapse_gnome_bookmarks_plugin_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SynapseGnomeBookmarksPlugin * self;
	SynapseUtilsAsyncOnce* _tmp0_;
#line 75 "gnome-bookmarks-plugin.vala"
	parent_class = G_OBJECT_CLASS (synapse_gnome_bookmarks_plugin_parent_class);
#line 75 "gnome-bookmarks-plugin.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 75 "gnome-bookmarks-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_GNOME_BOOKMARKS_PLUGIN, SynapseGnomeBookmarksPlugin);
#line 77 "gnome-bookmarks-plugin.vala"
	_tmp0_ = synapse_utils_async_once_new (GEE_TYPE_LIST, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
#line 77 "gnome-bookmarks-plugin.vala"
	_synapse_utils_async_once_unref0 (self->priv->bookmarks_once);
#line 77 "gnome-bookmarks-plugin.vala"
	self->priv->bookmarks_once = _tmp0_;
#line 75 "gnome-bookmarks-plugin.vala"
	return obj;
#line 1470 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_class_init (SynapseGnomeBookmarksPluginClass * klass,
                                           gpointer klass_data)
{
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_parent_class = g_type_class_peek_parent (klass);
#line 20 "gnome-bookmarks-plugin.vala"
	g_type_class_adjust_private_offset (klass, &SynapseGnomeBookmarksPlugin_private_offset);
#line 20 "gnome-bookmarks-plugin.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_synapse_gnome_bookmarks_plugin_get_property;
#line 20 "gnome-bookmarks-plugin.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_synapse_gnome_bookmarks_plugin_set_property;
#line 20 "gnome-bookmarks-plugin.vala"
	G_OBJECT_CLASS (klass)->constructor = synapse_gnome_bookmarks_plugin_constructor;
#line 20 "gnome-bookmarks-plugin.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_gnome_bookmarks_plugin_finalize;
#line 20 "gnome-bookmarks-plugin.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_GNOME_BOOKMARKS_PLUGIN_ENABLED_PROPERTY, synapse_gnome_bookmarks_plugin_properties[SYNAPSE_GNOME_BOOKMARKS_PLUGIN_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 70 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_register_plugin ();
#line 1493 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_synapse_activatable_interface_init (SynapseActivatableIface * iface,
                                                                   gpointer iface_data)
{
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_synapse_activatable_parent_iface = g_type_interface_peek_parent (iface);
#line 20 "gnome-bookmarks-plugin.vala"
	iface->activate = (void (*) (SynapseActivatable*)) synapse_gnome_bookmarks_plugin_real_activate;
#line 20 "gnome-bookmarks-plugin.vala"
	iface->deactivate = (void (*) (SynapseActivatable*)) synapse_gnome_bookmarks_plugin_real_deactivate;
#line 20 "gnome-bookmarks-plugin.vala"
	iface->get_enabled = synapse_gnome_bookmarks_plugin_real_get_enabled;
#line 20 "gnome-bookmarks-plugin.vala"
	iface->set_enabled = synapse_gnome_bookmarks_plugin_real_set_enabled;
#line 1510 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_synapse_item_provider_interface_init (SynapseItemProviderIface * iface,
                                                                     gpointer iface_data)
{
#line 20 "gnome-bookmarks-plugin.vala"
	synapse_gnome_bookmarks_plugin_synapse_item_provider_parent_iface = g_type_interface_peek_parent (iface);
#line 20 "gnome-bookmarks-plugin.vala"
	iface->handles_query = (gboolean (*) (SynapseItemProvider*, SynapseQuery*)) synapse_gnome_bookmarks_plugin_real_handles_query;
#line 20 "gnome-bookmarks-plugin.vala"
	iface->search = (void (*) (SynapseItemProvider*, SynapseQuery*, GAsyncReadyCallback, gpointer)) synapse_gnome_bookmarks_plugin_real_search;
#line 20 "gnome-bookmarks-plugin.vala"
	iface->search_finish = (SynapseResultSet* (*) (SynapseItemProvider*, GAsyncResult*, GError**)) synapse_gnome_bookmarks_plugin_search_finish;
#line 1525 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_instance_init (SynapseGnomeBookmarksPlugin * self,
                                              gpointer klass)
{
#line 20 "gnome-bookmarks-plugin.vala"
	self->priv = synapse_gnome_bookmarks_plugin_get_instance_private (self);
#line 22 "gnome-bookmarks-plugin.vala"
	self->priv->_enabled = TRUE;
#line 1536 "gnome-bookmarks-plugin.c"
}

static void
synapse_gnome_bookmarks_plugin_finalize (GObject * obj)
{
	SynapseGnomeBookmarksPlugin * self;
#line 20 "gnome-bookmarks-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_GNOME_BOOKMARKS_PLUGIN, SynapseGnomeBookmarksPlugin);
#line 73 "gnome-bookmarks-plugin.vala"
	_synapse_utils_async_once_unref0 (self->priv->bookmarks_once);
#line 20 "gnome-bookmarks-plugin.vala"
	G_OBJECT_CLASS (synapse_gnome_bookmarks_plugin_parent_class)->finalize (obj);
#line 1549 "gnome-bookmarks-plugin.c"
}

static GType
synapse_gnome_bookmarks_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseGnomeBookmarksPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_gnome_bookmarks_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseGnomeBookmarksPlugin), 0, (GInstanceInitFunc) synapse_gnome_bookmarks_plugin_instance_init, NULL };
	static const GInterfaceInfo synapse_activatable_info = { (GInterfaceInitFunc) synapse_gnome_bookmarks_plugin_synapse_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo synapse_item_provider_info = { (GInterfaceInitFunc) synapse_gnome_bookmarks_plugin_synapse_item_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType synapse_gnome_bookmarks_plugin_type_id;
	synapse_gnome_bookmarks_plugin_type_id = g_type_register_static (G_TYPE_OBJECT, "SynapseGnomeBookmarksPlugin", &g_define_type_info, 0);
	g_type_add_interface_static (synapse_gnome_bookmarks_plugin_type_id, SYNAPSE_TYPE_ACTIVATABLE, &synapse_activatable_info);
	g_type_add_interface_static (synapse_gnome_bookmarks_plugin_type_id, SYNAPSE_TYPE_ITEM_PROVIDER, &synapse_item_provider_info);
	SynapseGnomeBookmarksPlugin_private_offset = g_type_add_instance_private (synapse_gnome_bookmarks_plugin_type_id, sizeof (SynapseGnomeBookmarksPluginPrivate));
	return synapse_gnome_bookmarks_plugin_type_id;
}

GType
synapse_gnome_bookmarks_plugin_get_type (void)
{
	static volatile gsize synapse_gnome_bookmarks_plugin_type_id__once = 0;
	if (g_once_init_enter (&synapse_gnome_bookmarks_plugin_type_id__once)) {
		GType synapse_gnome_bookmarks_plugin_type_id;
		synapse_gnome_bookmarks_plugin_type_id = synapse_gnome_bookmarks_plugin_get_type_once ();
		g_once_init_leave (&synapse_gnome_bookmarks_plugin_type_id__once, synapse_gnome_bookmarks_plugin_type_id);
	}
	return synapse_gnome_bookmarks_plugin_type_id__once;
}

static void
_vala_synapse_gnome_bookmarks_plugin_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	SynapseGnomeBookmarksPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_GNOME_BOOKMARKS_PLUGIN, SynapseGnomeBookmarksPlugin);
#line 20 "gnome-bookmarks-plugin.vala"
	switch (property_id) {
#line 20 "gnome-bookmarks-plugin.vala"
		case SYNAPSE_GNOME_BOOKMARKS_PLUGIN_ENABLED_PROPERTY:
#line 20 "gnome-bookmarks-plugin.vala"
		g_value_set_boolean (value, synapse_activatable_get_enabled ((SynapseActivatable*) self));
#line 20 "gnome-bookmarks-plugin.vala"
		break;
#line 1594 "gnome-bookmarks-plugin.c"
		default:
#line 20 "gnome-bookmarks-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "gnome-bookmarks-plugin.vala"
		break;
#line 1600 "gnome-bookmarks-plugin.c"
	}
}

static void
_vala_synapse_gnome_bookmarks_plugin_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	SynapseGnomeBookmarksPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_GNOME_BOOKMARKS_PLUGIN, SynapseGnomeBookmarksPlugin);
#line 20 "gnome-bookmarks-plugin.vala"
	switch (property_id) {
#line 20 "gnome-bookmarks-plugin.vala"
		case SYNAPSE_GNOME_BOOKMARKS_PLUGIN_ENABLED_PROPERTY:
#line 20 "gnome-bookmarks-plugin.vala"
		synapse_activatable_set_enabled ((SynapseActivatable*) self, g_value_get_boolean (value));
#line 20 "gnome-bookmarks-plugin.vala"
		break;
#line 1620 "gnome-bookmarks-plugin.c"
		default:
#line 20 "gnome-bookmarks-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "gnome-bookmarks-plugin.vala"
		break;
#line 1626 "gnome-bookmarks-plugin.c"
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

