/* screen-saver-provider.c generated by valac 0.56.19, the Vala compiler
 * generated from screen-saver-provider.vala, do not modify */

/*
 * Copyright (c) 2026 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "ft_plugin_xfce.h"
#include <glib.h>
#include "ft_core.h"
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.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

enum  {
	XFCE_SCREEN_SAVER_PROVIDER_0_PROPERTY,
	XFCE_SCREEN_SAVER_PROVIDER_ACTIVE_PROPERTY,
	XFCE_SCREEN_SAVER_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* xfce_screen_saver_provider_properties[XFCE_SCREEN_SAVER_PROVIDER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _XfceScreenSaverProviderInitializeData XfceScreenSaverProviderInitializeData;
typedef struct _XfceScreenSaverProviderUninitializeData XfceScreenSaverProviderUninitializeData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _XfceScreenSaverProviderEnableData XfceScreenSaverProviderEnableData;
typedef struct _XfceScreenSaverProviderDisableData XfceScreenSaverProviderDisableData;

struct _XfceScreenSaverProviderPrivate {
	gboolean _active;
	XfceScreenSaver* screensaver_proxy;
	guint watcher_id;
	gulong active_changed_id;
};

struct _XfceScreenSaverProviderInitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XfceScreenSaverProvider* self;
	GCancellable* cancellable;
};

struct _XfceScreenSaverProviderUninitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XfceScreenSaverProvider* self;
};

struct _XfceScreenSaverProviderEnableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XfceScreenSaverProvider* self;
	GCancellable* cancellable;
	XfceScreenSaver* _tmp0_;
	XfceScreenSaver* _tmp1_;
	XfceScreenSaver* _tmp2_;
	gboolean _tmp3_;
	XfceScreenSaver* _tmp4_;
	XfceScreenSaver* _tmp5_;
	gulong _tmp6_;
	GError* _error_;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GError* _inner_error0_;
};

struct _XfceScreenSaverProviderDisableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XfceScreenSaverProvider* self;
	XfceScreenSaver* _tmp0_;
};

static gint XfceScreenSaverProvider_private_offset;
static gpointer xfce_screen_saver_provider_parent_class = NULL;
static FtScreenSaverProviderIface * xfce_screen_saver_provider_ft_screen_saver_provider_parent_iface = NULL;
static GType xfce_screen_saver_provider_type_id = 0;

static void xfce_screen_saver_provider_on_name_appeared (XfceScreenSaverProvider* self,
                                                  GDBusConnection* connection,
                                                  const gchar* name,
                                                  const gchar* name_owner);
static void xfce_screen_saver_provider_on_name_vanished (XfceScreenSaverProvider* self,
                                                  GDBusConnection* connection,
                                                  const gchar* name);
static void xfce_screen_saver_provider_on_active_changed (XfceScreenSaverProvider* self,
                                                   gboolean new_value);
static void xfce_screen_saver_provider_real_initialize_data_free (gpointer _data);
static void xfce_screen_saver_provider_real_initialize (FtProvider* base,
                                                 GCancellable* cancellable,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static gboolean xfce_screen_saver_provider_real_initialize_co (XfceScreenSaverProviderInitializeData* _data_);
static void _xfce_screen_saver_provider_on_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                               const gchar* name,
                                                                               const gchar* name_owner,
                                                                               gpointer self);
static void _xfce_screen_saver_provider_on_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                               const gchar* name,
                                                                               gpointer self);
static void xfce_screen_saver_provider_real_uninitialize_data_free (gpointer _data);
static void xfce_screen_saver_provider_real_uninitialize (FtProvider* base,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static gboolean xfce_screen_saver_provider_real_uninitialize_co (XfceScreenSaverProviderUninitializeData* _data_);
static void xfce_screen_saver_provider_real_enable_data_free (gpointer _data);
static void xfce_screen_saver_provider_real_enable (FtProvider* base,
                                             GCancellable* cancellable,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static gboolean xfce_screen_saver_provider_real_enable_co (XfceScreenSaverProviderEnableData* _data_);
static void xfce_screen_saver_provider_enable_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void _xfce_screen_saver_provider_on_active_changed_xfce_screen_saver_active_changed (XfceScreenSaver* _sender,
                                                                                     gboolean new_value,
                                                                                     gpointer self);
static void xfce_screen_saver_provider_real_disable_data_free (gpointer _data);
static void xfce_screen_saver_provider_real_disable (FtProvider* base,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static gboolean xfce_screen_saver_provider_real_disable_co (XfceScreenSaverProviderDisableData* _data_);
static void xfce_screen_saver_provider_finalize (GObject * obj);
static void _vala_xfce_screen_saver_provider_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
xfce_screen_saver_provider_get_instance_private (XfceScreenSaverProvider* self)
{
	return G_STRUCT_MEMBER_P (self, XfceScreenSaverProvider_private_offset);
}

static void
xfce_screen_saver_provider_on_name_appeared (XfceScreenSaverProvider* self,
                                             GDBusConnection* connection,
                                             const gchar* name,
                                             const gchar* name_owner)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (name_owner != NULL);
	ft_provider_set_available ((FtProvider*) self, TRUE);
}

static void
xfce_screen_saver_provider_on_name_vanished (XfceScreenSaverProvider* self,
                                             GDBusConnection* connection,
                                             const gchar* name)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	ft_provider_set_available ((FtProvider*) self, FALSE);
}

static void
xfce_screen_saver_provider_on_active_changed (XfceScreenSaverProvider* self,
                                              gboolean new_value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_active != new_value) {
		self->priv->_active = new_value;
		g_object_notify ((GObject*) self, "active");
	}
}

static void
xfce_screen_saver_provider_real_initialize_data_free (gpointer _data)
{
	XfceScreenSaverProviderInitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (XfceScreenSaverProviderInitializeData, _data_);
}

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

static void
xfce_screen_saver_provider_real_initialize (FtProvider* base,
                                            GCancellable* cancellable,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	XfceScreenSaverProvider * self;
	XfceScreenSaverProviderInitializeData* _data_;
	XfceScreenSaverProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (XfceScreenSaverProvider*) base;
	_data_ = g_slice_new0 (XfceScreenSaverProviderInitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xfce_screen_saver_provider_real_initialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	xfce_screen_saver_provider_real_initialize_co (_data_);
}

static void
xfce_screen_saver_provider_initialize_finish (FtProvider* base,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	XfceScreenSaverProviderInitializeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
_xfce_screen_saver_provider_on_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                          const gchar* name,
                                                                          const gchar* name_owner,
                                                                          gpointer self)
{
	xfce_screen_saver_provider_on_name_appeared ((XfceScreenSaverProvider*) self, connection, name, name_owner);
}

static void
_xfce_screen_saver_provider_on_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                          const gchar* name,
                                                                          gpointer self)
{
	xfce_screen_saver_provider_on_name_vanished ((XfceScreenSaverProvider*) self, connection, name);
}

static gboolean
xfce_screen_saver_provider_real_initialize_co (XfceScreenSaverProviderInitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->self->priv->watcher_id = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "org.xfce.ScreenSaver", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_xfce_screen_saver_provider_on_name_appeared_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _xfce_screen_saver_provider_on_name_appeared_gbus_name_appeared_callback, g_object_ref (_data_->self), (GClosureNotify) g_object_unref)), (GClosure*) ((_xfce_screen_saver_provider_on_name_vanished_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _xfce_screen_saver_provider_on_name_vanished_gbus_name_vanished_callback, g_object_ref (_data_->self), (GClosureNotify) g_object_unref)));
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xfce_screen_saver_provider_real_uninitialize_data_free (gpointer _data)
{
	XfceScreenSaverProviderUninitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (XfceScreenSaverProviderUninitializeData, _data_);
}

static void
xfce_screen_saver_provider_real_uninitialize (FtProvider* base,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	XfceScreenSaverProvider * self;
	XfceScreenSaverProviderUninitializeData* _data_;
	XfceScreenSaverProvider* _tmp0_;
	self = (XfceScreenSaverProvider*) base;
	_data_ = g_slice_new0 (XfceScreenSaverProviderUninitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xfce_screen_saver_provider_real_uninitialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	xfce_screen_saver_provider_real_uninitialize_co (_data_);
}

static void
xfce_screen_saver_provider_uninitialize_finish (FtProvider* base,
                                                GAsyncResult* _res_,
                                                GError** error)
{
	XfceScreenSaverProviderUninitializeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
xfce_screen_saver_provider_real_uninitialize_co (XfceScreenSaverProviderUninitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->watcher_id != ((guint) 0)) {
		g_bus_unwatch_name (_data_->self->priv->watcher_id);
		_data_->self->priv->watcher_id = (guint) 0;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xfce_screen_saver_provider_real_enable_data_free (gpointer _data)
{
	XfceScreenSaverProviderEnableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (XfceScreenSaverProviderEnableData, _data_);
}

static void
xfce_screen_saver_provider_real_enable (FtProvider* base,
                                        GCancellable* cancellable,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	XfceScreenSaverProvider * self;
	XfceScreenSaverProviderEnableData* _data_;
	XfceScreenSaverProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (XfceScreenSaverProvider*) base;
	_data_ = g_slice_new0 (XfceScreenSaverProviderEnableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xfce_screen_saver_provider_real_enable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	xfce_screen_saver_provider_real_enable_co (_data_);
}

static void
xfce_screen_saver_provider_enable_finish (FtProvider* base,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	XfceScreenSaverProviderEnableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
xfce_screen_saver_provider_enable_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	XfceScreenSaverProviderEnableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xfce_screen_saver_provider_real_enable_co (_data_);
}

static void
_xfce_screen_saver_provider_on_active_changed_xfce_screen_saver_active_changed (XfceScreenSaver* _sender,
                                                                                gboolean new_value,
                                                                                gpointer self)
{
	xfce_screen_saver_provider_on_active_changed ((XfceScreenSaverProvider*) self, new_value);
}

static gboolean
xfce_screen_saver_provider_real_enable_co (XfceScreenSaverProviderEnableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		g_async_initable_new_async (XFCE_TYPE_SCREEN_SAVER_PROXY, 0, _data_->cancellable, xfce_screen_saver_provider_enable_ready, _data_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", "org.xfce.ScreenSaver", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/xfce/ScreenSaver", "g-interface-name", "org.xfce.ScreenSaver", NULL);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = (XfceScreenSaver*) g_async_initable_new_finish ((GAsyncInitable *) _data_->_source_object_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp0_ = (XfceScreenSaver*) _data_->_tmp1_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp2_ = _data_->_tmp0_;
		_data_->_tmp0_ = NULL;
		_g_object_unref0 (_data_->self->priv->screensaver_proxy);
		_data_->self->priv->screensaver_proxy = _data_->_tmp2_;
		_data_->_tmp4_ = _data_->self->priv->screensaver_proxy;
		_data_->_state_ = 2;
		xfce_screen_saver_get_active (_data_->_tmp4_, xfce_screen_saver_provider_enable_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp3_ = xfce_screen_saver_get_active_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->_tmp0_);
			goto __catch0_g_error;
		}
		_data_->self->priv->_active = _data_->_tmp3_;
		_data_->_tmp5_ = _data_->self->priv->screensaver_proxy;
		_data_->_tmp6_ = g_signal_connect_object (_data_->_tmp5_, "active-changed", (GCallback) _xfce_screen_saver_provider_on_active_changed_xfce_screen_saver_active_changed, _data_->self, 0);
		_data_->self->priv->active_changed_id = _data_->_tmp6_;
		_g_object_unref0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp7_ = _data_->_error_;
		_data_->_tmp8_ = _data_->_tmp7_->message;
		g_warning ("screen-saver-provider.vala:77: Error while initializing session proxy:" \
" %s", _data_->_tmp8_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xfce_screen_saver_provider_real_disable_data_free (gpointer _data)
{
	XfceScreenSaverProviderDisableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (XfceScreenSaverProviderDisableData, _data_);
}

static void
xfce_screen_saver_provider_real_disable (FtProvider* base,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	XfceScreenSaverProvider * self;
	XfceScreenSaverProviderDisableData* _data_;
	XfceScreenSaverProvider* _tmp0_;
	self = (XfceScreenSaverProvider*) base;
	_data_ = g_slice_new0 (XfceScreenSaverProviderDisableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xfce_screen_saver_provider_real_disable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	xfce_screen_saver_provider_real_disable_co (_data_);
}

static void
xfce_screen_saver_provider_disable_finish (FtProvider* base,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	XfceScreenSaverProviderDisableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
xfce_screen_saver_provider_real_disable_co (XfceScreenSaverProviderDisableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->active_changed_id != ((gulong) 0)) {
		_data_->_tmp0_ = _data_->self->priv->screensaver_proxy;
		g_signal_handler_disconnect ((GObject*) _data_->_tmp0_, _data_->self->priv->active_changed_id);
		_data_->self->priv->active_changed_id = (gulong) 0;
	}
	_g_object_unref0 (_data_->self->priv->screensaver_proxy);
	_data_->self->priv->screensaver_proxy = NULL;
	if (_data_->self->priv->_active) {
		_data_->self->priv->_active = FALSE;
		g_object_notify ((GObject*) _data_->self, "active");
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

XfceScreenSaverProvider*
xfce_screen_saver_provider_construct (GType object_type)
{
	XfceScreenSaverProvider * self = NULL;
	self = (XfceScreenSaverProvider*) ft_provider_construct (object_type);
	return self;
}

XfceScreenSaverProvider*
xfce_screen_saver_provider_new (void)
{
	return xfce_screen_saver_provider_construct (XFCE_TYPE_SCREEN_SAVER_PROVIDER);
}

static gboolean
xfce_screen_saver_provider_real_get_active (FtScreenSaverProvider* base)
{
	gboolean result;
	XfceScreenSaverProvider* self;
	self = (XfceScreenSaverProvider*) base;
	result = self->priv->_active;
	return result;
}

static void
xfce_screen_saver_provider_class_init (XfceScreenSaverProviderClass * klass,
                                       gpointer klass_data)
{
	xfce_screen_saver_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XfceScreenSaverProvider_private_offset);
	((FtProviderClass *) klass)->initialize = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) xfce_screen_saver_provider_real_initialize;
	((FtProviderClass *) klass)->initialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) xfce_screen_saver_provider_initialize_finish;
	((FtProviderClass *) klass)->uninitialize = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) xfce_screen_saver_provider_real_uninitialize;
	((FtProviderClass *) klass)->uninitialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) xfce_screen_saver_provider_uninitialize_finish;
	((FtProviderClass *) klass)->enable = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) xfce_screen_saver_provider_real_enable;
	((FtProviderClass *) klass)->enable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) xfce_screen_saver_provider_enable_finish;
	((FtProviderClass *) klass)->disable = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) xfce_screen_saver_provider_real_disable;
	((FtProviderClass *) klass)->disable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) xfce_screen_saver_provider_disable_finish;
	G_OBJECT_CLASS (klass)->get_property = _vala_xfce_screen_saver_provider_get_property;
	G_OBJECT_CLASS (klass)->finalize = xfce_screen_saver_provider_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XFCE_SCREEN_SAVER_PROVIDER_ACTIVE_PROPERTY, xfce_screen_saver_provider_properties[XFCE_SCREEN_SAVER_PROVIDER_ACTIVE_PROPERTY] = g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xfce_screen_saver_provider_ft_screen_saver_provider_interface_init (FtScreenSaverProviderIface * iface,
                                                                    gpointer iface_data)
{
	xfce_screen_saver_provider_ft_screen_saver_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_active = xfce_screen_saver_provider_real_get_active;
}

static void
xfce_screen_saver_provider_instance_init (XfceScreenSaverProvider * self,
                                          gpointer klass)
{
	self->priv = xfce_screen_saver_provider_get_instance_private (self);
	self->priv->_active = FALSE;
	self->priv->screensaver_proxy = NULL;
	self->priv->watcher_id = (guint) 0;
	self->priv->active_changed_id = (gulong) 0;
}

static void
xfce_screen_saver_provider_finalize (GObject * obj)
{
	XfceScreenSaverProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XFCE_TYPE_SCREEN_SAVER_PROVIDER, XfceScreenSaverProvider);
	_g_object_unref0 (self->priv->screensaver_proxy);
	G_OBJECT_CLASS (xfce_screen_saver_provider_parent_class)->finalize (obj);
}

GType
xfce_screen_saver_provider_get_type (void)
{
	return xfce_screen_saver_provider_type_id;
}

GType
xfce_screen_saver_provider_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (XfceScreenSaverProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xfce_screen_saver_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XfceScreenSaverProvider), 0, (GInstanceInitFunc) xfce_screen_saver_provider_instance_init, NULL };
	static const GInterfaceInfo ft_screen_saver_provider_info = { (GInterfaceInitFunc) xfce_screen_saver_provider_ft_screen_saver_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	xfce_screen_saver_provider_type_id = g_type_module_register_type (module, FT_TYPE_PROVIDER, "XfceScreenSaverProvider", &g_define_type_info, 0);
	g_type_module_add_interface (module, xfce_screen_saver_provider_type_id, FT_TYPE_SCREEN_SAVER_PROVIDER, &ft_screen_saver_provider_info);
	XfceScreenSaverProvider_private_offset = sizeof (XfceScreenSaverProviderPrivate);
	return xfce_screen_saver_provider_type_id;
}

static void
_vala_xfce_screen_saver_provider_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	XfceScreenSaverProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XFCE_TYPE_SCREEN_SAVER_PROVIDER, XfceScreenSaverProvider);
	switch (property_id) {
		case XFCE_SCREEN_SAVER_PROVIDER_ACTIVE_PROPERTY:
		g_value_set_boolean (value, ft_screen_saver_provider_get_active ((FtScreenSaverProvider*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

