/* midori-viewcompletion.c generated by valac 0.38.8, the Vala compiler
 * generated from midori-viewcompletion.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>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.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_VIEW_COMPLETION (midori_view_completion_get_type ())
#define MIDORI_VIEW_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_VIEW_COMPLETION, MidoriViewCompletion))
#define MIDORI_VIEW_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_VIEW_COMPLETION, MidoriViewCompletionClass))
#define MIDORI_IS_VIEW_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_VIEW_COMPLETION))
#define MIDORI_IS_VIEW_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_VIEW_COMPLETION))
#define MIDORI_VIEW_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_VIEW_COMPLETION, MidoriViewCompletionClass))

typedef struct _MidoriViewCompletion MidoriViewCompletion;
typedef struct _MidoriViewCompletionClass MidoriViewCompletionClass;
typedef struct _MidoriViewCompletionPrivate MidoriViewCompletionPrivate;
enum  {
	MIDORI_VIEW_COMPLETION_0_PROPERTY,
	MIDORI_VIEW_COMPLETION_NUM_PROPERTIES
};
static GParamSpec* midori_view_completion_properties[MIDORI_VIEW_COMPLETION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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)))
typedef struct _MidoriViewCompletionCompleteData MidoriViewCompletionCompleteData;

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 _MidoriViewCompletion {
	MidoriCompletion parent_instance;
	MidoriViewCompletionPrivate * priv;
};

struct _MidoriViewCompletionClass {
	MidoriCompletionClass parent_class;
};

struct _MidoriViewCompletionPrivate {
	GObject* app;
	GObject* browsers;
};

struct _MidoriViewCompletionCompleteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	MidoriViewCompletion* self;
	gchar* text;
	gchar* action;
	GCancellable* cancellable;
	GList* result;
	GObject* _tmp0_;
	GList* browsers_list;
	GObject* _tmp1_;
	GList* _tmp2_;
	GList* suggestions;
	guint n;
	gchar* key;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GList* _tmp5_;
	GList* browser_collection;
	GList* browser_it;
	GObject* _tmp6_;
	GObject* browser;
	GObject* current_browser;
	GObject* _tmp7_;
	GObject* _tmp8_;
	GObject* _tmp9_;
	GObject* items;
	GObject* _tmp10_;
	GList* items_list;
	GObject* _tmp11_;
	GList* _tmp12_;
	GList* _tmp13_;
	GList* item_collection;
	GList* item_it;
	GObject* _tmp14_;
	GObject* item;
	gchar* uri;
	gchar* title;
	GObject* _tmp15_;
	GObject* _tmp16_;
	gboolean _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gboolean _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	const gchar* _tmp26_;
	gboolean _tmp27_;
	gboolean _tmp28_;
	const gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	const gchar* _tmp32_;
	gboolean _tmp33_;
	GdkPixbuf* icon;
	const gchar* _tmp34_;
	GdkPixbuf* _tmp35_;
	gchar* background;
	gchar* _tmp36_;
	MidoriSuggestion* suggestion;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	GdkPixbuf* _tmp40_;
	gint _tmp41_;
	gint _tmp42_;
	MidoriSuggestion* _tmp43_;
	MidoriSuggestion* _tmp44_;
	MidoriSuggestion* _tmp45_;
	guint _tmp46_;
	gboolean _tmp47_;
	guint _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	gint _tmp51_;
	MidoriSuggestion* _tmp52_;
	MidoriSuggestion* _tmp53_;
	MidoriSuggestion* _tmp54_;
	MidoriSuggestion* _tmp55_;
	guint src;
	guint _tmp56_;
	guint _tmp57_;
	GCancellable* _tmp58_;
	gboolean _tmp59_;
};


static gpointer midori_view_completion_parent_class = NULL;

GType midori_completion_get_type (void) G_GNUC_CONST;
GType midori_suggestion_get_type (void) G_GNUC_CONST;
GType midori_view_completion_get_type (void) G_GNUC_CONST;
#define MIDORI_VIEW_COMPLETION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MIDORI_TYPE_VIEW_COMPLETION, MidoriViewCompletionPrivate))
MidoriViewCompletion* midori_view_completion_new (void);
MidoriViewCompletion* midori_view_completion_construct (GType object_type);
static void midori_view_completion_real_prepare (MidoriCompletion* base, GObject* app);
static gboolean midori_view_completion_real_can_complete (MidoriCompletion* base, const gchar* text);
static gboolean midori_view_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_view_completion_real_complete_data_free (gpointer _data);
static void midori_view_completion_real_complete_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data);
static void midori_view_completion_real_complete (MidoriCompletion* base, const gchar* text, const gchar* action, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean midori_view_completion_real_complete_co (MidoriViewCompletionCompleteData* _data_);
GList* katze_array_peek_items (GObject* array);
GdkPixbuf* midori_paths_get_icon (const gchar* uri, GtkWidget* widget);
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);
void midori_suggestion_set_action (MidoriSuggestion* self, gboolean value);
void midori_completion_complete (MidoriCompletion* self, const gchar* text, const gchar* action, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
GList* midori_completion_complete_finish (MidoriCompletion* self, GAsyncResult* _res_);
static gboolean _midori_view_completion_real_complete_co_gsource_func (gpointer self);
static void midori_view_completion_finalize (GObject * obj);


MidoriViewCompletion* midori_view_completion_construct (GType object_type) {
	MidoriViewCompletion * self = NULL;
#line 18 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self = (MidoriViewCompletion*) g_object_new (object_type, "description", _ ("Open tabs"), NULL);
#line 17 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return self;
#line 224 "midori-viewcompletion.c"
}


MidoriViewCompletion* midori_view_completion_new (void) {
#line 17 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return midori_view_completion_construct (MIDORI_TYPE_VIEW_COMPLETION);
#line 231 "midori-viewcompletion.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return self ? g_object_ref (self) : NULL;
#line 238 "midori-viewcompletion.c"
}


static void midori_view_completion_real_prepare (MidoriCompletion* base, GObject* app) {
	MidoriViewCompletion * self;
	GObject* _tmp0_;
	GObject* _tmp1_;
	GObject* _tmp2_;
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self = (MidoriViewCompletion*) base;
#line 21 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_return_if_fail (app != NULL);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp0_ = app;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_object_unref0 (self->priv->app);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self->priv->app = _tmp1_;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp2_ = app;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_object_get (_tmp2_, "browsers", &self->priv->browsers, NULL);
#line 263 "midori-viewcompletion.c"
}


static gboolean midori_view_completion_real_can_complete (MidoriCompletion* base, const gchar* text) {
	MidoriViewCompletion * self;
	gboolean result = FALSE;
	GObject* _tmp0_;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self = (MidoriViewCompletion*) base;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_return_val_if_fail (text != NULL, FALSE);
#line 27 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp0_ = self->priv->browsers;
#line 27 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	result = _tmp0_ != NULL;
#line 27 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return result;
#line 281 "midori-viewcompletion.c"
}


static gboolean midori_view_completion_real_can_action (MidoriCompletion* base, const gchar* action) {
	MidoriViewCompletion * self;
	gboolean result = FALSE;
	const gchar* _tmp0_;
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self = (MidoriViewCompletion*) base;
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_return_val_if_fail (action != NULL, FALSE);
#line 31 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp0_ = action;
#line 31 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	result = g_strcmp0 (_tmp0_, "complete:more/views") == 0;
#line 31 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return result;
#line 299 "midori-viewcompletion.c"
}


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


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


static void midori_view_completion_real_complete_data_free (gpointer _data) {
	MidoriViewCompletionCompleteData* _data_;
	_data_ = _data;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_free0 (_data_->text);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_free0 (_data_->action);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_object_unref0 (_data_->cancellable);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	__g_list_free__g_object_unref0_0 (_data_->result);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_object_unref0 (_data_->self);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_slice_free (MidoriViewCompletionCompleteData, _data_);
#line 332 "midori-viewcompletion.c"
}


static void midori_view_completion_real_complete_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data) {
	MidoriViewCompletionCompleteData* _task_data_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	if (_task_data_->_callback_ != NULL) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 344 "midori-viewcompletion.c"
	}
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_task_data_->_task_complete_ = TRUE;
#line 348 "midori-viewcompletion.c"
}


static void midori_view_completion_real_complete (MidoriCompletion* base, const gchar* text, const gchar* action, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MidoriViewCompletion * self;
	MidoriViewCompletionCompleteData* _data_;
	MidoriViewCompletion* _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.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self = (MidoriViewCompletion*) base;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_ = g_slice_new0 (MidoriViewCompletionCompleteData);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_callback_ = _callback_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, midori_view_completion_real_complete_async_ready_wrapper, _user_data_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	if (_callback_ == NULL) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		_data_->_task_complete_ = TRUE;
#line 374 "midori-viewcompletion.c"
	}
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_task_set_task_data (_data_->_async_result, _data_, midori_view_completion_real_complete_data_free);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->self = _tmp0_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp1_ = text;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_free0 (_data_->text);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->text = _tmp2_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp3_ = action;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_free0 (_data_->action);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->action = _tmp4_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp5_ = cancellable;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_object_unref0 (_data_->cancellable);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->cancellable = _tmp6_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	midori_view_completion_real_complete_co (_data_);
#line 408 "midori-viewcompletion.c"
}


static GList* midori_view_completion_real_complete_finish (MidoriCompletion* base, GAsyncResult* _res_) {
	GList* result;
	MidoriViewCompletionCompleteData* _data_;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	if (NULL == _data_) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		return NULL;
#line 421 "midori-viewcompletion.c"
	}
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	result = _data_->result;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->result = NULL;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return result;
#line 429 "midori-viewcompletion.c"
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gchar* _tmp1_;
#line 1411 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1411 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = needle;
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _tmp1_ != NULL;
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 449 "midori-viewcompletion.c"
}


static gboolean _midori_view_completion_real_complete_co_gsource_func (gpointer self) {
	gboolean result;
	result = midori_view_completion_real_complete_co (self);
#line 86 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return result;
#line 458 "midori-viewcompletion.c"
}


static gboolean midori_view_completion_real_complete_co (MidoriViewCompletionCompleteData* _data_) {
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	switch (_data_->_state_) {
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		case 0:
#line 467 "midori-viewcompletion.c"
		goto _state_0;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		case 1:
#line 471 "midori-viewcompletion.c"
		goto _state_1;
		default:
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		g_assert_not_reached ();
#line 476 "midori-viewcompletion.c"
	}
	_state_0:
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp0_ = _data_->self->priv->browsers;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_return_val_if_fail (_data_->_tmp0_ != NULL, NULL);
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp1_ = _data_->self->priv->browsers;
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp2_ = katze_array_peek_items (_data_->_tmp1_);
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->browsers_list = _data_->_tmp2_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->suggestions = NULL;
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->n = (guint) 0;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp3_ = _data_->text;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp4_ = g_utf8_casefold (_data_->_tmp3_, (gssize) -1);
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->key = _data_->_tmp4_;
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp5_ = _data_->browsers_list;
#line 501 "midori-viewcompletion.c"
	{
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		_data_->browser_collection = _data_->_tmp5_;
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		for (_data_->browser_it = _data_->browser_collection; _data_->browser_it != NULL; _data_->browser_it = _data_->browser_it->next) {
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
			_data_->_tmp6_ = _g_object_ref0 ((GObject*) _data_->browser_it->data);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
			_data_->browser = _data_->_tmp6_;
#line 511 "midori-viewcompletion.c"
			{
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->_tmp7_ = _data_->self->priv->app;
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				g_object_get (_data_->_tmp7_, "browser", &_data_->current_browser, NULL);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->_tmp8_ = _data_->browser;
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->_tmp9_ = _data_->current_browser;
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				if (_data_->_tmp8_ != _data_->_tmp9_) {
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
					_g_object_unref0 (_data_->current_browser);
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
					_g_object_unref0 (_data_->browser);
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
					continue;
#line 529 "midori-viewcompletion.c"
				}
#line 49 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->_tmp10_ = _data_->browser;
#line 49 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				g_object_get (_data_->_tmp10_, "proxy-items", &_data_->items, NULL);
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->_tmp11_ = _data_->items;
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->_tmp12_ = katze_array_peek_items (_data_->_tmp11_);
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->items_list = _data_->_tmp12_;
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_data_->_tmp13_ = _data_->items_list;
#line 543 "midori-viewcompletion.c"
				{
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
					_data_->item_collection = _data_->_tmp13_;
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
					for (_data_->item_it = _data_->item_collection; _data_->item_it != NULL; _data_->item_it = _data_->item_it->next) {
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
						_data_->_tmp14_ = _g_object_ref0 ((GObject*) _data_->item_it->data);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
						_data_->item = _data_->_tmp14_;
#line 553 "midori-viewcompletion.c"
						{
#line 54 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp15_ = _data_->item;
#line 54 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							g_object_get (_data_->_tmp15_, "uri", &_data_->uri, NULL);
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp16_ = _data_->item;
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							g_object_get (_data_->_tmp16_, "name", &_data_->title, NULL);
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp18_ = _data_->uri;
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (g_strcmp0 (_data_->_tmp18_, "about:dial") == 0) {
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp17_ = TRUE;
#line 569 "midori-viewcompletion.c"
							} else {
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp19_ = _data_->uri;
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp17_ = g_strcmp0 (_data_->_tmp19_, "about:blank") == 0;
#line 575 "midori-viewcompletion.c"
							}
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (_data_->_tmp17_) {
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->title);
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->uri);
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->item);
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								continue;
#line 587 "midori-viewcompletion.c"
							}
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp20_ = _data_->uri;
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (_data_->_tmp20_ == NULL) {
#line 62 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								g_warning ("midori-viewcompletion.vala:62: item.uri != null");
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->title);
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->uri);
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->item);
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								continue;
#line 603 "midori-viewcompletion.c"
							}
#line 65 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp21_ = _data_->title;
#line 65 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (_data_->_tmp21_ == NULL) {
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								g_warning ("midori-viewcompletion.vala:66: item.name != null");
#line 67 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->title);
#line 67 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->uri);
#line 67 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->item);
#line 67 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								continue;
#line 619 "midori-viewcompletion.c"
							}
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp23_ = _data_->uri;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp24_ = g_utf8_casefold (_data_->_tmp23_, (gssize) -1);
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp25_ = _data_->_tmp24_;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp26_ = _data_->key;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp27_ = string_contains (_data_->_tmp25_, _data_->_tmp26_);
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp28_ = _data_->_tmp27_;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_g_free0 (_data_->_tmp25_);
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (_data_->_tmp28_) {
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp22_ = TRUE;
#line 639 "midori-viewcompletion.c"
							} else {
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp29_ = _data_->title;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp30_ = g_utf8_casefold (_data_->_tmp29_, (gssize) -1);
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp31_ = _data_->_tmp30_;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp32_ = _data_->key;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp33_ = string_contains (_data_->_tmp31_, _data_->_tmp32_);
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp22_ = _data_->_tmp33_;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->_tmp31_);
#line 655 "midori-viewcompletion.c"
							}
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (!_data_->_tmp22_) {
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->title);
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->uri);
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->item);
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								continue;
#line 667 "midori-viewcompletion.c"
							}
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp34_ = _data_->uri;
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp35_ = midori_paths_get_icon (_data_->_tmp34_, NULL);
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->icon = _data_->_tmp35_;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp36_ = g_strdup ("gray");
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->background = _data_->_tmp36_;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp37_ = _data_->uri;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp38_ = _data_->title;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp39_ = _data_->background;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp40_ = _data_->icon;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp41_ = midori_completion_get_position ((MidoriCompletion*) _data_->self);
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp42_ = _data_->_tmp41_;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp43_ = midori_suggestion_new (_data_->_tmp37_, _data_->_tmp38_, TRUE, _data_->_tmp39_, (GIcon*) _data_->_tmp40_, &_data_->_tmp42_);
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->suggestion = _data_->_tmp43_;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp44_ = _data_->suggestion;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp45_ = _g_object_ref0 (_data_->_tmp44_);
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->suggestions = g_list_append (_data_->suggestions, _data_->_tmp45_);
#line 78 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp46_ = _data_->n;
#line 78 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->n = _data_->_tmp46_ + 1;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp48_ = _data_->n;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (_data_->_tmp48_ == ((guint) 3)) {
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp49_ = _data_->action;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp47_ = _data_->_tmp49_ == NULL;
#line 713 "midori-viewcompletion.c"
							} else {
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp47_ = FALSE;
#line 717 "midori-viewcompletion.c"
							}
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							if (_data_->_tmp47_) {
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp50_ = _data_->background;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp51_ = 0;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp52_ = midori_suggestion_new ("complete:more/views", _ ("More open tabs…"), FALSE, _data_->_tmp50_, NULL, &_data_->_tmp51_);
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->suggestion);
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->suggestion = _data_->_tmp52_;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp53_ = _data_->suggestion;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								midori_suggestion_set_action (_data_->_tmp53_, TRUE);
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp54_ = _data_->suggestion;
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->_tmp55_ = _g_object_ref0 (_data_->_tmp54_);
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_data_->suggestions = g_list_append (_data_->suggestions, _data_->_tmp55_);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->suggestion);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->background);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->icon);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->title);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_free0 (_data_->uri);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								_g_object_unref0 (_data_->item);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
								break;
#line 755 "midori-viewcompletion.c"
							}
#line 86 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp56_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _midori_view_completion_real_complete_co_gsource_func, _data_, NULL);
#line 86 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->src = _data_->_tmp56_;
#line 87 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_state_ = 1;
#line 87 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							return FALSE;
#line 765 "midori-viewcompletion.c"
							_state_1:
							;
#line 88 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_data_->_tmp57_ = _data_->src;
#line 88 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							g_source_remove (_data_->_tmp57_);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_g_object_unref0 (_data_->suggestion);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_g_free0 (_data_->background);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_g_object_unref0 (_data_->icon);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_g_free0 (_data_->title);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_g_free0 (_data_->uri);
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
							_g_object_unref0 (_data_->item);
#line 784 "midori-viewcompletion.c"
						}
					}
				}
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_g_object_unref0 (_data_->items);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_g_object_unref0 (_data_->current_browser);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				_g_object_unref0 (_data_->browser);
#line 794 "midori-viewcompletion.c"
			}
		}
	}
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp58_ = _data_->cancellable;
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->_tmp59_ = g_cancellable_is_cancelled (_data_->_tmp58_);
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	if (_data_->_tmp59_) {
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		_data_->result = NULL;
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		_g_free0 (_data_->key);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		__g_list_free__g_object_unref0_0 (_data_->suggestions);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		if (_data_->_state_ != 0) {
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 818 "midori-viewcompletion.c"
			}
		}
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		g_object_unref (_data_->_async_result);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		return FALSE;
#line 825 "midori-viewcompletion.c"
	}
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_data_->result = _data_->suggestions;
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_free0 (_data_->key);
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	if (_data_->_state_ != 0) {
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 839 "midori-viewcompletion.c"
		}
	}
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_object_unref (_data_->_async_result);
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	return FALSE;
#line 846 "midori-viewcompletion.c"
}


static void midori_view_completion_class_init (MidoriViewCompletionClass * klass) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	midori_view_completion_parent_class = g_type_class_peek_parent (klass);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	g_type_class_add_private (klass, sizeof (MidoriViewCompletionPrivate));
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	((MidoriCompletionClass *) klass)->prepare = (void (*) (MidoriCompletion *, GObject*)) midori_view_completion_real_prepare;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	((MidoriCompletionClass *) klass)->can_complete = (gboolean (*) (MidoriCompletion *, const gchar*)) midori_view_completion_real_can_complete;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	((MidoriCompletionClass *) klass)->can_action = (gboolean (*) (MidoriCompletion *, const gchar*)) midori_view_completion_real_can_action;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	((MidoriCompletionClass *) klass)->complete = (void (*) (MidoriCompletion *, const gchar*, const gchar*, GCancellable*, GAsyncReadyCallback, gpointer)) midori_view_completion_real_complete;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	((MidoriCompletionClass *) klass)->complete_finish = (GList* (*) (MidoriCompletion *, GAsyncResult*)) midori_view_completion_real_complete_finish;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	G_OBJECT_CLASS (klass)->finalize = midori_view_completion_finalize;
#line 867 "midori-viewcompletion.c"
}


static void midori_view_completion_instance_init (MidoriViewCompletion * self) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self->priv = MIDORI_VIEW_COMPLETION_GET_PRIVATE (self);
#line 874 "midori-viewcompletion.c"
}


static void midori_view_completion_finalize (GObject * obj) {
	MidoriViewCompletion * self;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MIDORI_TYPE_VIEW_COMPLETION, MidoriViewCompletion);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_object_unref0 (self->priv->app);
#line 15 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	_g_object_unref0 (self->priv->browsers);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-viewcompletion.vala"
	G_OBJECT_CLASS (midori_view_completion_parent_class)->finalize (obj);
#line 888 "midori-viewcompletion.c"
}


GType midori_view_completion_get_type (void) {
	static volatile gsize midori_view_completion_type_id__volatile = 0;
	if (g_once_init_enter (&midori_view_completion_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MidoriViewCompletionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) midori_view_completion_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MidoriViewCompletion), 0, (GInstanceInitFunc) midori_view_completion_instance_init, NULL };
		GType midori_view_completion_type_id;
		midori_view_completion_type_id = g_type_register_static (MIDORI_TYPE_COMPLETION, "MidoriViewCompletion", &g_define_type_info, 0);
		g_once_init_leave (&midori_view_completion_type_id__volatile, midori_view_completion_type_id);
	}
	return midori_view_completion_type_id__volatile;
}



