/* shell-extension.c generated by valac 0.56.19, the Vala compiler
 * generated from shell-extension.vala, do not modify */

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

#include "ft_plugin_gnome.h"
#include <glib.h>
#include <gio/gio.h>
#include "ft_core.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_SHELL_EXTENSION_0_PROPERTY,
	GNOME_SHELL_EXTENSION_AVAILABLE_PROPERTY,
	GNOME_SHELL_EXTENSION_ENABLED_PROPERTY,
	GNOME_SHELL_EXTENSION_STATE_PROPERTY,
	GNOME_SHELL_EXTENSION_SETTINGS_PROPERTY,
	GNOME_SHELL_EXTENSION_NUM_PROPERTIES
};
static GParamSpec* gnome_shell_extension_properties[GNOME_SHELL_EXTENSION_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)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _GnomeShellExtensionQueryExtensionStateData GnomeShellExtensionQueryExtensionStateData;
typedef struct _GnomeShellExtensionWaitData GnomeShellExtensionWaitData;
typedef struct _GnomeShellExtensionEnableExtensionData GnomeShellExtensionEnableExtensionData;
typedef struct _GnomeShellExtensionDisableExtensionData GnomeShellExtensionDisableExtensionData;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _GnomeShellExtensionInstallExtensionData GnomeShellExtensionInstallExtensionData;
typedef struct _GnomeShellExtensionUninstallExtensionData GnomeShellExtensionUninstallExtensionData;

struct _GnomeShellExtensionPrivate {
	gboolean _available;
	gboolean _enabled;
	GnomeShellExtensionSettings* _settings;
	GnomeShellExtensions* shell_extensions_proxy;
	GnomeShellIntegration* shell_integration_proxy;
	GnomeExtensionInfo extension_info;
	guint shell_watcher_id;
	guint shell_integration_watcher_id;
	GCancellable* cancellable;
	FtAsyncCallback** wait_callbacks;
	gint wait_callbacks_length1;
	gint _wait_callbacks_size_;
};

struct _GnomeShellExtensionQueryExtensionStateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeShellExtension* self;
	GHashTable* _tmp0_;
	GnomeShellExtensions* _tmp1_;
	GHashTable* _tmp2_;
	GnomeExtensionInfo _tmp3_;
	GError* _error_;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GError* _inner_error0_;
};

struct _GnomeShellExtensionWaitData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeShellExtension* self;
	GnomeExtensionInfo _tmp0_;
	FtAsyncCallback* _tmp1_;
};

struct _GnomeShellExtensionEnableExtensionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeShellExtension* self;
	gboolean result;
	GnomeShellExtensions* _tmp0_;
	gboolean _tmp1_;
	GnomeShellExtensions* _tmp2_;
	GError* _error_;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GError* _inner_error0_;
};

struct _GnomeShellExtensionDisableExtensionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeShellExtension* self;
	gboolean result;
	GnomeShellExtensions* _tmp0_;
	gboolean _tmp1_;
	GnomeShellExtensions* _tmp2_;
	GError* _error_;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GError* _inner_error0_;
};

struct _GnomeShellExtensionInstallExtensionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeShellExtension* self;
	gboolean result;
	GnomeShellExtensions* _tmp0_;
	gchar* _result_;
	GnomeShellExtensions* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GQuark _tmp6_;
	const gchar* _tmp7_;
	GError* _error_;
	GError* _tmp8_;
	GError* _tmp9_;
	gboolean _tmp10_;
	GError* _tmp11_;
	GError* _tmp12_;
	const gchar* _tmp13_;
	GError* _tmp14_;
	gboolean _tmp15_;
	gboolean _tmp16_;
	GError* _tmp17_;
	GError* _tmp18_;
	const gchar* _tmp19_;
	GError* _tmp20_;
	const gchar* _tmp21_;
	GError* _tmp22_;
	GError* _tmp23_;
	const gchar* _tmp24_;
	GError* _tmp25_;
	const gchar* _tmp26_;
	GError* _tmp27_;
	GError* _vala1__error_;
	GError* _tmp28_;
	const gchar* _tmp29_;
	GError* _tmp30_;
	const gchar* _tmp31_;
	GError* _tmp32_;
	GError* _inner_error0_;
};

struct _GnomeShellExtensionUninstallExtensionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GnomeShellExtension* self;
	gboolean result;
	GnomeShellExtensions* _tmp0_;
	gboolean _tmp1_;
	GnomeShellExtensions* _tmp2_;
	GError* _error_;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GError* _inner_error0_;
};

static gint GnomeShellExtension_private_offset;
static gpointer gnome_shell_extension_parent_class = NULL;
static GType gnome_shell_extension_type_id = 0;

VALA_EXTERN GnomeShellIntegration* gnome_shell_extension_get_shell_integration_proxy (GnomeShellExtension* self);
static void gnome_shell_extension_update_available (GnomeShellExtension* self);
static void gnome_shell_extension_set_available (GnomeShellExtension* self,
                                          gboolean value);
static void gnome_shell_extension_on_properties_changed (GnomeShellExtension* self,
                                                  GVariant* changed_properties,
                                                  gchar** invalidated_properties,
                                                  gint invalidated_properties_length1);
static void gnome_shell_extension_on_shell_name_appeared (GnomeShellExtension* self,
                                                   GDBusConnection* connection,
                                                   const gchar* name,
                                                   const gchar* name_owner);
static void _gnome_shell_extension_on_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                                                     GVariant* changed_properties,
                                                                                     gchar** invalidated_properties,
                                                                                     gpointer self);
static void gnome_shell_extension_on_extension_state_changed (GnomeShellExtension* self,
                                                       const gchar* uuid,
                                                       GHashTable* state);
static void _gnome_shell_extension_on_extension_state_changed_gnome_shell_extensions_extension_state_changed (GnomeShellExtensions* _sender,
                                                                                                       const gchar* uuid,
                                                                                                       GHashTable* state,
                                                                                                       gpointer self);
