/* 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_ui.h"
#include <gio/gio.h>
#include "ft_core.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  {
	FT_DEFAULT_SCREEN_OVERLAY_PROVIDER_0_PROPERTY,
	FT_DEFAULT_SCREEN_OVERLAY_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* ft_default_screen_overlay_provider_properties[FT_DEFAULT_SCREEN_OVERLAY_PROVIDER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block30Data Block30Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _FtDefaultScreenOverlayProviderInitializeData FtDefaultScreenOverlayProviderInitializeData;
typedef struct _FtDefaultScreenOverlayProviderUninitializeData FtDefaultScreenOverlayProviderUninitializeData;
typedef struct _FtDefaultScreenOverlayProviderEnableData FtDefaultScreenOverlayProviderEnableData;
typedef struct _FtDefaultScreenOverlayProviderDisableData FtDefaultScreenOverlayProviderDisableData;

struct _FtDefaultScreenOverlayProviderPrivate {
	GCancellable* cancellable;
};

struct _Block30Data {
	int _ref_count_;
	FtDefaultScreenOverlayProvider* self;
	FtLightboxGroup* screen_overlay_group;
	GCancellable* cancellable;
};

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

struct _FtDefaultScreenOverlayProviderUninitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FtDefaultScreenOverlayProvider* self;
};

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

struct _FtDefaultScreenOverlayProviderDisableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FtDefaultScreenOverlayProvider* self;
};

static gint FtDefaultScreenOverlayProvider_private_offset;
static gpointer ft_default_screen_overlay_provider_parent_class = NULL;
static FtScreenOverlayProviderIface * ft_default_screen_overlay_provider_ft_screen_overlay_provider_parent_iface = NULL;

static void ft_default_screen_overlay_provider_real_open (FtScreenOverlayProvider* base);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
static void __lambda89_ (Block30Data* _data30_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda89__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ft_default_screen_overlay_provider_real_close (FtScreenOverlayProvider* base);
static void ft_default_screen_overlay_provider_real_initialize_data_free (gpointer _data);
static void ft_default_screen_overlay_provider_real_initialize (FtProvider* base,
                                                         GCancellable* cancellable,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static gboolean ft_default_screen_overlay_provider_real_initialize_co (FtDefaultScreenOverlayProviderInitializeData* _data_);
static void ft_default_screen_overlay_provider_real_uninitialize_data_free (gpointer _data);
static void ft_default_screen_overlay_provider_real_uninitialize (FtProvider* base,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
static gboolean ft_default_screen_overlay_provider_real_uninitialize_co (FtDefaultScreenOverlayProviderUninitializeData* _data_);
static void ft_default_screen_overlay_provider_real_enable_data_free (gpointer _data);
static void ft_default_screen_overlay_provider_real_enable (FtProvider* base,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static gboolean ft_default_screen_overlay_provider_real_enable_co (FtDefaultScreenOverlayProviderEnableData* _data_);
static void ft_default_screen_overlay_provider_real_disable_data_free (gpointer _data);
static void ft_default_screen_overlay_provider_real_disable (FtProvider* base,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static gboolean ft_default_screen_overlay_provider_real_disable_co (FtDefaultScreenOverlayProviderDisableData* _data_);
static GObject * ft_default_screen_overlay_provider_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
static void ft_default_screen_overlay_provider_finalize (GObject * obj);
static GType ft_default_screen_overlay_provider_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
ft_default_screen_overlay_provider_get_instance_private (FtDefaultScreenOverlayProvider* self)
{
	return G_STRUCT_MEMBER_P (self, FtDefaultScreenOverlayProvider_private_offset);
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		FtDefaultScreenOverlayProvider* self;
		self = _data30_->self;
		_g_object_unref0 (_data30_->cancellable);
		_g_object_unref0 (_data30_->screen_overlay_group);
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

static void
__lambda89_ (Block30Data* _data30_,
             GObject* obj,
             GAsyncResult* res)
{
	FtDefaultScreenOverlayProvider* self;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
	GError* _inner_error0_ = NULL;
	self = _data30_->self;
	g_return_if_fail (res != NULL);
	{
		FtLightboxGroup* _tmp0_;
		_tmp0_ = _data30_->screen_overlay_group;
		ft_lightbox_group_open_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GCancellable* _tmp1_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = _data30_->cancellable;
		if (!g_cancellable_is_cancelled (_tmp1_)) {
			GError* _tmp2_;
			const gchar* _tmp3_;
			GCancellable* _tmp4_;
			_tmp2_ = _error_;
			_tmp3_ = _tmp2_->message;
			g_warning ("screen-overlay-provider.vala:42: Failed to open overlay: %s", _tmp3_);
			_tmp4_ = _data30_->cancellable;
			g_cancellable_cancel (_tmp4_);
		}
		_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;
	}
	_tmp5_ = self->priv->cancellable;
	_tmp6_ = _data30_->cancellable;
	if (_tmp5_ == _tmp6_) {
		_g_object_unref0 (self->priv->cancellable);
		self->priv->cancellable = NULL;
		g_signal_emit_by_name ((FtScreenOverlayProvider*) self, "closed");
	}
}

static void
___lambda89__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda89_ (self, source_object, res);
	block30_data_unref (self);
}

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

static void
ft_default_screen_overlay_provider_real_open (FtScreenOverlayProvider* base)
{
	FtDefaultScreenOverlayProvider * self;
	Block30Data* _data30_;
	gboolean _tmp0_ = FALSE;
	GCancellable* _tmp1_;
	FtLightboxGroup* _tmp3_;
	GCancellable* _tmp4_;
	FtLightboxGroup* _tmp5_;
	GCancellable* _tmp6_;
	GCancellable* _tmp7_;
	self = (FtDefaultScreenOverlayProvider*) base;
	_data30_ = g_slice_new0 (Block30Data);
	_data30_->_ref_count_ = 1;
	_data30_->self = g_object_ref (self);
	_tmp1_ = self->priv->cancellable;
	if (_tmp1_ != NULL) {
		GCancellable* _tmp2_;
		_tmp2_ = self->priv->cancellable;
		_tmp0_ = !g_cancellable_is_cancelled (_tmp2_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		block30_data_unref (_data30_);
		_data30_ = NULL;
		return;
	}
	_tmp3_ = ft_lightbox_group_new (FT_TYPE_SCREEN_OVERLAY);
	g_object_ref_sink (_tmp3_);
	_data30_->screen_overlay_group = _tmp3_;
	_tmp4_ = g_cancellable_new ();
	_data30_->cancellable = _tmp4_;
	_tmp5_ = _data30_->screen_overlay_group;
	_tmp6_ = _data30_->cancellable;
	ft_lightbox_group_open (_tmp5_, _tmp6_, ___lambda89__gasync_ready_callback, block30_data_ref (_data30_));
	_tmp7_ = _data30_->cancellable;
	if (!g_cancellable_is_cancelled (_tmp7_)) {
		GCancellable* _tmp8_;
		GCancellable* _tmp9_;
		_tmp8_ = _data30_->cancellable;
		_tmp9_ = _g_object_ref0 (_tmp8_);
		_g_object_unref0 (self->priv->cancellable);
		self->priv->cancellable = _tmp9_;
		g_signal_emit_by_name ((FtScreenOverlayProvider*) self, "opened");
	}
	block30_data_unref (_data30_);
	_data30_ = NULL;
}

static void
ft_default_screen_overlay_provider_real_close (FtScreenOverlayProvider* base)
{
	FtDefaultScreenOverlayProvider * self;
	GCancellable* _tmp0_;
	self = (FtDefaultScreenOverlayProvider*) base;
	_tmp0_ = self->priv->cancellable;
	if (_tmp0_ != NULL) {
		GCancellable* _tmp1_;
		_tmp1_ = self->priv->cancellable;
		g_cancellable_cancel (_tmp1_);
		_g_object_unref0 (self->priv->cancellable);
		self->priv->cancellable = NULL;
	}
}

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

static void
ft_default_screen_overlay_provider_real_initialize (FtProvider* base,
                                                    GCancellable* cancellable,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	FtDefaultScreenOverlayProvider * self;
	FtDefaultScreenOverlayProviderInitializeData* _data_;
	FtDefaultScreenOverlayProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (FtDefaultScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (FtDefaultScreenOverlayProviderInitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, ft_default_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_;
	ft_default_screen_overlay_provider_real_initialize_co (_data_);
}

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

static gboolean
ft_default_screen_overlay_provider_real_initialize_co (FtDefaultScreenOverlayProviderInitializeData* _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
ft_default_screen_overlay_provider_real_uninitialize_data_free (gpointer _data)
{
	FtDefaultScreenOverlayProviderUninitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FtDefaultScreenOverlayProviderUninitializeData, _data_);
}

static void
ft_default_screen_overlay_provider_real_uninitialize (FtProvider* base,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	FtDefaultScreenOverlayProvider * self;
	FtDefaultScreenOverlayProviderUninitializeData* _data_;
	FtDefaultScreenOverlayProvider* _tmp0_;
	self = (FtDefaultScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (FtDefaultScreenOverlayProviderUninitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, ft_default_screen_overlay_provider_real_uninitialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	ft_default_screen_overlay_provider_real_uninitialize_co (_data_);
}

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

static gboolean
ft_default_screen_overlay_provider_real_uninitialize_co (FtDefaultScreenOverlayProviderUninitializeData* _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
ft_default_screen_overlay_provider_real_enable_data_free (gpointer _data)
{
	FtDefaultScreenOverlayProviderEnableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (FtDefaultScreenOverlayProviderEnableData, _data_);
}

static void
ft_default_screen_overlay_provider_real_enable (FtProvider* base,
                                                GCancellable* cancellable,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	FtDefaultScreenOverlayProvider * self;
	FtDefaultScreenOverlayProviderEnableData* _data_;
	FtDefaultScreenOverlayProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (FtDefaultScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (FtDefaultScreenOverlayProviderEnableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, ft_default_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_;
	ft_default_screen_overlay_provider_real_enable_co (_data_);
}

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

static gboolean
ft_default_screen_overlay_provider_real_enable_co (FtDefaultScreenOverlayProviderEnableData* _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
ft_default_screen_overlay_provider_real_disable_data_free (gpointer _data)
{
	FtDefaultScreenOverlayProviderDisableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FtDefaultScreenOverlayProviderDisableData, _data_);
}

static void
ft_default_screen_overlay_provider_real_disable (FtProvider* base,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	FtDefaultScreenOverlayProvider * self;
	FtDefaultScreenOverlayProviderDisableData* _data_;
	FtDefaultScreenOverlayProvider* _tmp0_;
	self = (FtDefaultScreenOverlayProvider*) base;
	_data_ = g_slice_new0 (FtDefaultScreenOverlayProviderDisableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, ft_default_screen_overlay_provider_real_disable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	ft_default_screen_overlay_provider_real_disable_co (_data_);
}

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

static gboolean
ft_default_screen_overlay_provider_real_disable_co (FtDefaultScreenOverlayProviderDisableData* _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;
}

FtDefaultScreenOverlayProvider*
ft_default_screen_overlay_provider_construct (GType object_type)
{
	FtDefaultScreenOverlayProvider * self = NULL;
	self = (FtDefaultScreenOverlayProvider*) ft_provider_construct (object_type);
	return self;
}

FtDefaultScreenOverlayProvider*
ft_default_screen_overlay_provider_new (void)
{
	return ft_default_screen_overlay_provider_construct (FT_TYPE_DEFAULT_SCREEN_OVERLAY_PROVIDER);
}

static GObject *
ft_default_screen_overlay_provider_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtDefaultScreenOverlayProvider * self;
	parent_class = G_OBJECT_CLASS (ft_default_screen_overlay_provider_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_DEFAULT_SCREEN_OVERLAY_PROVIDER, FtDefaultScreenOverlayProvider);
	ft_provider_set_available ((FtProvider*) self, TRUE);
	return obj;
}

static void
ft_default_screen_overlay_provider_class_init (FtDefaultScreenOverlayProviderClass * klass,
                                               gpointer klass_data)
{
	ft_default_screen_overlay_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtDefaultScreenOverlayProvider_private_offset);
	((FtProviderClass *) klass)->initialize = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) ft_default_screen_overlay_provider_real_initialize;
	((FtProviderClass *) klass)->initialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) ft_default_screen_overlay_provider_initialize_finish;
	((FtProviderClass *) klass)->uninitialize = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) ft_default_screen_overlay_provider_real_uninitialize;
	((FtProviderClass *) klass)->uninitialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) ft_default_screen_overlay_provider_uninitialize_finish;
	((FtProviderClass *) klass)->enable = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) ft_default_screen_overlay_provider_real_enable;
	((FtProviderClass *) klass)->enable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) ft_default_screen_overlay_provider_enable_finish;
	((FtProviderClass *) klass)->disable = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) ft_default_screen_overlay_provider_real_disable;
	((FtProviderClass *) klass)->disable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) ft_default_screen_overlay_provider_disable_finish;
	G_OBJECT_CLASS (klass)->constructor = ft_default_screen_overlay_provider_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_default_screen_overlay_provider_finalize;
}

static void
ft_default_screen_overlay_provider_ft_screen_overlay_provider_interface_init (FtScreenOverlayProviderIface * iface,
                                                                              gpointer iface_data)
{
	ft_default_screen_overlay_provider_ft_screen_overlay_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->open = (void (*) (FtScreenOverlayProvider*)) ft_default_screen_overlay_provider_real_open;
	iface->close = (void (*) (FtScreenOverlayProvider*)) ft_default_screen_overlay_provider_real_close;
}

static void
ft_default_screen_overlay_provider_instance_init (FtDefaultScreenOverlayProvider * self,
                                                  gpointer klass)
{
	self->priv = ft_default_screen_overlay_provider_get_instance_private (self);
	self->priv->cancellable = NULL;
}

static void
ft_default_screen_overlay_provider_finalize (GObject * obj)
{
	FtDefaultScreenOverlayProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_DEFAULT_SCREEN_OVERLAY_PROVIDER, FtDefaultScreenOverlayProvider);
	_g_object_unref0 (self->priv->cancellable);
	G_OBJECT_CLASS (ft_default_screen_overlay_provider_parent_class)->finalize (obj);
}

static GType
ft_default_screen_overlay_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtDefaultScreenOverlayProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_default_screen_overlay_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtDefaultScreenOverlayProvider), 0, (GInstanceInitFunc) ft_default_screen_overlay_provider_instance_init, NULL };
	static const GInterfaceInfo ft_screen_overlay_provider_info = { (GInterfaceInitFunc) ft_default_screen_overlay_provider_ft_screen_overlay_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType ft_default_screen_overlay_provider_type_id;
	ft_default_screen_overlay_provider_type_id = g_type_register_static (FT_TYPE_PROVIDER, "FtDefaultScreenOverlayProvider", &g_define_type_info, 0);
	g_type_add_interface_static (ft_default_screen_overlay_provider_type_id, FT_TYPE_SCREEN_OVERLAY_PROVIDER, &ft_screen_overlay_provider_info);
	FtDefaultScreenOverlayProvider_private_offset = g_type_add_instance_private (ft_default_screen_overlay_provider_type_id, sizeof (FtDefaultScreenOverlayProviderPrivate));
	return ft_default_screen_overlay_provider_type_id;
}

GType
ft_default_screen_overlay_provider_get_type (void)
{
	static volatile gsize ft_default_screen_overlay_provider_type_id__once = 0;
	if (g_once_init_enter (&ft_default_screen_overlay_provider_type_id__once)) {
		GType ft_default_screen_overlay_provider_type_id;
		ft_default_screen_overlay_provider_type_id = ft_default_screen_overlay_provider_get_type_once ();
		g_once_init_leave (&ft_default_screen_overlay_provider_type_id__once, ft_default_screen_overlay_provider_type_id);
	}
	return ft_default_screen_overlay_provider_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

