/* blacklist.c generated by valac 0.35.5, the Vala compiler
 * generated from blacklist.vala, do not modify */

/* ds-registry.vala
 *
 * Copyright © 2011 Collabora Ltd.
 *             By Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com>
 * Copyright © 2011 Michal Hruby <michal.mhr@gmail.com>
 *
 * Based upon a Python implementation (2009-2011) by:
 *  Mikkel Kamstrup Erlandsen <mikkel.kamstrup@gmail.com>
 *  Manish Sinha <manishsinha@ubuntu.com>
 *
 * This program 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include "zeitgeist-datamodel.h"
#include "zeitgeist-engine.h"


#define ZEITGEIST_TYPE_REMOTE_BLACKLIST (zeitgeist_remote_blacklist_get_type ())
#define ZEITGEIST_REMOTE_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_REMOTE_BLACKLIST, ZeitgeistRemoteBlacklist))
#define ZEITGEIST_IS_REMOTE_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_REMOTE_BLACKLIST))
#define ZEITGEIST_REMOTE_BLACKLIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ZEITGEIST_TYPE_REMOTE_BLACKLIST, ZeitgeistRemoteBlacklistIface))

typedef struct _ZeitgeistRemoteBlacklist ZeitgeistRemoteBlacklist;
typedef struct _ZeitgeistRemoteBlacklistIface ZeitgeistRemoteBlacklistIface;

#define ZEITGEIST_TYPE_REMOTE_BLACKLIST_PROXY (zeitgeist_remote_blacklist_proxy_get_type ())
enum  {
	ZEITGEIST_REMOTE_BLACKLIST_TEMPLATE_ADDED_SIGNAL,
	ZEITGEIST_REMOTE_BLACKLIST_TEMPLATE_REMOVED_SIGNAL,
	ZEITGEIST_REMOTE_BLACKLIST_LAST_SIGNAL
};
static guint zeitgeist_remote_blacklist_signals[ZEITGEIST_REMOTE_BLACKLIST_LAST_SIGNAL] = {0};
typedef GDBusProxy ZeitgeistRemoteBlacklistProxy;
typedef GDBusProxyClass ZeitgeistRemoteBlacklistProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))

#define ZEITGEIST_TYPE_BLACKLIST (zeitgeist_blacklist_get_type ())
#define ZEITGEIST_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_BLACKLIST, ZeitgeistBlacklist))
#define ZEITGEIST_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZEITGEIST_TYPE_BLACKLIST, ZeitgeistBlacklistClass))
#define ZEITGEIST_IS_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_BLACKLIST))
#define ZEITGEIST_IS_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZEITGEIST_TYPE_BLACKLIST))
#define ZEITGEIST_BLACKLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZEITGEIST_TYPE_BLACKLIST, ZeitgeistBlacklistClass))

typedef struct _ZeitgeistBlacklist ZeitgeistBlacklist;
typedef struct _ZeitgeistBlacklistClass ZeitgeistBlacklistClass;
typedef struct _ZeitgeistBlacklistPrivate ZeitgeistBlacklistPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

struct _ZeitgeistRemoteBlacklistIface {
	GTypeInterface parent_iface;
	void (*add_template) (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GVariant* event_template, GError** error);
	GVariant* (*get_templates) (ZeitgeistRemoteBlacklist* self, GError** error);
	void (*remove_template) (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GError** error);
};

struct _ZeitgeistBlacklist {
	ZeitgeistExtension parent_instance;
	ZeitgeistBlacklistPrivate * priv;
};

struct _ZeitgeistBlacklistClass {
	ZeitgeistExtensionClass parent_class;
};

struct _ZeitgeistBlacklistPrivate {
	GHashTable* blacklist;
	guint registration_id;
};


static GType zeitgeist_remote_blacklist_type_id = 0;
static gpointer zeitgeist_blacklist_parent_class = NULL;
static ZeitgeistRemoteBlacklistIface * zeitgeist_blacklist_zeitgeist_remote_blacklist_parent_iface = NULL;
static GType zeitgeist_blacklist_type_id = 0;

GType zeitgeist_remote_blacklist_proxy_get_type (void) G_GNUC_CONST;
void zeitgeist_remote_blacklist_proxy_register_dynamic_type (GTypeModule* module);
guint zeitgeist_remote_blacklist_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType zeitgeist_remote_blacklist_get_type (void) G_GNUC_CONST;
void zeitgeist_remote_blacklist_add_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GVariant* event_template, GError** error);
GVariant* zeitgeist_remote_blacklist_get_templates (ZeitgeistRemoteBlacklist* self, GError** error);
void zeitgeist_remote_blacklist_remove_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GError** error);
static void g_cclosure_user_marshal_VOID__STRING_VARIANT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void zeitgeist_remote_blacklist_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
static void _dbus_handle_zeitgeist_remote_blacklist_template_added (ZeitgeistRemoteBlacklist* self, GVariant* parameters);
static void _dbus_handle_zeitgeist_remote_blacklist_template_removed (ZeitgeistRemoteBlacklist* self, GVariant* parameters);
static void zeitgeist_remote_blacklist_proxy_add_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GVariant* event_template, GError** error);
static GVariant* zeitgeist_remote_blacklist_proxy_get_templates (ZeitgeistRemoteBlacklist* self, GError** error);
static void zeitgeist_remote_blacklist_proxy_remove_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GError** error);
static void zeitgeist_remote_blacklist_proxy_zeitgeist_remote_blacklist_interface_init (ZeitgeistRemoteBlacklistIface* iface);
static void _dbus_zeitgeist_remote_blacklist_add_template (ZeitgeistRemoteBlacklist* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_zeitgeist_remote_blacklist_get_templates (ZeitgeistRemoteBlacklist* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_zeitgeist_remote_blacklist_remove_template (ZeitgeistRemoteBlacklist* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void zeitgeist_remote_blacklist_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
static GVariant* zeitgeist_remote_blacklist_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
static gboolean zeitgeist_remote_blacklist_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
static void _dbus_zeitgeist_remote_blacklist_template_added (GObject* _sender, const gchar* template_id, GVariant* event_template, gpointer* _data);
static void _dbus_zeitgeist_remote_blacklist_template_removed (GObject* _sender, const gchar* template_id, GVariant* event_template, gpointer* _data);
static void _zeitgeist_remote_blacklist_unregister_object (gpointer user_data);
#define ZEITGEIST_BLACKLIST_TEMPLATES_SIG_BLACKLIST "a{s(" ZEITGEIST_UTILS_SIG_EVENT ")}"
GHashTable* zeitgeist_blacklist_templates_from_variant (GVariant* templates_variant, GError** error);
static void _g_free0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
GVariant* zeitgeist_blacklist_templates_to_variant (GHashTable* blacklist);
GType zeitgeist_blacklist_get_type (void) G_GNUC_CONST;
#define ZEITGEIST_BLACKLIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ZEITGEIST_TYPE_BLACKLIST, ZeitgeistBlacklistPrivate))
enum  {
	ZEITGEIST_BLACKLIST_DUMMY_PROPERTY
};
static ZeitgeistBlacklist* zeitgeist_blacklist_new (void);
static ZeitgeistBlacklist* zeitgeist_blacklist_construct (GType object_type);
static void zeitgeist_blacklist_real_unload (ZeitgeistExtension* base);
static void zeitgeist_blacklist_flush (ZeitgeistBlacklist* self);
static void zeitgeist_blacklist_real_pre_insert_events (ZeitgeistExtension* base, GPtrArray* events, const char* sender);
static void zeitgeist_blacklist_real_add_template (ZeitgeistRemoteBlacklist* base, const gchar* template_id, GVariant* event_template, GError** error);
static void zeitgeist_blacklist_real_remove_template (ZeitgeistRemoteBlacklist* base, const gchar* template_id, GError** error);
static GVariant* zeitgeist_blacklist_real_get_templates (ZeitgeistRemoteBlacklist* base, GError** error);
static GObject * zeitgeist_blacklist_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void zeitgeist_blacklist_finalize (GObject * obj);
GType zeitgeist_extension_register (GTypeModule* module);
GType zeitgeist_remote_blacklist_register_type (GTypeModule * module);
GType zeitgeist_blacklist_register_type (GTypeModule * module);

static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_add_template_template_id = {-1, "template_id", "s"};
static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_add_template_event_template = {-1, "event_template", "(asaasay)"};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_add_template_in[] = {&_zeitgeist_remote_blacklist_dbus_arg_info_add_template_template_id, &_zeitgeist_remote_blacklist_dbus_arg_info_add_template_event_template, NULL};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_add_template_out[] = {NULL};
static const GDBusMethodInfo _zeitgeist_remote_blacklist_dbus_method_info_add_template = {-1, "AddTemplate", (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_add_template_in), (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_add_template_out)};
static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_get_templates_result = {-1, "result", "a{s(asaasay)}"};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_get_templates_in[] = {NULL};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_get_templates_out[] = {&_zeitgeist_remote_blacklist_dbus_arg_info_get_templates_result, NULL};
static const GDBusMethodInfo _zeitgeist_remote_blacklist_dbus_method_info_get_templates = {-1, "GetTemplates", (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_get_templates_in), (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_get_templates_out)};
static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_remove_template_template_id = {-1, "template_id", "s"};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_remove_template_in[] = {&_zeitgeist_remote_blacklist_dbus_arg_info_remove_template_template_id, NULL};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_remove_template_out[] = {NULL};
static const GDBusMethodInfo _zeitgeist_remote_blacklist_dbus_method_info_remove_template = {-1, "RemoveTemplate", (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_remove_template_in), (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_remove_template_out)};
static const GDBusMethodInfo * const _zeitgeist_remote_blacklist_dbus_method_info[] = {&_zeitgeist_remote_blacklist_dbus_method_info_add_template, &_zeitgeist_remote_blacklist_dbus_method_info_get_templates, &_zeitgeist_remote_blacklist_dbus_method_info_remove_template, NULL};
static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_template_added_template_id = {-1, "template_id", "s"};
static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_template_added_event_template = {-1, "event_template", "(asaasay)"};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_template_added[] = {&_zeitgeist_remote_blacklist_dbus_arg_info_template_added_template_id, &_zeitgeist_remote_blacklist_dbus_arg_info_template_added_event_template, NULL};
static const GDBusSignalInfo _zeitgeist_remote_blacklist_dbus_signal_info_template_added = {-1, "TemplateAdded", (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_template_added)};
static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_template_removed_template_id = {-1, "template_id", "s"};
static const GDBusArgInfo _zeitgeist_remote_blacklist_dbus_arg_info_template_removed_event_template = {-1, "event_template", "(asassay)"};
static const GDBusArgInfo * const _zeitgeist_remote_blacklist_dbus_arg_info_template_removed[] = {&_zeitgeist_remote_blacklist_dbus_arg_info_template_removed_template_id, &_zeitgeist_remote_blacklist_dbus_arg_info_template_removed_event_template, NULL};
static const GDBusSignalInfo _zeitgeist_remote_blacklist_dbus_signal_info_template_removed = {-1, "TemplateRemoved", (GDBusArgInfo **) (&_zeitgeist_remote_blacklist_dbus_arg_info_template_removed)};
static const GDBusSignalInfo * const _zeitgeist_remote_blacklist_dbus_signal_info[] = {&_zeitgeist_remote_blacklist_dbus_signal_info_template_added, &_zeitgeist_remote_blacklist_dbus_signal_info_template_removed, NULL};
static const GDBusPropertyInfo * const _zeitgeist_remote_blacklist_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _zeitgeist_remote_blacklist_dbus_interface_info = {-1, "org.gnome.zeitgeist.Blacklist", (GDBusMethodInfo **) (&_zeitgeist_remote_blacklist_dbus_method_info), (GDBusSignalInfo **) (&_zeitgeist_remote_blacklist_dbus_signal_info), (GDBusPropertyInfo **) (&_zeitgeist_remote_blacklist_dbus_property_info)};
static const GDBusInterfaceVTable _zeitgeist_remote_blacklist_dbus_interface_vtable = {zeitgeist_remote_blacklist_dbus_interface_method_call, zeitgeist_remote_blacklist_dbus_interface_get_property, zeitgeist_remote_blacklist_dbus_interface_set_property};

void zeitgeist_remote_blacklist_add_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GVariant* event_template, GError** error) {
	g_return_if_fail (self != NULL);
	ZEITGEIST_REMOTE_BLACKLIST_GET_INTERFACE (self)->add_template (self, template_id, event_template, error);
}


GVariant* zeitgeist_remote_blacklist_get_templates (ZeitgeistRemoteBlacklist* self, GError** error) {
	g_return_val_if_fail (self != NULL, NULL);
	return ZEITGEIST_REMOTE_BLACKLIST_GET_INTERFACE (self)->get_templates (self, error);
}


void zeitgeist_remote_blacklist_remove_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GError** error) {
	g_return_if_fail (self != NULL);
	ZEITGEIST_REMOTE_BLACKLIST_GET_INTERFACE (self)->remove_template (self, template_id, error);
}


static void g_cclosure_user_marshal_VOID__STRING_VARIANT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__STRING_VARIANT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_VARIANT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_VARIANT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_variant (param_values + 2), data2);
}


static void zeitgeist_remote_blacklist_base_init (ZeitgeistRemoteBlacklistIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		zeitgeist_remote_blacklist_signals[ZEITGEIST_REMOTE_BLACKLIST_TEMPLATE_ADDED_SIGNAL] = g_signal_new ("template_added", ZEITGEIST_TYPE_REMOTE_BLACKLIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_VARIANT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VARIANT);
		zeitgeist_remote_blacklist_signals[ZEITGEIST_REMOTE_BLACKLIST_TEMPLATE_REMOVED_SIGNAL] = g_signal_new ("template_removed", ZEITGEIST_TYPE_REMOTE_BLACKLIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_VARIANT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VARIANT);
	}
}


GType zeitgeist_remote_blacklist_get_type (void) {
	return zeitgeist_remote_blacklist_type_id;
}


GType zeitgeist_remote_blacklist_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistRemoteBlacklistIface), (GBaseInitFunc) zeitgeist_remote_blacklist_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	zeitgeist_remote_blacklist_type_id = g_type_module_register_type (module, G_TYPE_INTERFACE, "ZeitgeistRemoteBlacklist", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (zeitgeist_remote_blacklist_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (zeitgeist_remote_blacklist_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) zeitgeist_remote_blacklist_proxy_get_type);
	g_type_set_qdata (zeitgeist_remote_blacklist_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.gnome.zeitgeist.Blacklist");
	g_type_set_qdata (zeitgeist_remote_blacklist_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_zeitgeist_remote_blacklist_dbus_interface_info));
	g_type_set_qdata (zeitgeist_remote_blacklist_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) zeitgeist_remote_blacklist_register_object);
	return zeitgeist_remote_blacklist_type_id;
}


G_DEFINE_DYNAMIC_TYPE_EXTENDED (ZeitgeistRemoteBlacklistProxy, zeitgeist_remote_blacklist_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE_DYNAMIC (ZEITGEIST_TYPE_REMOTE_BLACKLIST, zeitgeist_remote_blacklist_proxy_zeitgeist_remote_blacklist_interface_init) )
static void zeitgeist_remote_blacklist_proxy_class_init (ZeitgeistRemoteBlacklistProxyClass* klass) {
	G_DBUS_PROXY_CLASS (klass)->g_signal = zeitgeist_remote_blacklist_proxy_g_signal;
}


static void _dbus_handle_zeitgeist_remote_blacklist_template_added (ZeitgeistRemoteBlacklist* self, GVariant* parameters) {
	GVariantIter _arguments_iter;
	gchar* template_id = NULL;
	GVariant* _tmp0_;
	GVariant* event_template = NULL;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	template_id = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	event_template = g_variant_iter_next_value (&_arguments_iter);
	g_signal_emit_by_name (self, "template-added", template_id, event_template);
	_g_free0 (template_id);
	_g_variant_unref0 (event_template);
}


static void _dbus_handle_zeitgeist_remote_blacklist_template_removed (ZeitgeistRemoteBlacklist* self, GVariant* parameters) {
	GVariantIter _arguments_iter;
	gchar* template_id = NULL;
	GVariant* _tmp1_;
	GVariant* event_template = NULL;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	template_id = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	event_template = g_variant_iter_next_value (&_arguments_iter);
	g_signal_emit_by_name (self, "template-removed", template_id, event_template);
	_g_free0 (template_id);
	_g_variant_unref0 (event_template);
}


static void zeitgeist_remote_blacklist_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
	if (strcmp (signal_name, "TemplateAdded") == 0) {
		_dbus_handle_zeitgeist_remote_blacklist_template_added ((ZeitgeistRemoteBlacklist*) proxy, parameters);
	} else if (strcmp (signal_name, "TemplateRemoved") == 0) {
		_dbus_handle_zeitgeist_remote_blacklist_template_removed ((ZeitgeistRemoteBlacklist*) proxy, parameters);
	}
}


static void zeitgeist_remote_blacklist_proxy_class_finalize (ZeitgeistRemoteBlacklistProxyClass* klass) {
}


void zeitgeist_remote_blacklist_proxy_register_dynamic_type (GTypeModule* module) {
	zeitgeist_remote_blacklist_proxy_register_type (module);
}


static void zeitgeist_remote_blacklist_proxy_init (ZeitgeistRemoteBlacklistProxy* self) {
}


static void zeitgeist_remote_blacklist_proxy_add_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GVariant* event_template, GError** error) {
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.zeitgeist.Blacklist", "AddTemplate");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (template_id));
	g_variant_builder_add_value (&_arguments_builder, event_template);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}


static GVariant* zeitgeist_remote_blacklist_proxy_get_templates (ZeitgeistRemoteBlacklist* self, GError** error) {
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GVariant* _result = NULL;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.zeitgeist.Blacklist", "GetTemplates");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_result = g_variant_iter_next_value (&_reply_iter);
	g_object_unref (_reply_message);
	return _result;
}


static void zeitgeist_remote_blacklist_proxy_remove_template (ZeitgeistRemoteBlacklist* self, const gchar* template_id, GError** error) {
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.zeitgeist.Blacklist", "RemoveTemplate");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (template_id));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}


static void zeitgeist_remote_blacklist_proxy_zeitgeist_remote_blacklist_interface_init (ZeitgeistRemoteBlacklistIface* iface) {
	iface->add_template = zeitgeist_remote_blacklist_proxy_add_template;
	iface->get_templates = zeitgeist_remote_blacklist_proxy_get_templates;
	iface->remove_template = zeitgeist_remote_blacklist_proxy_remove_template;
}


static void _dbus_zeitgeist_remote_blacklist_add_template (ZeitgeistRemoteBlacklist* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* template_id = NULL;
	GVariant* _tmp2_;
	GVariant* event_template = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp2_ = g_variant_iter_next_value (&_arguments_iter);
	template_id = g_variant_dup_string (_tmp2_, NULL);
	g_variant_unref (_tmp2_);
	event_template = g_variant_iter_next_value (&_arguments_iter);
	zeitgeist_remote_blacklist_add_template (self, template_id, event_template, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (template_id);
	_g_variant_unref0 (event_template);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_zeitgeist_remote_blacklist_get_templates (ZeitgeistRemoteBlacklist* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = zeitgeist_remote_blacklist_get_templates (self, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_zeitgeist_remote_blacklist_remove_template (ZeitgeistRemoteBlacklist* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* template_id = NULL;
	GVariant* _tmp3_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	template_id = g_variant_dup_string (_tmp3_, NULL);
	g_variant_unref (_tmp3_);
	zeitgeist_remote_blacklist_remove_template (self, template_id, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (template_id);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void zeitgeist_remote_blacklist_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "AddTemplate") == 0) {
		_dbus_zeitgeist_remote_blacklist_add_template (object, parameters, invocation);
	} else if (strcmp (method_name, "GetTemplates") == 0) {
		_dbus_zeitgeist_remote_blacklist_get_templates (object, parameters, invocation);
	} else if (strcmp (method_name, "RemoveTemplate") == 0) {
		_dbus_zeitgeist_remote_blacklist_remove_template (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* zeitgeist_remote_blacklist_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}


static gboolean zeitgeist_remote_blacklist_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}


static void _dbus_zeitgeist_remote_blacklist_template_added (GObject* _sender, const gchar* template_id, GVariant* event_template, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (template_id));
	g_variant_builder_add_value (&_arguments_builder, event_template);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.zeitgeist.Blacklist", "TemplateAdded", _arguments, NULL);
}


static void _dbus_zeitgeist_remote_blacklist_template_removed (GObject* _sender, const gchar* template_id, GVariant* event_template, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (template_id));
	g_variant_builder_add_value (&_arguments_builder, event_template);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.zeitgeist.Blacklist", "TemplateRemoved", _arguments, NULL);
}


guint zeitgeist_remote_blacklist_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_zeitgeist_remote_blacklist_dbus_interface_info), &_zeitgeist_remote_blacklist_dbus_interface_vtable, data, _zeitgeist_remote_blacklist_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "template-added", (GCallback) _dbus_zeitgeist_remote_blacklist_template_added, data);
	g_signal_connect (object, "template-removed", (GCallback) _dbus_zeitgeist_remote_blacklist_template_removed, data);
	return result;
}


static void _zeitgeist_remote_blacklist_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_zeitgeist_remote_blacklist_template_added, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_zeitgeist_remote_blacklist_template_removed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


GHashTable* zeitgeist_blacklist_templates_from_variant (GVariant* templates_variant, GError** error) {
	GHashTable* result = NULL;
	GHashTable* blacklist;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GVariant* _tmp3_;
	const gchar* _tmp4_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (templates_variant != NULL, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
	blacklist = _tmp2_;
	_tmp3_ = templates_variant;
	_tmp4_ = g_variant_get_type_string (_tmp3_);
	g_warn_if_fail (g_strcmp0 (_tmp4_, ZEITGEIST_BLACKLIST_TEMPLATES_SIG_BLACKLIST) == 0);
	{
		GVariantIter* _template_variant_it;
		GVariant* _tmp5_;
		GVariantIter* _tmp6_;
		GVariant* template_variant = NULL;
		_tmp5_ = templates_variant;
		_tmp6_ = g_variant_iter_new (_tmp5_);
		_template_variant_it = _tmp6_;
		while (TRUE) {
			GVariantIter* _tmp7_;
			GVariant* _tmp8_;
			GVariant* _tmp9_;
			GVariantIter* iter;
			GVariant* _tmp10_;
			GVariantIter* _tmp11_;
			gchar* template_id;
			GVariantIter* _tmp12_;
			GVariant* _tmp13_;
			GVariant* _tmp14_;
			const gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			ZeitgeistEvent* template;
			GVariantIter* _tmp18_;
			GVariant* _tmp19_;
			GVariant* _tmp20_;
			ZeitgeistEvent* _tmp21_;
			ZeitgeistEvent* _tmp22_;
			GHashTable* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			ZeitgeistEvent* _tmp26_;
			ZeitgeistEvent* _tmp27_;
			_tmp7_ = _template_variant_it;
			_tmp8_ = g_variant_iter_next_value (_tmp7_);
			_g_variant_unref0 (template_variant);
			template_variant = _tmp8_;
			_tmp9_ = template_variant;
			if (!(_tmp9_ != NULL)) {
				break;
			}
			_tmp10_ = template_variant;
			_tmp11_ = g_variant_iter_new (_tmp10_);
			iter = _tmp11_;
			_tmp12_ = iter;
			_tmp13_ = g_variant_iter_next_value (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = g_variant_get_string (_tmp14_, NULL);
			_tmp16_ = g_strdup (_tmp15_);
			_tmp17_ = _tmp16_;
			_g_variant_unref0 (_tmp14_);
			template_id = _tmp17_;
			_tmp18_ = iter;
			_tmp19_ = g_variant_iter_next_value (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = zeitgeist_event_new_from_variant (_tmp20_, &_inner_error_);
			_tmp22_ = _tmp21_;
			_g_variant_unref0 (_tmp20_);
			template = _tmp22_;
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				if (_inner_error_->domain == ZEITGEIST_DATA_MODEL_ERROR) {
					g_propagate_error (error, _inner_error_);
					_g_free0 (template_id);
					_g_variant_iter_free0 (iter);
					_g_variant_unref0 (template_variant);
					_g_variant_iter_free0 (_template_variant_it);
					_g_hash_table_unref0 (blacklist);
					return NULL;
				} else {
					_g_free0 (template_id);
					_g_variant_iter_free0 (iter);
					_g_variant_unref0 (template_variant);
					_g_variant_iter_free0 (_template_variant_it);
					_g_hash_table_unref0 (blacklist);
					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);
					g_clear_error (&_inner_error_);
					return NULL;
				}
			}
			_tmp23_ = blacklist;
			_tmp24_ = template_id;
			_tmp25_ = g_strdup (_tmp24_);
			_tmp26_ = template;
			_tmp27_ = _g_object_ref0 (_tmp26_);
			g_hash_table_insert (_tmp23_, _tmp25_, _tmp27_);
			_g_object_unref0 (template);
			_g_free0 (template_id);
			_g_variant_iter_free0 (iter);
		}
		_g_variant_unref0 (template_variant);
		_g_variant_iter_free0 (_template_variant_it);
	}
	result = blacklist;
	return result;
}


GVariant* zeitgeist_blacklist_templates_to_variant (GHashTable* blacklist) {
	GVariant* result = NULL;
	GVariantBuilder* vb;
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* _tmp3_;
	GVariantBuilder* _tmp20_;
	GVariant* _tmp21_;
	g_return_val_if_fail (blacklist != NULL, NULL);
	_tmp0_ = g_variant_type_new (ZEITGEIST_BLACKLIST_TEMPLATES_SIG_BLACKLIST);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_variant_type_free0 (_tmp1_);
	vb = _tmp3_;
	{
		GHashTableIter iter;
		GHashTable* _tmp4_;
		gchar* template_id = NULL;
		ZeitgeistEvent* event_template = NULL;
		_tmp4_ = blacklist;
		g_hash_table_iter_init (&iter, _tmp4_);
		while (TRUE) {
			gconstpointer _tmp5_ = NULL;
			gconstpointer _tmp6_ = NULL;
			gboolean _tmp7_;
			gchar* _tmp8_;
			ZeitgeistEvent* _tmp9_;
			GVariantBuilder* _tmp10_;
			GVariantType* _tmp11_;
			GVariantType* _tmp12_;
			GVariantBuilder* _tmp13_;
			const gchar* _tmp14_;
			GVariantBuilder* _tmp15_;
			ZeitgeistEvent* _tmp16_;
			GVariant* _tmp17_;
			GVariant* _tmp18_;
			GVariantBuilder* _tmp19_;
			_tmp7_ = g_hash_table_iter_next (&iter, (gpointer*) (&_tmp5_), (gpointer*) (&_tmp6_));
			_g_free0 (template_id);
			_tmp8_ = g_strdup (_tmp5_);
			template_id = _tmp8_;
			_g_object_unref0 (event_template);
			_tmp9_ = _g_object_ref0 (_tmp6_);
			event_template = _tmp9_;
			if (!_tmp7_) {
				break;
			}
			_tmp10_ = vb;
			_tmp11_ = g_variant_type_new ("{s(" ZEITGEIST_UTILS_SIG_EVENT ")}");
			_tmp12_ = _tmp11_;
			g_variant_builder_open (_tmp10_, _tmp12_);
			_g_variant_type_free0 (_tmp12_);
			_tmp13_ = vb;
			_tmp14_ = template_id;
			g_variant_builder_add (_tmp13_, "s", _tmp14_, NULL);
			_tmp15_ = vb;
			_tmp16_ = event_template;
			_tmp17_ = zeitgeist_event_to_variant (_tmp16_);
			_tmp18_ = _tmp17_;
			g_variant_builder_add_value (_tmp15_, _tmp18_);
			_g_variant_unref0 (_tmp18_);
			_tmp19_ = vb;
			g_variant_builder_close (_tmp19_);
		}
		_g_object_unref0 (event_template);
		_g_free0 (template_id);
	}
	_tmp20_ = vb;
	_tmp21_ = g_variant_builder_end (_tmp20_);
	g_variant_ref_sink (_tmp21_);
	result = _tmp21_;
	_g_variant_builder_unref0 (vb);
	return result;
}


static ZeitgeistBlacklist* zeitgeist_blacklist_construct (GType object_type) {
	ZeitgeistBlacklist * self = NULL;
	self = (ZeitgeistBlacklist*) g_object_new (object_type, NULL);
	return self;
}


static ZeitgeistBlacklist* zeitgeist_blacklist_new (void) {
	return zeitgeist_blacklist_construct (ZEITGEIST_TYPE_BLACKLIST);
}


static void zeitgeist_blacklist_real_unload (ZeitgeistExtension* base) {
	ZeitgeistBlacklist * self;
	guint _tmp5_;
	GError * _inner_error_ = NULL;
	self = (ZeitgeistBlacklist*) base;
	{
		GDBusConnection* connection;
		GDBusConnection* _tmp0_;
		guint _tmp1_;
		_tmp0_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
		connection = _tmp0_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = self->priv->registration_id;
		if (_tmp1_ != ((guint) 0)) {
			guint _tmp2_;
			_tmp2_ = self->priv->registration_id;
			g_dbus_connection_unregister_object (connection, _tmp2_);
			self->priv->registration_id = (guint) 0;
		}
		_g_object_unref0 (connection);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = err;
		_tmp4_ = _tmp3_->message;
		g_warning ("blacklist.vala:145: %s", _tmp4_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		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);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp5_ = ((GObject*) self)->ref_count;
	g_debug ("blacklist.vala:148: %s, this.ref_count = %u", "Zeitgeist.Blacklist.unload", _tmp5_);
}


static void zeitgeist_blacklist_flush (ZeitgeistBlacklist* self) {
	GVariant* v;
	GHashTable* _tmp0_;
	GVariant* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->blacklist;
	_tmp1_ = zeitgeist_blacklist_templates_to_variant (_tmp0_);
	v = _tmp1_;
	zeitgeist_extension_store_config ((ZeitgeistExtension*) self, "blacklist", v);
	_g_variant_unref0 (v);
}


static gint g_ptr_array_get_length (GPtrArray* self) {
	gint result;
	guint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->len;
	result = (gint) _tmp0_;
	return result;
}


static void g_ptr_array_set_length (GPtrArray* self, gint value) {
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	g_ptr_array_set_size (self, _tmp0_);
}


static void g_ptr_array_set (GPtrArray* self, guint index, gpointer data) {
	gpointer _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = data;
	data = NULL;
	g_ptr_array_add (self, _tmp0_);
	_tmp1_ = index;
	g_ptr_array_remove_index_fast (self, _tmp1_);
}


static void zeitgeist_blacklist_real_pre_insert_events (ZeitgeistExtension* base, GPtrArray* events, const char* sender) {
	ZeitgeistBlacklist * self;
	self = (ZeitgeistBlacklist*) base;
	g_return_if_fail (events != NULL);
	{
		gint i;
		i = 0;
		{
			gboolean _tmp0_;
			_tmp0_ = TRUE;
			while (TRUE) {
				gint _tmp2_;
				GPtrArray* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				GPtrArray* _tmp6_;
				gint _tmp7_;
				gconstpointer _tmp8_;
				GHashTable* _tmp9_;
				GList* _tmp10_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = i;
				_tmp3_ = events;
				_tmp4_ = g_ptr_array_get_length (_tmp3_);
				_tmp5_ = _tmp4_;
				if (!(_tmp2_ < _tmp5_)) {
					break;
				}
				_tmp6_ = events;
				_tmp7_ = i;
				_tmp8_ = g_ptr_array_index (_tmp6_, (guint) _tmp7_);
				if (((ZeitgeistEvent*) _tmp8_) == NULL) {
					continue;
				}
				_tmp9_ = self->priv->blacklist;
				_tmp10_ = g_hash_table_get_values (_tmp9_);
				{
					GList* tmpl_collection = NULL;
					GList* tmpl_it = NULL;
					tmpl_collection = _tmp10_;
					for (tmpl_it = tmpl_collection; tmpl_it != NULL; tmpl_it = tmpl_it->next) {
						ZeitgeistEvent* tmpl = NULL;
						tmpl = (ZeitgeistEvent*) tmpl_it->data;
						{
							GPtrArray* _tmp11_;
							gint _tmp12_;
							gconstpointer _tmp13_;
							ZeitgeistEvent* _tmp14_;
							gboolean _tmp15_;
							_tmp11_ = events;
							_tmp12_ = i;
							_tmp13_ = g_ptr_array_index (_tmp11_, (guint) _tmp12_);
							_tmp14_ = tmpl;
							_tmp15_ = zeitgeist_event_matches_template ((ZeitgeistEvent*) _tmp13_, _tmp14_);
							if (_tmp15_) {
								GPtrArray* _tmp16_;
								gint _tmp17_;
								_tmp16_ = events;
								_tmp17_ = i;
								g_ptr_array_set (_tmp16_, (guint) _tmp17_, NULL);
								break;
							}
						}
					}
					_g_list_free0 (tmpl_collection);
				}
			}
		}
	}
}


static void zeitgeist_blacklist_real_add_template (ZeitgeistRemoteBlacklist* base, const gchar* template_id, GVariant* event_template, GError** error) {
	ZeitgeistBlacklist * self;
	ZeitgeistEvent* template;
	GVariant* _tmp0_;
	ZeitgeistEvent* _tmp1_;
	GHashTable* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	ZeitgeistEvent* _tmp5_;
	const gchar* _tmp6_;
	guint _tmp7_;
	const gchar* _tmp8_;
	GVariant* _tmp9_;
	GError * _inner_error_ = NULL;
	self = (ZeitgeistBlacklist*) base;
	g_return_if_fail (template_id != NULL);
	g_return_if_fail (event_template != NULL);
	_tmp0_ = event_template;
	_tmp1_ = zeitgeist_event_new_from_variant (_tmp0_, &_inner_error_);
	template = _tmp1_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		if (_inner_error_->domain == ZEITGEIST_DATA_MODEL_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			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);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_tmp2_ = self->priv->blacklist;
	_tmp3_ = template_id;
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = _g_object_ref0 (template);
	g_hash_table_insert (_tmp2_, _tmp4_, _tmp5_);
	_tmp6_ = template_id;
	_tmp7_ = g_str_hash (_tmp6_);
	g_debug ("blacklist.vala:179: Added blacklist template: [#%u]", _tmp7_);
	_tmp8_ = template_id;
	_tmp9_ = event_template;
	g_signal_emit ((ZeitgeistRemoteBlacklist*) self, zeitgeist_remote_blacklist_signals[ZEITGEIST_REMOTE_BLACKLIST_TEMPLATE_ADDED_SIGNAL], 0, _tmp8_, _tmp9_);
	zeitgeist_blacklist_flush (self);
	_g_object_unref0 (template);
}


static void zeitgeist_blacklist_real_remove_template (ZeitgeistRemoteBlacklist* base, const gchar* template_id, GError** error) {
	ZeitgeistBlacklist * self;
	ZeitgeistEvent* event_template;
	GHashTable* _tmp0_;
	const gchar* _tmp1_;
	gconstpointer _tmp2_;
	ZeitgeistEvent* _tmp3_;
	GHashTable* _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp6_;
	self = (ZeitgeistBlacklist*) base;
	g_return_if_fail (template_id != NULL);
	_tmp0_ = self->priv->blacklist;
	_tmp1_ = template_id;
	_tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
	_tmp3_ = _g_object_ref0 ((ZeitgeistEvent*) _tmp2_);
	event_template = _tmp3_;
	_tmp4_ = self->priv->blacklist;
	_tmp5_ = template_id;
	_tmp6_ = g_hash_table_remove (_tmp4_, _tmp5_);
	if (_tmp6_) {
		const gchar* _tmp7_;
		guint _tmp8_;
		const gchar* _tmp9_;
		ZeitgeistEvent* _tmp10_;
		GVariant* _tmp11_;
		GVariant* _tmp12_;
		_tmp7_ = template_id;
		_tmp8_ = g_str_hash (_tmp7_);
		g_debug ("blacklist.vala:189: Removed blacklist template: [#%u]", _tmp8_);
		_tmp9_ = template_id;
		_tmp10_ = event_template;
		_tmp11_ = zeitgeist_event_to_variant (_tmp10_);
		_tmp12_ = _tmp11_;
		g_signal_emit ((ZeitgeistRemoteBlacklist*) self, zeitgeist_remote_blacklist_signals[ZEITGEIST_REMOTE_BLACKLIST_TEMPLATE_REMOVED_SIGNAL], 0, _tmp9_, _tmp12_);
		_g_variant_unref0 (_tmp12_);
		zeitgeist_blacklist_flush (self);
	} else {
		const gchar* _tmp13_;
		guint _tmp14_;
		_tmp13_ = template_id;
		_tmp14_ = g_str_hash (_tmp13_);
		g_debug ("blacklist.vala:195: Blacklist template [#%u] not found.", _tmp14_);
	}
	_g_object_unref0 (event_template);
}


static GVariant* zeitgeist_blacklist_real_get_templates (ZeitgeistRemoteBlacklist* base, GError** error) {
	ZeitgeistBlacklist * self;
	GVariant* result = NULL;
	GHashTable* _tmp0_;
	GVariant* _tmp1_;
	self = (ZeitgeistBlacklist*) base;
	_tmp0_ = self->priv->blacklist;
	_tmp1_ = zeitgeist_blacklist_templates_to_variant (_tmp0_);
	result = _tmp1_;
	return result;
}


static GObject * zeitgeist_blacklist_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	ZeitgeistBlacklist * self;
	GVariant* templates;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	GError * _inner_error_ = NULL;
	parent_class = G_OBJECT_CLASS (zeitgeist_blacklist_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ZEITGEIST_TYPE_BLACKLIST, ZeitgeistBlacklist);
	_tmp0_ = zeitgeist_extension_retrieve_config ((ZeitgeistExtension*) self, "blacklist", ZEITGEIST_BLACKLIST_TEMPLATES_SIG_BLACKLIST);
	templates = _tmp0_;
	_tmp1_ = templates;
	if (_tmp1_ != NULL) {
		{
			GHashTable* _tmp2_;
			GVariant* _tmp3_;
			GHashTable* _tmp4_;
			GHashTable* _tmp5_;
			_tmp3_ = templates;
			_tmp4_ = zeitgeist_blacklist_templates_from_variant (_tmp3_, &_inner_error_);
			_tmp2_ = _tmp4_;
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				if (_inner_error_->domain == ZEITGEIST_DATA_MODEL_ERROR) {
					goto __catch1_zeitgeist_data_model_error;
				}
				_g_variant_unref0 (templates);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
			}
			_tmp5_ = _tmp2_;
			_tmp2_ = NULL;
			_g_hash_table_unref0 (self->priv->blacklist);
			self->priv->blacklist = _tmp5_;
			_g_hash_table_unref0 (_tmp2_);
		}
		goto __finally1;
		__catch1_zeitgeist_data_model_error:
		{
			GError* e = NULL;
			GError* _tmp6_;
			const gchar* _tmp7_;
			GHashFunc _tmp8_;
			GEqualFunc _tmp9_;
			GHashTable* _tmp10_;
			e = _inner_error_;
			_inner_error_ = NULL;
			_tmp6_ = e;
			_tmp7_ = _tmp6_->message;
			g_warning ("blacklist.vala:110: Could not load blacklist from variant: %s", _tmp7_);
			_tmp8_ = g_str_hash;
			_tmp9_ = g_str_equal;
			_tmp10_ = g_hash_table_new_full (_tmp8_, _tmp9_, _g_free0_, _g_object_unref0_);
			_g_hash_table_unref0 (self->priv->blacklist);
			self->priv->blacklist = _tmp10_;
			_g_error_free0 (e);
		}
		__finally1:
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_variant_unref0 (templates);
			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);
			g_clear_error (&_inner_error_);
		}
	} else {
		GHashFunc _tmp11_;
		GEqualFunc _tmp12_;
		GHashTable* _tmp13_;
		_tmp11_ = g_str_hash;
		_tmp12_ = g_str_equal;
		_tmp13_ = g_hash_table_new_full (_tmp11_, _tmp12_, _g_free0_, _g_object_unref0_);
		_g_hash_table_unref0 (self->priv->blacklist);
		self->priv->blacklist = _tmp13_;
	}
	{
		GDBusConnection* connection;
		GDBusConnection* _tmp14_;
		guint _tmp15_;
		GDBusConnection* _tmp16_;
		guint _tmp17_;
		_tmp14_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
		connection = _tmp14_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch2_g_error;
		}
		_tmp16_ = connection;
		_tmp17_ = zeitgeist_remote_blacklist_register_object ((ZeitgeistRemoteBlacklist*) self, _tmp16_, "/org/gnome/zeitgeist/blacklist", &_inner_error_);
		_tmp15_ = _tmp17_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (connection);
			goto __catch2_g_error;
		}
		self->priv->registration_id = _tmp15_;
		_g_object_unref0 (connection);
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* err = NULL;
		GError* _tmp18_;
		const gchar* _tmp19_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp18_ = err;
		_tmp19_ = _tmp18_->message;
		g_warning ("blacklist.vala:128: %s", _tmp19_);
		_g_error_free0 (err);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_variant_unref0 (templates);
		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);
		g_clear_error (&_inner_error_);
	}
	_g_variant_unref0 (templates);
	return obj;
}


static void zeitgeist_blacklist_class_init (ZeitgeistBlacklistClass * klass) {
	zeitgeist_blacklist_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ZeitgeistBlacklistPrivate));
	((ZeitgeistExtensionClass *) klass)->unload = zeitgeist_blacklist_real_unload;
	((ZeitgeistExtensionClass *) klass)->pre_insert_events = zeitgeist_blacklist_real_pre_insert_events;
	G_OBJECT_CLASS (klass)->constructor = zeitgeist_blacklist_constructor;
	G_OBJECT_CLASS (klass)->finalize = zeitgeist_blacklist_finalize;
}


static void zeitgeist_blacklist_zeitgeist_remote_blacklist_interface_init (ZeitgeistRemoteBlacklistIface * iface) {
	zeitgeist_blacklist_zeitgeist_remote_blacklist_parent_iface = g_type_interface_peek_parent (iface);
	iface->add_template = (void (*) (ZeitgeistRemoteBlacklist *, const gchar*, GVariant*, GError**)) zeitgeist_blacklist_real_add_template;
	iface->remove_template = (void (*) (ZeitgeistRemoteBlacklist *, const gchar*, GError**)) zeitgeist_blacklist_real_remove_template;
	iface->get_templates = (GVariant* (*) (ZeitgeistRemoteBlacklist *, GError**)) zeitgeist_blacklist_real_get_templates;
}


static void zeitgeist_blacklist_instance_init (ZeitgeistBlacklist * self) {
	self->priv = ZEITGEIST_BLACKLIST_GET_PRIVATE (self);
}


static void zeitgeist_blacklist_finalize (GObject * obj) {
	ZeitgeistBlacklist * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ZEITGEIST_TYPE_BLACKLIST, ZeitgeistBlacklist);
	_g_hash_table_unref0 (self->priv->blacklist);
	G_OBJECT_CLASS (zeitgeist_blacklist_parent_class)->finalize (obj);
}


GType zeitgeist_blacklist_get_type (void) {
	return zeitgeist_blacklist_type_id;
}


GType zeitgeist_blacklist_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistBlacklistClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) zeitgeist_blacklist_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ZeitgeistBlacklist), 0, (GInstanceInitFunc) zeitgeist_blacklist_instance_init, NULL };
	static const GInterfaceInfo zeitgeist_remote_blacklist_info = { (GInterfaceInitFunc) zeitgeist_blacklist_zeitgeist_remote_blacklist_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	zeitgeist_blacklist_type_id = g_type_module_register_type (module, ZEITGEIST_TYPE_EXTENSION, "ZeitgeistBlacklist", &g_define_type_info, 0);
	g_type_module_add_interface (module, zeitgeist_blacklist_type_id, ZEITGEIST_TYPE_REMOTE_BLACKLIST, &zeitgeist_remote_blacklist_info);
	return zeitgeist_blacklist_type_id;
}


GType zeitgeist_extension_register (GTypeModule* module) {
	GType result = 0UL;
	g_return_val_if_fail (module != NULL, 0UL);
	zeitgeist_remote_blacklist_register_type (module);
	zeitgeist_remote_blacklist_proxy_register_dynamic_type (module);
	zeitgeist_blacklist_register_type (module);
	result = ZEITGEIST_TYPE_BLACKLIST;
	return result;
}