static void gnome_shell_extension_query_extension_state (GnomeShellExtension* self,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static void gnome_shell_extension_query_extension_state_finish (GnomeShellExtension* self,
                                                         GAsyncResult* _res_);
static void ___lambda4_ (GnomeShellExtension* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ____lambda4__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void gnome_shell_extension_on_shell_name_vanished (GnomeShellExtension* self,
                                                   GDBusConnection* connection,
                                                   const gchar* name);
static void gnome_shell_extension_set_enabled (GnomeShellExtension* self,
                                        gboolean value);
static void gnome_shell_extension_on_shell_integration_name_appeared (GnomeShellExtension* self,
                                                               GDBusConnection* connection,
                                                               const gchar* name,
                                                               const gchar* name_owner);
static void gnome_shell_extension_on_shell_integration_name_vanished (GnomeShellExtension* self,
                                                               GDBusConnection* connection,
                                                               const gchar* name);
static void gnome_shell_extension_query_extension_state_data_free (gpointer _data);
static gboolean gnome_shell_extension_query_extension_state_co (GnomeShellExtensionQueryExtensionStateData* _data_);
static void gnome_shell_extension_query_extension_state_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void gnome_shell_extension_wait_data_free (gpointer _data);
static gboolean gnome_shell_extension_wait_co (GnomeShellExtensionWaitData* _data_);
static gboolean _gnome_shell_extension_wait_co_gsource_func (gpointer self);
static void _vala_array_add2 (FtAsyncCallback** * array,
                       gint* length,
                       gint* size,
                       FtAsyncCallback* value);
static void gnome_shell_extension_enable_extension_data_free (gpointer _data);
static gboolean gnome_shell_extension_enable_extension_co (GnomeShellExtensionEnableExtensionData* _data_);
static void gnome_shell_extension_enable_extension_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void gnome_shell_extension_disable_extension_data_free (gpointer _data);
static gboolean gnome_shell_extension_disable_extension_co (GnomeShellExtensionDisableExtensionData* _data_);
static void gnome_shell_extension_disable_extension_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void gnome_shell_extension_install_extension_data_free (gpointer _data);
static gboolean gnome_shell_extension_install_extension_co (GnomeShellExtensionInstallExtensionData* _data_);
static void gnome_shell_extension_install_extension_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void gnome_shell_extension_uninstall_extension_data_free (gpointer _data);
static gboolean gnome_shell_extension_uninstall_extension_co (GnomeShellExtensionUninstallExtensionData* _data_);
static void gnome_shell_extension_uninstall_extension_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void gnome_shell_extension_real_dispose (GObject* base);
static GObject * gnome_shell_extension_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _gnome_shell_extension_on_shell_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                const gchar* name,
                                                                                const gchar* name_owner,
                                                                                gpointer self);
static void _gnome_shell_extension_on_shell_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                const gchar* name,
                                                                                gpointer self);
static void _gnome_shell_extension_on_shell_integration_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                            const gchar* name,
                                                                                            const gchar* name_owner,
                                                                                            gpointer self);
static void _gnome_shell_extension_on_shell_integration_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                            const gchar* name,
                                                                                            gpointer self);
static void gnome_shell_extension_finalize (GObject * obj);
static void _vala_gnome_shell_extension_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_gnome_shell_extension_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

GQuark
gnome_shell_extension_error_quark (void)
{
	return g_quark_from_static_string ("gnome-shell-extension-error-quark");
}

static GType
gnome_shell_extension_error_get_type_once (void)
{
	static const GEnumValue values[] = {{GNOME_SHELL_EXTENSION_ERROR_TIMED_OUT, "GNOME_SHELL_EXTENSION_ERROR_TIMED_OUT", "timed-out"}, {GNOME_SHELL_EXTENSION_ERROR_NOT_ALLOWED, "GNOME_SHELL_EXTENSION_ERROR_NOT_ALLOWED", "not-allowed"}, {GNOME_SHELL_EXTENSION_ERROR_DOWNLOAD_FAILED, "GNOME_SHELL_EXTENSION_ERROR_DOWNLOAD_FAILED", "download-failed"}, {GNOME_SHELL_EXTENSION_ERROR_OTHER, "GNOME_SHELL_EXTENSION_ERROR_OTHER", "other"}, {0, NULL, NULL}};
	GType gnome_shell_extension_error_type_id;
	gnome_shell_extension_error_type_id = g_enum_register_static ("GnomeShellExtensionError", values);
	return gnome_shell_extension_error_type_id;
}

GType
gnome_shell_extension_error_get_type (void)
{
	static volatile gsize gnome_shell_extension_error_type_id__once = 0;
	if (g_once_init_enter (&gnome_shell_extension_error_type_id__once)) {
		GType gnome_shell_extension_error_type_id;
		gnome_shell_extension_error_type_id = gnome_shell_extension_error_get_type_once ();
		g_once_init_leave (&gnome_shell_extension_error_type_id__once, gnome_shell_extension_error_type_id);
	}
	return gnome_shell_extension_error_type_id__once;
}

static inline gpointer
gnome_shell_extension_get_instance_private (GnomeShellExtension* self)
{
	return G_STRUCT_MEMBER_P (self, GnomeShellExtension_private_offset);
}

GnomeShellIntegration*
gnome_shell_extension_get_shell_integration_proxy (GnomeShellExtension* self)
{
	GnomeShellIntegration* _tmp0_;
	GnomeShellIntegration* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->shell_integration_proxy;
	result = _tmp0_;
	return result;
}

static void
gnome_shell_extension_update_available (GnomeShellExtension* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GnomeShellExtensions* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->shell_extensions_proxy;
	if (_tmp2_ != NULL) {
		GnomeShellExtensions* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = self->priv->shell_extensions_proxy;
		_tmp4_ = gnome_shell_extensions_get_user_extensions_enabled (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GnomeExtensionInfo _tmp6_;
		_tmp6_ = self->priv->extension_info;
		_tmp0_ = _tmp6_.state != GNOME_EXTENSION_STATE_UNKNOWN;
	} else {
		_tmp0_ = FALSE;
	}
	gnome_shell_extension_set_available (self, _tmp0_);
}

static void
gnome_shell_extension_on_properties_changed (GnomeShellExtension* self,
                                             GVariant* changed_properties,
                                             gchar** invalidated_properties,
                                             gint invalidated_properties_length1)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (changed_properties != NULL);
	gnome_shell_extension_update_available (self);
}

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

static void
_gnome_shell_extension_on_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                                                GVariant* changed_properties,
                                                                                gchar** invalidated_properties,
                                                                                gpointer self)
{
	gnome_shell_extension_on_properties_changed ((GnomeShellExtension*) self, changed_properties, invalidated_properties, _vala_array_length (invalidated_properties));
}

