/* AbstractSimpleSettingsPage.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from AbstractSimpleSettingsPage.vala, do not modify */

/*
 * Copyright 2017–2022 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#include "granite-7.h"
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <float.h>
#include <math.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  {
	GRANITE_SIMPLE_SETTINGS_PAGE_0_PROPERTY,
	GRANITE_SIMPLE_SETTINGS_PAGE_ACTION_AREA_PROPERTY,
	GRANITE_SIMPLE_SETTINGS_PAGE_CONTENT_AREA_PROPERTY,
	GRANITE_SIMPLE_SETTINGS_PAGE_STATUS_SWITCH_PROPERTY,
	GRANITE_SIMPLE_SETTINGS_PAGE_ACTIVATABLE_PROPERTY,
	GRANITE_SIMPLE_SETTINGS_PAGE_DESCRIPTION_PROPERTY,
	GRANITE_SIMPLE_SETTINGS_PAGE_NUM_PROPERTIES
};
static GParamSpec* granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_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))
typedef struct _Block1Data Block1Data;

struct _GraniteSimpleSettingsPagePrivate {
	GtkLabel* description_label;
	gchar* _description;
	GtkBox* _action_area;
	GtkGrid* _content_area;
	GtkSwitch* _status_switch;
	gboolean _activatable;
};

struct _Block1Data {
	int _ref_count_;
	GraniteSimpleSettingsPage* self;
	GtkImage* header_icon;
	GtkLabel* title_label;
};

static gint GraniteSimpleSettingsPage_private_offset;
static gpointer granite_simple_settings_page_parent_class = NULL;

static GObject * granite_simple_settings_page_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void _granite_simple_settings_page___lambda8_ (Block1Data* _data1_);
static void __granite_simple_settings_page___lambda8__g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void _granite_simple_settings_page___lambda9_ (Block1Data* _data1_);
static void __granite_simple_settings_page___lambda9__g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void granite_simple_settings_page_finalize (GObject * obj);
static GType granite_simple_settings_page_get_type_once (void);
static void _vala_granite_simple_settings_page_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_granite_simple_settings_page_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec);

static inline gpointer
granite_simple_settings_page_get_instance_private (GraniteSimpleSettingsPage* self)
{
	return G_STRUCT_MEMBER_P (self, GraniteSimpleSettingsPage_private_offset);
}

GtkBox*
granite_simple_settings_page_get_action_area (GraniteSimpleSettingsPage* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_action_area;
	result = _tmp0_;
	return result;
}

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

static void
granite_simple_settings_page_set_action_area (GraniteSimpleSettingsPage* self,
                                              GtkBox* value)
{
	GtkBox* old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_simple_settings_page_get_action_area (self);
	if (old_value != value) {
		GtkBox* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_action_area);
		self->priv->_action_area = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_ACTION_AREA_PROPERTY]);
	}
}

GtkGrid*
granite_simple_settings_page_get_content_area (GraniteSimpleSettingsPage* self)
{
	GtkGrid* result;
	GtkGrid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_area;
	result = _tmp0_;
	return result;
}

static void
granite_simple_settings_page_set_content_area (GraniteSimpleSettingsPage* self,
                                               GtkGrid* value)
{
	GtkGrid* old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_simple_settings_page_get_content_area (self);
	if (old_value != value) {
		GtkGrid* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_content_area);
		self->priv->_content_area = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_CONTENT_AREA_PROPERTY]);
	}
}

GtkSwitch*
granite_simple_settings_page_get_status_switch (GraniteSimpleSettingsPage* self)
{
	GtkSwitch* result;
	GtkSwitch* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_status_switch;
	result = _tmp0_;
	return result;
}

static void
granite_simple_settings_page_set_status_switch (GraniteSimpleSettingsPage* self,
                                                GtkSwitch* value)
{
	GtkSwitch* old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_simple_settings_page_get_status_switch (self);
	if (old_value != value) {
		GtkSwitch* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_status_switch);
		self->priv->_status_switch = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_STATUS_SWITCH_PROPERTY]);
	}
}

gboolean
granite_simple_settings_page_get_activatable (GraniteSimpleSettingsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_activatable;
	return result;
}

static void
granite_simple_settings_page_set_activatable (GraniteSimpleSettingsPage* self,
                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_simple_settings_page_get_activatable (self);
	if (old_value != value) {
		self->priv->_activatable = value;
		g_object_notify_by_pspec ((GObject *) self, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_ACTIVATABLE_PROPERTY]);
	}
}

const gchar*
granite_simple_settings_page_get_description (GraniteSimpleSettingsPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_description;
	result = _tmp0_;
	return result;
}

void
granite_simple_settings_page_set_description (GraniteSimpleSettingsPage* self,
                                              const gchar* value)
{
	GtkLabel* _tmp0_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->description_label;
	if (_tmp0_ != NULL) {
		GtkLabel* _tmp1_;
		_tmp1_ = self->priv->description_label;
		gtk_label_set_label (_tmp1_, value);
	}
	_tmp2_ = g_strdup (value);
	_g_free0 (self->priv->_description);
	self->priv->_description = _tmp2_;
	g_object_notify_by_pspec ((GObject *) self, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_DESCRIPTION_PROPERTY]);
}

/**
     * Creates a new SimpleSettingsPage
     * Deprecated: Subclass this instead.
     */
