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

/*
 * Copyright (C) 2010 Igor S. Mandrigin <i@mandrigin.ru>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 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 General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 *
 * Based on plugins code by Michal Hruby <michal.mhr@gmail.com>
 *
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "plugins.h"
#include <gee.h>
#include <synapse-core.h>
#include <glib/gi18n-lib.h>

#define SYNAPSE_GNOME_SCREEN_SAVER_UNIQUE_NAME "org.gnome.ScreenSaver"
#define SYNAPSE_GNOME_SCREEN_SAVER_OBJECT_PATH "/org/gnome/ScreenSaver"
#define SYNAPSE_MATE_SCREEN_SAVER_UNIQUE_NAME "org.mate.ScreenSaver"
#define SYNAPSE_MATE_SCREEN_SAVER_OBJECT_PATH "/org/mate/ScreenSaver"
#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 SYNAPSE_TYPE_GNOME_SCREEN_SAVER (synapse_gnome_screen_saver_get_type ())
#define SYNAPSE_GNOME_SCREEN_SAVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_TYPE_GNOME_SCREEN_SAVER, SynapseGnomeScreenSaver))
#define SYNAPSE_IS_GNOME_SCREEN_SAVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_TYPE_GNOME_SCREEN_SAVER))
#define SYNAPSE_GNOME_SCREEN_SAVER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SYNAPSE_TYPE_GNOME_SCREEN_SAVER, SynapseGnomeScreenSaverIface))

typedef struct _SynapseGnomeScreenSaver SynapseGnomeScreenSaver;
typedef struct _SynapseGnomeScreenSaverIface SynapseGnomeScreenSaverIface;

#define SYNAPSE_TYPE_GNOME_SCREEN_SAVER_PROXY (synapse_gnome_screen_saver_proxy_get_type ())
typedef GDBusProxy SynapseGnomeScreenSaverProxy;
typedef GDBusProxyClass SynapseGnomeScreenSaverProxyClass;
typedef struct _SynapseGnomeScreenSaverLockReadyData SynapseGnomeScreenSaverLockReadyData;

#define SYNAPSE_TYPE_MATE_SCREEN_SAVER (synapse_mate_screen_saver_get_type ())
#define SYNAPSE_MATE_SCREEN_SAVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_TYPE_MATE_SCREEN_SAVER, SynapseMateScreenSaver))
#define SYNAPSE_IS_MATE_SCREEN_SAVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_TYPE_MATE_SCREEN_SAVER))
#define SYNAPSE_MATE_SCREEN_SAVER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SYNAPSE_TYPE_MATE_SCREEN_SAVER, SynapseMateScreenSaverIface))

typedef struct _SynapseMateScreenSaver SynapseMateScreenSaver;
typedef struct _SynapseMateScreenSaverIface SynapseMateScreenSaverIface;

#define SYNAPSE_TYPE_MATE_SCREEN_SAVER_PROXY (synapse_mate_screen_saver_proxy_get_type ())
typedef GDBusProxy SynapseMateScreenSaverProxy;
typedef GDBusProxyClass SynapseMateScreenSaverProxyClass;
typedef struct _SynapseMateScreenSaverLockReadyData SynapseMateScreenSaverLockReadyData;
enum  {
	SYNAPSE_SCREEN_SAVER_PLUGIN_0_PROPERTY,
	SYNAPSE_SCREEN_SAVER_PLUGIN_ENABLED_PROPERTY,
	SYNAPSE_SCREEN_SAVER_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* synapse_screen_saver_plugin_properties[SYNAPSE_SCREEN_SAVER_PLUGIN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _SynapseScreenSaverPluginSearchData SynapseScreenSaverPluginSearchData;

#define SYNAPSE_SCREEN_SAVER_PLUGIN_TYPE_LOCK_SCREEN_ACTION (synapse_screen_saver_plugin_lock_screen_action_get_type ())
#define SYNAPSE_SCREEN_SAVER_PLUGIN_LOCK_SCREEN_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_SCREEN_SAVER_PLUGIN_TYPE_LOCK_SCREEN_ACTION, SynapseScreenSaverPluginLockScreenAction))
#define SYNAPSE_SCREEN_SAVER_PLUGIN_LOCK_SCREEN_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_SCREEN_SAVER_PLUGIN_TYPE_LOCK_SCREEN_ACTION, SynapseScreenSaverPluginLockScreenActionClass))
#define SYNAPSE_SCREEN_SAVER_PLUGIN_IS_LOCK_SCREEN_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_SCREEN_SAVER_PLUGIN_TYPE_LOCK_SCREEN_ACTION))
#define SYNAPSE_SCREEN_SAVER_PLUGIN_IS_LOCK_SCREEN_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_SCREEN_SAVER_PLUGIN_TYPE_LOCK_SCREEN_ACTION))
#define SYNAPSE_SCREEN_SAVER_PLUGIN_LOCK_SCREEN_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_SCREEN_SAVER_PLUGIN_TYPE_LOCK_SCREEN_ACTION, SynapseScreenSaverPluginLockScreenActionClass))

typedef struct _SynapseScreenSaverPluginLockScreenAction SynapseScreenSaverPluginLockScreenAction;
typedef struct _SynapseScreenSaverPluginLockScreenActionClass SynapseScreenSaverPluginLockScreenActionClass;
typedef struct _SynapseScreenSaverPluginLockScreenActionPrivate SynapseScreenSaverPluginLockScreenActionPrivate;
enum  {
	SYNAPSE_SCREEN_SAVER_PLUGIN_LOCK_SCREEN_ACTION_0_PROPERTY,
	SYNAPSE_SCREEN_SAVER_PLUGIN_LOCK_SCREEN_ACTION_NUM_PROPERTIES
};
static GParamSpec* synapse_screen_saver_plugin_lock_screen_action_properties[SYNAPSE_SCREEN_SAVER_PLUGIN_LOCK_SCREEN_ACTION_NUM_PROPERTIES];

struct _SynapseGnomeScreenSaverIface {
	GTypeInterface parent_iface;
	void (*lock) (SynapseGnomeScreenSaver* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*lock_finish) (SynapseGnomeScreenSaver* self, GAsyncResult* _res_, GError** error);
};

struct _SynapseGnomeScreenSaverLockReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _SynapseMateScreenSaverIface {
	GTypeInterface parent_iface;
	void (*lock) (SynapseMateScreenSaver* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*lock_finish) (SynapseMateScreenSaver* self, GAsyncResult* _res_, GError** error);
};

struct _SynapseMateScreenSaverLockReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _SynapseScreenSaverPluginPrivate {
	gboolean _enabled;
	GeeList* actions;
};

struct _SynapseScreenSaverPluginSearchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SynapseScreenSaverPlugin* self;
	SynapseQuery q;
	SynapseResultSet* result;
	SynapseQuery _tmp0_;
	SynapseResultSet* _result_;
	SynapseResultSet* _tmp1_;
	GeeList* matchers;
	SynapseQuery _tmp2_;
	const gchar* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _action_list;
	GeeList* _tmp5_;
	gint _action_size;
	GeeList* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gint _action_index;
	gint _tmp9_;
	gint _tmp10_;
	SynapseMatch* action;
	GeeList* _tmp11_;
	gpointer _tmp12_;
	GeeList* _matcher_list;
	GeeList* _tmp13_;
	gint _matcher_size;
	GeeList* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _matcher_index;
	gint _tmp17_;
	gint _tmp18_;
	GeeMapEntry* matcher;
	GeeList* _tmp19_;
	gpointer _tmp20_;
	GeeMapEntry* _tmp21_;
	gconstpointer _tmp22_;
	gconstpointer _tmp23_;
	SynapseMatch* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	SynapseResultSet* _tmp27_;
	SynapseMatch* _tmp28_;
	GeeMapEntry* _tmp29_;
	gconstpointer _tmp30_;
	gconstpointer _tmp31_;
	GError* _inner_error0_;
};

struct _SynapseScreenSaverPluginLockScreenAction {
	SynapseActionMatch parent_instance;
	SynapseScreenSaverPluginLockScreenActionPrivate * priv;
};

struct _SynapseScreenSaverPluginLockScreenActionClass {
	SynapseActionMatchClass parent_class;
};

static gint SynapseScreenSaverPlugin_private_offset;
static gpointer synapse_screen_saver_plugin_parent_class = NULL;
static gpointer synapse_screen_saver_plugin_lock_screen_action_parent_class = NULL;
static SynapseActivatableIface * synapse_screen_saver_plugin_synapse_activatable_parent_iface = NULL;
static SynapseItemProviderIface * synapse_screen_saver_plugin_synapse_item_provider_parent_iface = NULL;

VALA_EXTERN GType synapse_gnome_screen_saver_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint synapse_gnome_screen_saver_register_object (void* object,
                                                  GDBusConnection* connection,
                                                  const gchar* path,
                                                  GError** error);
VALA_EXTERN GType synapse_gnome_screen_saver_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void synapse_gnome_screen_saver_lock (SynapseGnomeScreenSaver* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void synapse_gnome_screen_saver_lock_finish (SynapseGnomeScreenSaver* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static GType synapse_gnome_screen_saver_get_type_once (void);
static void synapse_gnome_screen_saver_proxy_g_signal (GDBusProxy* proxy,
                                                const gchar* sender_name,
                                                const gchar* signal_name,
                                                GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void synapse_gnome_screen_saver_proxy_lock_async (SynapseGnomeScreenSaver* self,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static void synapse_gnome_screen_saver_proxy_lock_finish (SynapseGnomeScreenSaver* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static void synapse_gnome_screen_saver_proxy_synapse_gnome_screen_saver_interface_init (SynapseGnomeScreenSaverIface* iface);
static void _dbus_synapse_gnome_screen_saver_lock (SynapseGnomeScreenSaver* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _dbus_synapse_gnome_screen_saver_lock_ready (GObject * source_object,
                                                  GAsyncResult * _res_,
                                                  gpointer _user_data_);
static void synapse_gnome_screen_saver_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* synapse_gnome_screen_saver_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 synapse_gnome_screen_saver_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 _synapse_gnome_screen_saver_unregister_object (gpointer user_data);
VALA_EXTERN GType synapse_mate_screen_saver_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint synapse_mate_screen_saver_register_object (void* object,
                                                 GDBusConnection* connection,
                                                 const gchar* path,
                                                 GError** error);
VALA_EXTERN GType synapse_mate_screen_saver_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void synapse_mate_screen_saver_lock (SynapseMateScreenSaver* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void synapse_mate_screen_saver_lock_finish (SynapseMateScreenSaver* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static GType synapse_mate_screen_saver_get_type_once (void);
static void synapse_mate_screen_saver_proxy_g_signal (GDBusProxy* proxy,
                                               const gchar* sender_name,
                                               const gchar* signal_name,
                                               GVariant* parameters);
static void synapse_mate_screen_saver_proxy_lock_async (SynapseMateScreenSaver* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void synapse_mate_screen_saver_proxy_lock_finish (SynapseMateScreenSaver* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static void synapse_mate_screen_saver_proxy_synapse_mate_screen_saver_interface_init (SynapseMateScreenSaverIface* iface);
static void _dbus_synapse_mate_screen_saver_lock (SynapseMateScreenSaver* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation);
static void _dbus_synapse_mate_screen_saver_lock_ready (GObject * source_object,
                                                 GAsyncResult * _res_,
                                                 gpointer _user_data_);
static void synapse_mate_screen_saver_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* synapse_mate_screen_saver_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 synapse_mate_screen_saver_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 _synapse_mate_screen_saver_unregister_object (gpointer user_data);
static void synapse_screen_saver_plugin_real_activate (SynapseActivatable* base);
static void synapse_screen_saver_plugin_real_deactivate (SynapseActivatable* base);
static void synapse_screen_saver_plugin_mate_lock_screen (void);
static void synapse_screen_saver_plugin_gnome_lock_screen (void);
static void synapse_screen_saver_plugin_register_plugin (void);
static void _synapse_screen_saver_plugin_register_plugin_synapse_plugin_register_func (void);
static void synapse_screen_saver_plugin_real_search_data_free (gpointer _data);
static void synapse_screen_saver_plugin_real_search (SynapseItemProvider* base,
                                              SynapseQuery* q,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static gboolean synapse_screen_saver_plugin_real_search_co (SynapseScreenSaverPluginSearchData* _data_);
static GType synapse_screen_saver_plugin_lock_screen_action_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SynapseScreenSaverPluginLockScreenAction* synapse_screen_saver_plugin_lock_screen_action_new (void);
static SynapseScreenSaverPluginLockScreenAction* synapse_screen_saver_plugin_lock_screen_action_construct (GType object_type);
static void synapse_screen_saver_plugin_lock_screen_action_real_do_action (SynapseActionMatch* base);
static GType synapse_screen_saver_plugin_lock_screen_action_get_type_once (void);
static GObject * synapse_screen_saver_plugin_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void synapse_screen_saver_plugin_finalize (GObject * obj);
static GType synapse_screen_saver_plugin_get_type_once (void);
static void _vala_synapse_screen_saver_plugin_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_synapse_screen_saver_plugin_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);

static const GDBusArgInfo * const _synapse_gnome_screen_saver_dbus_arg_info_lock_in[] = {NULL};
static const GDBusArgInfo * const _synapse_gnome_screen_saver_dbus_arg_info_lock_out[] = {NULL};
static const GDBusMethodInfo _synapse_gnome_screen_saver_dbus_method_info_lock = {-1, "Lock", (GDBusArgInfo **) (&_synapse_gnome_screen_saver_dbus_arg_info_lock_in), (GDBusArgInfo **) (&_synapse_gnome_screen_saver_dbus_arg_info_lock_out), NULL};
static const GDBusMethodInfo * const _synapse_gnome_screen_saver_dbus_method_info[] = {&_synapse_gnome_screen_saver_dbus_method_info_lock, NULL};
static const GDBusSignalInfo * const _synapse_gnome_screen_saver_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _synapse_gnome_screen_saver_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _synapse_gnome_screen_saver_dbus_interface_info = {-1, "org.gnome.ScreenSaver", (GDBusMethodInfo **) (&_synapse_gnome_screen_saver_dbus_method_info), (GDBusSignalInfo **) (&_synapse_gnome_screen_saver_dbus_signal_info), (GDBusPropertyInfo **) (&_synapse_gnome_screen_saver_dbus_property_info), NULL};
static const GDBusInterfaceVTable _synapse_gnome_screen_saver_dbus_interface_vtable = {synapse_gnome_screen_saver_dbus_interface_method_call, synapse_gnome_screen_saver_dbus_interface_get_property, synapse_gnome_screen_saver_dbus_interface_set_property};
static const GDBusArgInfo * const _synapse_mate_screen_saver_dbus_arg_info_lock_in[] = {NULL};
static const GDBusArgInfo * const _synapse_mate_screen_saver_dbus_arg_info_lock_out[] = {NULL};
static const GDBusMethodInfo _synapse_mate_screen_saver_dbus_method_info_lock = {-1, "Lock", (GDBusArgInfo **) (&_synapse_mate_screen_saver_dbus_arg_info_lock_in), (GDBusArgInfo **) (&_synapse_mate_screen_saver_dbus_arg_info_lock_out), NULL};
static const GDBusMethodInfo * const _synapse_mate_screen_saver_dbus_method_info[] = {&_synapse_mate_screen_saver_dbus_method_info_lock, NULL};
static const GDBusSignalInfo * const _synapse_mate_screen_saver_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _synapse_mate_screen_saver_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _synapse_mate_screen_saver_dbus_interface_info = {-1, "org.mate.ScreenSaver", (GDBusMethodInfo **) (&_synapse_mate_screen_saver_dbus_method_info), (GDBusSignalInfo **) (&_synapse_mate_screen_saver_dbus_signal_info), (GDBusPropertyInfo **) (&_synapse_mate_screen_saver_dbus_property_info), NULL};
static const GDBusInterfaceVTable _synapse_mate_screen_saver_dbus_interface_vtable = {synapse_mate_screen_saver_dbus_interface_method_call, synapse_mate_screen_saver_dbus_interface_get_property, synapse_mate_screen_saver_dbus_interface_set_property};

void
synapse_gnome_screen_saver_lock (SynapseGnomeScreenSaver* self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	SynapseGnomeScreenSaverIface* _iface_;
#line 25 "screensaver-plugin.vala"
	_iface_ = SYNAPSE_GNOME_SCREEN_SAVER_GET_INTERFACE (self);
#line 25 "screensaver-plugin.vala"
	if (_iface_->lock) {
#line 25 "screensaver-plugin.vala"
		_iface_->lock (self, _callback_, _user_data_);
#line 364 "screensaver-plugin.c"
	}
}

void
synapse_gnome_screen_saver_lock_finish (SynapseGnomeScreenSaver* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	SynapseGnomeScreenSaverIface* _iface_;
#line 25 "screensaver-plugin.vala"
	_iface_ = SYNAPSE_GNOME_SCREEN_SAVER_GET_INTERFACE (self);
#line 25 "screensaver-plugin.vala"
	if (_iface_->lock_finish) {
#line 25 "screensaver-plugin.vala"
		_iface_->lock_finish (self, _res_, error);
#line 380 "screensaver-plugin.c"
	}
}

static void
synapse_gnome_screen_saver_default_init (SynapseGnomeScreenSaverIface * iface,
                                         gpointer iface_data)
{
}

static GType
synapse_gnome_screen_saver_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseGnomeScreenSaverIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_gnome_screen_saver_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType synapse_gnome_screen_saver_type_id;
	synapse_gnome_screen_saver_type_id = g_type_register_static (G_TYPE_INTERFACE, "SynapseGnomeScreenSaver", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (synapse_gnome_screen_saver_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (synapse_gnome_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) synapse_gnome_screen_saver_proxy_get_type);
	g_type_set_qdata (synapse_gnome_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.gnome.ScreenSaver");
	g_type_set_qdata (synapse_gnome_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_synapse_gnome_screen_saver_dbus_interface_info));
	g_type_set_qdata (synapse_gnome_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) synapse_gnome_screen_saver_register_object);
	return synapse_gnome_screen_saver_type_id;
}

GType
synapse_gnome_screen_saver_get_type (void)
{
	static volatile gsize synapse_gnome_screen_saver_type_id__once = 0;
	if (g_once_init_enter (&synapse_gnome_screen_saver_type_id__once)) {
		GType synapse_gnome_screen_saver_type_id;
		synapse_gnome_screen_saver_type_id = synapse_gnome_screen_saver_get_type_once ();
		g_once_init_leave (&synapse_gnome_screen_saver_type_id__once, synapse_gnome_screen_saver_type_id);
	}
	return synapse_gnome_screen_saver_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SynapseGnomeScreenSaverProxy, synapse_gnome_screen_saver_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SYNAPSE_TYPE_GNOME_SCREEN_SAVER, synapse_gnome_screen_saver_proxy_synapse_gnome_screen_saver_interface_init) )
static void
synapse_gnome_screen_saver_proxy_class_init (SynapseGnomeScreenSaverProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = synapse_gnome_screen_saver_proxy_g_signal;
}

static void
synapse_gnome_screen_saver_proxy_g_signal (GDBusProxy* proxy,
                                           const gchar* sender_name,
                                           const gchar* signal_name,
                                           GVariant* parameters)
{
}

static void
synapse_gnome_screen_saver_proxy_init (SynapseGnomeScreenSaverProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_synapse_gnome_screen_saver_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
synapse_gnome_screen_saver_proxy_lock_async (SynapseGnomeScreenSaver* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.ScreenSaver", "Lock");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
synapse_gnome_screen_saver_proxy_lock_finish (SynapseGnomeScreenSaver* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	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
synapse_gnome_screen_saver_proxy_synapse_gnome_screen_saver_interface_init (SynapseGnomeScreenSaverIface* iface)
{
	iface->lock = synapse_gnome_screen_saver_proxy_lock_async;
	iface->lock_finish = synapse_gnome_screen_saver_proxy_lock_finish;
}

static void
_dbus_synapse_gnome_screen_saver_lock (SynapseGnomeScreenSaver* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SynapseGnomeScreenSaverLockReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SynapseGnomeScreenSaverLockReadyData);
	_ready_data->_invocation_ = invocation;
	synapse_gnome_screen_saver_lock (self, (GAsyncReadyCallback) _dbus_synapse_gnome_screen_saver_lock_ready, _ready_data);
}

static void
_dbus_synapse_gnome_screen_saver_lock_ready (GObject * source_object,
                                             GAsyncResult * _res_,
                                             gpointer _user_data_)
{
	SynapseGnomeScreenSaverLockReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	synapse_gnome_screen_saver_lock_finish ((SynapseGnomeScreenSaver*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_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_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);
	_error:
	g_slice_free (SynapseGnomeScreenSaverLockReadyData, _ready_data);
}

static void
synapse_gnome_screen_saver_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, "Lock") == 0) {
		_dbus_synapse_gnome_screen_saver_lock (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
synapse_gnome_screen_saver_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
synapse_gnome_screen_saver_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;
}

guint
synapse_gnome_screen_saver_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 *) (&_synapse_gnome_screen_saver_dbus_interface_info), &_synapse_gnome_screen_saver_dbus_interface_vtable, data, _synapse_gnome_screen_saver_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_synapse_gnome_screen_saver_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

void
synapse_mate_screen_saver_lock (SynapseMateScreenSaver* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	SynapseMateScreenSaverIface* _iface_;
#line 34 "screensaver-plugin.vala"
	_iface_ = SYNAPSE_MATE_SCREEN_SAVER_GET_INTERFACE (self);
#line 34 "screensaver-plugin.vala"
	if (_iface_->lock) {
#line 34 "screensaver-plugin.vala"
		_iface_->lock (self, _callback_, _user_data_);
#line 632 "screensaver-plugin.c"
	}
}

void
synapse_mate_screen_saver_lock_finish (SynapseMateScreenSaver* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	SynapseMateScreenSaverIface* _iface_;
#line 34 "screensaver-plugin.vala"
	_iface_ = SYNAPSE_MATE_SCREEN_SAVER_GET_INTERFACE (self);
#line 34 "screensaver-plugin.vala"
	if (_iface_->lock_finish) {
#line 34 "screensaver-plugin.vala"
		_iface_->lock_finish (self, _res_, error);
#line 648 "screensaver-plugin.c"
	}
}

static void
synapse_mate_screen_saver_default_init (SynapseMateScreenSaverIface * iface,
                                        gpointer iface_data)
{
}

static GType
synapse_mate_screen_saver_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseMateScreenSaverIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_mate_screen_saver_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType synapse_mate_screen_saver_type_id;
	synapse_mate_screen_saver_type_id = g_type_register_static (G_TYPE_INTERFACE, "SynapseMateScreenSaver", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (synapse_mate_screen_saver_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (synapse_mate_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) synapse_mate_screen_saver_proxy_get_type);
	g_type_set_qdata (synapse_mate_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.mate.ScreenSaver");
	g_type_set_qdata (synapse_mate_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_synapse_mate_screen_saver_dbus_interface_info));
	g_type_set_qdata (synapse_mate_screen_saver_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) synapse_mate_screen_saver_register_object);
	return synapse_mate_screen_saver_type_id;
}

GType
synapse_mate_screen_saver_get_type (void)
{
	static volatile gsize synapse_mate_screen_saver_type_id__once = 0;
	if (g_once_init_enter (&synapse_mate_screen_saver_type_id__once)) {
		GType synapse_mate_screen_saver_type_id;
		synapse_mate_screen_saver_type_id = synapse_mate_screen_saver_get_type_once ();
		g_once_init_leave (&synapse_mate_screen_saver_type_id__once, synapse_mate_screen_saver_type_id);
	}
	return synapse_mate_screen_saver_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SynapseMateScreenSaverProxy, synapse_mate_screen_saver_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SYNAPSE_TYPE_MATE_SCREEN_SAVER, synapse_mate_screen_saver_proxy_synapse_mate_screen_saver_interface_init) )
static void
synapse_mate_screen_saver_proxy_class_init (SynapseMateScreenSaverProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = synapse_mate_screen_saver_proxy_g_signal;
}

static void
synapse_mate_screen_saver_proxy_g_signal (GDBusProxy* proxy,
                                          const gchar* sender_name,
                                          const gchar* signal_name,
                                          GVariant* parameters)
{
}

static void
synapse_mate_screen_saver_proxy_init (SynapseMateScreenSaverProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_synapse_mate_screen_saver_dbus_interface_info));
}

static void
synapse_mate_screen_saver_proxy_lock_async (SynapseMateScreenSaver* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.mate.ScreenSaver", "Lock");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
synapse_mate_screen_saver_proxy_lock_finish (SynapseMateScreenSaver* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	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
synapse_mate_screen_saver_proxy_synapse_mate_screen_saver_interface_init (SynapseMateScreenSaverIface* iface)
{
	iface->lock = synapse_mate_screen_saver_proxy_lock_async;
	iface->lock_finish = synapse_mate_screen_saver_proxy_lock_finish;
}

static void
_dbus_synapse_mate_screen_saver_lock (SynapseMateScreenSaver* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SynapseMateScreenSaverLockReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SynapseMateScreenSaverLockReadyData);
	_ready_data->_invocation_ = invocation;
	synapse_mate_screen_saver_lock (self, (GAsyncReadyCallback) _dbus_synapse_mate_screen_saver_lock_ready, _ready_data);
}

static void
_dbus_synapse_mate_screen_saver_lock_ready (GObject * source_object,
                                            GAsyncResult * _res_,
                                            gpointer _user_data_)
{
	SynapseMateScreenSaverLockReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	synapse_mate_screen_saver_lock_finish ((SynapseMateScreenSaver*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_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_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);
	_error:
	g_slice_free (SynapseMateScreenSaverLockReadyData, _ready_data);
}

static void
synapse_mate_screen_saver_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, "Lock") == 0) {
		_dbus_synapse_mate_screen_saver_lock (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
synapse_mate_screen_saver_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
synapse_mate_screen_saver_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;
}

guint
synapse_mate_screen_saver_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 *) (&_synapse_mate_screen_saver_dbus_interface_info), &_synapse_mate_screen_saver_dbus_interface_vtable, data, _synapse_mate_screen_saver_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_synapse_mate_screen_saver_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
synapse_screen_saver_plugin_get_instance_private (SynapseScreenSaverPlugin* self)
{
	return G_STRUCT_MEMBER_P (self, SynapseScreenSaverPlugin_private_offset);
}

static void
synapse_screen_saver_plugin_real_activate (SynapseActivatable* base)
{
	SynapseScreenSaverPlugin * self;
#line 46 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPlugin*) base;
#line 891 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_real_deactivate (SynapseActivatable* base)
{
	SynapseScreenSaverPlugin * self;
#line 51 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPlugin*) base;
#line 900 "screensaver-plugin.c"
}

void
synapse_screen_saver_plugin_lock_screen (void)
{
	SynapseDesktopFileService* _tmp0_;
	SynapseDesktopFileService* _tmp1_;
	SynapseDesktopEnvironmentType _tmp2_;
#line 73 "screensaver-plugin.vala"
	_tmp0_ = synapse_desktop_file_service_get_default ();
#line 73 "screensaver-plugin.vala"
	_tmp1_ = _tmp0_;
#line 73 "screensaver-plugin.vala"
	_tmp2_ = synapse_desktop_file_service_get_environment (_tmp1_);
#line 73 "screensaver-plugin.vala"
	_g_object_unref0 (_tmp1_);
#line 73 "screensaver-plugin.vala"
	switch (_tmp2_) {
#line 73 "screensaver-plugin.vala"
		case SYNAPSE_DESKTOP_ENVIRONMENT_TYPE_MATE:
#line 921 "screensaver-plugin.c"
		{
#line 76 "screensaver-plugin.vala"
			synapse_screen_saver_plugin_mate_lock_screen ();
#line 77 "screensaver-plugin.vala"
			break;
#line 927 "screensaver-plugin.c"
		}
		default:
#line 73 "screensaver-plugin.vala"
		case SYNAPSE_DESKTOP_ENVIRONMENT_TYPE_GNOME:
#line 932 "screensaver-plugin.c"
		{
#line 80 "screensaver-plugin.vala"
			synapse_screen_saver_plugin_gnome_lock_screen ();
#line 81 "screensaver-plugin.vala"
			break;
#line 938 "screensaver-plugin.c"
		}
	}
}

static void
synapse_screen_saver_plugin_gnome_lock_screen (void)
{
	GError* _inner_error0_ = NULL;
	{
		SynapseGnomeScreenSaver* dbus_interface = NULL;
		SynapseGnomeScreenSaver* _tmp0_;
#line 88 "screensaver-plugin.vala"
		_tmp0_ = (SynapseGnomeScreenSaver*) g_initable_new (SYNAPSE_TYPE_GNOME_SCREEN_SAVER_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", SYNAPSE_GNOME_SCREEN_SAVER_UNIQUE_NAME, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", SYNAPSE_GNOME_SCREEN_SAVER_OBJECT_PATH, "g-interface-name", "org.gnome.ScreenSaver", NULL);
#line 88 "screensaver-plugin.vala"
		dbus_interface = (SynapseGnomeScreenSaver*) _tmp0_;
#line 88 "screensaver-plugin.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 956 "screensaver-plugin.c"
			goto __catch0_g_error;
		}
#line 92 "screensaver-plugin.vala"
		synapse_gnome_screen_saver_lock (dbus_interface, NULL, NULL);
#line 87 "screensaver-plugin.vala"
		_g_object_unref0 (dbus_interface);
#line 963 "screensaver-plugin.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
#line 87 "screensaver-plugin.vala"
		err = _inner_error0_;
#line 87 "screensaver-plugin.vala"
		_inner_error0_ = NULL;
#line 94 "screensaver-plugin.vala"
		_tmp1_ = err;
#line 94 "screensaver-plugin.vala"
		_tmp2_ = _tmp1_->message;
#line 94 "screensaver-plugin.vala"
		g_warning ("screensaver-plugin.vala:94: %s", _tmp2_);
#line 87 "screensaver-plugin.vala"
		_g_error_free0 (err);
#line 983 "screensaver-plugin.c"
	}
	__finally0:
#line 87 "screensaver-plugin.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 87 "screensaver-plugin.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 87 "screensaver-plugin.vala"
		g_clear_error (&_inner_error0_);
#line 87 "screensaver-plugin.vala"
		return;
#line 994 "screensaver-plugin.c"
	}
}

static void
synapse_screen_saver_plugin_mate_lock_screen (void)
{
	GError* _inner_error0_ = NULL;
	{
		SynapseMateScreenSaver* dbus_interface = NULL;
		SynapseMateScreenSaver* _tmp0_;
#line 101 "screensaver-plugin.vala"
		_tmp0_ = (SynapseMateScreenSaver*) g_initable_new (SYNAPSE_TYPE_MATE_SCREEN_SAVER_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", SYNAPSE_MATE_SCREEN_SAVER_UNIQUE_NAME, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", SYNAPSE_MATE_SCREEN_SAVER_OBJECT_PATH, "g-interface-name", "org.mate.ScreenSaver", NULL);
#line 101 "screensaver-plugin.vala"
		dbus_interface = (SynapseMateScreenSaver*) _tmp0_;
#line 101 "screensaver-plugin.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 1011 "screensaver-plugin.c"
			goto __catch0_g_error;
		}
#line 105 "screensaver-plugin.vala"
		synapse_mate_screen_saver_lock (dbus_interface, NULL, NULL);
#line 100 "screensaver-plugin.vala"
		_g_object_unref0 (dbus_interface);
#line 1018 "screensaver-plugin.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
#line 100 "screensaver-plugin.vala"
		err = _inner_error0_;
#line 100 "screensaver-plugin.vala"
		_inner_error0_ = NULL;
#line 107 "screensaver-plugin.vala"
		_tmp1_ = err;
#line 107 "screensaver-plugin.vala"
		_tmp2_ = _tmp1_->message;
#line 107 "screensaver-plugin.vala"
		g_warning ("screensaver-plugin.vala:107: %s", _tmp2_);
#line 100 "screensaver-plugin.vala"
		_g_error_free0 (err);
#line 1038 "screensaver-plugin.c"
	}
	__finally0:
#line 100 "screensaver-plugin.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 100 "screensaver-plugin.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 100 "screensaver-plugin.vala"
		g_clear_error (&_inner_error0_);
#line 100 "screensaver-plugin.vala"
		return;
#line 1049 "screensaver-plugin.c"
	}
}

static void
_synapse_screen_saver_plugin_register_plugin_synapse_plugin_register_func (void)
{
#line 125 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_register_plugin ();
#line 1058 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_register_plugin (void)
{
	gboolean is_supported = FALSE;
	SynapseDesktopFileService* _tmp0_;
	SynapseDesktopFileService* _tmp1_;
	SynapseDesktopEnvironmentType _tmp2_;
	gboolean _tmp7_ = FALSE;
	SynapsePluginRegistry* _tmp10_;
	SynapsePluginRegistry* _tmp11_;
#line 113 "screensaver-plugin.vala"
	is_supported = FALSE;
#line 115 "screensaver-plugin.vala"
	_tmp0_ = synapse_desktop_file_service_get_default ();
#line 115 "screensaver-plugin.vala"
	_tmp1_ = _tmp0_;
#line 115 "screensaver-plugin.vala"
	_tmp2_ = synapse_desktop_file_service_get_environment (_tmp1_);
#line 115 "screensaver-plugin.vala"
	_g_object_unref0 (_tmp1_);
#line 115 "screensaver-plugin.vala"
	switch (_tmp2_) {
#line 115 "screensaver-plugin.vala"
		case SYNAPSE_DESKTOP_ENVIRONMENT_TYPE_MATE:
#line 1085 "screensaver-plugin.c"
		{
			SynapseDBusService* _tmp3_;
			SynapseDBusService* _tmp4_;
#line 118 "screensaver-plugin.vala"
			_tmp3_ = synapse_dbus_service_get_default ();
#line 118 "screensaver-plugin.vala"
			_tmp4_ = _tmp3_;
#line 118 "screensaver-plugin.vala"
			is_supported = synapse_dbus_service_name_is_activatable (_tmp4_, SYNAPSE_MATE_SCREEN_SAVER_UNIQUE_NAME);
#line 118 "screensaver-plugin.vala"
			_g_object_unref0 (_tmp4_);
#line 119 "screensaver-plugin.vala"
			break;
#line 1099 "screensaver-plugin.c"
		}
#line 115 "screensaver-plugin.vala"
		case SYNAPSE_DESKTOP_ENVIRONMENT_TYPE_GNOME:
#line 1103 "screensaver-plugin.c"
		{
			SynapseDBusService* _tmp5_;
			SynapseDBusService* _tmp6_;
#line 121 "screensaver-plugin.vala"
			_tmp5_ = synapse_dbus_service_get_default ();
#line 121 "screensaver-plugin.vala"
			_tmp6_ = _tmp5_;
#line 121 "screensaver-plugin.vala"
			is_supported = synapse_dbus_service_name_is_activatable (_tmp6_, SYNAPSE_GNOME_SCREEN_SAVER_UNIQUE_NAME);
#line 121 "screensaver-plugin.vala"
			_g_object_unref0 (_tmp6_);
#line 122 "screensaver-plugin.vala"
			break;
#line 1117 "screensaver-plugin.c"
		}
		default:
#line 115 "screensaver-plugin.vala"
		break;
#line 1122 "screensaver-plugin.c"
	}
#line 131 "screensaver-plugin.vala"
	if (is_supported) {
#line 131 "screensaver-plugin.vala"
		_tmp7_ = TRUE;
#line 1128 "screensaver-plugin.c"
	} else {
		SynapseDBusService* _tmp8_;
		SynapseDBusService* _tmp9_;
#line 131 "screensaver-plugin.vala"
		_tmp8_ = synapse_dbus_service_get_default ();
#line 131 "screensaver-plugin.vala"
		_tmp9_ = _tmp8_;
#line 131 "screensaver-plugin.vala"
		_tmp7_ = synapse_dbus_service_name_is_activatable (_tmp9_, SYNAPSE_GNOME_SCREEN_SAVER_UNIQUE_NAME);
#line 131 "screensaver-plugin.vala"
		_g_object_unref0 (_tmp9_);
#line 1140 "screensaver-plugin.c"
	}
#line 125 "screensaver-plugin.vala"
	_tmp10_ = synapse_plugin_registry_get_default ();
#line 125 "screensaver-plugin.vala"
	_tmp11_ = _tmp10_;
#line 125 "screensaver-plugin.vala"
	synapse_plugin_registry_register_plugin (_tmp11_, SYNAPSE_TYPE_SCREEN_SAVER_PLUGIN, "Screensaver plugin", _ ("Lock screen of your computer."), "system-lock-screen", _synapse_screen_saver_plugin_register_plugin_synapse_plugin_register_func, _tmp7_, _ ("Screensaver wasn't found"));
#line 125 "screensaver-plugin.vala"
	_g_object_unref0 (_tmp11_);
#line 1150 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_real_search_data_free (gpointer _data)
{
	SynapseScreenSaverPluginSearchData* _data_;
	_data_ = _data;
#line 42 "screensaver-plugin.vala"
	synapse_query_destroy (&_data_->q);
#line 42 "screensaver-plugin.vala"
	_g_object_unref0 (_data_->result);
#line 42 "screensaver-plugin.vala"
	_g_object_unref0 (_data_->self);
#line 42 "screensaver-plugin.vala"
	g_slice_free (SynapseScreenSaverPluginSearchData, _data_);
#line 1166 "screensaver-plugin.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 42 "screensaver-plugin.vala"
	return self ? g_object_ref (self) : NULL;
#line 1174 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_real_search (SynapseItemProvider* base,
                                         SynapseQuery* q,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	SynapseScreenSaverPlugin * self;
	SynapseScreenSaverPluginSearchData* _data_;
	SynapseScreenSaverPlugin* _tmp0_;
	SynapseQuery _tmp1_;
	SynapseQuery _tmp2_;
	SynapseQuery _tmp3_ = {0};
#line 42 "screensaver-plugin.vala"
	g_return_if_fail (q != NULL);
#line 42 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPlugin*) base;
#line 42 "screensaver-plugin.vala"
	_data_ = g_slice_new0 (SynapseScreenSaverPluginSearchData);
#line 42 "screensaver-plugin.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 42 "screensaver-plugin.vala"
	g_task_set_task_data (_data_->_async_result, _data_, synapse_screen_saver_plugin_real_search_data_free);
#line 42 "screensaver-plugin.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 42 "screensaver-plugin.vala"
	_data_->self = _tmp0_;
#line 42 "screensaver-plugin.vala"
	_tmp1_ = *q;
#line 42 "screensaver-plugin.vala"
	_tmp2_ = _tmp1_;
#line 42 "screensaver-plugin.vala"
	synapse_query_copy (&_tmp2_, &_tmp3_);
#line 42 "screensaver-plugin.vala"
	synapse_query_destroy (&_data_->q);
#line 42 "screensaver-plugin.vala"
	_data_->q = _tmp3_;
#line 42 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_real_search_co (_data_);
#line 1215 "screensaver-plugin.c"
}

static SynapseResultSet*
synapse_screen_saver_plugin_search_finish (SynapseItemProvider* base,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	SynapseResultSet* result;
	SynapseScreenSaverPluginSearchData* _data_;
#line 42 "screensaver-plugin.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 42 "screensaver-plugin.vala"
	if (NULL == _data_) {
#line 42 "screensaver-plugin.vala"
		return NULL;
#line 1231 "screensaver-plugin.c"
	}
#line 42 "screensaver-plugin.vala"
	result = _data_->result;
#line 42 "screensaver-plugin.vala"
	_data_->result = NULL;
#line 42 "screensaver-plugin.vala"
	return result;
#line 1239 "screensaver-plugin.c"
}

static gboolean
synapse_screen_saver_plugin_real_search_co (SynapseScreenSaverPluginSearchData* _data_)
{
#line 149 "screensaver-plugin.vala"
	switch (_data_->_state_) {
#line 149 "screensaver-plugin.vala"
		case 0:
#line 1249 "screensaver-plugin.c"
		goto _state_0;
		default:
#line 149 "screensaver-plugin.vala"
		g_assert_not_reached ();
#line 1254 "screensaver-plugin.c"
	}
	_state_0:
#line 152 "screensaver-plugin.vala"
	_data_->_tmp0_ = _data_->q;
#line 152 "screensaver-plugin.vala"
	if (!((_data_->_tmp0_.query_type & SYNAPSE_QUERY_FLAGS_ACTIONS) == SYNAPSE_QUERY_FLAGS_ACTIONS)) {
#line 152 "screensaver-plugin.vala"
		_data_->result = NULL;
#line 152 "screensaver-plugin.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 152 "screensaver-plugin.vala"
		if (_data_->_state_ != 0) {
#line 152 "screensaver-plugin.vala"
			while (!g_task_get_completed (_data_->_async_result)) {
#line 152 "screensaver-plugin.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1271 "screensaver-plugin.c"
			}
		}
#line 152 "screensaver-plugin.vala"
		g_object_unref (_data_->_async_result);
#line 152 "screensaver-plugin.vala"
		return FALSE;
#line 1278 "screensaver-plugin.c"
	}
#line 154 "screensaver-plugin.vala"
	_data_->_tmp1_ = synapse_result_set_new ();
#line 154 "screensaver-plugin.vala"
	_data_->_result_ = _data_->_tmp1_;
#line 156 "screensaver-plugin.vala"
	_data_->_tmp2_ = _data_->q;
#line 156 "screensaver-plugin.vala"
	_data_->_tmp3_ = _data_->_tmp2_.query_string;
#line 156 "screensaver-plugin.vala"
	_data_->_tmp4_ = synapse_query_get_matchers_for_query (_data_->_tmp3_, 0, G_REGEX_OPTIMIZE | G_REGEX_CASELESS);
#line 156 "screensaver-plugin.vala"
	_data_->matchers = _data_->_tmp4_;
#line 1292 "screensaver-plugin.c"
	{
#line 159 "screensaver-plugin.vala"
		_data_->_tmp5_ = _data_->self->priv->actions;
#line 159 "screensaver-plugin.vala"
		_data_->_action_list = _data_->_tmp5_;
#line 159 "screensaver-plugin.vala"
		_data_->_tmp6_ = _data_->_action_list;
#line 159 "screensaver-plugin.vala"
		_data_->_tmp7_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp6_);
#line 159 "screensaver-plugin.vala"
		_data_->_tmp8_ = _data_->_tmp7_;
#line 159 "screensaver-plugin.vala"
		_data_->_action_size = _data_->_tmp8_;
#line 159 "screensaver-plugin.vala"
		_data_->_action_index = -1;
#line 159 "screensaver-plugin.vala"
		while (TRUE) {
#line 159 "screensaver-plugin.vala"
			_data_->_action_index = _data_->_action_index + 1;
#line 159 "screensaver-plugin.vala"
			_data_->_tmp9_ = _data_->_action_index;
#line 159 "screensaver-plugin.vala"
			_data_->_tmp10_ = _data_->_action_size;
#line 159 "screensaver-plugin.vala"
			if (!(_data_->_tmp9_ < _data_->_tmp10_)) {
#line 159 "screensaver-plugin.vala"
				break;
#line 1320 "screensaver-plugin.c"
			}
#line 159 "screensaver-plugin.vala"
			_data_->_tmp11_ = _data_->_action_list;
#line 159 "screensaver-plugin.vala"
			_data_->_tmp12_ = gee_list_get (_data_->_tmp11_, _data_->_action_index);
#line 159 "screensaver-plugin.vala"
			_data_->action = (SynapseMatch*) _data_->_tmp12_;
#line 1328 "screensaver-plugin.c"
			{
#line 161 "screensaver-plugin.vala"
				_data_->_tmp13_ = _data_->matchers;
#line 161 "screensaver-plugin.vala"
				_data_->_matcher_list = _data_->_tmp13_;
#line 161 "screensaver-plugin.vala"
				_data_->_tmp14_ = _data_->_matcher_list;
#line 161 "screensaver-plugin.vala"
				_data_->_tmp15_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp14_);
#line 161 "screensaver-plugin.vala"
				_data_->_tmp16_ = _data_->_tmp15_;
#line 161 "screensaver-plugin.vala"
				_data_->_matcher_size = _data_->_tmp16_;
#line 161 "screensaver-plugin.vala"
				_data_->_matcher_index = -1;
#line 161 "screensaver-plugin.vala"
				while (TRUE) {
#line 161 "screensaver-plugin.vala"
					_data_->_matcher_index = _data_->_matcher_index + 1;
#line 161 "screensaver-plugin.vala"
					_data_->_tmp17_ = _data_->_matcher_index;
#line 161 "screensaver-plugin.vala"
					_data_->_tmp18_ = _data_->_matcher_size;
#line 161 "screensaver-plugin.vala"
					if (!(_data_->_tmp17_ < _data_->_tmp18_)) {
#line 161 "screensaver-plugin.vala"
						break;
#line 1356 "screensaver-plugin.c"
					}
#line 161 "screensaver-plugin.vala"
					_data_->_tmp19_ = _data_->_matcher_list;
#line 161 "screensaver-plugin.vala"
					_data_->_tmp20_ = gee_list_get (_data_->_tmp19_, _data_->_matcher_index);
#line 161 "screensaver-plugin.vala"
					_data_->matcher = (GeeMapEntry*) _data_->_tmp20_;
#line 163 "screensaver-plugin.vala"
					_data_->_tmp21_ = _data_->matcher;
#line 163 "screensaver-plugin.vala"
					_data_->_tmp22_ = gee_map_entry_get_key (_data_->_tmp21_);
#line 163 "screensaver-plugin.vala"
					_data_->_tmp23_ = _data_->_tmp22_;
#line 163 "screensaver-plugin.vala"
					_data_->_tmp24_ = _data_->action;
#line 163 "screensaver-plugin.vala"
					_data_->_tmp25_ = synapse_match_get_title (_data_->_tmp24_);
#line 163 "screensaver-plugin.vala"
					_data_->_tmp26_ = _data_->_tmp25_;
#line 163 "screensaver-plugin.vala"
					if (g_regex_match ((GRegex*) _data_->_tmp23_, _data_->_tmp26_, 0, NULL)) {
#line 165 "screensaver-plugin.vala"
						_data_->_tmp27_ = _data_->_result_;
#line 165 "screensaver-plugin.vala"
						_data_->_tmp28_ = _data_->action;
#line 165 "screensaver-plugin.vala"
						_data_->_tmp29_ = _data_->matcher;
#line 165 "screensaver-plugin.vala"
						_data_->_tmp30_ = gee_map_entry_get_value (_data_->_tmp29_);
#line 165 "screensaver-plugin.vala"
						_data_->_tmp31_ = _data_->_tmp30_;
#line 165 "screensaver-plugin.vala"
						synapse_result_set_add (_data_->_tmp27_, _data_->_tmp28_, ((gint) ((gintptr) _data_->_tmp31_)) - SYNAPSE_MATCH_SCORE_INCREMENT_SMALL);
#line 166 "screensaver-plugin.vala"
						_g_object_unref0 (_data_->matcher);
#line 166 "screensaver-plugin.vala"
						break;
#line 1394 "screensaver-plugin.c"
					}
#line 161 "screensaver-plugin.vala"
					_g_object_unref0 (_data_->matcher);
#line 1398 "screensaver-plugin.c"
				}
			}
#line 159 "screensaver-plugin.vala"
			_g_object_unref0 (_data_->action);
#line 1403 "screensaver-plugin.c"
		}
	}
#line 171 "screensaver-plugin.vala"
	synapse_query_check_cancellable (&_data_->q, &_data_->_inner_error0_);
#line 171 "screensaver-plugin.vala"
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 171 "screensaver-plugin.vala"
		if (_data_->_inner_error0_->domain == SYNAPSE_SEARCH_ERROR) {
#line 171 "screensaver-plugin.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
#line 171 "screensaver-plugin.vala"
			_g_object_unref0 (_data_->matchers);
#line 171 "screensaver-plugin.vala"
			_g_object_unref0 (_data_->_result_);
#line 171 "screensaver-plugin.vala"
			g_object_unref (_data_->_async_result);
#line 171 "screensaver-plugin.vala"
			return FALSE;
#line 1422 "screensaver-plugin.c"
		} else {
#line 171 "screensaver-plugin.vala"
			_g_object_unref0 (_data_->matchers);
#line 171 "screensaver-plugin.vala"
			_g_object_unref0 (_data_->_result_);
#line 171 "screensaver-plugin.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
#line 171 "screensaver-plugin.vala"
			g_clear_error (&_data_->_inner_error0_);
#line 171 "screensaver-plugin.vala"
			g_object_unref (_data_->_async_result);
#line 171 "screensaver-plugin.vala"
			return FALSE;
#line 1436 "screensaver-plugin.c"
		}
	}
#line 173 "screensaver-plugin.vala"
	_data_->result = _data_->_result_;
#line 173 "screensaver-plugin.vala"
	_g_object_unref0 (_data_->matchers);
#line 173 "screensaver-plugin.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 173 "screensaver-plugin.vala"
	if (_data_->_state_ != 0) {
#line 173 "screensaver-plugin.vala"
		while (!g_task_get_completed (_data_->_async_result)) {
#line 173 "screensaver-plugin.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1451 "screensaver-plugin.c"
		}
	}
#line 173 "screensaver-plugin.vala"
	g_object_unref (_data_->_async_result);
#line 173 "screensaver-plugin.vala"
	return FALSE;
#line 1458 "screensaver-plugin.c"
}

SynapseScreenSaverPlugin*
synapse_screen_saver_plugin_construct (GType object_type)
{
	SynapseScreenSaverPlugin * self = NULL;
#line 42 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPlugin*) g_object_new (object_type, NULL);
#line 42 "screensaver-plugin.vala"
	return self;
#line 1469 "screensaver-plugin.c"
}

SynapseScreenSaverPlugin*
synapse_screen_saver_plugin_new (void)
{
#line 42 "screensaver-plugin.vala"
	return synapse_screen_saver_plugin_construct (SYNAPSE_TYPE_SCREEN_SAVER_PLUGIN);
#line 1477 "screensaver-plugin.c"
}

static gboolean
synapse_screen_saver_plugin_real_get_enabled (SynapseActivatable* base)
{
	gboolean result;
	SynapseScreenSaverPlugin* self;
#line 44 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPlugin*) base;
#line 44 "screensaver-plugin.vala"
	result = self->priv->_enabled;
#line 44 "screensaver-plugin.vala"
	return result;
#line 1491 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_real_set_enabled (SynapseActivatable* base,
                                              gboolean value)
{
	SynapseScreenSaverPlugin* self;
	gboolean old_value;
#line 44 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPlugin*) base;
#line 44 "screensaver-plugin.vala"
	old_value = synapse_screen_saver_plugin_real_get_enabled (base);
#line 44 "screensaver-plugin.vala"
	if (old_value != value) {
#line 44 "screensaver-plugin.vala"
		self->priv->_enabled = value;
#line 44 "screensaver-plugin.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_screen_saver_plugin_properties[SYNAPSE_SCREEN_SAVER_PLUGIN_ENABLED_PROPERTY]);
#line 1510 "screensaver-plugin.c"
	}
}

static SynapseScreenSaverPluginLockScreenAction*
synapse_screen_saver_plugin_lock_screen_action_construct (GType object_type)
{
	SynapseScreenSaverPluginLockScreenAction * self = NULL;
#line 60 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPluginLockScreenAction*) g_object_new (object_type, "title", _ ("Lock Screen"), "description", _ ("Locks screen and starts screensaver."), "icon-name", "system-lock-screen", "has-thumbnail", FALSE, NULL);
#line 58 "screensaver-plugin.vala"
	return self;
#line 1522 "screensaver-plugin.c"
}

static SynapseScreenSaverPluginLockScreenAction*
synapse_screen_saver_plugin_lock_screen_action_new (void)
{
#line 58 "screensaver-plugin.vala"
	return synapse_screen_saver_plugin_lock_screen_action_construct (SYNAPSE_SCREEN_SAVER_PLUGIN_TYPE_LOCK_SCREEN_ACTION);
#line 1530 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_lock_screen_action_real_do_action (SynapseActionMatch* base)
{
	SynapseScreenSaverPluginLockScreenAction * self;
#line 65 "screensaver-plugin.vala"
	self = (SynapseScreenSaverPluginLockScreenAction*) base;
#line 67 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_lock_screen ();
#line 1541 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_lock_screen_action_class_init (SynapseScreenSaverPluginLockScreenActionClass * klass,
                                                           gpointer klass_data)
{
#line 56 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_lock_screen_action_parent_class = g_type_class_peek_parent (klass);
#line 56 "screensaver-plugin.vala"
	((SynapseActionMatchClass *) klass)->do_action = (void (*) (SynapseActionMatch*)) synapse_screen_saver_plugin_lock_screen_action_real_do_action;
#line 1552 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_lock_screen_action_instance_init (SynapseScreenSaverPluginLockScreenAction * self,
                                                              gpointer klass)
{
}

static GType
synapse_screen_saver_plugin_lock_screen_action_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseScreenSaverPluginLockScreenActionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_screen_saver_plugin_lock_screen_action_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseScreenSaverPluginLockScreenAction), 0, (GInstanceInitFunc) synapse_screen_saver_plugin_lock_screen_action_instance_init, NULL };
	GType synapse_screen_saver_plugin_lock_screen_action_type_id;
	synapse_screen_saver_plugin_lock_screen_action_type_id = g_type_register_static (SYNAPSE_TYPE_ACTION_MATCH, "SynapseScreenSaverPluginLockScreenAction", &g_define_type_info, 0);
	return synapse_screen_saver_plugin_lock_screen_action_type_id;
}

static GType
synapse_screen_saver_plugin_lock_screen_action_get_type (void)
{
	static volatile gsize synapse_screen_saver_plugin_lock_screen_action_type_id__once = 0;
	if (g_once_init_enter (&synapse_screen_saver_plugin_lock_screen_action_type_id__once)) {
		GType synapse_screen_saver_plugin_lock_screen_action_type_id;
		synapse_screen_saver_plugin_lock_screen_action_type_id = synapse_screen_saver_plugin_lock_screen_action_get_type_once ();
		g_once_init_leave (&synapse_screen_saver_plugin_lock_screen_action_type_id__once, synapse_screen_saver_plugin_lock_screen_action_type_id);
	}
	return synapse_screen_saver_plugin_lock_screen_action_type_id__once;
}

static GObject *
synapse_screen_saver_plugin_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SynapseScreenSaverPlugin * self;
	GeeLinkedList* _tmp0_;
	GeeList* _tmp1_;
	SynapseScreenSaverPluginLockScreenAction* _tmp2_;
	SynapseScreenSaverPluginLockScreenAction* _tmp3_;
#line 143 "screensaver-plugin.vala"
	parent_class = G_OBJECT_CLASS (synapse_screen_saver_plugin_parent_class);
#line 143 "screensaver-plugin.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 143 "screensaver-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_SCREEN_SAVER_PLUGIN, SynapseScreenSaverPlugin);
#line 145 "screensaver-plugin.vala"
	_tmp0_ = gee_linked_list_new (SYNAPSE_TYPE_MATCH, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 145 "screensaver-plugin.vala"
	_g_object_unref0 (self->priv->actions);
#line 145 "screensaver-plugin.vala"
	self->priv->actions = (GeeList*) _tmp0_;
#line 146 "screensaver-plugin.vala"
	_tmp1_ = self->priv->actions;
#line 146 "screensaver-plugin.vala"
	_tmp2_ = synapse_screen_saver_plugin_lock_screen_action_new ();
#line 146 "screensaver-plugin.vala"
	_tmp3_ = _tmp2_;
#line 146 "screensaver-plugin.vala"
	gee_collection_add ((GeeCollection*) _tmp1_, (SynapseMatch*) _tmp3_);
#line 146 "screensaver-plugin.vala"
	_g_object_unref0 (_tmp3_);
#line 143 "screensaver-plugin.vala"
	return obj;
#line 1618 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_class_init (SynapseScreenSaverPluginClass * klass,
                                        gpointer klass_data)
{
#line 42 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_parent_class = g_type_class_peek_parent (klass);
#line 42 "screensaver-plugin.vala"
	g_type_class_adjust_private_offset (klass, &SynapseScreenSaverPlugin_private_offset);
#line 42 "screensaver-plugin.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_synapse_screen_saver_plugin_get_property;
#line 42 "screensaver-plugin.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_synapse_screen_saver_plugin_set_property;
#line 42 "screensaver-plugin.vala"
	G_OBJECT_CLASS (klass)->constructor = synapse_screen_saver_plugin_constructor;
#line 42 "screensaver-plugin.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_screen_saver_plugin_finalize;
#line 42 "screensaver-plugin.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_SCREEN_SAVER_PLUGIN_ENABLED_PROPERTY, synapse_screen_saver_plugin_properties[SYNAPSE_SCREEN_SAVER_PLUGIN_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 138 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_register_plugin ();
#line 1641 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_synapse_activatable_interface_init (SynapseActivatableIface * iface,
                                                                gpointer iface_data)
{
#line 42 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_synapse_activatable_parent_iface = g_type_interface_peek_parent (iface);
#line 42 "screensaver-plugin.vala"
	iface->activate = (void (*) (SynapseActivatable*)) synapse_screen_saver_plugin_real_activate;
#line 42 "screensaver-plugin.vala"
	iface->deactivate = (void (*) (SynapseActivatable*)) synapse_screen_saver_plugin_real_deactivate;
#line 42 "screensaver-plugin.vala"
	iface->get_enabled = synapse_screen_saver_plugin_real_get_enabled;
#line 42 "screensaver-plugin.vala"
	iface->set_enabled = synapse_screen_saver_plugin_real_set_enabled;
#line 1658 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_synapse_item_provider_interface_init (SynapseItemProviderIface * iface,
                                                                  gpointer iface_data)
{
#line 42 "screensaver-plugin.vala"
	synapse_screen_saver_plugin_synapse_item_provider_parent_iface = g_type_interface_peek_parent (iface);
#line 42 "screensaver-plugin.vala"
	iface->search = (void (*) (SynapseItemProvider*, SynapseQuery*, GAsyncReadyCallback, gpointer)) synapse_screen_saver_plugin_real_search;
#line 42 "screensaver-plugin.vala"
	iface->search_finish = (SynapseResultSet* (*) (SynapseItemProvider*, GAsyncResult*, GError**)) synapse_screen_saver_plugin_search_finish;
#line 1671 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_instance_init (SynapseScreenSaverPlugin * self,
                                           gpointer klass)
{
#line 42 "screensaver-plugin.vala"
	self->priv = synapse_screen_saver_plugin_get_instance_private (self);
#line 44 "screensaver-plugin.vala"
	self->priv->_enabled = TRUE;
#line 1682 "screensaver-plugin.c"
}

static void
synapse_screen_saver_plugin_finalize (GObject * obj)
{
	SynapseScreenSaverPlugin * self;
#line 42 "screensaver-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_SCREEN_SAVER_PLUGIN, SynapseScreenSaverPlugin);
#line 141 "screensaver-plugin.vala"
	_g_object_unref0 (self->priv->actions);
#line 42 "screensaver-plugin.vala"
	G_OBJECT_CLASS (synapse_screen_saver_plugin_parent_class)->finalize (obj);
#line 1695 "screensaver-plugin.c"
}

static GType
synapse_screen_saver_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseScreenSaverPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_screen_saver_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseScreenSaverPlugin), 0, (GInstanceInitFunc) synapse_screen_saver_plugin_instance_init, NULL };
	static const GInterfaceInfo synapse_activatable_info = { (GInterfaceInitFunc) synapse_screen_saver_plugin_synapse_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo synapse_item_provider_info = { (GInterfaceInitFunc) synapse_screen_saver_plugin_synapse_item_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType synapse_screen_saver_plugin_type_id;
	synapse_screen_saver_plugin_type_id = g_type_register_static (G_TYPE_OBJECT, "SynapseScreenSaverPlugin", &g_define_type_info, 0);
	g_type_add_interface_static (synapse_screen_saver_plugin_type_id, SYNAPSE_TYPE_ACTIVATABLE, &synapse_activatable_info);
	g_type_add_interface_static (synapse_screen_saver_plugin_type_id, SYNAPSE_TYPE_ITEM_PROVIDER, &synapse_item_provider_info);
	SynapseScreenSaverPlugin_private_offset = g_type_add_instance_private (synapse_screen_saver_plugin_type_id, sizeof (SynapseScreenSaverPluginPrivate));
	return synapse_screen_saver_plugin_type_id;
}

GType
synapse_screen_saver_plugin_get_type (void)
{
	static volatile gsize synapse_screen_saver_plugin_type_id__once = 0;
	if (g_once_init_enter (&synapse_screen_saver_plugin_type_id__once)) {
		GType synapse_screen_saver_plugin_type_id;
		synapse_screen_saver_plugin_type_id = synapse_screen_saver_plugin_get_type_once ();
		g_once_init_leave (&synapse_screen_saver_plugin_type_id__once, synapse_screen_saver_plugin_type_id);
	}
	return synapse_screen_saver_plugin_type_id__once;
}

static void
_vala_synapse_screen_saver_plugin_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	SynapseScreenSaverPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_SCREEN_SAVER_PLUGIN, SynapseScreenSaverPlugin);
#line 42 "screensaver-plugin.vala"
	switch (property_id) {
#line 42 "screensaver-plugin.vala"
		case SYNAPSE_SCREEN_SAVER_PLUGIN_ENABLED_PROPERTY:
#line 42 "screensaver-plugin.vala"
		g_value_set_boolean (value, synapse_activatable_get_enabled ((SynapseActivatable*) self));
#line 42 "screensaver-plugin.vala"
		break;
#line 1740 "screensaver-plugin.c"
		default:
#line 42 "screensaver-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 42 "screensaver-plugin.vala"
		break;
#line 1746 "screensaver-plugin.c"
	}
}

static void
_vala_synapse_screen_saver_plugin_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	SynapseScreenSaverPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_SCREEN_SAVER_PLUGIN, SynapseScreenSaverPlugin);
#line 42 "screensaver-plugin.vala"
	switch (property_id) {
#line 42 "screensaver-plugin.vala"
		case SYNAPSE_SCREEN_SAVER_PLUGIN_ENABLED_PROPERTY:
#line 42 "screensaver-plugin.vala"
		synapse_activatable_set_enabled ((SynapseActivatable*) self, g_value_get_boolean (value));
#line 42 "screensaver-plugin.vala"
		break;
#line 1766 "screensaver-plugin.c"
		default:
#line 42 "screensaver-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 42 "screensaver-plugin.vala"
		break;
#line 1772 "screensaver-plugin.c"
	}
}