static void
_gnome_shell_extension_on_extension_state_changed_gnome_shell_extensions_extension_state_changed (GnomeShellExtensions* _sender,
                                                                                                  const gchar* uuid,
                                                                                                  GHashTable* state,
                                                                                                  gpointer self)
{
	gnome_shell_extension_on_extension_state_changed ((GnomeShellExtension*) self, uuid, state);
}

static void
___lambda4_ (GnomeShellExtension* self,
             GObject* obj,
             GAsyncResult* res)
{
	FtAsyncCallback** callbacks = NULL;
	FtAsyncCallback** _tmp0_;
	gint _tmp0__length1;
	gint callbacks_length1;
	gint _callbacks_size_;
	FtAsyncCallback** _tmp1_;
	FtAsyncCallback** _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (res != NULL);
	gnome_shell_extension_query_extension_state_finish (self, res);
	_tmp0_ = self->priv->wait_callbacks;
	_tmp0__length1 = self->priv->wait_callbacks_length1;
	self->priv->wait_callbacks = NULL;
	self->priv->wait_callbacks_length1 = 0;
	callbacks = _tmp0_;
	callbacks_length1 = _tmp0__length1;
	_callbacks_size_ = callbacks_length1;
	_tmp1_ = g_new0 (FtAsyncCallback*, 0 + 1);
	self->priv->wait_callbacks = (_vala_array_free (self->priv->wait_callbacks, self->priv->wait_callbacks_length1, (GDestroyNotify) ft_async_callback_free), NULL);
	self->priv->wait_callbacks = _tmp1_;
	self->priv->wait_callbacks_length1 = 0;
	self->priv->_wait_callbacks_size_ = self->priv->wait_callbacks_length1;
	_tmp2_ = callbacks;
	_tmp2__length1 = callbacks_length1;
	{
		FtAsyncCallback** callback_collection = NULL;
		gint callback_collection_length1 = 0;
		gint _callback_collection_size_ = 0;
		gint callback_it = 0;
		callback_collection = _tmp2_;
		callback_collection_length1 = _tmp2__length1;
		for (callback_it = 0; callback_it < callback_collection_length1; callback_it = callback_it + 1) {
			FtAsyncCallback* callback = NULL;
			callback = callback_collection[callback_it];
			{
				FtAsyncCallback* _tmp3_;
				GSourceFunc _tmp4_;
				gpointer _tmp4__target;
				_tmp3_ = callback;
				_tmp4_ = _tmp3_->func;
				_tmp4__target = _tmp3_->func_target;
				_tmp4_ (_tmp4__target);
			}
		}
	}
	callbacks = (_vala_array_free (callbacks, callbacks_length1, (GDestroyNotify) ft_async_callback_free), NULL);
}

static void
____lambda4__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	___lambda4_ ((GnomeShellExtension*) self, source_object, res);
	g_object_unref (self);
}

static void
gnome_shell_extension_on_shell_name_appeared (GnomeShellExtension* self,
                                              GDBusConnection* connection,
                                              const gchar* name,
                                              const gchar* name_owner)
{
	GnomeShellExtensions* _tmp0_;
	GError* _inner_error0_ = NULL;
	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);
	_tmp0_ = self->priv->shell_extensions_proxy;
	if (_tmp0_ != NULL) {
		return;
	}
	{
		GnomeShellExtensions* _tmp1_ = NULL;
		GCancellable* _tmp2_;
		GnomeShellExtensions* _tmp3_;
		GnomeShellExtensions* _tmp4_;
		GDBusProxy* shell_extensions_proxy = NULL;
		GnomeShellExtensions* _tmp5_;
		GDBusProxy* _tmp6_;
		GDBusProxy* _tmp7_;
		GnomeShellExtensions* _tmp8_;
		_tmp2_ = self->priv->cancellable;
		_tmp3_ = (GnomeShellExtensions*) g_initable_new (GNOME_TYPE_SHELL_EXTENSIONS_PROXY, _tmp2_, &_inner_error0_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", "org.gnome.Shell", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/gnome/Shell", "g-interface-name", "org.gnome.Shell.Extensions", NULL);
		_tmp1_ = (GnomeShellExtensions*) _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (self->priv->shell_extensions_proxy);
		self->priv->shell_extensions_proxy = _tmp4_;
		_tmp5_ = self->priv->shell_extensions_proxy;
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, g_dbus_proxy_get_type (), GDBusProxy));
		shell_extensions_proxy = _tmp6_;
		_tmp7_ = shell_extensions_proxy;
		g_signal_connect_object (_tmp7_, "g-properties-changed", (GCallback) _gnome_shell_extension_on_properties_changed_g_dbus_proxy_g_properties_changed, self, 0);
		_tmp8_ = self->priv->shell_extensions_proxy;
		g_signal_connect_object (_tmp8_, "extension-state-changed", (GCallback) _gnome_shell_extension_on_extension_state_changed_gnome_shell_extensions_extension_state_changed, self, 0);
		gnome_shell_extension_query_extension_state (self, ____lambda4__gasync_ready_callback, g_object_ref (self));
		_g_object_unref0 (shell_extensions_proxy);
		_g_object_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = _error_;
		_tmp10_ = _tmp9_->message;
		g_warning ("shell-extension.vala:151: Error while initializing extensions proxy: %" \
"s", _tmp10_);
		_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
