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

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

#include "ft_plugin_kde.h"
#include <gio/gio.h>
#include "ft_ui.h"
#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include "ft_core.h"
#include <stdlib.h>
#include <string.h>
#include <config.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  {
	KDE_PREFERENCES_WINDOW_EXTENSION_0_PROPERTY,
	KDE_PREFERENCES_WINDOW_EXTENSION_NUM_PROPERTIES
};
static GParamSpec* kde_preferences_window_extension_properties[KDE_PREFERENCES_WINDOW_EXTENSION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _KdePreferencesWindowExtensionPrivate {
	GSettings* settings;
	FtPreferencesPanel* last_panel;
	AdwPreferencesGroup* notification_group;
	AdwPreferencesGroup* desktop_group;
};

static gint KdePreferencesWindowExtension_private_offset;
static gpointer kde_preferences_window_extension_parent_class = NULL;
static GType kde_preferences_window_extension_type_id = 0;

static void kde_preferences_window_extension_setup_notifications_panel (KdePreferencesWindowExtension* self,
                                                                 FtPreferencesPanel* panel);
static void ___lambda6_ (KdePreferencesWindowExtension* self);
static void ____lambda6__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void kde_preferences_window_extension_taredown_notifications_panel (KdePreferencesWindowExtension* self,
                                                                    FtPreferencesPanel* panel);
static void kde_preferences_window_extension_setup_integrations_panel (KdePreferencesWindowExtension* self,
                                                                FtPreferencesPanel* panel);
static void kde_preferences_window_extension_taredown_integrations_panel (KdePreferencesWindowExtension* self,
                                                                   FtPreferencesPanel* panel);
static void kde_preferences_window_extension_setup (KdePreferencesWindowExtension* self);
static void kde_preferences_window_extension_taredown (KdePreferencesWindowExtension* self);
static void kde_preferences_window_extension_on_notify_window (KdePreferencesWindowExtension* self,
                                                        GObject* object,
                                                        GParamSpec* pspec);
static void kde_preferences_window_extension_on_notify_visible_panel (KdePreferencesWindowExtension* self);
static void _kde_preferences_window_extension_on_notify_visible_panel_g_object_notify (GObject* _sender,
                                                                                GParamSpec* pspec,
                                                                                gpointer self);
static void kde_preferences_window_extension_real_dispose (GObject* base);
static GObject * kde_preferences_window_extension_constructor (GType type,
                                                        guint n_construct_properties,
                                                        GObjectConstructParam * construct_properties);
static void _kde_preferences_window_extension_on_notify_window_g_object_notify (GObject* _sender,
                                                                         GParamSpec* pspec,
                                                                         gpointer self);
static void kde_preferences_window_extension_finalize (GObject * obj);

static inline gpointer
kde_preferences_window_extension_get_instance_private (KdePreferencesWindowExtension* self)
{
	return G_STRUCT_MEMBER_P (self, KdePreferencesWindowExtension_private_offset);
}

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

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
___lambda6_ (KdePreferencesWindowExtension* self)
{
	GError* _inner_error0_ = NULL;
	{
		if (ft_is_flatpak ()) {
			g_app_info_launch_default_for_uri ("systemsettings://kcm_notifications", NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		} else {
			GAppInfo* app_info = NULL;
			const gchar* _tmp0_;
			gchar* _tmp1_;
			gchar* _tmp2_;
			GAppInfo* _tmp3_;
			GAppInfo* _tmp4_;
			GAppInfo* _tmp5_;
			_tmp0_ = string_to_string (APPLICATION_ID);
			_tmp1_ = g_strconcat ("kcmshell6 kcm_notifications --args --desktop-entry=", _tmp0_, NULL);
			_tmp2_ = _tmp1_;
			_tmp3_ = g_app_info_create_from_commandline (_tmp2_, NULL, G_APP_INFO_CREATE_NONE, &_inner_error0_);
			_tmp4_ = _tmp3_;
			_g_free0 (_tmp2_);
			app_info = _tmp4_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp5_ = app_info;
			g_app_info_launch (_tmp5_, NULL, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (app_info);
				goto __catch0_g_error;
			}
			_g_object_unref0 (app_info);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = _error_;
		_tmp7_ = _tmp6_->message;
		g_warning ("preferences-window-extension.vala:50: Error opening notification setti" \
"ngs: %s", _tmp7_);
		_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
____lambda6__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	___lambda6_ ((KdePreferencesWindowExtension*) self);
}

static void
kde_preferences_window_extension_setup_notifications_panel (KdePreferencesWindowExtension* self,
                                                            FtPreferencesPanel* panel)
{
	AdwPreferencesPage* page = NULL;
	AdwPreferencesPage* _tmp0_;
	AdwPreferencesPage* _tmp1_;
	AdwPreferencesGroup* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (panel != NULL);
	_tmp0_ = ft_preferences_panel_get_preferences_page (panel);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	page = _tmp1_;
	_tmp2_ = self->priv->notification_group;
	if (_tmp2_ == NULL) {
		GtkButton* notification_settings_button = NULL;
		GtkButton* _tmp3_;
		GtkButton* _tmp4_;
		GtkButton* _tmp5_;
		GtkButton* _tmp6_;
		AdwPreferencesGroup* notification_group = NULL;
		AdwPreferencesGroup* _tmp7_;
		AdwPreferencesGroup* _tmp8_;
		AdwPreferencesGroup* _tmp9_;
		GtkButton* _tmp10_;
		AdwPreferencesPage* _tmp11_;
		AdwPreferencesGroup* _tmp12_;
		AdwPreferencesGroup* _tmp13_;
		AdwPreferencesGroup* _tmp14_;
		GtkWidget* _tmp15_;
		GtkWidget* _tmp16_;
		AdwPreferencesGroup* _tmp17_;
		_tmp3_ = (GtkButton*) gtk_button_new_with_label (_ ("Open Settings"));
		g_object_ref_sink (_tmp3_);
		notification_settings_button = _tmp3_;
		_tmp4_ = notification_settings_button;
		gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_CENTER);
		_tmp5_ = notification_settings_button;
		gtk_widget_set_margin_start ((GtkWidget*) _tmp5_, 12);
		_tmp6_ = notification_settings_button;
		g_signal_connect_object (_tmp6_, "clicked", (GCallback) ____lambda6__gtk_button_clicked, self, 0);
		_tmp7_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
		g_object_ref_sink (_tmp7_);
		notification_group = _tmp7_;
		_tmp8_ = notification_group;
		adw_preferences_group_set_description (_tmp8_, _ ("For reliable break reminders, allow this app's notifications during Do" \
" Not Disturb and disable its notification history."));
		_tmp9_ = notification_group;
		_tmp10_ = notification_settings_button;
		adw_preferences_group_set_header_suffix (_tmp9_, (GtkWidget*) _tmp10_);
		_tmp11_ = page;
		_tmp12_ = notification_group;
		adw_preferences_page_add (_tmp11_, _tmp12_);
		_tmp13_ = notification_group;
		_tmp14_ = notification_group;
		_tmp15_ = gtk_widget_get_parent ((GtkWidget*) _tmp14_);
		_tmp16_ = _tmp15_;
		gtk_widget_insert_after ((GtkWidget*) _tmp13_, _tmp16_, NULL);
		_tmp17_ = notification_group;
		self->priv->notification_group = _tmp17_;
		_g_object_unref0 (notification_group);
		_g_object_unref0 (notification_settings_button);
	}
	_g_object_unref0 (page);
}

static void
kde_preferences_window_extension_taredown_notifications_panel (KdePreferencesWindowExtension* self,
                                                               FtPreferencesPanel* panel)
{
	AdwPreferencesGroup* _tmp0_ = NULL;
	AdwPreferencesGroup* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (panel != NULL);
	_tmp1_ = self->priv->notification_group;
	_tmp0_ = _tmp1_;
	if (_tmp0_ != NULL) {
		gtk_widget_unparent ((GtkWidget*) _tmp0_);
	}
	self->priv->notification_group = NULL;
}

static void
kde_preferences_window_extension_setup_integrations_panel (KdePreferencesWindowExtension* self,
                                                           FtPreferencesPanel* panel)
{
	AdwPreferencesPage* page = NULL;
	AdwPreferencesPage* _tmp0_;
	AdwPreferencesPage* _tmp1_;
	GSettings* _tmp2_;
	AdwPreferencesGroup* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (panel != NULL);
	_tmp0_ = ft_preferences_panel_get_preferences_page (panel);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	page = _tmp1_;
	_tmp2_ = self->priv->settings;
	if (_tmp2_ == NULL) {
		kde_preferences_window_extension_taredown_integrations_panel (self, panel);
		_g_object_unref0 (page);
		return;
	}
	_tmp3_ = self->priv->desktop_group;
	if (_tmp3_ == NULL) {
		AdwPreferencesGroup* desktop_group = NULL;
		AdwPreferencesGroup* _tmp4_;
		AdwPreferencesGroup* _tmp5_;
		AdwPreferencesPage* _tmp6_;
		AdwPreferencesGroup* _tmp7_;
		AdwSwitchRow* manage_notifications_row = NULL;
		AdwSwitchRow* _tmp8_;
		AdwSwitchRow* _tmp9_;
		AdwSwitchRow* _tmp10_;
		AdwPreferencesGroup* _tmp11_;
		AdwSwitchRow* _tmp12_;
		AdwPreferencesGroup* _tmp13_;
		GSettings* _tmp14_;
		AdwSwitchRow* _tmp15_;
		_tmp4_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
		g_object_ref_sink (_tmp4_);
		desktop_group = _tmp4_;
		_tmp5_ = desktop_group;
		adw_preferences_group_set_title (_tmp5_, _ ("Desktop"));
		_tmp6_ = page;
		_tmp7_ = desktop_group;
		adw_preferences_page_add (_tmp6_, _tmp7_);
		_tmp8_ = (AdwSwitchRow*) adw_switch_row_new ();
		g_object_ref_sink (_tmp8_);
		manage_notifications_row = _tmp8_;
		_tmp9_ = manage_notifications_row;
		adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp9_, _ ("Do Not Disturb"));
		_tmp10_ = manage_notifications_row;
		adw_action_row_set_subtitle ((AdwActionRow*) _tmp10_, _ ("Hide non-critical notifications while using the timer."));
		_tmp11_ = desktop_group;
		_tmp12_ = manage_notifications_row;
		adw_preferences_group_add (_tmp11_, (GtkWidget*) _tmp12_);
		_tmp13_ = desktop_group;
		self->priv->desktop_group = _tmp13_;
		_tmp14_ = self->priv->settings;
		_tmp15_ = manage_notifications_row;
		g_settings_bind (_tmp14_, "manage-notifications", (GObject*) _tmp15_, "active", G_SETTINGS_BIND_DEFAULT);
		_g_object_unref0 (manage_notifications_row);
		_g_object_unref0 (desktop_group);
	}
	_g_object_unref0 (page);
}

static void
kde_preferences_window_extension_taredown_integrations_panel (KdePreferencesWindowExtension* self,
                                                              FtPreferencesPanel* panel)
{
	AdwPreferencesGroup* _tmp0_ = NULL;
	AdwPreferencesGroup* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (panel != NULL);
	_tmp1_ = self->priv->desktop_group;
	_tmp0_ = _tmp1_;
	if (_tmp0_ != NULL) {
		gtk_widget_unparent ((GtkWidget*) _tmp0_);
	}
	self->priv->desktop_group = NULL;
}

/**
         * Modify visible_panel of the PreferencesWindow.
         */
static void
kde_preferences_window_extension_setup (KdePreferencesWindowExtension* self)
{
	FtPreferencesWindow* _tmp0_ = NULL;
	FtPreferencesWindow* _tmp1_;
	FtPreferencesWindow* _tmp2_;
	FtPreferencesPanel* _tmp3_ = NULL;
	FtPreferencesPanel* panel = NULL;
	FtPreferencesPanel* _tmp6_;
	FtPreferencesPanel* _tmp7_;
	FtPreferencesPanel* _tmp8_;
	FtPreferencesPanel* _tmp11_ = NULL;
	FtPreferencesPanel* _tmp12_;
	const gchar* _tmp13_ = NULL;
	const gchar* _tmp16_;
	GQuark _tmp18_ = 0U;
	static GQuark _tmp17_label0 = 0;
	static GQuark _tmp17_label1 = 0;
	g_return_if_fail (self != NULL);
	_tmp1_ = ft_preferences_window_extension_get_window ((FtPreferencesWindowExtension*) self);
	_tmp2_ = _tmp1_;
	_tmp0_ = _tmp2_;
	_tmp3_ = NULL;
	if (_tmp0_ != NULL) {
		FtPreferencesPanel* _tmp4_;
		FtPreferencesPanel* _tmp5_;
		_tmp4_ = ft_preferences_window_get_visible_panel (_tmp0_);
		_tmp5_ = _tmp4_;
		_tmp3_ = _tmp5_;
	}
	_tmp6_ = _g_object_ref0 (_tmp3_);
	panel = _tmp6_;
	_tmp7_ = panel;
	_tmp8_ = self->priv->last_panel;
	if (_tmp7_ != _tmp8_) {
		FtPreferencesPanel* _tmp9_;
		FtPreferencesPanel* _tmp10_;
		kde_preferences_window_extension_taredown (self);
		_tmp9_ = panel;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_g_object_unref0 (self->priv->last_panel);
		self->priv->last_panel = _tmp10_;
	}
	_tmp12_ = panel;
	_tmp11_ = _tmp12_;
	_tmp13_ = NULL;
	if (_tmp11_ != NULL) {
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		_tmp14_ = adw_navigation_page_get_tag ((AdwNavigationPage*) _tmp11_);
		_tmp15_ = _tmp14_;
		_tmp13_ = _tmp15_;
	}
	_tmp16_ = _tmp13_;
	_tmp18_ = (NULL == _tmp16_) ? 0 : g_quark_from_string (_tmp16_);
	if (_tmp18_ == ((0 != _tmp17_label0) ? _tmp17_label0 : (_tmp17_label0 = g_quark_from_static_string ("notifications")))) {
		switch (0) {
			default:
			{
				FtPreferencesPanel* _tmp19_;
				_tmp19_ = panel;
				kde_preferences_window_extension_setup_notifications_panel (self, _tmp19_);
				break;
			}
		}
	} else if (_tmp18_ == ((0 != _tmp17_label1) ? _tmp17_label1 : (_tmp17_label1 = g_quark_from_static_string ("integrations")))) {
		switch (0) {
			default:
			{
				FtPreferencesPanel* _tmp20_;
				_tmp20_ = panel;
				kde_preferences_window_extension_setup_integrations_panel (self, _tmp20_);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				break;
			}
		}
	}
	_g_object_unref0 (panel);
	_g_object_unref0 (_tmp0_);
}

static void
kde_preferences_window_extension_taredown (KdePreferencesWindowExtension* self)
{
	FtPreferencesPanel* _tmp0_ = NULL;
	FtPreferencesPanel* _tmp1_;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp5_;
	GQuark _tmp7_ = 0U;
	static GQuark _tmp6_label0 = 0;
	static GQuark _tmp6_label1 = 0;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->last_panel;
	_tmp0_ = _tmp1_;
	_tmp2_ = NULL;
	if (_tmp0_ != NULL) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = adw_navigation_page_get_tag ((AdwNavigationPage*) _tmp0_);
		_tmp4_ = _tmp3_;
		_tmp2_ = _tmp4_;
	}
	_tmp5_ = _tmp2_;
	_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
	if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("notifications")))) {
		switch (0) {
			default:
			{
				FtPreferencesPanel* _tmp8_;
				_tmp8_ = self->priv->last_panel;
				kde_preferences_window_extension_taredown_notifications_panel (self, _tmp8_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("integrations")))) {
		switch (0) {
			default:
			{
				FtPreferencesPanel* _tmp9_;
				_tmp9_ = self->priv->last_panel;
				kde_preferences_window_extension_taredown_integrations_panel (self, _tmp9_);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				break;
			}
		}
	}
	_g_object_unref0 (self->priv->last_panel);
	self->priv->last_panel = NULL;
}