GraniteSimpleSettingsPage*
granite_simple_settings_page_construct (GType object_type)
{
	GraniteSimpleSettingsPage * self = NULL;
	self = (GraniteSimpleSettingsPage*) granite_settings_page_construct (object_type);
	return self;
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		GraniteSimpleSettingsPage* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->title_label);
		_g_object_unref0 (_data1_->header_icon);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
_granite_simple_settings_page___lambda8_ (Block1Data* _data1_)
{
	GraniteSimpleSettingsPage* self;
	GtkImage* _tmp0_;
	self = _data1_->self;
	_tmp0_ = _data1_->header_icon;
	if (_tmp0_ != NULL) {
		GtkImage* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp1_ = _data1_->header_icon;
		_tmp2_ = granite_settings_page_get_icon_name ((GraniteSettingsPage*) self);
		_tmp3_ = _tmp2_;
		g_object_set (_tmp1_, "icon-name", _tmp3_, NULL);
	}
}

static void
__granite_simple_settings_page___lambda8__g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	_granite_simple_settings_page___lambda8_ (self);
}

static void
_granite_simple_settings_page___lambda9_ (Block1Data* _data1_)
{
	GraniteSimpleSettingsPage* self;
	GtkLabel* _tmp0_;
	self = _data1_->self;
	_tmp0_ = _data1_->title_label;
	if (_tmp0_ != NULL) {
		GtkLabel* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp1_ = _data1_->title_label;
		_tmp2_ = granite_settings_page_get_title ((GraniteSettingsPage*) self);
		_tmp3_ = _tmp2_;
		gtk_label_set_label (_tmp1_, _tmp3_);
	}
}

static void
__granite_simple_settings_page___lambda9__g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	_granite_simple_settings_page___lambda9_ (self);
}