gnome_shell_extension_on_shell_name_vanished (GnomeShellExtension* self,
                                              GDBusConnection* connection,
                                              const gchar* name)
{
	GnomeShellExtensions* _tmp0_;
	GDBusProxy* shell_extensions_proxy = NULL;
	GnomeShellExtensions* _tmp1_;
	GDBusProxy* _tmp2_;
	GDBusProxy* _tmp3_;
	guint _tmp4_;
	GnomeShellExtensions* _tmp5_;
	guint _tmp6_;
	FtAsyncCallback** callbacks = NULL;
	FtAsyncCallback** _tmp7_;
	gint _tmp7__length1;
	gint callbacks_length1;
	gint _callbacks_size_;
	FtAsyncCallback** _tmp8_;
	FtAsyncCallback** _tmp9_;
	gint _tmp9__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->shell_extensions_proxy;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->shell_extensions_proxy;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, g_dbus_proxy_get_type (), GDBusProxy));
	shell_extensions_proxy = _tmp2_;
	_tmp3_ = shell_extensions_proxy;
	g_signal_parse_name ("g-properties-changed", g_dbus_proxy_get_type (), &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _gnome_shell_extension_on_properties_changed_g_dbus_proxy_g_properties_changed, self);
	_tmp5_ = self->priv->shell_extensions_proxy;
	g_signal_parse_name ("extension-state-changed", GNOME_TYPE_SHELL_EXTENSIONS, &_tmp6_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _gnome_shell_extension_on_extension_state_changed_gnome_shell_extensions_extension_state_changed, self);
	gnome_extension_info_destroy (&self->priv->extension_info);
	gnome_extension_info_init (&self->priv->extension_info, GNOME_SHELL_EXTENSION_EXTENSION_UUID);
	g_object_notify ((GObject*) self, "state");
	_g_object_unref0 (self->priv->shell_extensions_proxy);
	self->priv->shell_extensions_proxy = NULL;
	gnome_shell_extension_set_available (self, FALSE);
	gnome_shell_extension_set_enabled (self, FALSE);
	_tmp7_ = self->priv->wait_callbacks;
	_tmp7__length1 = self->priv->wait_callbacks_length1;
	self->priv->wait_callbacks = NULL;
	self->priv->wait_callbacks_length1 = 0;
	callbacks = _tmp7_;
	callbacks_length1 = _tmp7__length1;
	_callbacks_size_ = callbacks_length1;
	_tmp8_ = g_new0 (FtAsyncCallback*, 0 + 1);
	self->priv->wait_callbacks = (_vala_array_free (self->priv->wait_callbacks, self->priv->wait_callbacks_length1, (GDestroyNotify) ft_async_callback_free), NULL);
	self->priv->wait_callbacks = _tmp8_;
	self->priv->wait_callbacks_length1 = 0;
	self->priv->_wait_callbacks_size_ = self->priv->wait_callbacks_length1;
	_tmp9_ = callbacks;
	_tmp9__length1 = callbacks_length1;
	{
		FtAsyncCallback** callback_collection = NULL;
		gint callback_collection_length1 = 0;
		gint _callback_collection_size_ = 0;
		gint callback_it = 0;
		callback_collection = _tmp9_;
		callback_collection_length1 = _tmp9__length1;
		for (callback_it = 0; callback_it < callback_collection_length1; callback_it = callback_it + 1) {
			FtAsyncCallback* callback = NULL;
			callback = callback_collection[callback_it];
			{
				FtAsyncCallback* _tmp10_;
				GSourceFunc _tmp11_;
				gpointer _tmp11__target;
				_tmp10_ = callback;
				_tmp11_ = _tmp10_->func;
				_tmp11__target = _tmp10_->func_target;
				_tmp11_ (_tmp11__target);
			}
		}
	}
	callbacks = (_vala_array_free (callbacks, callbacks_length1, (GDestroyNotify) ft_async_callback_free), NULL);
	_g_object_unref0 (shell_extensions_proxy);
}

