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

/*
 * Copyright (C) 2010 Michal Hruby <michal.mhr@gmail.com>
 *
 * 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.
 *
 * This library 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
 * Lesser 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/>.
 *
 * Authored by Michal Hruby <michal.mhr@gmail.com>
 *
 */

#include "synapse-core.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>
#include <gee.h>

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

#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _SynapseParamSpecPluginInfo SynapseParamSpecPluginInfo;
enum  {
	SYNAPSE_PLUGIN_REGISTRY_0_PROPERTY,
	SYNAPSE_PLUGIN_REGISTRY_NUM_PROPERTIES
};
static GParamSpec* synapse_plugin_registry_properties[SYNAPSE_PLUGIN_REGISTRY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _synapse_plugin_info_unref0(var) ((var == NULL) ? NULL : (var = (synapse_plugin_info_unref (var), NULL)))

struct _SynapseParamSpecPluginInfo {
	GParamSpec parent_instance;
};

struct _SynapsePluginRegistryPrivate {
	GeeList* plugins;
};

static gpointer synapse_plugin_info_parent_class = NULL;
static gint SynapsePluginRegistry_private_offset;
static gpointer synapse_plugin_registry_parent_class = NULL;
SynapsePluginRegistry* synapse_plugin_registry_instance = NULL;

static GType synapse_activatable_get_type_once (void);
static GType synapse_configurable_get_type_once (void);
static gboolean synapse_item_provider_real_handles_query (SynapseItemProvider* self,
                                                   SynapseQuery* query);
static gboolean synapse_item_provider_real_handles_empty_query (SynapseItemProvider* self);
static GType synapse_item_provider_get_type_once (void);
static gboolean synapse_action_provider_real_handles_unknown (SynapseActionProvider* self);
static GType synapse_action_provider_get_type_once (void);
static void synapse_plugin_info_finalize (SynapsePluginInfo * obj);
static GType synapse_plugin_info_get_type_once (void);
static GObject * synapse_plugin_registry_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void synapse_plugin_registry_finalize (GObject * obj);
static GType synapse_plugin_registry_get_type_once (void);

void
synapse_activatable_activate (SynapseActivatable* self)
{
	SynapseActivatableIface* _iface_;
#line 28 "plugin.vala"
	g_return_if_fail (self != NULL);
#line 28 "plugin.vala"
	_iface_ = SYNAPSE_ACTIVATABLE_GET_INTERFACE (self);
#line 28 "plugin.vala"
	if (_iface_->activate) {
#line 28 "plugin.vala"
		_iface_->activate (self);
#line 95 "plugin.c"
	}
}

void
synapse_activatable_deactivate (SynapseActivatable* self)
{
	SynapseActivatableIface* _iface_;
#line 29 "plugin.vala"
	g_return_if_fail (self != NULL);
#line 29 "plugin.vala"
	_iface_ = SYNAPSE_ACTIVATABLE_GET_INTERFACE (self);
#line 29 "plugin.vala"
	if (_iface_->deactivate) {
#line 29 "plugin.vala"
		_iface_->deactivate (self);
#line 111 "plugin.c"
	}
}

gboolean
synapse_activatable_get_enabled (SynapseActivatable* self)
{
	SynapseActivatableIface* _iface_;
#line 26 "plugin.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 26 "plugin.vala"
	_iface_ = SYNAPSE_ACTIVATABLE_GET_INTERFACE (self);
#line 26 "plugin.vala"
	if (_iface_->get_enabled) {
#line 26 "plugin.vala"
		return _iface_->get_enabled (self);
#line 127 "plugin.c"
	}
#line 26 "plugin.vala"
	return FALSE;
#line 131 "plugin.c"
}

void
synapse_activatable_set_enabled (SynapseActivatable* self,
                                 gboolean value)
{
	SynapseActivatableIface* _iface_;
#line 26 "plugin.vala"
	g_return_if_fail (self != NULL);
#line 26 "plugin.vala"
	_iface_ = SYNAPSE_ACTIVATABLE_GET_INTERFACE (self);
#line 26 "plugin.vala"
	if (_iface_->set_enabled) {
#line 26 "plugin.vala"
		_iface_->set_enabled (self, value);
#line 147 "plugin.c"
	}
}

static void
synapse_activatable_default_init (SynapseActivatableIface * iface,
                                  gpointer iface_data)
{
#line 23 "plugin.vala"
	g_object_interface_install_property (iface, g_param_spec_boolean ("enabled", "enabled", "enabled", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 157 "plugin.c"
}

static GType
synapse_activatable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseActivatableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_activatable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType synapse_activatable_type_id;
	synapse_activatable_type_id = g_type_register_static (G_TYPE_INTERFACE, "SynapseActivatable", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (synapse_activatable_type_id, G_TYPE_OBJECT);
	return synapse_activatable_type_id;
}

GType
synapse_activatable_get_type (void)
{
	static volatile gsize synapse_activatable_type_id__once = 0;
	if (g_once_init_enter (&synapse_activatable_type_id__once)) {
		GType synapse_activatable_type_id;
		synapse_activatable_type_id = synapse_activatable_get_type_once ();
		g_once_init_leave (&synapse_activatable_type_id__once, synapse_activatable_type_id);
	}
	return synapse_activatable_type_id__once;
}

GtkWidget*
synapse_configurable_create_config_widget (SynapseConfigurable* self)
{
	SynapseConfigurableIface* _iface_;
#line 34 "plugin.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 34 "plugin.vala"
	_iface_ = SYNAPSE_CONFIGURABLE_GET_INTERFACE (self);
#line 34 "plugin.vala"
	if (_iface_->create_config_widget) {
#line 34 "plugin.vala"
		return _iface_->create_config_widget (self);
#line 194 "plugin.c"
	}
#line 34 "plugin.vala"
	return NULL;
#line 198 "plugin.c"
}

static void
synapse_configurable_default_init (SynapseConfigurableIface * iface,
                                   gpointer iface_data)
{
}

static GType
synapse_configurable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseConfigurableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_configurable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType synapse_configurable_type_id;
	synapse_configurable_type_id = g_type_register_static (G_TYPE_INTERFACE, "SynapseConfigurable", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (synapse_configurable_type_id, G_TYPE_OBJECT);
	return synapse_configurable_type_id;
}

GType
synapse_configurable_get_type (void)
{
	static volatile gsize synapse_configurable_type_id__once = 0;
	if (g_once_init_enter (&synapse_configurable_type_id__once)) {
		GType synapse_configurable_type_id;
		synapse_configurable_type_id = synapse_configurable_get_type_once ();
		g_once_init_leave (&synapse_configurable_type_id__once, synapse_configurable_type_id);
	}
	return synapse_configurable_type_id__once;
}

void
synapse_item_provider_search (SynapseItemProvider* self,
                              SynapseQuery* query,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	SynapseItemProviderIface* _iface_;
#line 37 "plugin.vala"
	_iface_ = SYNAPSE_ITEM_PROVIDER_GET_INTERFACE (self);
#line 37 "plugin.vala"
	if (_iface_->search) {
#line 37 "plugin.vala"
		_iface_->search (self, query, _callback_, _user_data_);
#line 242 "plugin.c"
	}
}

SynapseResultSet*
synapse_item_provider_search_finish (SynapseItemProvider* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	SynapseItemProviderIface* _iface_;
#line 37 "plugin.vala"
	_iface_ = SYNAPSE_ITEM_PROVIDER_GET_INTERFACE (self);
#line 37 "plugin.vala"
	if (_iface_->search_finish) {
#line 37 "plugin.vala"
		return _iface_->search_finish (self, _res_, error);
#line 258 "plugin.c"
	}
#line 37 "plugin.vala"
	return NULL;
#line 262 "plugin.c"
}

static gboolean
synapse_item_provider_real_handles_query (SynapseItemProvider* self,
                                          SynapseQuery* query)
{
	gboolean result;
#line 40 "plugin.vala"
	g_return_val_if_fail (query != NULL, FALSE);
#line 42 "plugin.vala"
	result = TRUE;
#line 42 "plugin.vala"
	return result;
#line 276 "plugin.c"
}

gboolean
synapse_item_provider_handles_query (SynapseItemProvider* self,
                                     SynapseQuery* query)
{
	SynapseItemProviderIface* _iface_;
#line 40 "plugin.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 40 "plugin.vala"
	_iface_ = SYNAPSE_ITEM_PROVIDER_GET_INTERFACE (self);
#line 40 "plugin.vala"
	if (_iface_->handles_query) {
#line 40 "plugin.vala"
		return _iface_->handles_query (self, query);
#line 292 "plugin.c"
	}
#line 40 "plugin.vala"
	return FALSE;
#line 296 "plugin.c"
}

static gboolean
synapse_item_provider_real_handles_empty_query (SynapseItemProvider* self)
{
	gboolean result;
#line 46 "plugin.vala"
	result = FALSE;
#line 46 "plugin.vala"
	return result;
#line 307 "plugin.c"
}

gboolean
synapse_item_provider_handles_empty_query (SynapseItemProvider* self)
{
	SynapseItemProviderIface* _iface_;
#line 44 "plugin.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 44 "plugin.vala"
	_iface_ = SYNAPSE_ITEM_PROVIDER_GET_INTERFACE (self);
#line 44 "plugin.vala"
	if (_iface_->handles_empty_query) {
#line 44 "plugin.vala"
		return _iface_->handles_empty_query (self);
#line 322 "plugin.c"
	}
#line 44 "plugin.vala"
	return FALSE;
#line 326 "plugin.c"
}

static void
synapse_item_provider_default_init (SynapseItemProviderIface * iface,
                                    gpointer iface_data)
{
#line 37 "plugin.vala"
	iface->handles_query = synapse_item_provider_real_handles_query;
#line 37 "plugin.vala"
	iface->handles_empty_query = synapse_item_provider_real_handles_empty_query;
#line 337 "plugin.c"
}

static GType
synapse_item_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseItemProviderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_item_provider_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType synapse_item_provider_type_id;
	synapse_item_provider_type_id = g_type_register_static (G_TYPE_INTERFACE, "SynapseItemProvider", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (synapse_item_provider_type_id, SYNAPSE_TYPE_ACTIVATABLE);
	return synapse_item_provider_type_id;
}

GType
synapse_item_provider_get_type (void)
{
	static volatile gsize synapse_item_provider_type_id__once = 0;
	if (g_once_init_enter (&synapse_item_provider_type_id__once)) {
		GType synapse_item_provider_type_id;
		synapse_item_provider_type_id = synapse_item_provider_get_type_once ();
		g_once_init_leave (&synapse_item_provider_type_id__once, synapse_item_provider_type_id);
	}
	return synapse_item_provider_type_id__once;
}

SynapseResultSet*
synapse_action_provider_find_for_match (SynapseActionProvider* self,
                                        SynapseQuery* query,
                                        SynapseMatch* match)
{
	SynapseActionProviderIface* _iface_;
#line 52 "plugin.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 52 "plugin.vala"
	_iface_ = SYNAPSE_ACTION_PROVIDER_GET_INTERFACE (self);
#line 52 "plugin.vala"
	if (_iface_->find_for_match) {
#line 52 "plugin.vala"
		return _iface_->find_for_match (self, query, match);
#line 376 "plugin.c"
	}
#line 52 "plugin.vala"
	return NULL;
#line 380 "plugin.c"
}

static gboolean
synapse_action_provider_real_handles_unknown (SynapseActionProvider* self)
{
	gboolean result;
#line 55 "plugin.vala"
	result = FALSE;
#line 55 "plugin.vala"
	return result;
#line 391 "plugin.c"
}

gboolean
synapse_action_provider_handles_unknown (SynapseActionProvider* self)
{
	SynapseActionProviderIface* _iface_;
#line 53 "plugin.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 53 "plugin.vala"
	_iface_ = SYNAPSE_ACTION_PROVIDER_GET_INTERFACE (self);
#line 53 "plugin.vala"
	if (_iface_->handles_unknown) {
#line 53 "plugin.vala"
		return _iface_->handles_unknown (self);
#line 406 "plugin.c"
	}
#line 53 "plugin.vala"
	return FALSE;
#line 410 "plugin.c"
}

static void
synapse_action_provider_default_init (SynapseActionProviderIface * iface,
                                      gpointer iface_data)
{
#line 50 "plugin.vala"
	iface->handles_unknown = synapse_action_provider_real_handles_unknown;
#line 419 "plugin.c"
}

static GType
synapse_action_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseActionProviderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_action_provider_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType synapse_action_provider_type_id;
	synapse_action_provider_type_id = g_type_register_static (G_TYPE_INTERFACE, "SynapseActionProvider", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (synapse_action_provider_type_id, SYNAPSE_TYPE_ACTIVATABLE);
	return synapse_action_provider_type_id;
}

GType
synapse_action_provider_get_type (void)
{
	static volatile gsize synapse_action_provider_type_id__once = 0;
	if (g_once_init_enter (&synapse_action_provider_type_id__once)) {
		GType synapse_action_provider_type_id;
		synapse_action_provider_type_id = synapse_action_provider_get_type_once ();
		g_once_init_leave (&synapse_action_provider_type_id__once, synapse_action_provider_type_id);
	}
	return synapse_action_provider_type_id__once;
}

SynapsePluginInfo*
synapse_plugin_info_construct (GType object_type,
                               GType type,
                               const gchar* title,
                               const gchar* desc,
                               const gchar* icon_name,
                               SynapsePluginRegisterFunc reg_func,
                               gboolean runnable,
                               const gchar* runnable_error)
{
	SynapsePluginInfo* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 72 "plugin.vala"
	g_return_val_if_fail (title != NULL, NULL);
#line 72 "plugin.vala"
	g_return_val_if_fail (desc != NULL, NULL);
#line 72 "plugin.vala"
	g_return_val_if_fail (icon_name != NULL, NULL);
#line 72 "plugin.vala"
	g_return_val_if_fail (runnable_error != NULL, NULL);
#line 72 "plugin.vala"
	self = (SynapsePluginInfo*) g_type_create_instance (object_type);
#line 76 "plugin.vala"
	self->plugin_type = type;
#line 77 "plugin.vala"
	_tmp0_ = g_strdup (title);
#line 77 "plugin.vala"
	_g_free0 (self->title);
#line 77 "plugin.vala"
	self->title = _tmp0_;
#line 78 "plugin.vala"
	_tmp1_ = g_strdup (desc);
#line 78 "plugin.vala"
	_g_free0 (self->description);
#line 78 "plugin.vala"
	self->description = _tmp1_;
#line 79 "plugin.vala"
	_tmp2_ = g_strdup (icon_name);
#line 79 "plugin.vala"
	_g_free0 (self->icon_name);
#line 79 "plugin.vala"
	self->icon_name = _tmp2_;
#line 80 "plugin.vala"
	self->register_func = reg_func;
#line 81 "plugin.vala"
	self->runnable = runnable;
#line 82 "plugin.vala"
	_tmp3_ = g_strdup (runnable_error);
#line 82 "plugin.vala"
	_g_free0 (self->runnable_error);
#line 82 "plugin.vala"
	self->runnable_error = _tmp3_;
#line 72 "plugin.vala"
	return self;
#line 501 "plugin.c"
}

SynapsePluginInfo*
synapse_plugin_info_new (GType type,
                         const gchar* title,
                         const gchar* desc,
                         const gchar* icon_name,
                         SynapsePluginRegisterFunc reg_func,
                         gboolean runnable,
                         const gchar* runnable_error)
{
#line 72 "plugin.vala"
	return synapse_plugin_info_construct (SYNAPSE_TYPE_PLUGIN_INFO, type, title, desc, icon_name, reg_func, runnable, runnable_error);
#line 515 "plugin.c"
}

static void
synapse_value_plugin_info_init (GValue* value)
{
#line 63 "plugin.vala"
	value->data[0].v_pointer = NULL;
#line 523 "plugin.c"
}

static void
synapse_value_plugin_info_free_value (GValue* value)
{
#line 63 "plugin.vala"
	if (value->data[0].v_pointer) {
#line 63 "plugin.vala"
		synapse_plugin_info_unref (value->data[0].v_pointer);
#line 533 "plugin.c"
	}
}

static void
synapse_value_plugin_info_copy_value (const GValue* src_value,
                                      GValue* dest_value)
{
#line 63 "plugin.vala"
	if (src_value->data[0].v_pointer) {
#line 63 "plugin.vala"
		dest_value->data[0].v_pointer = synapse_plugin_info_ref (src_value->data[0].v_pointer);
#line 545 "plugin.c"
	} else {
#line 63 "plugin.vala"
		dest_value->data[0].v_pointer = NULL;
#line 549 "plugin.c"
	}
}

static gpointer
synapse_value_plugin_info_peek_pointer (const GValue* value)
{
#line 63 "plugin.vala"
	return value->data[0].v_pointer;
#line 558 "plugin.c"
}

static gchar*
synapse_value_plugin_info_collect_value (GValue* value,
                                         guint n_collect_values,
                                         GTypeCValue* collect_values,
                                         guint collect_flags)
{
#line 63 "plugin.vala"
	if (collect_values[0].v_pointer) {
#line 569 "plugin.c"
		SynapsePluginInfo * object;
		object = collect_values[0].v_pointer;
#line 63 "plugin.vala"
		if (object->parent_instance.g_class == NULL) {
#line 63 "plugin.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 576 "plugin.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 63 "plugin.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 580 "plugin.c"
		}
#line 63 "plugin.vala"
		value->data[0].v_pointer = synapse_plugin_info_ref (object);
#line 584 "plugin.c"
	} else {
#line 63 "plugin.vala"
		value->data[0].v_pointer = NULL;
#line 588 "plugin.c"
	}
#line 63 "plugin.vala"
	return NULL;
#line 592 "plugin.c"
}

static gchar*
synapse_value_plugin_info_lcopy_value (const GValue* value,
                                       guint n_collect_values,
                                       GTypeCValue* collect_values,
                                       guint collect_flags)
{
	SynapsePluginInfo ** object_p;
	object_p = collect_values[0].v_pointer;
#line 63 "plugin.vala"
	if (!object_p) {
#line 63 "plugin.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 607 "plugin.c"
	}
#line 63 "plugin.vala"
	if (!value->data[0].v_pointer) {
#line 63 "plugin.vala"
		*object_p = NULL;
#line 613 "plugin.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 63 "plugin.vala"
		*object_p = value->data[0].v_pointer;
#line 617 "plugin.c"
	} else {
#line 63 "plugin.vala"
		*object_p = synapse_plugin_info_ref (value->data[0].v_pointer);
#line 621 "plugin.c"
	}
#line 63 "plugin.vala"
	return NULL;
#line 625 "plugin.c"
}

GParamSpec*
synapse_param_spec_plugin_info (const gchar* name,
                                const gchar* nick,
                                const gchar* blurb,
                                GType object_type,
                                GParamFlags flags)
{
	SynapseParamSpecPluginInfo* spec;
#line 63 "plugin.vala"
	g_return_val_if_fail (g_type_is_a (object_type, SYNAPSE_TYPE_PLUGIN_INFO), NULL);
#line 63 "plugin.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 63 "plugin.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 63 "plugin.vala"
	return G_PARAM_SPEC (spec);
#line 644 "plugin.c"
}

gpointer
synapse_value_get_plugin_info (const GValue* value)
{
#line 63 "plugin.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SYNAPSE_TYPE_PLUGIN_INFO), NULL);
#line 63 "plugin.vala"
	return value->data[0].v_pointer;
#line 654 "plugin.c"
}

void
synapse_value_set_plugin_info (GValue* value,
                               gpointer v_object)
{
	SynapsePluginInfo * old;
#line 63 "plugin.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SYNAPSE_TYPE_PLUGIN_INFO));
#line 63 "plugin.vala"
	old = value->data[0].v_pointer;
#line 63 "plugin.vala"
	if (v_object) {
#line 63 "plugin.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SYNAPSE_TYPE_PLUGIN_INFO));
#line 63 "plugin.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 63 "plugin.vala"
		value->data[0].v_pointer = v_object;
#line 63 "plugin.vala"
		synapse_plugin_info_ref (value->data[0].v_pointer);
#line 676 "plugin.c"
	} else {
#line 63 "plugin.vala"
		value->data[0].v_pointer = NULL;
#line 680 "plugin.c"
	}
#line 63 "plugin.vala"
	if (old) {
#line 63 "plugin.vala"
		synapse_plugin_info_unref (old);
#line 686 "plugin.c"
	}
}

void
synapse_value_take_plugin_info (GValue* value,
                                gpointer v_object)
{
	SynapsePluginInfo * old;
#line 63 "plugin.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SYNAPSE_TYPE_PLUGIN_INFO));
#line 63 "plugin.vala"
	old = value->data[0].v_pointer;
#line 63 "plugin.vala"
	if (v_object) {
#line 63 "plugin.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SYNAPSE_TYPE_PLUGIN_INFO));
#line 63 "plugin.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 63 "plugin.vala"
		value->data[0].v_pointer = v_object;
#line 707 "plugin.c"
	} else {
#line 63 "plugin.vala"
		value->data[0].v_pointer = NULL;
#line 711 "plugin.c"
	}
#line 63 "plugin.vala"
	if (old) {
#line 63 "plugin.vala"
		synapse_plugin_info_unref (old);
#line 717 "plugin.c"
	}
}

static void
synapse_plugin_info_class_init (SynapsePluginInfoClass * klass,
                                gpointer klass_data)
{
#line 63 "plugin.vala"
	synapse_plugin_info_parent_class = g_type_class_peek_parent (klass);
#line 63 "plugin.vala"
	((SynapsePluginInfoClass *) klass)->finalize = synapse_plugin_info_finalize;
#line 729 "plugin.c"
}

static void
synapse_plugin_info_instance_init (SynapsePluginInfo * self,
                                   gpointer klass)
{
#line 63 "plugin.vala"
	self->ref_count = 1;
#line 738 "plugin.c"
}

static void
synapse_plugin_info_finalize (SynapsePluginInfo * obj)
{
	SynapsePluginInfo * self;
#line 63 "plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_PLUGIN_INFO, SynapsePluginInfo);
#line 63 "plugin.vala"
	g_signal_handlers_destroy (self);
#line 66 "plugin.vala"
	_g_free0 (self->title);
#line 67 "plugin.vala"
	_g_free0 (self->description);
#line 68 "plugin.vala"
	_g_free0 (self->icon_name);
#line 71 "plugin.vala"
	_g_free0 (self->runnable_error);
#line 757 "plugin.c"
}

static GType
synapse_plugin_info_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { synapse_value_plugin_info_init, synapse_value_plugin_info_free_value, synapse_value_plugin_info_copy_value, synapse_value_plugin_info_peek_pointer, "p", synapse_value_plugin_info_collect_value, "p", synapse_value_plugin_info_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (SynapsePluginInfoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_plugin_info_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapsePluginInfo), 0, (GInstanceInitFunc) synapse_plugin_info_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType synapse_plugin_info_type_id;
	synapse_plugin_info_type_id = g_type_register_fundamental (g_type_fundamental_next (), "SynapsePluginInfo", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return synapse_plugin_info_type_id;
}

GType
synapse_plugin_info_get_type (void)
{
	static volatile gsize synapse_plugin_info_type_id__once = 0;
	if (g_once_init_enter (&synapse_plugin_info_type_id__once)) {
		GType synapse_plugin_info_type_id;
		synapse_plugin_info_type_id = synapse_plugin_info_get_type_once ();
		g_once_init_leave (&synapse_plugin_info_type_id__once, synapse_plugin_info_type_id);
	}
	return synapse_plugin_info_type_id__once;
}

gpointer
synapse_plugin_info_ref (gpointer instance)
{
	SynapsePluginInfo * self;
	self = instance;
#line 63 "plugin.vala"
	g_atomic_int_inc (&self->ref_count);
#line 63 "plugin.vala"
	return instance;
#line 792 "plugin.c"
}

void
synapse_plugin_info_unref (gpointer instance)
{
	SynapsePluginInfo * self;
	self = instance;
#line 63 "plugin.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 63 "plugin.vala"
		SYNAPSE_PLUGIN_INFO_GET_CLASS (self)->finalize (self);
#line 63 "plugin.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 806 "plugin.c"
	}
}

static inline gpointer
synapse_plugin_registry_get_instance_private (SynapsePluginRegistry* self)
{
	return G_STRUCT_MEMBER_P (self, SynapsePluginRegistry_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 105 "plugin.vala"
	return self ? g_object_ref (self) : NULL;
#line 821 "plugin.c"
}

SynapsePluginRegistry*
synapse_plugin_registry_get_default (void)
{
	SynapsePluginRegistry* _tmp0_ = NULL;
	SynapsePluginRegistry* _tmp1_;
	SynapsePluginRegistry* _tmp2_;
	SynapsePluginRegistry* _tmp4_;
	SynapsePluginRegistry* result;
#line 105 "plugin.vala"
	_tmp1_ = synapse_plugin_registry_instance;
#line 105 "plugin.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 105 "plugin.vala"
	_tmp0_ = _tmp2_;
#line 105 "plugin.vala"
	if (_tmp0_ == NULL) {
#line 840 "plugin.c"
		SynapsePluginRegistry* _tmp3_;
#line 105 "plugin.vala"
		_tmp3_ = synapse_plugin_registry_new ();
#line 105 "plugin.vala"
		_g_object_unref0 (_tmp0_);
#line 105 "plugin.vala"
		_tmp0_ = _tmp3_;
#line 848 "plugin.c"
	}
#line 105 "plugin.vala"
	_tmp4_ = _tmp0_;
#line 105 "plugin.vala"
	_tmp0_ = NULL;
#line 105 "plugin.vala"
	result = _tmp4_;
#line 105 "plugin.vala"
	_g_object_unref0 (_tmp0_);
#line 105 "plugin.vala"
	return result;
#line 860 "plugin.c"
}

void
synapse_plugin_registry_register_plugin (SynapsePluginRegistry* self,
                                         GType plugin_type,
                                         const gchar* title,
                                         const gchar* description,
                                         const gchar* icon_name,
                                         SynapsePluginRegisterFunc reg_func,
                                         gboolean runnable,
                                         const gchar* runnable_error)
{
	gint index = 0;
	SynapsePluginInfo* p = NULL;
	SynapsePluginInfo* _tmp12_;
	GeeList* _tmp13_;
#line 108 "plugin.vala"
	g_return_if_fail (self != NULL);
#line 108 "plugin.vala"
	g_return_if_fail (title != NULL);
#line 108 "plugin.vala"
	g_return_if_fail (description != NULL);
#line 108 "plugin.vala"
	g_return_if_fail (icon_name != NULL);
#line 108 "plugin.vala"
	g_return_if_fail (runnable_error != NULL);
#line 117 "plugin.vala"
	index = -1;
#line 889 "plugin.c"
	{
		gint i = 0;
#line 118 "plugin.vala"
		i = 0;
#line 894 "plugin.c"
		{
			gboolean _tmp0_ = FALSE;
#line 118 "plugin.vala"
			_tmp0_ = TRUE;
#line 118 "plugin.vala"
			while (TRUE) {
#line 901 "plugin.c"
				GeeList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				GeeList* _tmp5_;
				gpointer _tmp6_;
				SynapsePluginInfo* _tmp7_;
				gboolean _tmp8_;
#line 118 "plugin.vala"
				if (!_tmp0_) {
#line 911 "plugin.c"
					gint _tmp1_;
#line 118 "plugin.vala"
					_tmp1_ = i;
#line 118 "plugin.vala"
					i = _tmp1_ + 1;
#line 917 "plugin.c"
				}
#line 118 "plugin.vala"
				_tmp0_ = FALSE;
#line 118 "plugin.vala"
				_tmp2_ = self->priv->plugins;
#line 118 "plugin.vala"
				_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
#line 118 "plugin.vala"
				_tmp4_ = _tmp3_;
#line 118 "plugin.vala"
				if (!(i < _tmp4_)) {
#line 118 "plugin.vala"
					break;
#line 931 "plugin.c"
				}
#line 120 "plugin.vala"
				_tmp5_ = self->priv->plugins;
#line 120 "plugin.vala"
				_tmp6_ = gee_list_get (_tmp5_, i);
#line 120 "plugin.vala"
				_tmp7_ = (SynapsePluginInfo*) _tmp6_;
#line 120 "plugin.vala"
				_tmp8_ = _tmp7_->plugin_type == plugin_type;
#line 120 "plugin.vala"
				_synapse_plugin_info_unref0 (_tmp7_);
#line 120 "plugin.vala"
				if (_tmp8_) {
#line 122 "plugin.vala"
					index = i;
#line 123 "plugin.vala"
					break;
#line 949 "plugin.c"
				}
			}
		}
	}
#line 126 "plugin.vala"
	if (index >= 0) {
#line 956 "plugin.c"
		GeeList* _tmp9_;
		gpointer _tmp10_;
		SynapsePluginInfo* _tmp11_;
#line 126 "plugin.vala"
		_tmp9_ = self->priv->plugins;
#line 126 "plugin.vala"
		_tmp10_ = gee_list_remove_at (_tmp9_, index);
#line 126 "plugin.vala"
		_tmp11_ = (SynapsePluginInfo*) _tmp10_;
#line 126 "plugin.vala"
		_synapse_plugin_info_unref0 (_tmp11_);
#line 968 "plugin.c"
	}
#line 128 "plugin.vala"
	_tmp12_ = synapse_plugin_info_new (plugin_type, title, description, icon_name, reg_func, runnable, runnable_error);
#line 128 "plugin.vala"
	p = _tmp12_;
#line 130 "plugin.vala"
	_tmp13_ = self->priv->plugins;
#line 130 "plugin.vala"
	gee_collection_add ((GeeCollection*) _tmp13_, p);
#line 108 "plugin.vala"
	_synapse_plugin_info_unref0 (p);
#line 980 "plugin.c"
}

GeeList*
synapse_plugin_registry_get_plugins (SynapsePluginRegistry* self)
{
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	GeeList* _tmp2_;
	GeeList* result;
#line 133 "plugin.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 135 "plugin.vala"
	_tmp0_ = self->priv->plugins;
#line 135 "plugin.vala"
	_tmp1_ = gee_list_get_read_only_view (_tmp0_);
#line 135 "plugin.vala"
	_tmp2_ = _tmp1_;
#line 135 "plugin.vala"
	result = _tmp2_;
#line 135 "plugin.vala"
	return result;
#line 1002 "plugin.c"
}

SynapsePluginInfo*
synapse_plugin_registry_get_plugin_info_for_type (SynapsePluginRegistry* self,
                                                  GType plugin_type)
{
	SynapsePluginInfo* result;
#line 138 "plugin.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 1012 "plugin.c"
	{
		GeeList* _pi_list = NULL;
		GeeList* _tmp0_;
		gint _pi_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _pi_index = 0;
#line 140 "plugin.vala"
		_tmp0_ = self->priv->plugins;
#line 140 "plugin.vala"
		_pi_list = _tmp0_;
#line 140 "plugin.vala"
		_tmp1_ = _pi_list;
#line 140 "plugin.vala"
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
#line 140 "plugin.vala"
		_tmp3_ = _tmp2_;
#line 140 "plugin.vala"
		_pi_size = _tmp3_;
#line 140 "plugin.vala"
		_pi_index = -1;
#line 140 "plugin.vala"
		while (TRUE) {
#line 1037 "plugin.c"
			gint _tmp4_;
			gint _tmp5_;
			SynapsePluginInfo* pi = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			SynapsePluginInfo* _tmp8_;
#line 140 "plugin.vala"
			_pi_index = _pi_index + 1;
#line 140 "plugin.vala"
			_tmp4_ = _pi_index;
#line 140 "plugin.vala"
			_tmp5_ = _pi_size;
#line 140 "plugin.vala"
			if (!(_tmp4_ < _tmp5_)) {
#line 140 "plugin.vala"
				break;
#line 1054 "plugin.c"
			}
#line 140 "plugin.vala"
			_tmp6_ = _pi_list;
#line 140 "plugin.vala"
			_tmp7_ = gee_list_get (_tmp6_, _pi_index);
#line 140 "plugin.vala"
			pi = (SynapsePluginInfo*) _tmp7_;
#line 142 "plugin.vala"
			_tmp8_ = pi;
#line 142 "plugin.vala"
			if (_tmp8_->plugin_type == plugin_type) {
#line 142 "plugin.vala"
				result = pi;
#line 142 "plugin.vala"
				return result;
#line 1070 "plugin.c"
			}
#line 140 "plugin.vala"
			_synapse_plugin_info_unref0 (pi);
#line 1074 "plugin.c"
		}
	}
#line 145 "plugin.vala"
	result = NULL;
#line 145 "plugin.vala"
	return result;
#line 1081 "plugin.c"
}

SynapsePluginRegistry*
synapse_plugin_registry_construct (GType object_type)
{
	SynapsePluginRegistry * self = NULL;
#line 86 "plugin.vala"
	self = (SynapsePluginRegistry*) g_object_new (object_type, NULL);
#line 86 "plugin.vala"
	return self;
#line 1092 "plugin.c"
}

SynapsePluginRegistry*
synapse_plugin_registry_new (void)
{
#line 86 "plugin.vala"
	return synapse_plugin_registry_construct (SYNAPSE_TYPE_PLUGIN_REGISTRY);
#line 1100 "plugin.c"
}

static GObject *
synapse_plugin_registry_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SynapsePluginRegistry * self;
	GeeArrayList* _tmp0_;
#line 92 "plugin.vala"
	parent_class = G_OBJECT_CLASS (synapse_plugin_registry_parent_class);
#line 92 "plugin.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 92 "plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_PLUGIN_REGISTRY, SynapsePluginRegistry);
#line 94 "plugin.vala"
	synapse_plugin_registry_instance = self;
#line 95 "plugin.vala"
	_tmp0_ = gee_array_list_new (SYNAPSE_TYPE_PLUGIN_INFO, (GBoxedCopyFunc) synapse_plugin_info_ref, (GDestroyNotify) synapse_plugin_info_unref, NULL, NULL, NULL);
#line 95 "plugin.vala"
	_g_object_unref0 (self->priv->plugins);
#line 95 "plugin.vala"
	self->priv->plugins = (GeeList*) _tmp0_;
#line 92 "plugin.vala"
	return obj;
#line 1128 "plugin.c"
}

static void
synapse_plugin_registry_class_init (SynapsePluginRegistryClass * klass,
                                    gpointer klass_data)
{
#line 86 "plugin.vala"
	synapse_plugin_registry_parent_class = g_type_class_peek_parent (klass);
#line 86 "plugin.vala"
	g_type_class_adjust_private_offset (klass, &SynapsePluginRegistry_private_offset);
#line 86 "plugin.vala"
	G_OBJECT_CLASS (klass)->constructor = synapse_plugin_registry_constructor;
#line 86 "plugin.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_plugin_registry_finalize;
#line 1143 "plugin.c"
}

static void
synapse_plugin_registry_instance_init (SynapsePluginRegistry * self,
                                       gpointer klass)
{
#line 86 "plugin.vala"
	self->priv = synapse_plugin_registry_get_instance_private (self);
#line 1152 "plugin.c"
}

static void
synapse_plugin_registry_finalize (GObject * obj)
{
	SynapsePluginRegistry * self;
#line 86 "plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_PLUGIN_REGISTRY, SynapsePluginRegistry);
#line 100 "plugin.vala"
	synapse_plugin_registry_instance = NULL;
#line 90 "plugin.vala"
	_g_object_unref0 (self->priv->plugins);
#line 86 "plugin.vala"
	G_OBJECT_CLASS (synapse_plugin_registry_parent_class)->finalize (obj);
#line 1167 "plugin.c"
}

static GType
synapse_plugin_registry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapsePluginRegistryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_plugin_registry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapsePluginRegistry), 0, (GInstanceInitFunc) synapse_plugin_registry_instance_init, NULL };
	GType synapse_plugin_registry_type_id;
	synapse_plugin_registry_type_id = g_type_register_static (G_TYPE_OBJECT, "SynapsePluginRegistry", &g_define_type_info, 0);
	SynapsePluginRegistry_private_offset = g_type_add_instance_private (synapse_plugin_registry_type_id, sizeof (SynapsePluginRegistryPrivate));
	return synapse_plugin_registry_type_id;
}

GType
synapse_plugin_registry_get_type (void)
{
	static volatile gsize synapse_plugin_registry_type_id__once = 0;
	if (g_once_init_enter (&synapse_plugin_registry_type_id__once)) {
		GType synapse_plugin_registry_type_id;
		synapse_plugin_registry_type_id = synapse_plugin_registry_get_type_once ();
		g_once_init_leave (&synapse_plugin_registry_type_id__once, synapse_plugin_registry_type_id);
	}
	return synapse_plugin_registry_type_id__once;
}

