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

/*
 * Copyright (c) 2026 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authors: Kamil Prusko <kamilprusko@gmail.com>
 */

#include "ft_plugin_gnome.h"
#include "ft_core.h"
#include <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.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  {
	GNOME_SCREEN_OVERLAY_PROVIDER_0_PROPERTY,
	GNOME_SCREEN_OVERLAY_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* gnome_screen_overlay_provider_properties[GNOME_SCREEN_OVERLAY_PROVIDER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block4Data Block4Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GnomeScreenOverlayProviderInitializeData GnomeScreenOverlayProviderInitializeData;
typedef struct _GnomeScreenOverlayProviderUninitializeData GnomeScreenOverlayProviderUninitializeData;
typedef struct _GnomeScreenOverlayProviderEnableData GnomeScreenOverlayProviderEnableData;
typedef struct _GnomeScreenOverlayProviderDisableData GnomeScreenOverlayProviderDisableData;

struct _GnomeScreenOverlayProviderPrivate {
	GnomeShellExtension* shell_extension;
};

struct _Block4Data {
	int _ref_count_;
	GnomeScreenOverlayProvider* self;
	GnomeShellIntegration* proxy;
};

struct _GnomeScreenOverlayProviderInitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeScreenOverlayProvider* self;
	GCancellable* cancellable;
	GnomeShellExtension* _tmp0_;
	GnomeShellExtension* _tmp1_;
	GnomeShellExtension* _tmp2_;
};

struct _GnomeScreenOverlayProviderUninitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeScreenOverlayProvider* self;
	GnomeShellExtension* _tmp0_;
	GnomeShellExtension* _tmp1_;
	guint _tmp2_;
	GQuark _tmp3_;
};

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

struct _GnomeScreenOverlayProviderDisableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeScreenOverlayProvider* self;
};

static gint GnomeScreenOverlayProvider_private_offset;
static gpointer gnome_screen_overlay_provider_parent_class = NULL;
static FtScreenOverlayProviderIface * gnome_screen_overlay_provider_ft_screen_overlay_provider_parent_iface = NULL;
static GType gnome_screen_overlay_provider_type_id = 0;

static void gnome_screen_overlay_provider_update_available (GnomeScreenOverlayProvider* self);
static void gnome_screen_overlay_provider_on_notify_extension_enabled (GnomeScreenOverlayProvider* self,
                                                                GObject* object,
                                                                GParamSpec* pspec);