static void
gnome_shell_extension_on_shell_integration_name_appeared (GnomeShellExtension* self,
                                                          GDBusConnection* connection,
                                                          const gchar* name,
                                                          const gchar* name_owner)
{
	GnomeShellIntegration* _tmp0_;
	GError* _inner_error0_ = NULL;
	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);
	_tmp0_ = self->priv->shell_integration_proxy;
	if (_tmp0_ != NULL) {
		return;
	}
	{
		GnomeShellIntegration* _tmp1_ = NULL;
		GCancellable* _tmp2_;
		GnomeShellIntegration* _tmp3_;
		GnomeShellIntegration* _tmp4_;
		GnomeShellIntegration* _tmp5_;
		GnomeShellExtensionSettings* _tmp6_;
		_tmp2_ = self->priv->cancellable;
		_tmp3_ = (GnomeShellIntegration*) g_initable_new (GNOME_TYPE_SHELL_INTEGRATION_PROXY, _tmp2_, &_inner_error0_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", "io.github.focustimerhq.FocusTimer.ShellIntegration", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/io/github/focustimerhq/FocusTimer/ShellIntegration", "g-interface-name", "io.github.focustimerhq.FocusTimer.ShellIntegration", NULL);
		_tmp1_ = (GnomeShellIntegration*) _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (self->priv->shell_integration_proxy);
		self->priv->shell_integration_proxy = _tmp4_;
		_tmp5_ = self->priv->shell_integration_proxy;
		_tmp6_ = gnome_shell_extension_settings_new (_tmp5_);
		_g_object_unref0 (self->priv->_settings);
		self->priv->_settings = _tmp6_;
		g_object_notify ((GObject*) self, "settings");
		_g_object_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = _error_;
		_tmp8_ = _tmp7_->message;
		g_warning ("shell-extension.vala:203: Error while initializing Shell integration p" \
"roxy: %s", _tmp8_);
		_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
gnome_shell_extension_on_shell_integration_name_vanished (GnomeShellExtension* self,
                                                          GDBusConnection* connection,
                                                          const gchar* name)
{
	GnomeShellExtensionSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->_settings;
	if (_tmp0_ != NULL) {
		_g_object_unref0 (self->priv->_settings);
		self->priv->_settings = NULL;
		g_object_notify ((GObject*) self, "settings");
	}
	_g_object_unref0 (self->priv->shell_integration_proxy);
	self->priv->shell_integration_proxy = NULL;
}

static void
gnome_shell_extension_on_extension_state_changed (GnomeShellExtension* self,
                                                  const gchar* uuid,
                                                  GHashTable* state)
{
	GnomeExtensionInfo _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (uuid != NULL);
	g_return_if_fail (state != NULL);
	if (g_strcmp0 (uuid, GNOME_SHELL_EXTENSION_EXTENSION_UUID) != 0) {
		return;
	}
	gnome_extension_info_destroy (&self->priv->extension_info);
	gnome_extension_info_init_deserialize (&self->priv->extension_info, uuid, state);
	_tmp0_ = self->priv->extension_info;
	gnome_shell_extension_set_enabled (self, _tmp0_.enabled);
	gnome_shell_extension_update_available (self);
	g_object_notify ((GObject*) self, "state");
}

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

static void
gnome_shell_extension_query_extension_state (GnomeShellExtension* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	GnomeShellExtensionQueryExtensionStateData* _data_;
	GnomeShellExtension* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GnomeShellExtensionQueryExtensionStateData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_shell_extension_query_extension_state_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_shell_extension_query_extension_state_co (_data_);
}

static void
gnome_shell_extension_query_extension_state_finish (GnomeShellExtension* self,
                                                    GAsyncResult* _res_)
{
	GnomeShellExtensionQueryExtensionStateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
gnome_shell_extension_query_extension_state_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	GnomeShellExtensionQueryExtensionStateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gnome_shell_extension_query_extension_state_co (_data_);
}

static gboolean
gnome_shell_extension_query_extension_state_co (GnomeShellExtensionQueryExtensionStateData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp1_ = _data_->self->priv->shell_extensions_proxy;
		_data_->_state_ = 1;
		gnome_shell_extensions_get_extension_info (_data_->_tmp1_, GNOME_SHELL_EXTENSION_EXTENSION_UUID, gnome_shell_extension_query_extension_state_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = gnome_shell_extensions_get_extension_info_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp0_ = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gnome_extension_info_destroy (&_data_->self->priv->extension_info);
		gnome_extension_info_init_deserialize (&_data_->self->priv->extension_info, GNOME_SHELL_EXTENSION_EXTENSION_UUID, _data_->_tmp0_);
		_data_->_tmp3_ = _data_->self->priv->extension_info;
		gnome_shell_extension_set_enabled (_data_->self, _data_->_tmp3_.enabled);
		g_object_notify ((GObject*) _data_->self, "state");
		_g_hash_table_unref0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->_error_;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("shell-extension.vala:241: Error while querying extension state: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	gnome_shell_extension_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_shell_extension_wait_data_free (gpointer _data)
{
	GnomeShellExtensionWaitData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GnomeShellExtensionWaitData, _data_);
}

void
gnome_shell_extension_wait (GnomeShellExtension* self,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	GnomeShellExtensionWaitData* _data_;
	GnomeShellExtension* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GnomeShellExtensionWaitData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_shell_extension_wait_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_shell_extension_wait_co (_data_);
}

void
gnome_shell_extension_wait_finish (GnomeShellExtension* self,
                                   GAsyncResult* _res_)
{
	GnomeShellExtensionWaitData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

/**
         * Wait until initialized
         */
static gboolean
_gnome_shell_extension_wait_co_gsource_func (gpointer self)
{
	gboolean result;
	result = gnome_shell_extension_wait_co (self);
	return result;
}

static void
_vala_array_add2 (FtAsyncCallback** * array,
                  gint* length,
                  gint* size,
                  FtAsyncCallback* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (FtAsyncCallback*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gboolean
gnome_shell_extension_wait_co (GnomeShellExtensionWaitData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->shell_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;
	}
	_data_->_tmp0_ = _data_->self->priv->extension_info;
	if (_data_->_tmp0_.state != GNOME_EXTENSION_STATE_UNKNOWN) {
		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;
	}
	_data_->_tmp1_ = ft_async_callback_new (_gnome_shell_extension_wait_co_gsource_func, _data_, NULL);
	_vala_array_add2 (&_data_->self->priv->wait_callbacks, &_data_->self->priv->wait_callbacks_length1, &_data_->self->priv->_wait_callbacks_size_, _data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	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;
}

gboolean
gnome_shell_extension_is_installed (GnomeShellExtension* self)
{
	GnomeExtensionInfo _tmp0_;
	GnomeExtensionInfo _tmp1_;
	const gchar* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->extension_info;
	if (_tmp0_.state == GNOME_EXTENSION_STATE_UNINSTALLED) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->extension_info;
	_tmp2_ = _tmp1_.path;
	result = g_strcmp0 (_tmp2_, "") != 0;
	return result;
}

gboolean
gnome_shell_extension_has_update (GnomeShellExtension* self)
{
	GnomeExtensionInfo _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->extension_info;
	result = _tmp0_.has_update;
	return result;
}

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

void
gnome_shell_extension_enable_extension (GnomeShellExtension* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	GnomeShellExtensionEnableExtensionData* _data_;
	GnomeShellExtension* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GnomeShellExtensionEnableExtensionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_shell_extension_enable_extension_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_shell_extension_enable_extension_co (_data_);
}

gboolean
gnome_shell_extension_enable_extension_finish (GnomeShellExtension* self,
                                               GAsyncResult* _res_)
{
	gboolean result;
	GnomeShellExtensionEnableExtensionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gnome_shell_extension_enable_extension_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	GnomeShellExtensionEnableExtensionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gnome_shell_extension_enable_extension_co (_data_);
}

static gboolean
gnome_shell_extension_enable_extension_co (GnomeShellExtensionEnableExtensionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->shell_extensions_proxy;
	if (_data_->_tmp0_ == NULL) {
		_data_->result = 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;
	}
	{
		_data_->_tmp2_ = _data_->self->priv->shell_extensions_proxy;
		_data_->_state_ = 1;
		gnome_shell_extensions_enable_extension (_data_->_tmp2_, GNOME_SHELL_EXTENSION_EXTENSION_UUID, gnome_shell_extension_enable_extension_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = gnome_shell_extensions_enable_extension_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->result = _data_->_tmp1_;
		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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->_error_;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("shell-extension.vala:289: Error while enabling extension: %s", _data_->_tmp4_);
		_data_->result = FALSE;
		_g_error_free0 (_data_->_error_);
		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;
	}
	__finally0:
	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);
	g_clear_error (&_data_->_inner_error0_);
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

void
gnome_shell_extension_disable_extension (GnomeShellExtension* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	GnomeShellExtensionDisableExtensionData* _data_;
	GnomeShellExtension* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GnomeShellExtensionDisableExtensionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_shell_extension_disable_extension_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_shell_extension_disable_extension_co (_data_);
}

gboolean
gnome_shell_extension_disable_extension_finish (GnomeShellExtension* self,
                                                GAsyncResult* _res_)
{
	gboolean result;
	GnomeShellExtensionDisableExtensionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gnome_shell_extension_disable_extension_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	GnomeShellExtensionDisableExtensionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gnome_shell_extension_disable_extension_co (_data_);
}

static gboolean
gnome_shell_extension_disable_extension_co (GnomeShellExtensionDisableExtensionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->shell_extensions_proxy;
	if (_data_->_tmp0_ == NULL) {
		_data_->result = 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;
	}
	{
		_data_->_tmp2_ = _data_->self->priv->shell_extensions_proxy;
		_data_->_state_ = 1;
		gnome_shell_extensions_disable_extension (_data_->_tmp2_, GNOME_SHELL_EXTENSION_EXTENSION_UUID, gnome_shell_extension_disable_extension_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = gnome_shell_extensions_disable_extension_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->result = _data_->_tmp1_;
		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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->_error_;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("shell-extension.vala:304: Error while disabling extension: %s", _data_->_tmp4_);
		_data_->result = FALSE;
		_g_error_free0 (_data_->_error_);
		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;
	}
	__finally0:
	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);
	g_clear_error (&_data_->_inner_error0_);
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

void
gnome_shell_extension_install_extension (GnomeShellExtension* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	GnomeShellExtensionInstallExtensionData* _data_;
	GnomeShellExtension* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GnomeShellExtensionInstallExtensionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_shell_extension_install_extension_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_shell_extension_install_extension_co (_data_);
}

gboolean
gnome_shell_extension_install_extension_finish (GnomeShellExtension* self,
                                                GAsyncResult* _res_,
                                                GError** error)
{
	gboolean result;
	GnomeShellExtensionInstallExtensionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
gnome_shell_extension_install_extension_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	GnomeShellExtensionInstallExtensionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gnome_shell_extension_install_extension_co (_data_);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
gnome_shell_extension_install_extension_co (GnomeShellExtensionInstallExtensionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->shell_extensions_proxy;
	if (_data_->_tmp0_ == NULL) {
		_data_->result = 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 GQuark _tmp5_label0 = 0;
		static GQuark _tmp5_label1 = 0;
		_data_->_tmp1_ = _data_->self->priv->shell_extensions_proxy;
		_data_->_state_ = 1;
		gnome_shell_extensions_install_remote_extension (_data_->_tmp1_, GNOME_SHELL_EXTENSION_EXTENSION_UUID, gnome_shell_extension_install_extension_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = gnome_shell_extensions_install_remote_extension_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_result_ = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp3_ = _data_->_result_;
		_data_->_tmp6_ = 0U;
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp6_ = (NULL == _data_->_tmp4_) ? 0 : g_quark_from_string (_data_->_tmp4_);
		if (_data_->_tmp6_ == ((0 != _tmp5_label0) ? _tmp5_label0 : (_tmp5_label0 = g_quark_from_static_string ("successful")))) {
			switch (0) {
				default:
				{
					_data_->result = TRUE;
					_g_free0 (_data_->_result_);
					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;
				}
			}
		} else if (_data_->_tmp6_ == ((0 != _tmp5_label1) ? _tmp5_label1 : (_tmp5_label1 = g_quark_from_static_string ("cancelled")))) {
			switch (0) {
				default:
				{
					_data_->result = FALSE;
					_g_free0 (_data_->_result_);
					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;
				}
			}
		} else {
			switch (0) {
				default:
				{
					_data_->_tmp7_ = _data_->_result_;
					g_warning ("shell-extension.vala:327: Unhandled InstallRemoteExtension result: `%s" \
"`", _data_->_tmp7_);
					_data_->result = FALSE;
					_g_free0 (_data_->_result_);
					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;
				}
			}
		}
		_g_free0 (_data_->_result_);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->_error_;
		if (_data_->_tmp8_->code == G_IO_ERROR_TIMED_OUT) {
			_data_->_tmp9_ = g_error_new_literal (GNOME_SHELL_EXTENSION_ERROR, GNOME_SHELL_EXTENSION_ERROR_TIMED_OUT, "Timed out");
			_data_->_inner_error0_ = _data_->_tmp9_;
			_g_error_free0 (_data_->_error_);
			goto __finally0;
		}
		_data_->_tmp11_ = _data_->_error_;
		if (_data_->_tmp11_->code == G_IO_ERROR_DBUS_ERROR) {
			_data_->_tmp12_ = _data_->_error_;
			_data_->_tmp13_ = _data_->_tmp12_->message;
			_data_->_tmp10_ = string_contains (_data_->_tmp13_, "Shell.Extensions.Error.NotAllowed");
		} else {
			_data_->_tmp10_ = FALSE;
		}
		if (_data_->_tmp10_) {
			_data_->_tmp14_ = g_error_new_literal (GNOME_SHELL_EXTENSION_ERROR, GNOME_SHELL_EXTENSION_ERROR_NOT_ALLOWED, "Not allowed");
			_data_->_inner_error0_ = _data_->_tmp14_;
			_g_error_free0 (_data_->_error_);
			goto __finally0;
		}
		_data_->_tmp17_ = _data_->_error_;
		if (_data_->_tmp17_->code == G_IO_ERROR_DBUS_ERROR) {
			_data_->_tmp18_ = _data_->_error_;
			_data_->_tmp19_ = _data_->_tmp18_->message;
			_data_->_tmp16_ = string_contains (_data_->_tmp19_, "Shell.Extensions.Error.InfoDownloadFailed");
		} else {
			_data_->_tmp16_ = FALSE;
		}
		if (_data_->_tmp16_) {
			_data_->_tmp15_ = TRUE;
		} else {
			_data_->_tmp20_ = _data_->_error_;
			_data_->_tmp21_ = _data_->_tmp20_->message;
			_data_->_tmp15_ = string_contains (_data_->_tmp21_, "Shell.Extensions.Error.DownloadFailed");
		}
		if (_data_->_tmp15_) {
			_data_->_tmp22_ = g_error_new_literal (GNOME_SHELL_EXTENSION_ERROR, GNOME_SHELL_EXTENSION_ERROR_DOWNLOAD_FAILED, "Failed to download the extension");
			_data_->_inner_error0_ = _data_->_tmp22_;
			_g_error_free0 (_data_->_error_);
			goto __finally0;
		}
		_data_->_tmp23_ = _data_->_error_;
		_data_->_tmp24_ = _data_->_tmp23_->message;
		g_warning ("shell-extension.vala:349: Error while installing extension: %s", _data_->_tmp24_);
		_data_->_tmp25_ = _data_->_error_;
		_data_->_tmp26_ = _data_->_tmp25_->message;
		_data_->_tmp27_ = g_error_new_literal (GNOME_SHELL_EXTENSION_ERROR, GNOME_SHELL_EXTENSION_ERROR_OTHER, _data_->_tmp26_);
		_data_->_inner_error0_ = _data_->_tmp27_;
		_g_error_free0 (_data_->_error_);
		goto __finally0;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_vala1__error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp28_ = _data_->_vala1__error_;
		_data_->_tmp29_ = _data_->_tmp28_->message;
		g_warning ("shell-extension.vala:353: Error while installing extension: %s", _data_->_tmp29_);
		_data_->_tmp30_ = _data_->_vala1__error_;
		_data_->_tmp31_ = _data_->_tmp30_->message;
		_data_->_tmp32_ = g_error_new_literal (GNOME_SHELL_EXTENSION_ERROR, GNOME_SHELL_EXTENSION_ERROR_OTHER, _data_->_tmp31_);
		_data_->_inner_error0_ = _data_->_tmp32_;
		_g_error_free0 (_data_->_vala1__error_);
		goto __finally0;
	}
	__finally0:
	if (_data_->_inner_error0_->domain == GNOME_SHELL_EXTENSION_ERROR) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		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);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
}

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

void
gnome_shell_extension_uninstall_extension (GnomeShellExtension* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	GnomeShellExtensionUninstallExtensionData* _data_;
	GnomeShellExtension* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GnomeShellExtensionUninstallExtensionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gnome_shell_extension_uninstall_extension_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	gnome_shell_extension_uninstall_extension_co (_data_);
}

gboolean
gnome_shell_extension_uninstall_extension_finish (GnomeShellExtension* self,
                                                  GAsyncResult* _res_)
{
	gboolean result;
	GnomeShellExtensionUninstallExtensionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
gnome_shell_extension_uninstall_extension_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	GnomeShellExtensionUninstallExtensionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	gnome_shell_extension_uninstall_extension_co (_data_);
}

static gboolean
gnome_shell_extension_uninstall_extension_co (GnomeShellExtensionUninstallExtensionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->shell_extensions_proxy;
	if (_data_->_tmp0_ == NULL) {
		_data_->result = 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;
	}
	{
		_data_->_tmp2_ = _data_->self->priv->shell_extensions_proxy;
		_data_->_state_ = 1;
		gnome_shell_extensions_uninstall_extension (_data_->_tmp2_, GNOME_SHELL_EXTENSION_EXTENSION_UUID, gnome_shell_extension_uninstall_extension_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = gnome_shell_extensions_uninstall_extension_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->result = _data_->_tmp1_;
		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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->_error_;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("shell-extension.vala:368: Error while uninstalling extension: %s", _data_->_tmp4_);
		_data_->result = FALSE;
		_g_error_free0 (_data_->_error_);
		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;
	}
	__finally0:
	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);
	g_clear_error (&_data_->_inner_error0_);
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
gnome_shell_extension_real_dispose (GObject* base)
{
	GnomeShellExtension * self;
	GCancellable* _tmp0_;
	self = (GnomeShellExtension*) base;
	if (self->priv->shell_watcher_id != ((guint) 0)) {
		g_bus_unwatch_name (self->priv->shell_watcher_id);
		self->priv->shell_watcher_id = (guint) 0;
	}
	if (self->priv->shell_integration_watcher_id != ((guint) 0)) {
		g_bus_unwatch_name (self->priv->shell_integration_watcher_id);
		self->priv->shell_integration_watcher_id = (guint) 0;
	}
	_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;
	}
	_g_object_unref0 (self->priv->_settings);
	self->priv->_settings = NULL;
	_g_object_unref0 (self->priv->shell_extensions_proxy);
	self->priv->shell_extensions_proxy = NULL;
	_g_object_unref0 (self->priv->shell_integration_proxy);
	self->priv->shell_integration_proxy = NULL;
	G_OBJECT_CLASS (gnome_shell_extension_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

GnomeShellExtension*
gnome_shell_extension_construct (GType object_type)
{
	GnomeShellExtension * self = NULL;
	self = (GnomeShellExtension*) g_object_new (object_type, NULL);
	return self;
}

GnomeShellExtension*
gnome_shell_extension_new (void)
{
	return gnome_shell_extension_construct (GNOME_TYPE_SHELL_EXTENSION);
}

gboolean
gnome_shell_extension_get_available (GnomeShellExtension* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_available;
	return result;
}

static void
gnome_shell_extension_set_available (GnomeShellExtension* self,
                                     gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_available != value) {
		self->priv->_available = value;
		g_object_notify ((GObject*) self, "available");
	}
}

gboolean
gnome_shell_extension_get_enabled (GnomeShellExtension* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_enabled;
	return result;
}

static void
gnome_shell_extension_set_enabled (GnomeShellExtension* self,
                                   gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_enabled != value) {
		self->priv->_enabled = value;
		g_object_notify ((GObject*) self, "enabled");
	}
}

GnomeExtensionState
gnome_shell_extension_get_state (GnomeShellExtension* self)
{
	GnomeExtensionState result;
	GnomeExtensionInfo _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->extension_info;
	result = _tmp0_.state;
	return result;
}

GnomeShellExtensionSettings*
gnome_shell_extension_get_settings (GnomeShellExtension* self)
{
	GnomeShellExtensionSettings* result;
	GnomeShellExtensionSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_settings;
	result = _tmp0_;
	return result;
}

static void
_gnome_shell_extension_on_shell_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                           const gchar* name,
                                                                           const gchar* name_owner,
                                                                           gpointer self)
{
	gnome_shell_extension_on_shell_name_appeared ((GnomeShellExtension*) self, connection, name, name_owner);
}

static void
_gnome_shell_extension_on_shell_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                           const gchar* name,
                                                                           gpointer self)
{
	gnome_shell_extension_on_shell_name_vanished ((GnomeShellExtension*) self, connection, name);
}

static void
_gnome_shell_extension_on_shell_integration_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                       const gchar* name,
                                                                                       const gchar* name_owner,
                                                                                       gpointer self)
{
	gnome_shell_extension_on_shell_integration_name_appeared ((GnomeShellExtension*) self, connection, name, name_owner);
}

static void
_gnome_shell_extension_on_shell_integration_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                       const gchar* name,
                                                                                       gpointer self)
{
	gnome_shell_extension_on_shell_integration_name_vanished ((GnomeShellExtension*) self, connection, name);
}

static GObject *
gnome_shell_extension_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	static GWeakRef GnomeShellExtension_singleton__ref;
	static GMutex GnomeShellExtension_singleton__lock;
	GnomeShellExtension * self;
	GCancellable* _tmp0_;
	FtAsyncCallback** _tmp1_;
	g_mutex_lock (&GnomeShellExtension_singleton__lock);
	obj = g_weak_ref_get (&GnomeShellExtension_singleton__ref);
	if (obj != NULL) {
		g_mutex_unlock (&GnomeShellExtension_singleton__lock);
		return obj;
	}
	parent_class = G_OBJECT_CLASS (gnome_shell_extension_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_TYPE_SHELL_EXTENSION, GnomeShellExtension);
	gnome_extension_info_destroy (&self->priv->extension_info);
	gnome_extension_info_init (&self->priv->extension_info, GNOME_SHELL_EXTENSION_EXTENSION_UUID);
	_tmp0_ = g_cancellable_new ();
	_g_object_unref0 (self->priv->cancellable);
	self->priv->cancellable = _tmp0_;
	_tmp1_ = g_new0 (FtAsyncCallback*, 0 + 1);
	self->priv->wait_callbacks = (_vala_array_free (self->priv->wait_callbacks, self->priv->wait_callbacks_length1, (GDestroyNotify) ft_async_callback_free), NULL);
	self->priv->wait_callbacks = _tmp1_;
	self->priv->wait_callbacks_length1 = 0;
	self->priv->_wait_callbacks_size_ = self->priv->wait_callbacks_length1;
	if (!ft_is_devel ()) {
		self->priv->shell_watcher_id = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "org.gnome.Shell", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_gnome_shell_extension_on_shell_name_appeared_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _gnome_shell_extension_on_shell_name_appeared_gbus_name_appeared_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((_gnome_shell_extension_on_shell_name_vanished_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _gnome_shell_extension_on_shell_name_vanished_gbus_name_vanished_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
		self->priv->shell_integration_watcher_id = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "io.github.focustimerhq.FocusTimer.ShellIntegration", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_gnome_shell_extension_on_shell_integration_name_appeared_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _gnome_shell_extension_on_shell_integration_name_appeared_gbus_name_appeared_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((_gnome_shell_extension_on_shell_integration_name_vanished_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _gnome_shell_extension_on_shell_integration_name_vanished_gbus_name_vanished_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
	}
	g_weak_ref_set (&GnomeShellExtension_singleton__ref, obj);
	g_mutex_unlock (&GnomeShellExtension_singleton__lock);
	return obj;
}

static void
gnome_shell_extension_class_init (GnomeShellExtensionClass * klass,
                                  gpointer klass_data)
{
	gnome_shell_extension_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomeShellExtension_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) gnome_shell_extension_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_shell_extension_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_shell_extension_set_property;
	G_OBJECT_CLASS (klass)->constructor = gnome_shell_extension_constructor;
	G_OBJECT_CLASS (klass)->finalize = gnome_shell_extension_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_AVAILABLE_PROPERTY, gnome_shell_extension_properties[GNOME_SHELL_EXTENSION_AVAILABLE_PROPERTY] = g_param_spec_boolean ("available", "available", "available", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_ENABLED_PROPERTY, gnome_shell_extension_properties[GNOME_SHELL_EXTENSION_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_STATE_PROPERTY, gnome_shell_extension_properties[GNOME_SHELL_EXTENSION_STATE_PROPERTY] = g_param_spec_enum ("state", "state", "state", GNOME_TYPE_EXTENSION_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_SETTINGS_PROPERTY, gnome_shell_extension_properties[GNOME_SHELL_EXTENSION_SETTINGS_PROPERTY] = g_param_spec_object ("settings", "settings", "settings", GNOME_TYPE_SHELL_EXTENSION_SETTINGS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gnome_shell_extension_instance_init (GnomeShellExtension * self,
                                     gpointer klass)
{
	self->priv = gnome_shell_extension_get_instance_private (self);
	self->priv->_available = FALSE;
	self->priv->_enabled = FALSE;
	self->priv->_settings = NULL;
	self->priv->shell_extensions_proxy = NULL;
	self->priv->shell_integration_proxy = NULL;
	self->priv->shell_watcher_id = (guint) 0;
	self->priv->shell_integration_watcher_id = (guint) 0;
	self->priv->cancellable = NULL;
}

static void
gnome_shell_extension_finalize (GObject * obj)
{
	GnomeShellExtension * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_TYPE_SHELL_EXTENSION, GnomeShellExtension);
	_g_object_unref0 (self->priv->_settings);
	_g_object_unref0 (self->priv->shell_extensions_proxy);
	_g_object_unref0 (self->priv->shell_integration_proxy);
	gnome_extension_info_destroy (&self->priv->extension_info);
	_g_object_unref0 (self->priv->cancellable);
	self->priv->wait_callbacks = (_vala_array_free (self->priv->wait_callbacks, self->priv->wait_callbacks_length1, (GDestroyNotify) ft_async_callback_free), NULL);
	G_OBJECT_CLASS (gnome_shell_extension_parent_class)->finalize (obj);
}

GType
gnome_shell_extension_get_type (void)
{
	return gnome_shell_extension_type_id;
}

GType
gnome_shell_extension_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomeShellExtensionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_shell_extension_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomeShellExtension), 0, (GInstanceInitFunc) gnome_shell_extension_instance_init, NULL };
	gnome_shell_extension_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "GnomeShellExtension", &g_define_type_info, 0);
	GnomeShellExtension_private_offset = sizeof (GnomeShellExtensionPrivate);
	return gnome_shell_extension_type_id;
}

static void
_vala_gnome_shell_extension_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	GnomeShellExtension * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_TYPE_SHELL_EXTENSION, GnomeShellExtension);
	switch (property_id) {
		case GNOME_SHELL_EXTENSION_AVAILABLE_PROPERTY:
		g_value_set_boolean (value, gnome_shell_extension_get_available (self));
		break;
		case GNOME_SHELL_EXTENSION_ENABLED_PROPERTY:
		g_value_set_boolean (value, gnome_shell_extension_get_enabled (self));
		break;
		case GNOME_SHELL_EXTENSION_STATE_PROPERTY:
		g_value_set_enum (value, gnome_shell_extension_get_state (self));
		break;
		case GNOME_SHELL_EXTENSION_SETTINGS_PROPERTY:
		g_value_set_object (value, gnome_shell_extension_get_settings (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_shell_extension_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	GnomeShellExtension * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_TYPE_SHELL_EXTENSION, GnomeShellExtension);
	switch (property_id) {
		case GNOME_SHELL_EXTENSION_AVAILABLE_PROPERTY:
		gnome_shell_extension_set_available (self, g_value_get_boolean (value));
		break;
		case GNOME_SHELL_EXTENSION_ENABLED_PROPERTY:
		gnome_shell_extension_set_enabled (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

