/* midori-historycompletion.c generated by valac 0.38.8, the Vala compiler
 * generated from midori-historycompletion.vala, do not modify */

/*
 Copyright (C) 2012-2013 Christian Dywan <christian@twotoasts.de>

 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.1 of the License, or (at your option) any later version.

 See the file COPYING for the full license text.
*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>


#define MIDORI_TYPE_COMPLETION (midori_completion_get_type ())
#define MIDORI_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_COMPLETION, MidoriCompletion))
#define MIDORI_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_COMPLETION, MidoriCompletionClass))
#define MIDORI_IS_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_COMPLETION))
#define MIDORI_IS_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_COMPLETION))
#define MIDORI_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_COMPLETION, MidoriCompletionClass))

typedef struct _MidoriCompletion MidoriCompletion;
typedef struct _MidoriCompletionClass MidoriCompletionClass;
typedef struct _MidoriCompletionPrivate MidoriCompletionPrivate;

#define MIDORI_TYPE_SUGGESTION (midori_suggestion_get_type ())
#define MIDORI_SUGGESTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_SUGGESTION, MidoriSuggestion))
#define MIDORI_SUGGESTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_SUGGESTION, MidoriSuggestionClass))
#define MIDORI_IS_SUGGESTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_SUGGESTION))
#define MIDORI_IS_SUGGESTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_SUGGESTION))
#define MIDORI_SUGGESTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_SUGGESTION, MidoriSuggestionClass))

typedef struct _MidoriSuggestion MidoriSuggestion;
typedef struct _MidoriSuggestionClass MidoriSuggestionClass;

#define MIDORI_TYPE_HISTORY_COMPLETION (midori_history_completion_get_type ())
#define MIDORI_HISTORY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_COMPLETION, MidoriHistoryCompletion))
#define MIDORI_HISTORY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_COMPLETION, MidoriHistoryCompletionClass))
#define MIDORI_IS_HISTORY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_COMPLETION))
#define MIDORI_IS_HISTORY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_COMPLETION))
#define MIDORI_HISTORY_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_COMPLETION, MidoriHistoryCompletionClass))

typedef struct _MidoriHistoryCompletion MidoriHistoryCompletion;
typedef struct _MidoriHistoryCompletionClass MidoriHistoryCompletionClass;
typedef struct _MidoriHistoryCompletionPrivate MidoriHistoryCompletionPrivate;

#define MIDORI_TYPE_DATABASE (midori_database_get_type ())
#define MIDORI_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_DATABASE, MidoriDatabase))
#define MIDORI_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_DATABASE, MidoriDatabaseClass))
#define MIDORI_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_DATABASE))
#define MIDORI_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_DATABASE))
#define MIDORI_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_DATABASE, MidoriDatabaseClass))

typedef struct _MidoriDatabase MidoriDatabase;
typedef struct _MidoriDatabaseClass MidoriDatabaseClass;

#define MIDORI_TYPE_HISTORY_DATABASE (midori_history_database_get_type ())
#define MIDORI_HISTORY_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_DATABASE, MidoriHistoryDatabase))
#define MIDORI_HISTORY_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_DATABASE, MidoriHistoryDatabaseClass))
#define MIDORI_IS_HISTORY_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_DATABASE))
#define MIDORI_IS_HISTORY_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_DATABASE))
#define MIDORI_HISTORY_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_DATABASE, MidoriHistoryDatabaseClass))

typedef struct _MidoriHistoryDatabase MidoriHistoryDatabase;
typedef struct _MidoriHistoryDatabaseClass MidoriHistoryDatabaseClass;
enum  {
	MIDORI_HISTORY_COMPLETION_0_PROPERTY,
	MIDORI_HISTORY_COMPLETION_NUM_PROPERTIES
};
static GParamSpec* midori_history_completion_properties[MIDORI_HISTORY_COMPLETION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))

#define MIDORI_TYPE_HISTORY_ITEM (midori_history_item_get_type ())
#define MIDORI_HISTORY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItem))
#define MIDORI_HISTORY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItemClass))
#define MIDORI_IS_HISTORY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_ITEM))
#define MIDORI_IS_HISTORY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_ITEM))
#define MIDORI_HISTORY_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItemClass))

typedef struct _MidoriHistoryItem MidoriHistoryItem;
typedef struct _MidoriHistoryItemClass MidoriHistoryItemClass;

#define MIDORI_TYPE_HISTORY_WEBSITE (midori_history_website_get_type ())
#define MIDORI_HISTORY_WEBSITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsite))
#define MIDORI_HISTORY_WEBSITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsiteClass))
#define MIDORI_IS_HISTORY_WEBSITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_WEBSITE))
#define MIDORI_IS_HISTORY_WEBSITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_WEBSITE))
#define MIDORI_HISTORY_WEBSITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsiteClass))

typedef struct _MidoriHistoryWebsite MidoriHistoryWebsite;
typedef struct _MidoriHistoryWebsiteClass MidoriHistoryWebsiteClass;

#define MIDORI_TYPE_HISTORY_SEARCH (midori_history_search_get_type ())
#define MIDORI_HISTORY_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearch))
#define MIDORI_HISTORY_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearchClass))
#define MIDORI_IS_HISTORY_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_SEARCH))
#define MIDORI_IS_HISTORY_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_SEARCH))
#define MIDORI_HISTORY_SEARCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearchClass))

typedef struct _MidoriHistorySearch MidoriHistorySearch;
typedef struct _MidoriHistorySearchClass MidoriHistorySearchClass;
typedef struct _MidoriHistoryCompletionCompleteData MidoriHistoryCompletionCompleteData;

struct _MidoriCompletion {
	GObject parent_instance;
	MidoriCompletionPrivate * priv;
};

struct _MidoriCompletionClass {
	GObjectClass parent_class;
	void (*prepare) (MidoriCompletion* self, GObject* app);
	gboolean (*can_complete) (MidoriCompletion* self, const gchar* prefix);
	gboolean (*can_action) (MidoriCompletion* self, const gchar* action);
	void (*complete) (MidoriCompletion* self, const gchar* text, const gchar* action, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GList* (*complete_finish) (MidoriCompletion* self, GAsyncResult* _res_);
};

struct _MidoriHistoryCompletion {
	MidoriCompletion parent_instance;
	MidoriHistoryCompletionPrivate * priv;
	MidoriHistoryDatabase* database;
};

struct _MidoriHistoryCompletionClass {
	MidoriCompletionClass parent_class;
};

typedef enum  {
	MIDORI_DATABASE_ERROR_OPEN,
	MIDORI_DATABASE_ERROR_NAMING,
	MIDORI_DATABASE_ERROR_FILENAME,
	MIDORI_DATABASE_ERROR_EXECUTE,
	MIDORI_DATABASE_ERROR_COMPILE,
	MIDORI_DATABASE_ERROR_TYPE
} MidoriDatabaseError;
#define MIDORI_DATABASE_ERROR midori_database_error_quark ()
struct _MidoriHistoryCompletionCompleteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	MidoriHistoryCompletion* self;
	gchar* text;
	gchar* action;
	GCancellable* cancellable;
	GList* result;
	MidoriHistoryDatabase* _tmp0_;
	GList* items;
	MidoriHistoryDatabase* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GCancellable* _tmp5_;
	GList* _tmp6_;
	GList* _tmp7_;
	GList* suggestions;
	GList* _tmp8_;
	GList* item_collection;
	GList* item_it;
	MidoriHistoryItem* _tmp9_;
	MidoriHistoryItem* item;
	MidoriHistoryItem* _tmp10_;
	MidoriHistoryWebsite* website;
	MidoriHistoryItem* _tmp11_;
	MidoriHistoryWebsite* _tmp12_;
	MidoriHistoryWebsite* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	MidoriHistoryWebsite* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	MidoriHistoryWebsite* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	GCancellable* _tmp22_;
	GIcon* _tmp23_;
	GIcon* _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	MidoriSuggestion* _tmp27_;
	MidoriHistoryItem* _tmp28_;
	MidoriHistorySearch* search;
	MidoriHistoryItem* _tmp29_;
	MidoriHistorySearch* _tmp30_;
	MidoriHistorySearch* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	MidoriHistorySearch* _tmp34_;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	MidoriHistorySearch* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	MidoriHistorySearch* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	GCancellable* _tmp47_;
	GIcon* _tmp48_;
	GIcon* _tmp49_;
	gint _tmp50_;
	gint _tmp51_;
	MidoriSuggestion* _tmp52_;
	GCancellable* _tmp53_;
	gboolean _tmp54_;
};


static gpointer midori_history_completion_parent_class = NULL;

GType midori_completion_get_type (void) G_GNUC_CONST;
GType midori_suggestion_get_type (void) G_GNUC_CONST;
GType midori_history_completion_get_type (void) G_GNUC_CONST;
GType midori_database_get_type (void) G_GNUC_CONST;
GType midori_history_database_get_type (void) G_GNUC_CONST;
MidoriHistoryCompletion* midori_history_completion_new (void);
MidoriHistoryCompletion* midori_history_completion_construct (GType object_type);
static void midori_history_completion_real_prepare (MidoriCompletion* base, GObject* app);
GQuark midori_database_error_quark (void);
MidoriHistoryDatabase* midori_history_database_new (GObject* app, GError** error);
MidoriHistoryDatabase* midori_history_database_construct (GType object_type, GObject* app, GError** error);
static gboolean midori_history_completion_real_can_complete (MidoriCompletion* base, const gchar* text);
static gboolean midori_history_completion_real_can_action (MidoriCompletion* base, const gchar* action);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void midori_history_completion_real_complete_data_free (gpointer _data);
static void midori_history_completion_real_complete_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data);
static void midori_history_completion_real_complete (MidoriCompletion* base, const gchar* text, const gchar* action, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean midori_history_completion_real_complete_co (MidoriHistoryCompletionCompleteData* _data_);
GType midori_history_item_get_type (void) G_GNUC_CONST;
void midori_history_database_list_by_count_with_bookmarks (MidoriHistoryDatabase* self, const gchar* filter, gint max_items, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
GList* midori_history_database_list_by_count_with_bookmarks_finish (MidoriHistoryDatabase* self, GAsyncResult* _res_);
gint midori_completion_get_max_items (MidoriCompletion* self);
static void midori_history_completion_complete_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
GType midori_history_website_get_type (void) G_GNUC_CONST;
const gchar* midori_history_website_get_uri (MidoriHistoryWebsite* self);
const gchar* midori_history_item_get_title (MidoriHistoryItem* self);
void midori_uri_get_icon_fallback (const gchar* uri, GIcon* fallback, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
GIcon* midori_uri_get_icon_fallback_finish (GAsyncResult* _res_);
gint midori_completion_get_position (MidoriCompletion* self);
MidoriSuggestion* midori_suggestion_new (const gchar* uri, const gchar* markup, gboolean use_markup, const gchar* background, GIcon* icon, gint* priority);
MidoriSuggestion* midori_suggestion_construct (GType object_type, const gchar* uri, const gchar* markup, gboolean use_markup, const gchar* background, GIcon* icon, gint* priority);
GType midori_history_search_get_type (void) G_GNUC_CONST;
const gchar* midori_history_search_get_uri (MidoriHistorySearch* self);
static void midori_history_completion_finalize (GObject * obj);


MidoriHistoryCompletion* midori_history_completion_construct (GType object_type) {
	MidoriHistoryCompletion * self = NULL;
#line 17 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	self = (MidoriHistoryCompletion*) g_object_new (object_type, "description", _ ("Bookmarks and History"), NULL);
#line 16 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return self;
#line 271 "midori-historycompletion.c"
}


MidoriHistoryCompletion* midori_history_completion_new (void) {
#line 16 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return midori_history_completion_construct (MIDORI_TYPE_HISTORY_COMPLETION);
#line 278 "midori-historycompletion.c"
}


static void midori_history_completion_real_prepare (MidoriCompletion* base, GObject* app) {
	MidoriHistoryCompletion * self;
	GError * _inner_error_ = NULL;
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	self = (MidoriHistoryCompletion*) base;
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_return_if_fail (app != NULL);
#line 289 "midori-historycompletion.c"
	{
		MidoriHistoryDatabase* _tmp0_ = NULL;
		GObject* _tmp1_;
		MidoriHistoryDatabase* _tmp2_;
		MidoriHistoryDatabase* _tmp3_;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_tmp1_ = app;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_tmp2_ = midori_history_database_new (_tmp1_, &_inner_error_);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_tmp0_ = _tmp2_;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 303 "midori-historycompletion.c"
			goto __catch20_g_error;
		}
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_tmp3_ = _tmp0_;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_tmp0_ = NULL;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_g_object_unref0 (self->database);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		self->database = _tmp3_;
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_g_object_unref0 (_tmp0_);
#line 316 "midori-historycompletion.c"
	}
	goto __finally20;
	__catch20_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_error_ = _inner_error_;
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_inner_error_ = NULL;
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_tmp4_ = _error_;
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_tmp5_ = _tmp4_->message;
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_warning ("midori-historycompletion.vala:25: %s", _tmp5_);
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_g_error_free0 (_error_);
#line 336 "midori-historycompletion.c"
	}
	__finally20:
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_clear_error (&_inner_error_);
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		return;
#line 347 "midori-historycompletion.c"
	}
}


static gboolean midori_history_completion_real_can_complete (MidoriCompletion* base, const gchar* text) {
	MidoriHistoryCompletion * self;
	gboolean result = FALSE;
	MidoriHistoryDatabase* _tmp0_;
#line 29 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	self = (MidoriHistoryCompletion*) base;
#line 29 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_return_val_if_fail (text != NULL, FALSE);
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp0_ = self->database;
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	result = _tmp0_ != NULL;
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return result;
#line 366 "midori-historycompletion.c"
}


static gboolean midori_history_completion_real_can_action (MidoriCompletion* base, const gchar* action) {
	MidoriHistoryCompletion * self;
	gboolean result = FALSE;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	self = (MidoriHistoryCompletion*) base;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_return_val_if_fail (action != NULL, FALSE);
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	result = FALSE;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return result;
#line 381 "midori-historycompletion.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 388 "midori-historycompletion.c"
}


static inline void _g_list_free__g_object_unref0_ (GList* self) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
#line 395 "midori-historycompletion.c"
}


static void midori_history_completion_real_complete_data_free (gpointer _data) {
	MidoriHistoryCompletionCompleteData* _data_;
	_data_ = _data;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_free0 (_data_->text);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_free0 (_data_->action);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_object_unref0 (_data_->cancellable);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	__g_list_free__g_object_unref0_0 (_data_->result);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_object_unref0 (_data_->self);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_slice_free (MidoriHistoryCompletionCompleteData, _data_);
#line 414 "midori-historycompletion.c"
}


static void midori_history_completion_real_complete_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data) {
	MidoriHistoryCompletionCompleteData* _task_data_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	if (_task_data_->_callback_ != NULL) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 426 "midori-historycompletion.c"
	}
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_task_data_->_task_complete_ = TRUE;
#line 430 "midori-historycompletion.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return self ? g_object_ref (self) : NULL;
#line 437 "midori-historycompletion.c"
}


static void midori_history_completion_real_complete (MidoriCompletion* base, const gchar* text, const gchar* action, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MidoriHistoryCompletion * self;
	MidoriHistoryCompletionCompleteData* _data_;
	MidoriHistoryCompletion* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	self = (MidoriHistoryCompletion*) base;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_ = g_slice_new0 (MidoriHistoryCompletionCompleteData);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_callback_ = _callback_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, midori_history_completion_real_complete_async_ready_wrapper, _user_data_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	if (_callback_ == NULL) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_data_->_task_complete_ = TRUE;
#line 463 "midori-historycompletion.c"
	}
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_task_set_task_data (_data_->_async_result, _data_, midori_history_completion_real_complete_data_free);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->self = _tmp0_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp1_ = text;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_free0 (_data_->text);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->text = _tmp2_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp3_ = action;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_free0 (_data_->action);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->action = _tmp4_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp5_ = cancellable;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_object_unref0 (_data_->cancellable);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->cancellable = _tmp6_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	midori_history_completion_real_complete_co (_data_);
#line 497 "midori-historycompletion.c"
}


static GList* midori_history_completion_real_complete_finish (MidoriCompletion* base, GAsyncResult* _res_) {
	GList* result;
	MidoriHistoryCompletionCompleteData* _data_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	if (NULL == _data_) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		return NULL;
#line 510 "midori-historycompletion.c"
	}
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	result = _data_->result;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->result = NULL;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return result;
#line 518 "midori-historycompletion.c"
}


static void midori_history_completion_complete_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	MidoriHistoryCompletionCompleteData* _data_;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_ = _user_data_;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_source_object_ = source_object;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_res_ = _res_;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_task_complete_ = TRUE;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	midori_history_completion_real_complete_co (_data_);
#line 534 "midori-historycompletion.c"
}


static gboolean midori_history_completion_real_complete_co (MidoriHistoryCompletionCompleteData* _data_) {
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	switch (_data_->_state_) {
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		case 0:
#line 543 "midori-historycompletion.c"
		goto _state_0;
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		case 1:
#line 547 "midori-historycompletion.c"
		goto _state_1;
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		case 2:
#line 551 "midori-historycompletion.c"
		goto _state_2;
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		case 3:
#line 555 "midori-historycompletion.c"
		goto _state_3;
		default:
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_assert_not_reached ();
#line 560 "midori-historycompletion.c"
	}
	_state_0:
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp0_ = _data_->self->database;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_return_val_if_fail (_data_->_tmp0_ != NULL, NULL);
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp1_ = _data_->self->database;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp2_ = _data_->text;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp3_ = midori_completion_get_max_items ((MidoriCompletion*) _data_->self);
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp4_ = _data_->_tmp3_;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp5_ = _data_->cancellable;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_state_ = 1;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	midori_history_database_list_by_count_with_bookmarks (_data_->_tmp1_, _data_->_tmp2_, _data_->_tmp4_, _data_->_tmp5_, midori_history_completion_complete_ready, _data_);
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return FALSE;
#line 583 "midori-historycompletion.c"
	_state_1:
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp6_ = midori_history_database_list_by_count_with_bookmarks_finish (_data_->_tmp1_, _data_->_res_);
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->items = _data_->_tmp6_;
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp7_ = _data_->items;
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	if (_data_->_tmp7_ == NULL) {
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_data_->result = NULL;
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		__g_list_free__g_object_unref0_0 (_data_->items);
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		if (_data_->_state_ != 0) {
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 605 "midori-historycompletion.c"
			}
		}
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_object_unref (_data_->_async_result);
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		return FALSE;
#line 612 "midori-historycompletion.c"
	}
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->suggestions = NULL;
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp8_ = _data_->items;
#line 618 "midori-historycompletion.c"
	{
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_data_->item_collection = _data_->_tmp8_;
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		for (_data_->item_it = _data_->item_collection; _data_->item_it != NULL; _data_->item_it = _data_->item_it->next) {
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
			_data_->_tmp9_ = _g_object_ref0 ((MidoriHistoryItem*) _data_->item_it->data);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
			_data_->item = _data_->_tmp9_;
#line 628 "midori-historycompletion.c"
			{
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
				_data_->_tmp10_ = _data_->item;
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
				if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp10_, MIDORI_TYPE_HISTORY_WEBSITE)) {
#line 47 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp11_ = _data_->item;
#line 47 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp11_, MIDORI_TYPE_HISTORY_WEBSITE) ? ((MidoriHistoryWebsite*) _data_->_tmp11_) : NULL);
#line 47 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->website = _data_->_tmp12_;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp13_ = _data_->website;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp14_ = midori_history_website_get_uri (_data_->_tmp13_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp15_ = _data_->_tmp14_;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp16_ = _data_->website;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp17_ = midori_history_item_get_title ((MidoriHistoryItem*) _data_->_tmp16_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp18_ = _data_->_tmp17_;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp19_ = _data_->website;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp20_ = midori_history_website_get_uri (_data_->_tmp19_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp21_ = _data_->_tmp20_;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp22_ = _data_->cancellable;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_state_ = 2;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					midori_uri_get_icon_fallback (_data_->_tmp21_, NULL, _data_->_tmp22_, midori_history_completion_complete_ready, _data_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					return FALSE;
#line 666 "midori-historycompletion.c"
					_state_2:
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp23_ = midori_uri_get_icon_fallback_finish (_data_->_res_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp24_ = _data_->_tmp23_;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp25_ = midori_completion_get_position ((MidoriCompletion*) _data_->self);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp26_ = _data_->_tmp25_;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp27_ = midori_suggestion_new (_data_->_tmp15_, _data_->_tmp18_, TRUE, NULL, _data_->_tmp24_, &_data_->_tmp26_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->suggestions = g_list_append (_data_->suggestions, _data_->_tmp27_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_g_object_unref0 (_data_->_tmp24_);
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_g_object_unref0 (_data_->website);
#line 684 "midori-historycompletion.c"
				} else {
#line 51 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					_data_->_tmp28_ = _data_->item;
#line 51 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
					if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp28_, MIDORI_TYPE_HISTORY_SEARCH)) {
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp29_ = _data_->item;
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp29_, MIDORI_TYPE_HISTORY_SEARCH) ? ((MidoriHistorySearch*) _data_->_tmp29_) : NULL);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->search = _data_->_tmp30_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp31_ = _data_->search;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp32_ = midori_history_search_get_uri (_data_->_tmp31_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp33_ = _data_->_tmp32_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp34_ = _data_->search;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp35_ = midori_history_item_get_title ((MidoriHistoryItem*) _data_->_tmp34_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp36_ = _data_->_tmp35_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp37_ = g_strconcat (_data_->_tmp36_, "\n", NULL);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp38_ = _data_->_tmp37_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp39_ = _data_->search;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp40_ = midori_history_search_get_uri (_data_->_tmp39_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp41_ = _data_->_tmp40_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp42_ = g_strconcat (_data_->_tmp38_, _data_->_tmp41_, NULL);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp43_ = _data_->_tmp42_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp44_ = _data_->search;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp45_ = midori_history_search_get_uri (_data_->_tmp44_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp46_ = _data_->_tmp45_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp47_ = _data_->cancellable;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_state_ = 3;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						midori_uri_get_icon_fallback (_data_->_tmp46_, NULL, _data_->_tmp47_, midori_history_completion_complete_ready, _data_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						return FALSE;
#line 736 "midori-historycompletion.c"
						_state_3:
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp48_ = midori_uri_get_icon_fallback_finish (_data_->_res_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp49_ = _data_->_tmp48_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp50_ = midori_completion_get_position ((MidoriCompletion*) _data_->self);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp51_ = _data_->_tmp50_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->_tmp52_ = midori_suggestion_new (_data_->_tmp33_, _data_->_tmp43_, FALSE, "gray", _data_->_tmp49_, &_data_->_tmp51_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_data_->suggestions = g_list_append (_data_->suggestions, _data_->_tmp52_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_g_object_unref0 (_data_->_tmp49_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_g_free0 (_data_->_tmp43_);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_g_free0 (_data_->_tmp38_);
#line 51 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						_g_object_unref0 (_data_->search);
#line 758 "midori-historycompletion.c"
					} else {
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
						g_warn_if_reached ();
#line 762 "midori-historycompletion.c"
					}
				}
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
				_g_object_unref0 (_data_->item);
#line 767 "midori-historycompletion.c"
			}
		}
	}
#line 60 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp53_ = _data_->cancellable;
#line 60 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->_tmp54_ = g_cancellable_is_cancelled (_data_->_tmp53_);
#line 60 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	if (_data_->_tmp54_) {
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		_data_->result = NULL;
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		__g_list_free__g_object_unref0_0 (_data_->suggestions);
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		__g_list_free__g_object_unref0_0 (_data_->items);
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		if (_data_->_state_ != 0) {
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 791 "midori-historycompletion.c"
			}
		}
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		g_object_unref (_data_->_async_result);
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		return FALSE;
#line 798 "midori-historycompletion.c"
	}
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_data_->result = _data_->suggestions;
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	__g_list_free__g_object_unref0_0 (_data_->items);
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	if (_data_->_state_ != 0) {
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 812 "midori-historycompletion.c"
		}
	}
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	g_object_unref (_data_->_async_result);
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	return FALSE;
#line 819 "midori-historycompletion.c"
}


static void midori_history_completion_class_init (MidoriHistoryCompletionClass * klass) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	midori_history_completion_parent_class = g_type_class_peek_parent (klass);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	((MidoriCompletionClass *) klass)->prepare = (void (*) (MidoriCompletion *, GObject*)) midori_history_completion_real_prepare;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	((MidoriCompletionClass *) klass)->can_complete = (gboolean (*) (MidoriCompletion *, const gchar*)) midori_history_completion_real_can_complete;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	((MidoriCompletionClass *) klass)->can_action = (gboolean (*) (MidoriCompletion *, const gchar*)) midori_history_completion_real_can_action;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	((MidoriCompletionClass *) klass)->complete = (void (*) (MidoriCompletion *, const gchar*, const gchar*, GCancellable*, GAsyncReadyCallback, gpointer)) midori_history_completion_real_complete;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	((MidoriCompletionClass *) klass)->complete_finish = (GList* (*) (MidoriCompletion *, GAsyncResult*)) midori_history_completion_real_complete_finish;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	G_OBJECT_CLASS (klass)->finalize = midori_history_completion_finalize;
#line 838 "midori-historycompletion.c"
}


static void midori_history_completion_instance_init (MidoriHistoryCompletion * self) {
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	self->database = NULL;
#line 845 "midori-historycompletion.c"
}


static void midori_history_completion_finalize (GObject * obj) {
	MidoriHistoryCompletion * self;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MIDORI_TYPE_HISTORY_COMPLETION, MidoriHistoryCompletion);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	_g_object_unref0 (self->database);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historycompletion.vala"
	G_OBJECT_CLASS (midori_history_completion_parent_class)->finalize (obj);
#line 857 "midori-historycompletion.c"
}


GType midori_history_completion_get_type (void) {
	static volatile gsize midori_history_completion_type_id__volatile = 0;
	if (g_once_init_enter (&midori_history_completion_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MidoriHistoryCompletionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) midori_history_completion_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MidoriHistoryCompletion), 0, (GInstanceInitFunc) midori_history_completion_instance_init, NULL };
		GType midori_history_completion_type_id;
		midori_history_completion_type_id = g_type_register_static (MIDORI_TYPE_COMPLETION, "MidoriHistoryCompletion", &g_define_type_info, 0);
		g_once_init_leave (&midori_history_completion_type_id__volatile, midori_history_completion_type_id);
	}
	return midori_history_completion_type_id__volatile;
}



