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

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

#include "ft_plugin_gnome.h"
#include <glib-object.h>
#include <glib.h>
#include <gio/gio.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_SETTINGS_0_PROPERTY,
	GNOME_SHELL_EXTENSION_SETTINGS_INDICATOR_TYPE_PROPERTY,
	GNOME_SHELL_EXTENSION_SETTINGS_BLUR_EFFECT_PROPERTY,
	GNOME_SHELL_EXTENSION_SETTINGS_DISMISS_GESTURE_PROPERTY,
	GNOME_SHELL_EXTENSION_SETTINGS_MANAGE_NOTIFICATIONS_PROPERTY,
	GNOME_SHELL_EXTENSION_SETTINGS_NUM_PROPERTIES
};
static GParamSpec* gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GnomeShellExtensionSettingsPrivate {
	GnomeShellIntegration* proxy;
};

static gint GnomeShellExtensionSettings_private_offset;
static gpointer gnome_shell_extension_settings_parent_class = NULL;
static GType gnome_shell_extension_settings_type_id = 0;

static void gnome_shell_extension_settings_on_properties_changed (GnomeShellExtensionSettings* self,
                                                           GVariant* changed_properties,
                                                           gchar** invalidated_properties,
                                                           gint invalidated_properties_length1);
static void _gnome_shell_extension_settings_on_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                                                              GVariant* changed_properties,
                                                                                              gchar** invalidated_properties,
                                                                                              gpointer self);
static void gnome_shell_extension_settings_real_dispose (GObject* base);
static void gnome_shell_extension_settings_finalize (GObject * obj);
static void _vala_gnome_shell_extension_settings_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_gnome_shell_extension_settings_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static gssize _vala_array_length (gpointer array);

static inline gpointer
gnome_shell_extension_settings_get_instance_private (GnomeShellExtensionSettings* self)
{
	return G_STRUCT_MEMBER_P (self, GnomeShellExtensionSettings_private_offset);
}

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

static void
_gnome_shell_extension_settings_on_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                                                         GVariant* changed_properties,
                                                                                         gchar** invalidated_properties,
                                                                                         gpointer self)
{
	gnome_shell_extension_settings_on_properties_changed ((GnomeShellExtensionSettings*) self, changed_properties, invalidated_properties, _vala_array_length (invalidated_properties));
}

GnomeShellExtensionSettings*
gnome_shell_extension_settings_construct (GType object_type,
                                          GnomeShellIntegration* shell_integration_proxy)
{
	GnomeShellExtensionSettings * self = NULL;
	GnomeShellIntegration* _tmp0_;
	GDBusProxy* proxy = NULL;
	GDBusProxy* _tmp1_;
	g_return_val_if_fail (shell_integration_proxy != NULL, NULL);
	self = (GnomeShellExtensionSettings*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (shell_integration_proxy);
	_g_object_unref0 (self->priv->proxy);
	self->priv->proxy = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (shell_integration_proxy, g_dbus_proxy_get_type (), GDBusProxy));
	proxy = _tmp1_;
	g_signal_connect_object (proxy, "g-properties-changed", (GCallback) _gnome_shell_extension_settings_on_properties_changed_g_dbus_proxy_g_properties_changed, self, 0);
	_g_object_unref0 (proxy);
	return self;
}

GnomeShellExtensionSettings*
gnome_shell_extension_settings_new (GnomeShellIntegration* shell_integration_proxy)
{
	return gnome_shell_extension_settings_construct (GNOME_TYPE_SHELL_EXTENSION_SETTINGS, shell_integration_proxy);
}