static void
_kde_preferences_window_extension_on_notify_visible_panel_g_object_notify (GObject* _sender,
                                                                           GParamSpec* pspec,
                                                                           gpointer self)
{
	kde_preferences_window_extension_on_notify_visible_panel ((KdePreferencesWindowExtension*) self);
}

static void
kde_preferences_window_extension_on_notify_window (KdePreferencesWindowExtension* self,
                                                   GObject* object,
                                                   GParamSpec* pspec)
{
	FtPreferencesWindow* _tmp0_;
	FtPreferencesWindow* _tmp1_;
	FtPreferencesWindow* _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (pspec != NULL);
	_tmp0_ = ft_preferences_window_extension_get_window ((FtPreferencesWindowExtension*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		FtPreferencesWindow* _tmp4_;
		FtPreferencesWindow* _tmp5_;
		FtPreferencesWindow* _tmp6_;
		_tmp4_ = ft_preferences_window_extension_get_window ((FtPreferencesWindowExtension*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		g_signal_connect_object ((GObject*) _tmp6_, "notify::visible-panel", (GCallback) _kde_preferences_window_extension_on_notify_visible_panel_g_object_notify, self, 0);
		_g_object_unref0 (_tmp6_);
	}
}

static void
kde_preferences_window_extension_on_notify_visible_panel (KdePreferencesWindowExtension* self)
{
	g_return_if_fail (self != NULL);
	kde_preferences_window_extension_setup (self);
}

static void
kde_preferences_window_extension_real_dispose (GObject* base)
{
	KdePreferencesWindowExtension * self;
	FtPreferencesWindow* _tmp0_;
	FtPreferencesWindow* _tmp1_;
	FtPreferencesWindow* _tmp2_;
	gboolean _tmp3_;
	self = (KdePreferencesWindowExtension*) base;
	kde_preferences_window_extension_taredown (self);
	_tmp0_ = ft_preferences_window_extension_get_window ((FtPreferencesWindowExtension*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		FtPreferencesWindow* _tmp4_;
		FtPreferencesWindow* _tmp5_;
		FtPreferencesWindow* _tmp6_;
		guint _tmp7_;
		GQuark _tmp8_;
		_tmp4_ = ft_preferences_window_extension_get_window ((FtPreferencesWindowExtension*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		g_signal_parse_name ("notify::visible-panel", G_TYPE_OBJECT, &_tmp7_, &_tmp8_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, _tmp8_, NULL, (GCallback) _kde_preferences_window_extension_on_notify_visible_panel_g_object_notify, self);
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = NULL;
	G_OBJECT_CLASS (kde_preferences_window_extension_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_PREFERENCES_WINDOW_EXTENSION, FtPreferencesWindowExtension));
}

KdePreferencesWindowExtension*
kde_preferences_window_extension_construct (GType object_type)
{
	KdePreferencesWindowExtension * self = NULL;
	self = (KdePreferencesWindowExtension*) ft_preferences_window_extension_construct (object_type);
	return self;
}

KdePreferencesWindowExtension*
kde_preferences_window_extension_new (void)
{
	return kde_preferences_window_extension_construct (KDE_TYPE_PREFERENCES_WINDOW_EXTENSION);
}

static void
_kde_preferences_window_extension_on_notify_window_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self)
{
	kde_preferences_window_extension_on_notify_window ((KdePreferencesWindowExtension*) self, _sender, pspec);
}

static GObject *
kde_preferences_window_extension_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	KdePreferencesWindowExtension * self;
	GSettings* _tmp0_;
	parent_class = G_OBJECT_CLASS (kde_preferences_window_extension_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, KDE_TYPE_PREFERENCES_WINDOW_EXTENSION, KdePreferencesWindowExtension);
	_tmp0_ = g_settings_new ("io.github.focustimerhq.FocusTimer.plugins.kde");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	g_signal_connect_object ((GObject*) self, "notify::window", (GCallback) _kde_preferences_window_extension_on_notify_window_g_object_notify, self, 0);
	return obj;
}

static void
kde_preferences_window_extension_class_init (KdePreferencesWindowExtensionClass * klass,
                                             gpointer klass_data)
{
	kde_preferences_window_extension_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &KdePreferencesWindowExtension_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) kde_preferences_window_extension_real_dispose;
	G_OBJECT_CLASS (klass)->constructor = kde_preferences_window_extension_constructor;
	G_OBJECT_CLASS (klass)->finalize = kde_preferences_window_extension_finalize;
}

static void
kde_preferences_window_extension_instance_init (KdePreferencesWindowExtension * self,
                                                gpointer klass)
{
	self->priv = kde_preferences_window_extension_get_instance_private (self);
	self->priv->settings = NULL;
	self->priv->last_panel = NULL;
	self->priv->notification_group = NULL;
	self->priv->desktop_group = NULL;
}

static void
kde_preferences_window_extension_finalize (GObject * obj)
{
	KdePreferencesWindowExtension * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, KDE_TYPE_PREFERENCES_WINDOW_EXTENSION, KdePreferencesWindowExtension);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->last_panel);
	G_OBJECT_CLASS (kde_preferences_window_extension_parent_class)->finalize (obj);
}

GType
kde_preferences_window_extension_get_type (void)
{
	return kde_preferences_window_extension_type_id;
}

GType
kde_preferences_window_extension_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (KdePreferencesWindowExtensionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) kde_preferences_window_extension_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (KdePreferencesWindowExtension), 0, (GInstanceInitFunc) kde_preferences_window_extension_instance_init, NULL };
	kde_preferences_window_extension_type_id = g_type_module_register_type (module, FT_TYPE_PREFERENCES_WINDOW_EXTENSION, "KdePreferencesWindowExtension", &g_define_type_info, 0);
	KdePreferencesWindowExtension_private_offset = sizeof (KdePreferencesWindowExtensionPrivate);
	return kde_preferences_window_extension_type_id;
}