static GObject *
granite_simple_settings_page_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GraniteSimpleSettingsPage * self;
	Block1Data* _data1_;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GtkImage* _tmp2_ = NULL;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GtkGrid* header_area = NULL;
	GtkGrid* _tmp7_;
	GtkGrid* _tmp8_;
	GtkGrid* _tmp9_;
	GtkLabel* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gboolean _tmp22_;
	GtkGrid* _tmp27_ = NULL;
	GtkGrid* _tmp28_;
	GtkGrid* _tmp29_;
	GtkBox* _tmp30_ = NULL;
	GtkBox* _tmp31_;
	GtkBox* _tmp32_;
	GtkBox* grid = NULL;
	GtkBox* _tmp33_;
	GtkBox* _tmp34_;
	GtkGrid* _tmp35_;
	GtkBox* _tmp36_;
	GtkGrid* _tmp37_;
	GtkBox* _tmp38_;
	GtkBox* _tmp39_;
	GtkBox* _tmp40_;
	parent_class = G_OBJECT_CLASS (granite_simple_settings_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRANITE_TYPE_SIMPLE_SETTINGS_PAGE, GraniteSimpleSettingsPage);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = granite_settings_page_get_icon_name ((GraniteSettingsPage*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp1_);
	gtk_image_set_icon_size (_tmp2_, GTK_ICON_SIZE_LARGE);
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp2_);
	_data1_->header_icon = _tmp2_;
	_tmp3_ = granite_settings_page_get_title ((GraniteSettingsPage*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = (GtkLabel*) gtk_label_new (_tmp4_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
	gtk_label_set_selectable (_tmp5_, TRUE);
	gtk_label_set_wrap (_tmp5_, TRUE);
	gtk_label_set_xalign (_tmp5_, (gfloat) 0);
	g_object_ref_sink (_tmp5_);
	_data1_->title_label = _tmp5_;
	_tmp6_ = _data1_->title_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp6_, GRANITE_STYLE_CLASS_H2_LABEL);
	_tmp7_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp7_);
	header_area = _tmp7_;
	_tmp8_ = header_area;
	gtk_widget_add_css_class ((GtkWidget*) _tmp8_, "header-area");
	_tmp9_ = header_area;
	_tmp10_ = _data1_->title_label;
	gtk_grid_attach (_tmp9_, (GtkWidget*) _tmp10_, 1, 0, 1, 1);
	_tmp11_ = granite_simple_settings_page_get_description (self);
	_tmp12_ = _tmp11_;
	if (_tmp12_ != NULL) {
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		GtkLabel* _tmp15_ = NULL;
		GtkGrid* _tmp16_;
		GtkImage* _tmp17_;
		GtkGrid* _tmp18_;
		GtkLabel* _tmp19_;
		_tmp13_ = granite_simple_settings_page_get_description (self);
		_tmp14_ = _tmp13_;
		_tmp15_ = (GtkLabel*) gtk_label_new (_tmp14_);
		gtk_label_set_selectable (_tmp15_, TRUE);
		gtk_label_set_use_markup (_tmp15_, TRUE);
		gtk_label_set_wrap (_tmp15_, TRUE);
		gtk_label_set_xalign (_tmp15_, (gfloat) 0);
		g_object_ref_sink (_tmp15_);
		_g_object_unref0 (self->priv->description_label);
		self->priv->description_label = _tmp15_;
		_tmp16_ = header_area;
		_tmp17_ = _data1_->header_icon;
		gtk_grid_attach (_tmp16_, (GtkWidget*) _tmp17_, 0, 0, 1, 2);
		_tmp18_ = header_area;
		_tmp19_ = self->priv->description_label;
		gtk_grid_attach (_tmp18_, (GtkWidget*) _tmp19_, 1, 1, 2, 1);
	} else {
		GtkGrid* _tmp20_;
		GtkImage* _tmp21_;
		_tmp20_ = header_area;
		_tmp21_ = _data1_->header_icon;
		gtk_grid_attach (_tmp20_, (GtkWidget*) _tmp21_, 0, 0, 1, 1);
	}
	_tmp22_ = self->priv->_activatable;
	if (_tmp22_) {
		GtkSwitch* _tmp23_ = NULL;
		GtkSwitch* _tmp24_;
		GtkGrid* _tmp25_;
		GtkSwitch* _tmp26_;
		_tmp23_ = (GtkSwitch*) gtk_switch_new ();
		gtk_widget_set_valign ((GtkWidget*) _tmp23_, GTK_ALIGN_START);
		g_object_ref_sink (_tmp23_);
		_tmp24_ = _tmp23_;
		granite_simple_settings_page_set_status_switch (self, _tmp24_);
		_g_object_unref0 (_tmp24_);
		_tmp25_ = header_area;
		_tmp26_ = self->priv->_status_switch;
		gtk_grid_attach (_tmp25_, (GtkWidget*) _tmp26_, 2, 0, 1, 1);
	}
	_tmp27_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp27_, 12);
	gtk_grid_set_row_spacing (_tmp27_, 12);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp27_, TRUE);
	g_object_ref_sink (_tmp27_);
	_tmp28_ = _tmp27_;
	granite_simple_settings_page_set_content_area (self, _tmp28_);
	_g_object_unref0 (_tmp28_);
	_tmp29_ = self->priv->_content_area;
	gtk_widget_add_css_class ((GtkWidget*) _tmp29_, "content-area");
	_tmp30_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_halign ((GtkWidget*) _tmp30_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp30_);
	_tmp31_ = _tmp30_;
	granite_simple_settings_page_set_action_area (self, _tmp31_);
	_g_object_unref0 (_tmp31_);
	_tmp32_ = self->priv->_action_area;
	gtk_widget_add_css_class ((GtkWidget*) _tmp32_, "buttonbox");
	_tmp33_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp33_);
	grid = _tmp33_;
	_tmp34_ = grid;
	_tmp35_ = header_area;
	gtk_box_append (_tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = grid;
	_tmp37_ = self->priv->_content_area;
	gtk_box_append (_tmp36_, (GtkWidget*) _tmp37_);
	_tmp38_ = grid;
	_tmp39_ = self->priv->_action_area;
	gtk_box_append (_tmp38_, (GtkWidget*) _tmp39_);
	_tmp40_ = grid;
	granite_settings_page_set_child ((GraniteSettingsPage*) self, (GtkWidget*) _tmp40_);
	g_signal_connect_data ((GObject*) self, "notify::icon-name", (GCallback) __granite_simple_settings_page___lambda8__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	g_signal_connect_data ((GObject*) self, "notify::title", (GCallback) __granite_simple_settings_page___lambda9__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_g_object_unref0 (grid);
	_g_object_unref0 (header_area);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return obj;
}

static void
granite_simple_settings_page_base_init (GraniteSimpleSettingsPageClass * klass)
{
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "simplesettingspage");
}

static void
granite_simple_settings_page_class_init (GraniteSimpleSettingsPageClass * klass,
                                         gpointer klass_data)
{
	granite_simple_settings_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GraniteSimpleSettingsPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_granite_simple_settings_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_granite_simple_settings_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = granite_simple_settings_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = granite_simple_settings_page_finalize;
	/**
	     * A {@link Gtk.Box} used as the action area for #this
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SIMPLE_SETTINGS_PAGE_ACTION_AREA_PROPERTY, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_ACTION_AREA_PROPERTY] = g_param_spec_object ("action-area", "action-area", "action-area", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	     * A {@link Gtk.Grid} used as the content area for #this
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SIMPLE_SETTINGS_PAGE_CONTENT_AREA_PROPERTY, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_CONTENT_AREA_PROPERTY] = g_param_spec_object ("content-area", "content-area", "content-area", gtk_grid_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	     * A {@link Gtk.Switch} that appears in the header area when #this.activatable is #true. #status_switch will be #null when #this.activatable is #false
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SIMPLE_SETTINGS_PAGE_STATUS_SWITCH_PROPERTY, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_STATUS_SWITCH_PROPERTY] = g_param_spec_object ("status-switch", "status-switch", "status-switch", gtk_switch_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	     * Creates a {@link Gtk.Switch} #status_switch in the header of #this
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SIMPLE_SETTINGS_PAGE_ACTIVATABLE_PROPERTY, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_ACTIVATABLE_PROPERTY] = g_param_spec_boolean ("activatable", "activatable", "activatable", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	     * Creates a {@link Gtk.Label} with a page description in the header of #this
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SIMPLE_SETTINGS_PAGE_DESCRIPTION_PROPERTY, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}

static void
granite_simple_settings_page_instance_init (GraniteSimpleSettingsPage * self,
                                            gpointer klass)
{
	self->priv = granite_simple_settings_page_get_instance_private (self);
}

static void
granite_simple_settings_page_finalize (GObject * obj)
{
	GraniteSimpleSettingsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRANITE_TYPE_SIMPLE_SETTINGS_PAGE, GraniteSimpleSettingsPage);
	_g_object_unref0 (self->priv->description_label);
	_g_free0 (self->priv->_description);
	_g_object_unref0 (self->priv->_action_area);
	_g_object_unref0 (self->priv->_content_area);
	_g_object_unref0 (self->priv->_status_switch);
	G_OBJECT_CLASS (granite_simple_settings_page_parent_class)->finalize (obj);
}

/**
 * SimpleSettingsPage is a widget divided into three sections: a predefined header,
 * a content area, and an action area.
 */
static GType
granite_simple_settings_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraniteSimpleSettingsPageClass), (GBaseInitFunc) granite_simple_settings_page_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) granite_simple_settings_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraniteSimpleSettingsPage), 0, (GInstanceInitFunc) granite_simple_settings_page_instance_init, NULL };
	GType granite_simple_settings_page_type_id;
	granite_simple_settings_page_type_id = g_type_register_static (GRANITE_TYPE_SETTINGS_PAGE, "GraniteSimpleSettingsPage", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	GraniteSimpleSettingsPage_private_offset = g_type_add_instance_private (granite_simple_settings_page_type_id, sizeof (GraniteSimpleSettingsPagePrivate));
	return granite_simple_settings_page_type_id;
}