static void
gnome_shell_extension_settings_on_properties_changed (GnomeShellExtensionSettings* self,
                                                      GVariant* changed_properties,
                                                      gchar** invalidated_properties,
                                                      gint invalidated_properties_length1)
{
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	gboolean _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	gboolean _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	gboolean _tmp8_;
	GVariant* _tmp9_;
	GVariant* _tmp10_;
	gboolean _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (changed_properties != NULL);
	_tmp0_ = g_variant_lookup_value (changed_properties, "IndicatorType", NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ != NULL;
	_g_variant_unref0 (_tmp1_);
	if (_tmp2_) {
		g_object_notify ((GObject*) self, "indicator-type");
	}
	_tmp3_ = g_variant_lookup_value (changed_properties, "EnableBlurEffect", NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_ != NULL;
	_g_variant_unref0 (_tmp4_);
	if (_tmp5_) {
		g_object_notify ((GObject*) self, "blur_effect");
	}
	_tmp6_ = g_variant_lookup_value (changed_properties, "EnableDismissGesture", NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_ != NULL;
	_g_variant_unref0 (_tmp7_);
	if (_tmp8_) {
		g_object_notify ((GObject*) self, "dismiss-gesture");
	}
	_tmp9_ = g_variant_lookup_value (changed_properties, "EnableManageNotifications", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = _tmp10_ != NULL;
	_g_variant_unref0 (_tmp10_);
	if (_tmp11_) {
		g_object_notify ((GObject*) self, "manage-notifications");
	}
}

static void
gnome_shell_extension_settings_real_dispose (GObject* base)
{
	GnomeShellExtensionSettings * self;
	GnomeShellIntegration* _tmp0_;
	self = (GnomeShellExtensionSettings*) base;
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ != NULL) {
		GDBusProxy* proxy = NULL;
		GnomeShellIntegration* _tmp1_;
		GDBusProxy* _tmp2_;
		GDBusProxy* _tmp3_;
		guint _tmp4_;
		_tmp1_ = self->priv->proxy;
		_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, g_dbus_proxy_get_type (), GDBusProxy));
		proxy = _tmp2_;
		_tmp3_ = 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_settings_on_properties_changed_g_dbus_proxy_g_properties_changed, self);
		_g_object_unref0 (self->priv->proxy);
		self->priv->proxy = NULL;
		_g_object_unref0 (proxy);
	}
	G_OBJECT_CLASS (gnome_shell_extension_settings_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

gchar*
gnome_shell_extension_settings_get_indicator_type (GnomeShellExtensionSettings* self)
{
	gchar* result;
	gchar* _tmp0_ = NULL;
	GnomeShellIntegration* _tmp1_;
	gchar* _tmp6_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->proxy;
	if (_tmp1_ != NULL) {
		GnomeShellIntegration* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = self->priv->proxy;
		_tmp3_ = gnome_shell_integration_get_indicator_type (_tmp2_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	} else {
		gchar* _tmp5_;
		_tmp5_ = g_strdup ("");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
	}
	_tmp6_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp6_;
	_g_free0 (_tmp0_);
	return result;
}

void
gnome_shell_extension_settings_set_indicator_type (GnomeShellExtensionSettings* self,
                                                   const gchar* value)
{
	GnomeShellIntegration* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ != NULL) {
		GnomeShellIntegration* _tmp1_;
		_tmp1_ = self->priv->proxy;
		gnome_shell_integration_set_indicator_type (_tmp1_, value);
	}
	g_object_notify_by_pspec ((GObject *) self, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_INDICATOR_TYPE_PROPERTY]);
}

gboolean
gnome_shell_extension_settings_get_blur_effect (GnomeShellExtensionSettings* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	GnomeShellIntegration* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->proxy;
	if (_tmp1_ != NULL) {
		GnomeShellIntegration* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->proxy;
		_tmp3_ = gnome_shell_integration_get_enable_blur_effect (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

void
gnome_shell_extension_settings_set_blur_effect (GnomeShellExtensionSettings* self,
                                                gboolean value)
{
	GnomeShellIntegration* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ != NULL) {
		GnomeShellIntegration* _tmp1_;
		_tmp1_ = self->priv->proxy;
		gnome_shell_integration_set_enable_blur_effect (_tmp1_, value);
	}
	g_object_notify_by_pspec ((GObject *) self, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_BLUR_EFFECT_PROPERTY]);
}

gboolean
gnome_shell_extension_settings_get_dismiss_gesture (GnomeShellExtensionSettings* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	GnomeShellIntegration* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->proxy;
	if (_tmp1_ != NULL) {
		GnomeShellIntegration* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->proxy;
		_tmp3_ = gnome_shell_integration_get_enable_dismiss_gesture (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

void
gnome_shell_extension_settings_set_dismiss_gesture (GnomeShellExtensionSettings* self,
                                                    gboolean value)
{
	GnomeShellIntegration* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ != NULL) {
		GnomeShellIntegration* _tmp1_;
		_tmp1_ = self->priv->proxy;
		gnome_shell_integration_set_enable_dismiss_gesture (_tmp1_, value);
	}
	g_object_notify_by_pspec ((GObject *) self, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_DISMISS_GESTURE_PROPERTY]);
}

gboolean
gnome_shell_extension_settings_get_manage_notifications (GnomeShellExtensionSettings* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	GnomeShellIntegration* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->proxy;
	if (_tmp1_ != NULL) {
		GnomeShellIntegration* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->proxy;
		_tmp3_ = gnome_shell_integration_get_enable_manage_notifications (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

void
gnome_shell_extension_settings_set_manage_notifications (GnomeShellExtensionSettings* self,
                                                         gboolean value)
{
	GnomeShellIntegration* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ != NULL) {
		GnomeShellIntegration* _tmp1_;
		_tmp1_ = self->priv->proxy;
		gnome_shell_integration_set_enable_manage_notifications (_tmp1_, value);
	}
	g_object_notify_by_pspec ((GObject *) self, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_MANAGE_NOTIFICATIONS_PROPERTY]);
}

static void
gnome_shell_extension_settings_class_init (GnomeShellExtensionSettingsClass * klass,
                                           gpointer klass_data)
{
	gnome_shell_extension_settings_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomeShellExtensionSettings_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) gnome_shell_extension_settings_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_shell_extension_settings_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_shell_extension_settings_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_shell_extension_settings_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_SETTINGS_INDICATOR_TYPE_PROPERTY, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_INDICATOR_TYPE_PROPERTY] = g_param_spec_string ("indicator-type", "indicator-type", "indicator-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_SETTINGS_BLUR_EFFECT_PROPERTY, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_BLUR_EFFECT_PROPERTY] = g_param_spec_boolean ("blur-effect", "blur-effect", "blur-effect", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_SETTINGS_DISMISS_GESTURE_PROPERTY, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_DISMISS_GESTURE_PROPERTY] = g_param_spec_boolean ("dismiss-gesture", "dismiss-gesture", "dismiss-gesture", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_SHELL_EXTENSION_SETTINGS_MANAGE_NOTIFICATIONS_PROPERTY, gnome_shell_extension_settings_properties[GNOME_SHELL_EXTENSION_SETTINGS_MANAGE_NOTIFICATIONS_PROPERTY] = g_param_spec_boolean ("manage-notifications", "manage-notifications", "manage-notifications", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gnome_shell_extension_settings_instance_init (GnomeShellExtensionSettings * self,
                                              gpointer klass)
{
	self->priv = gnome_shell_extension_settings_get_instance_private (self);
	self->priv->proxy = NULL;
}

static void
gnome_shell_extension_settings_finalize (GObject * obj)
{
	GnomeShellExtensionSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_TYPE_SHELL_EXTENSION_SETTINGS, GnomeShellExtensionSettings);
	_g_object_unref0 (self->priv->proxy);
	G_OBJECT_CLASS (gnome_shell_extension_settings_parent_class)->finalize (obj);
}

/**
     * Settings of a `ShellIntegration` may have different lifespan than `ShellExtension`,
     * therefore settings are represented separately.
     */
GType
gnome_shell_extension_settings_get_type (void)
{
	return gnome_shell_extension_settings_type_id;
}

GType
gnome_shell_extension_settings_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomeShellExtensionSettingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_shell_extension_settings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomeShellExtensionSettings), 0, (GInstanceInitFunc) gnome_shell_extension_settings_instance_init, NULL };
	gnome_shell_extension_settings_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "GnomeShellExtensionSettings", &g_define_type_info, 0);
	GnomeShellExtensionSettings_private_offset = sizeof (GnomeShellExtensionSettingsPrivate);
	return gnome_shell_extension_settings_type_id;
}

