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

/*
 Copyright (C) 2014 James Axl <bilimish@yandex.ru>

 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 "midori/midori-extension.h"
#include <glib/gi18n-lib.h>
#include "midori/midori-app.h"
#include "midori/midori-locationaction.h"
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>
#include "midori/midori-browser.h"
#include <gtk/gtk.h>
#include "domain-keys.h"


#define DOMAIN_HOTKEYS_TYPE_MANAGER (domain_hotkeys_manager_get_type ())
#define DOMAIN_HOTKEYS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DOMAIN_HOTKEYS_TYPE_MANAGER, DomainHotkeysManager))
#define DOMAIN_HOTKEYS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DOMAIN_HOTKEYS_TYPE_MANAGER, DomainHotkeysManagerClass))
#define DOMAIN_HOTKEYS_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DOMAIN_HOTKEYS_TYPE_MANAGER))
#define DOMAIN_HOTKEYS_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DOMAIN_HOTKEYS_TYPE_MANAGER))
#define DOMAIN_HOTKEYS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DOMAIN_HOTKEYS_TYPE_MANAGER, DomainHotkeysManagerClass))

typedef struct _DomainHotkeysManager DomainHotkeysManager;
typedef struct _DomainHotkeysManagerClass DomainHotkeysManagerClass;
typedef struct _DomainHotkeysManagerPrivate DomainHotkeysManagerPrivate;
enum  {
	DOMAIN_HOTKEYS_MANAGER_0_PROPERTY,
	DOMAIN_HOTKEYS_MANAGER_NUM_PROPERTIES
};
static GParamSpec* domain_hotkeys_manager_properties[DOMAIN_HOTKEYS_MANAGER_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

struct _DomainHotkeysManager {
	MidoriExtension parent_instance;
	DomainHotkeysManagerPrivate * priv;
};

struct _DomainHotkeysManagerClass {
	MidoriExtensionClass parent_class;
};


static gpointer domain_hotkeys_manager_parent_class = NULL;

GType domain_hotkeys_manager_get_type (void) G_GNUC_CONST;
DomainHotkeysManager* domain_hotkeys_manager_new (void);
DomainHotkeysManager* domain_hotkeys_manager_construct (GType object_type);
static void domain_hotkeys_manager_activated (DomainHotkeysManager* self, MidoriApp* app);
static void _domain_hotkeys_manager_activated_midori_extension_activate (MidoriExtension* _sender, MidoriApp* app, gpointer self);
static void domain_hotkeys_manager_deactivated (DomainHotkeysManager* self);
static void _domain_hotkeys_manager_deactivated_midori_extension_deactivate (MidoriExtension* _sender, gpointer self);
static gboolean domain_hotkeys_manager_key_press_event (DomainHotkeysManager* self, MidoriLocationAction* action, GdkEventKey* event_key);
static void domain_hotkeys_manager_location_action_submit_uri_with_suffix (DomainHotkeysManager* self, MidoriLocationAction* action, const gchar* suffix);
static void domain_hotkeys_manager_browser_added (DomainHotkeysManager* self, MidoriBrowser* browser);
static gboolean _domain_hotkeys_manager_key_press_event_midori_location_action_key_press_event (MidoriLocationAction* _sender, GdkEventKey* event, gpointer self);
static void _domain_hotkeys_manager_browser_added_midori_app_add_browser (MidoriApp* _sender, MidoriBrowser* browser, gpointer self);
static void domain_hotkeys_manager_browser_removed (DomainHotkeysManager* self, MidoriBrowser* browser);


static void _domain_hotkeys_manager_activated_midori_extension_activate (MidoriExtension* _sender, MidoriApp* app, gpointer self) {
#line 19 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	domain_hotkeys_manager_activated ((DomainHotkeysManager*) self, app);
#line 79 "domain-keys.c"
}


static void _domain_hotkeys_manager_deactivated_midori_extension_deactivate (MidoriExtension* _sender, gpointer self) {
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	domain_hotkeys_manager_deactivated ((DomainHotkeysManager*) self);
#line 86 "domain-keys.c"
}


DomainHotkeysManager* domain_hotkeys_manager_construct (GType object_type) {
	DomainHotkeysManager * self = NULL;
#line 15 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	self = (DomainHotkeysManager*) g_object_new (object_type, "name", _ ("Domain Hotkeys"), "description", _ ("Add www. and .com/.country_domain and proceed with Ctrl+Enter/Shift+En" \
"ter"), "version", "0.1" MIDORI_VERSION_SUFFIX, "authors", "James Axl <bilimish@yandex.ru>", NULL);
#line 19 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_connect_object ((MidoriExtension*) self, "activate", (GCallback) _domain_hotkeys_manager_activated_midori_extension_activate, self, 0);
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_connect_object ((MidoriExtension*) self, "deactivate", (GCallback) _domain_hotkeys_manager_deactivated_midori_extension_deactivate, self, 0);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	return self;
#line 100 "domain-keys.c"
}


DomainHotkeysManager* domain_hotkeys_manager_new (void) {
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	return domain_hotkeys_manager_construct (DOMAIN_HOTKEYS_TYPE_MANAGER);
#line 107 "domain-keys.c"
}


static gboolean domain_hotkeys_manager_key_press_event (DomainHotkeysManager* self, MidoriLocationAction* action, GdkEventKey* event_key) {
	gboolean result = FALSE;
	GdkEventKey _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_val_if_fail (action != NULL, FALSE);
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_val_if_fail (event_key != NULL, FALSE);
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp0_ = *event_key;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp1_ = _tmp0_.keyval;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp2_ = gdk_keyval_from_name ("Return");
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	if (_tmp1_ == _tmp2_) {
#line 130 "domain-keys.c"
		GdkEventKey _tmp3_;
		GdkModifierType _tmp4_;
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		_tmp3_ = *event_key;
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		_tmp4_ = _tmp3_.state;
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		if ((gboolean) (_tmp4_ & GDK_CONTROL_MASK)) {
#line 139 "domain-keys.c"
			MidoriLocationAction* _tmp5_;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			_tmp5_ = action;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			domain_hotkeys_manager_location_action_submit_uri_with_suffix (self, _tmp5_, ".com");
#line 27 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			result = TRUE;
#line 27 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			return result;
#line 149 "domain-keys.c"
		} else {
			GdkEventKey _tmp6_;
			GdkModifierType _tmp7_;
#line 28 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			_tmp6_ = *event_key;
#line 28 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			_tmp7_ = _tmp6_.state;
#line 28 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			if ((gboolean) (_tmp7_ & GDK_SHIFT_MASK)) {
#line 159 "domain-keys.c"
				gchar* domain = NULL;
				gchar* _tmp8_;
				MidoriLocationAction* _tmp9_;
				const gchar* _tmp10_;
#line 29 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				_tmp8_ = g_strdup (C_ ("Domain", ".com"));
#line 29 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				domain = _tmp8_;
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				_tmp9_ = action;
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				_tmp10_ = domain;
#line 30 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				domain_hotkeys_manager_location_action_submit_uri_with_suffix (self, _tmp9_, _tmp10_);
#line 31 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				result = TRUE;
#line 31 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				_g_free0 (domain);
#line 31 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				return result;
#line 180 "domain-keys.c"
			}
		}
	}
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	result = FALSE;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	return result;
#line 188 "domain-keys.c"
}


static void domain_hotkeys_manager_location_action_submit_uri_with_suffix (DomainHotkeysManager* self, MidoriLocationAction* action, const gchar* suffix) {
	gchar* url = NULL;
	MidoriLocationAction* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* completed_url = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	MidoriLocationAction* _tmp8_;
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (self != NULL);
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (action != NULL);
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (suffix != NULL);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp0_ = action;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp1_ = midori_location_action_get_text (_tmp0_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	url = _tmp2_;
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp3_ = g_strconcat ("www.", url, NULL);
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp4_ = _tmp3_;
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp5_ = suffix;
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp6_ = g_strconcat (_tmp4_, _tmp5_, NULL);
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp7_ = _tmp6_;
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_free0 (_tmp4_);
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	completed_url = _tmp7_;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp8_ = action;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_emit_by_name (_tmp8_, "submit-uri", completed_url, FALSE);
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_free0 (completed_url);
#line 37 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_free0 (url);
#line 240 "domain-keys.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	return self ? g_object_ref (self) : NULL;
#line 247 "domain-keys.c"
}


static gboolean _domain_hotkeys_manager_key_press_event_midori_location_action_key_press_event (MidoriLocationAction* _sender, GdkEventKey* event, gpointer self) {
	gboolean result;
	result = domain_hotkeys_manager_key_press_event ((DomainHotkeysManager*) self, _sender, event);
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	return result;
#line 256 "domain-keys.c"
}


static void domain_hotkeys_manager_browser_added (DomainHotkeysManager* self, MidoriBrowser* browser) {
	GtkActionGroup* action_group = NULL;
	MidoriBrowser* _tmp0_;
	GtkActionGroup* _tmp1_;
	GtkActionGroup* _tmp2_;
	MidoriLocationAction* action = NULL;
	GtkAction* _tmp3_;
	MidoriLocationAction* _tmp4_;
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (self != NULL);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (browser != NULL);
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp0_ = browser;
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp1_ = midori_browser_get_action_group (_tmp0_);
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 44 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	action_group = _tmp2_;
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp3_ = gtk_action_group_get_action (action_group, "Location");
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, MIDORI_TYPE_LOCATION_ACTION) ? ((MidoriLocationAction*) _tmp3_) : NULL);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	action = _tmp4_;
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_connect_object (action, "key-press-event", (GCallback) _domain_hotkeys_manager_key_press_event_midori_location_action_key_press_event, self, 0);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_object_unref0 (action);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_object_unref0 (action_group);
#line 292 "domain-keys.c"
}


static void _domain_hotkeys_manager_browser_added_midori_app_add_browser (MidoriApp* _sender, MidoriBrowser* browser, gpointer self) {
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	domain_hotkeys_manager_browser_added ((DomainHotkeysManager*) self, browser);
#line 299 "domain-keys.c"
}


static void domain_hotkeys_manager_activated (DomainHotkeysManager* self, MidoriApp* app) {
	MidoriApp* _tmp0_;
	GList* _tmp1_;
	MidoriApp* _tmp3_;
#line 49 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (self != NULL);
#line 49 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (app != NULL);
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp0_ = app;
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp1_ = midori_app_get_browsers (_tmp0_);
#line 315 "domain-keys.c"
	{
		GList* browser_collection = NULL;
		GList* browser_it = NULL;
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		browser_collection = _tmp1_;
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		for (browser_it = browser_collection; browser_it != NULL; browser_it = browser_it->next) {
#line 323 "domain-keys.c"
			MidoriBrowser* browser = NULL;
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			browser = (MidoriBrowser*) browser_it->data;
#line 327 "domain-keys.c"
			{
				MidoriBrowser* _tmp2_;
#line 51 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				_tmp2_ = browser;
#line 51 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				domain_hotkeys_manager_browser_added (self, _tmp2_);
#line 334 "domain-keys.c"
			}
		}
#line 50 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		_g_list_free0 (browser_collection);
#line 339 "domain-keys.c"
	}
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp3_ = app;
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_connect_object (_tmp3_, "add-browser", (GCallback) _domain_hotkeys_manager_browser_added_midori_app_add_browser, self, 0);
#line 345 "domain-keys.c"
}


static void domain_hotkeys_manager_browser_removed (DomainHotkeysManager* self, MidoriBrowser* browser) {
	GtkActionGroup* action_group = NULL;
	MidoriBrowser* _tmp0_;
	GtkActionGroup* _tmp1_;
	GtkActionGroup* _tmp2_;
	MidoriLocationAction* action = NULL;
	GtkAction* _tmp3_;
	MidoriLocationAction* _tmp4_;
	guint _tmp5_;
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (self != NULL);
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (browser != NULL);
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp0_ = browser;
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp1_ = midori_browser_get_action_group (_tmp0_);
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	action_group = _tmp2_;
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp3_ = gtk_action_group_get_action (action_group, "Location");
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, MIDORI_TYPE_LOCATION_ACTION) ? ((MidoriLocationAction*) _tmp3_) : NULL);
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	action = _tmp4_;
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_parse_name ("key-press-event", MIDORI_TYPE_LOCATION_ACTION, &_tmp5_, NULL, FALSE);
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_handlers_disconnect_matched (action, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _domain_hotkeys_manager_key_press_event_midori_location_action_key_press_event, self);
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_object_unref0 (action);
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_object_unref0 (action_group);
#line 384 "domain-keys.c"
}


static void domain_hotkeys_manager_deactivated (DomainHotkeysManager* self) {
	MidoriApp* app = NULL;
	MidoriApp* _tmp0_;
	MidoriApp* _tmp1_;
	MidoriApp* _tmp2_;
	guint _tmp3_;
	MidoriApp* _tmp4_;
	GList* _tmp5_;
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_return_if_fail (self != NULL);
#line 62 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp0_ = midori_extension_get_app ((MidoriExtension*) self);
#line 62 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 62 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	app = _tmp1_;
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp2_ = app;
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_parse_name ("add-browser", MIDORI_TYPE_APP, &_tmp3_, NULL, FALSE);
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _domain_hotkeys_manager_browser_added_midori_app_add_browser, self);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp4_ = app;
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp5_ = midori_app_get_browsers (_tmp4_);
#line 414 "domain-keys.c"
	{
		GList* browser_collection = NULL;
		GList* browser_it = NULL;
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		browser_collection = _tmp5_;
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		for (browser_it = browser_collection; browser_it != NULL; browser_it = browser_it->next) {
#line 422 "domain-keys.c"
			MidoriBrowser* browser = NULL;
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
			browser = (MidoriBrowser*) browser_it->data;
#line 426 "domain-keys.c"
			{
				MidoriBrowser* _tmp6_;
#line 65 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				_tmp6_ = browser;
#line 65 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
				domain_hotkeys_manager_browser_removed (self, _tmp6_);
#line 433 "domain-keys.c"
			}
		}
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
		_g_list_free0 (browser_collection);
#line 438 "domain-keys.c"
	}
#line 61 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_g_object_unref0 (app);
#line 442 "domain-keys.c"
}


static void domain_hotkeys_manager_class_init (DomainHotkeysManagerClass * klass) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	domain_hotkeys_manager_parent_class = g_type_class_peek_parent (klass);
#line 449 "domain-keys.c"
}


static void domain_hotkeys_manager_instance_init (DomainHotkeysManager * self) {
}


GType domain_hotkeys_manager_get_type (void) {
	static volatile gsize domain_hotkeys_manager_type_id__volatile = 0;
	if (g_once_init_enter (&domain_hotkeys_manager_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DomainHotkeysManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) domain_hotkeys_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DomainHotkeysManager), 0, (GInstanceInitFunc) domain_hotkeys_manager_instance_init, NULL };
		GType domain_hotkeys_manager_type_id;
		domain_hotkeys_manager_type_id = g_type_register_static (MIDORI_TYPE_EXTENSION, "DomainHotkeysManager", &g_define_type_info, 0);
		g_once_init_leave (&domain_hotkeys_manager_type_id__volatile, domain_hotkeys_manager_type_id);
	}
	return domain_hotkeys_manager_type_id__volatile;
}


MidoriExtension* extension_init (void) {
	MidoriExtension* result = NULL;
	DomainHotkeysManager* _tmp0_;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	_tmp0_ = domain_hotkeys_manager_new ();
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	result = (MidoriExtension*) _tmp0_;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/extensions/domain-keys.vala"
	return result;
#line 478 "domain-keys.c"
}