GType
granite_simple_settings_page_get_type (void)
{
	static volatile gsize granite_simple_settings_page_type_id__once = 0;
	if (g_once_init_enter (&granite_simple_settings_page_type_id__once)) {
		GType granite_simple_settings_page_type_id;
		granite_simple_settings_page_type_id = granite_simple_settings_page_get_type_once ();
		g_once_init_leave (&granite_simple_settings_page_type_id__once, granite_simple_settings_page_type_id);
	}
	return granite_simple_settings_page_type_id__once;
}

static void
_vala_granite_simple_settings_page_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	GraniteSimpleSettingsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRANITE_TYPE_SIMPLE_SETTINGS_PAGE, GraniteSimpleSettingsPage);
	switch (property_id) {
		case GRANITE_SIMPLE_SETTINGS_PAGE_ACTION_AREA_PROPERTY:
		g_value_set_object (value, granite_simple_settings_page_get_action_area (self));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_CONTENT_AREA_PROPERTY:
		g_value_set_object (value, granite_simple_settings_page_get_content_area (self));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_STATUS_SWITCH_PROPERTY:
		g_value_set_object (value, granite_simple_settings_page_get_status_switch (self));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_ACTIVATABLE_PROPERTY:
		g_value_set_boolean (value, granite_simple_settings_page_get_activatable (self));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_DESCRIPTION_PROPERTY:
		g_value_set_string (value, granite_simple_settings_page_get_description (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_granite_simple_settings_page_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	GraniteSimpleSettingsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRANITE_TYPE_SIMPLE_SETTINGS_PAGE, GraniteSimpleSettingsPage);
	switch (property_id) {
		case GRANITE_SIMPLE_SETTINGS_PAGE_ACTION_AREA_PROPERTY:
		granite_simple_settings_page_set_action_area (self, g_value_get_object (value));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_CONTENT_AREA_PROPERTY:
		granite_simple_settings_page_set_content_area (self, g_value_get_object (value));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_STATUS_SWITCH_PROPERTY:
		granite_simple_settings_page_set_status_switch (self, g_value_get_object (value));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_ACTIVATABLE_PROPERTY:
		granite_simple_settings_page_set_activatable (self, g_value_get_boolean (value));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_DESCRIPTION_PROPERTY:
		granite_simple_settings_page_set_description (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