static void gnome_screen_overlay_provider_real_open (FtScreenOverlayProvider* base);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
VALA_EXTERN GnomeShellIntegration* gnome_shell_extension_get_shell_integration_proxy (GnomeShellExtension* self);
static void ___lambda13_ (Block4Data* _data4_,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda13__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void gnome_screen_overlay_provider_real_close (FtScreenOverlayProvider* base);
static void gnome_screen_overlay_provider_real_initialize_data_free (gpointer _data);
static void gnome_screen_overlay_provider_real_initialize (FtProvider* base,
                                                    GCancellable* cancellable,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static gboolean gnome_screen_overlay_provider_real_initialize_co (GnomeScreenOverlayProviderInitializeData* _data_);
static void _gnome_screen_overlay_provider_on_notify_extension_enabled_g_object_notify (GObject* _sender,
                                                                                 GParamSpec* pspec,
                                                                                 gpointer self);
static void gnome_screen_overlay_provider_initialize_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void gnome_screen_overlay_provider_real_uninitialize_data_free (gpointer _data);
static void gnome_screen_overlay_provider_real_uninitialize (FtProvider* base,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static gboolean gnome_screen_overlay_provider_real_uninitialize_co (GnomeScreenOverlayProviderUninitializeData* _data_);
static void gnome_screen_overlay_provider_real_enable_data_free (gpointer _data);
static void gnome_screen_overlay_provider_real_enable (FtProvider* base,
                                                GCancellable* cancellable,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static gboolean gnome_screen_overlay_provider_real_enable_co (GnomeScreenOverlayProviderEnableData* _data_);
static void gnome_screen_overlay_provider_real_disable_data_free (gpointer _data);
static void gnome_screen_overlay_provider_real_disable (FtProvider* base,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static gboolean gnome_screen_overlay_provider_real_disable_co (GnomeScreenOverlayProviderDisableData* _data_);
static void gnome_screen_overlay_provider_finalize (GObject * obj);

static inline gpointer
gnome_screen_overlay_provider_get_instance_private (GnomeScreenOverlayProvider* self)
{
	return G_STRUCT_MEMBER_P (self, GnomeScreenOverlayProvider_private_offset);
}

static void
gnome_screen_overlay_provider_update_available (GnomeScreenOverlayProvider* self)
{
	gboolean _tmp0_ = FALSE;
	GnomeShellExtension* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->shell_extension;
	if (_tmp1_ != NULL) {
		GnomeShellExtension* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->shell_extension;
		_tmp3_ = gnome_shell_extension_get_enabled (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	ft_provider_set_available ((FtProvider*) self, _tmp0_);
}

static void
gnome_screen_overlay_provider_on_notify_extension_enabled (GnomeScreenOverlayProvider* self,
                                                           GObject* object,
                                                           GParamSpec* pspec)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (pspec != NULL);
	gnome_screen_overlay_provider_update_available (self);
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		GnomeScreenOverlayProvider* self;
		self = _data4_->self;
		_g_object_unref0 (_data4_->proxy);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

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

static void
___lambda13_ (Block4Data* _data4_,
              GObject* obj,
              GAsyncResult* res)
{
	GnomeScreenOverlayProvider* self;
	GError* _inner_error0_ = NULL;
	self = _data4_->self;
	g_return_if_fail (res != NULL);
	{
		GnomeShellIntegration* _tmp0_;
		_tmp0_ = _data4_->proxy;
		gnome_shell_integration_open_screen_overlay_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = _error_;
		_tmp2_ = _tmp1_->message;
		g_warning ("screen-overlay-provider.vala:46: Error opening screen overlay: %s", _tmp2_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda13__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda13_ (self, source_object, res);
	block4_data_unref (self);
}

static void
gnome_screen_overlay_provider_real_open (FtScreenOverlayProvider* base)
{
	GnomeScreenOverlayProvider * self;
	Block4Data* _data4_;
	GnomeShellExtension* _tmp0_ = NULL;
	GnomeShellExtension* _tmp1_;
	GnomeShellIntegration* _tmp2_ = NULL;
	GnomeShellIntegration* _tmp4_;
	GnomeShellIntegration* _tmp5_;
	self = (GnomeScreenOverlayProvider*) base;
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp1_ = self->priv->shell_extension;
	_tmp0_ = _tmp1_;
	_tmp2_ = NULL;
	if (_tmp0_ != NULL) {
		GnomeShellIntegration* _tmp3_;
		_tmp3_ = gnome_shell_extension_get_shell_integration_proxy (_tmp0_);
		_tmp2_ = _tmp3_;
	}
	_tmp4_ = _g_object_ref0 (_tmp2_);
	_data4_->proxy = _tmp4_;
	_tmp5_ = _data4_->proxy;
	if (_tmp5_ != NULL) {
		GnomeShellIntegration* _tmp6_;
		_tmp6_ = _data4_->proxy;
		gnome_shell_integration_open_screen_overlay (_tmp6_, ____lambda13__gasync_ready_callback, block4_data_ref (_data4_));
	} else {
		g_debug ("screen-overlay-provider.vala:51: Unable to open screen overlay. No She" \
"llIntegration.");
	}
	block4_data_unref (_data4_);
	_data4_ = NULL;
}

static void
gnome_screen_overlay_provider_real_close (FtScreenOverlayProvider* base)
{
	GnomeScreenOverlayProvider * self;
	self = (GnomeScreenOverlayProvider*) base;
}

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

static void
gnome_screen_overlay_provider_real_initialize (FtProvider* base,
                                               GCancellable* cancellable,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	GnomeScreenOverlayProvider * self;
	GnomeScreenOverlayProviderInitializeData* _data_;
	GnomeScreenOverlayProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (GnomeScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (GnomeScreenOverlayProviderInitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_screen_overlay_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_;
	gnome_screen_overlay_provider_real_initialize_co (_data_);
}

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

static void
_gnome_screen_overlay_provider_on_notify_extension_enabled_g_object_notify (GObject* _sender,
                                                                            GParamSpec* pspec,
                                                                            gpointer self)
{
	gnome_screen_overlay_provider_on_notify_extension_enabled ((GnomeScreenOverlayProvider*) self, _sender, pspec);
}

static void
gnome_screen_overlay_provider_initialize_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	GnomeScreenOverlayProviderInitializeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gnome_screen_overlay_provider_real_initialize_co (_data_);
}

static gboolean
gnome_screen_overlay_provider_real_initialize_co (GnomeScreenOverlayProviderInitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gnome_shell_extension_new ();
	_g_object_unref0 (_data_->self->priv->shell_extension);
	_data_->self->priv->shell_extension = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->shell_extension;
	g_signal_connect_object ((GObject*) _data_->_tmp1_, "notify::enabled", (GCallback) _gnome_screen_overlay_provider_on_notify_extension_enabled_g_object_notify, _data_->self, 0);
	_data_->_tmp2_ = _data_->self->priv->shell_extension;
	_data_->_state_ = 1;
	gnome_shell_extension_wait (_data_->_tmp2_, gnome_screen_overlay_provider_initialize_ready, _data_);
	return FALSE;
	_state_1:
	gnome_shell_extension_wait_finish (_data_->_tmp2_, _data_->_res_);
	gnome_screen_overlay_provider_update_available (_data_->self);
	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
gnome_screen_overlay_provider_real_uninitialize_data_free (gpointer _data)
{
	GnomeScreenOverlayProviderUninitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GnomeScreenOverlayProviderUninitializeData, _data_);
}

static void
gnome_screen_overlay_provider_real_uninitialize (FtProvider* base,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	GnomeScreenOverlayProvider * self;
	GnomeScreenOverlayProviderUninitializeData* _data_;
	GnomeScreenOverlayProvider* _tmp0_;
	self = (GnomeScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (GnomeScreenOverlayProviderUninitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_screen_overlay_provider_real_uninitialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_screen_overlay_provider_real_uninitialize_co (_data_);
}

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

static gboolean
gnome_screen_overlay_provider_real_uninitialize_co (GnomeScreenOverlayProviderUninitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->shell_extension;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->shell_extension;
		g_signal_parse_name ("notify::enabled", G_TYPE_OBJECT, &_data_->_tmp2_, &_data_->_tmp3_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _data_->_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp2_, _data_->_tmp3_, NULL, (GCallback) _gnome_screen_overlay_provider_on_notify_extension_enabled_g_object_notify, _data_->self);
		_g_object_unref0 (_data_->self->priv->shell_extension);
		_data_->self->priv->shell_extension = NULL;
		gnome_screen_overlay_provider_update_available (_data_->self);
	}
	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
gnome_screen_overlay_provider_real_enable_data_free (gpointer _data)
{
	GnomeScreenOverlayProviderEnableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GnomeScreenOverlayProviderEnableData, _data_);
}

static void
gnome_screen_overlay_provider_real_enable (FtProvider* base,
                                           GCancellable* cancellable,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	GnomeScreenOverlayProvider * self;
	GnomeScreenOverlayProviderEnableData* _data_;
	GnomeScreenOverlayProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (GnomeScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (GnomeScreenOverlayProviderEnableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_screen_overlay_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_;
	gnome_screen_overlay_provider_real_enable_co (_data_);
}

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

static gboolean
gnome_screen_overlay_provider_real_enable_co (GnomeScreenOverlayProviderEnableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_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
gnome_screen_overlay_provider_real_disable_data_free (gpointer _data)
{
	GnomeScreenOverlayProviderDisableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GnomeScreenOverlayProviderDisableData, _data_);
}

static void
gnome_screen_overlay_provider_real_disable (FtProvider* base,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	GnomeScreenOverlayProvider * self;
	GnomeScreenOverlayProviderDisableData* _data_;
	GnomeScreenOverlayProvider* _tmp0_;
	self = (GnomeScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (GnomeScreenOverlayProviderDisableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_screen_overlay_provider_real_disable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_screen_overlay_provider_real_disable_co (_data_);
}

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

static gboolean
gnome_screen_overlay_provider_real_disable_co (GnomeScreenOverlayProviderDisableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	ft_screen_overlay_provider_close ((FtScreenOverlayProvider*) _data_->self);
	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;
}

GnomeScreenOverlayProvider*
gnome_screen_overlay_provider_construct (GType object_type)
{
	GnomeScreenOverlayProvider * self = NULL;
	self = (GnomeScreenOverlayProvider*) ft_provider_construct (object_type);
	return self;
}

GnomeScreenOverlayProvider*
gnome_screen_overlay_provider_new (void)
{
	return gnome_screen_overlay_provider_construct (GNOME_TYPE_SCREEN_OVERLAY_PROVIDER);
}

static void
gnome_screen_overlay_provider_class_init (GnomeScreenOverlayProviderClass * klass,
                                          gpointer klass_data)
{
	gnome_screen_overlay_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomeScreenOverlayProvider_private_offset);
	((FtProviderClass *) klass)->initialize = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) gnome_screen_overlay_provider_real_initialize;
	((FtProviderClass *) klass)->initialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) gnome_screen_overlay_provider_initialize_finish;
	((FtProviderClass *) klass)->uninitialize = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) gnome_screen_overlay_provider_real_uninitialize;
	((FtProviderClass *) klass)->uninitialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) gnome_screen_overlay_provider_uninitialize_finish;
	((FtProviderClass *) klass)->enable = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) gnome_screen_overlay_provider_real_enable;
	((FtProviderClass *) klass)->enable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) gnome_screen_overlay_provider_enable_finish;
	((FtProviderClass *) klass)->disable = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) gnome_screen_overlay_provider_real_disable;
	((FtProviderClass *) klass)->disable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) gnome_screen_overlay_provider_disable_finish;
	G_OBJECT_CLASS (klass)->finalize = gnome_screen_overlay_provider_finalize;
}

static void
gnome_screen_overlay_provider_ft_screen_overlay_provider_interface_init (FtScreenOverlayProviderIface * iface,
                                                                         gpointer iface_data)
{
	gnome_screen_overlay_provider_ft_screen_overlay_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->open = (void (*) (FtScreenOverlayProvider*)) gnome_screen_overlay_provider_real_open;
	iface->close = (void (*) (FtScreenOverlayProvider*)) gnome_screen_overlay_provider_real_close;
}

static void
gnome_screen_overlay_provider_instance_init (GnomeScreenOverlayProvider * self,
                                             gpointer klass)
{
	self->priv = gnome_screen_overlay_provider_get_instance_private (self);
	self->priv->shell_extension = NULL;
}

static void
gnome_screen_overlay_provider_finalize (GObject * obj)
{
	GnomeScreenOverlayProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_TYPE_SCREEN_OVERLAY_PROVIDER, GnomeScreenOverlayProvider);
	_g_object_unref0 (self->priv->shell_extension);
	G_OBJECT_CLASS (gnome_screen_overlay_provider_parent_class)->finalize (obj);
}

/**
     * Provider for the screen overlay when the extension is enabled.
     *
     * Extension manages the overlay. Here we only need support for manually opening the overlay.
     */
GType
gnome_screen_overlay_provider_get_type (void)
{
	return gnome_screen_overlay_provider_type_id;
}

GType
gnome_screen_overlay_provider_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomeScreenOverlayProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_screen_overlay_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomeScreenOverlayProvider), 0, (GInstanceInitFunc) gnome_screen_overlay_provider_instance_init, NULL };
	static const GInterfaceInfo ft_screen_overlay_provider_info = { (GInterfaceInitFunc) gnome_screen_overlay_provider_ft_screen_overlay_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	gnome_screen_overlay_provider_type_id = g_type_module_register_type (module, FT_TYPE_PROVIDER, "GnomeScreenOverlayProvider", &g_define_type_info, 0);
	g_type_module_add_interface (module, gnome_screen_overlay_provider_type_id, FT_TYPE_SCREEN_OVERLAY_PROVIDER, &ft_screen_overlay_provider_info);
	GnomeScreenOverlayProvider_private_offset = sizeof (GnomeScreenOverlayProviderPrivate);
	return gnome_screen_overlay_provider_type_id;
}