static void
_vala_gnome_shell_extension_settings_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	GnomeShellExtensionSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_TYPE_SHELL_EXTENSION_SETTINGS, GnomeShellExtensionSettings);
	switch (property_id) {
		case GNOME_SHELL_EXTENSION_SETTINGS_INDICATOR_TYPE_PROPERTY:
		g_value_take_string (value, gnome_shell_extension_settings_get_indicator_type (self));
		break;
		case GNOME_SHELL_EXTENSION_SETTINGS_BLUR_EFFECT_PROPERTY:
		g_value_set_boolean (value, gnome_shell_extension_settings_get_blur_effect (self));
		break;
		case GNOME_SHELL_EXTENSION_SETTINGS_DISMISS_GESTURE_PROPERTY:
		g_value_set_boolean (value, gnome_shell_extension_settings_get_dismiss_gesture (self));
		break;
		case GNOME_SHELL_EXTENSION_SETTINGS_MANAGE_NOTIFICATIONS_PROPERTY:
		g_value_set_boolean (value, gnome_shell_extension_settings_get_manage_notifications (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_shell_extension_settings_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	GnomeShellExtensionSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_TYPE_SHELL_EXTENSION_SETTINGS, GnomeShellExtensionSettings);
	switch (property_id) {
		case GNOME_SHELL_EXTENSION_SETTINGS_INDICATOR_TYPE_PROPERTY:
		gnome_shell_extension_settings_set_indicator_type (self, g_value_get_string (value));
		break;
		case GNOME_SHELL_EXTENSION_SETTINGS_BLUR_EFFECT_PROPERTY:
		gnome_shell_extension_settings_set_blur_effect (self, g_value_get_boolean (value));
		break;
		case GNOME_SHELL_EXTENSION_SETTINGS_DISMISS_GESTURE_PROPERTY:
		gnome_shell_extension_settings_set_dismiss_gesture (self, g_value_get_boolean (value));
		break;
		case GNOME_SHELL_EXTENSION_SETTINGS_MANAGE_NOTIFICATIONS_PROPERTY:
		gnome_shell_extension_settings_set_manage_notifications (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

