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

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

#include "granite.h"
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <pango/pango.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_ICON_NAME_PROPERTY,
	GRANITE_SIMPLE_SETTINGS_PAGE_TITLE_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))

struct _GraniteSimpleSettingsPagePrivate {
	GtkImage* header_icon;
	GtkLabel* description_label;
	GtkLabel* title_label;
	gchar* _description;
	GtkButtonBox* _action_area;
	GtkGrid* _content_area;
	GtkSwitch* _status_switch;
	gboolean _activatable;
};

static gint GraniteSimpleSettingsPage_private_offset;
static gpointer granite_simple_settings_page_parent_class = NULL;

static void granite_simple_settings_page_set_action_area_visibility (GraniteSimpleSettingsPage* self);
static GObject * granite_simple_settings_page_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
static void _granite_simple_settings_page_set_action_area_visibility_gtk_container_add (GtkContainer* _sender,
                                                                                 GtkWidget* widget,
                                                                                 gpointer self);
static void _granite_simple_settings_page_set_action_area_visibility_gtk_container_remove (GtkContainer* _sender,
                                                                                    GtkWidget* widget,
                                                                                    gpointer self);
static void _granite_simple_settings_page___lambda11_ (GraniteSimpleSettingsPage* self);
static void __granite_simple_settings_page___lambda11__g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self);
static void _granite_simple_settings_page___lambda12_ (GraniteSimpleSettingsPage* self);
static void __granite_simple_settings_page___lambda12__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);
}

GtkButtonBox*
granite_simple_settings_page_get_action_area (GraniteSimpleSettingsPage* self)
{
	GtkButtonBox* result;
	GtkButtonBox* _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,
                                              GtkButtonBox* value)
{
	GtkButtonBox* old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_simple_settings_page_get_action_area (self);
	if (old_value != value) {
		GtkButtonBox* _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]);
}

const gchar*
granite_simple_settings_page_get_icon_name (GraniteSimpleSettingsPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = ((GraniteSettingsPage*) self)->_icon_name;
	result = _tmp0_;
	return result;
}

void
granite_simple_settings_page_set_icon_name (GraniteSimpleSettingsPage* self,
                                            const gchar* value)
{
	GtkImage* _tmp0_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->header_icon;
	if (_tmp0_ != NULL) {
		GtkImage* _tmp1_;
		_tmp1_ = self->priv->header_icon;
		g_object_set (_tmp1_, "icon-name", value, NULL);
	}
	_tmp2_ = g_strdup (value);
	_g_free0 (((GraniteSettingsPage*) self)->_icon_name);
	((GraniteSettingsPage*) self)->_icon_name = _tmp2_;
	g_object_notify_by_pspec ((GObject *) self, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_ICON_NAME_PROPERTY]);
}

const gchar*
granite_simple_settings_page_get_title (GraniteSimpleSettingsPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = ((GraniteSettingsPage*) self)->_title;
	result = _tmp0_;
	return result;
}

void
granite_simple_settings_page_set_title (GraniteSimpleSettingsPage* self,
                                        const gchar* value)
{
	GtkLabel* _tmp0_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title_label;
	if (_tmp0_ != NULL) {
		GtkLabel* _tmp1_;
		_tmp1_ = self->priv->title_label;
		gtk_label_set_label (_tmp1_, value);
	}
	_tmp2_ = g_strdup (value);
	_g_free0 (((GraniteSettingsPage*) self)->_title);
	((GraniteSettingsPage*) self)->_title = _tmp2_;
	g_object_notify_by_pspec ((GObject *) self, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_TITLE_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 void
granite_simple_settings_page_set_action_area_visibility (GraniteSimpleSettingsPage* self)
{
	GtkButtonBox* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_action_area;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_list_free (_tmp2_), NULL));
	if (_tmp3_) {
		GtkButtonBox* _tmp4_;
		GtkButtonBox* _tmp5_;
		_tmp4_ = self->priv->_action_area;
		gtk_widget_set_no_show_all ((GtkWidget*) _tmp4_, FALSE);
		_tmp5_ = self->priv->_action_area;
		gtk_widget_show ((GtkWidget*) _tmp5_);
	} else {
		GtkButtonBox* _tmp6_;
		GtkButtonBox* _tmp7_;
		_tmp6_ = self->priv->_action_area;
		gtk_widget_set_no_show_all ((GtkWidget*) _tmp6_, TRUE);
		_tmp7_ = self->priv->_action_area;
		gtk_widget_hide ((GtkWidget*) _tmp7_);
	}
}

static void
_granite_simple_settings_page_set_action_area_visibility_gtk_container_add (GtkContainer* _sender,
                                                                            GtkWidget* widget,
                                                                            gpointer self)
{
	granite_simple_settings_page_set_action_area_visibility ((GraniteSimpleSettingsPage*) self);
}

static void
_granite_simple_settings_page_set_action_area_visibility_gtk_container_remove (GtkContainer* _sender,
                                                                               GtkWidget* widget,
                                                                               gpointer self)
{
	granite_simple_settings_page_set_action_area_visibility ((GraniteSimpleSettingsPage*) self);
}

static void
_granite_simple_settings_page___lambda11_ (GraniteSimpleSettingsPage* self)
{
	GtkImage* _tmp0_;
	_tmp0_ = self->priv->header_icon;
	if (_tmp0_ != NULL) {
		GtkImage* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp1_ = self->priv->header_icon;
		_tmp2_ = granite_simple_settings_page_get_icon_name (self);
		_tmp3_ = _tmp2_;
		g_object_set (_tmp1_, "icon-name", _tmp3_, NULL);
	}
}

static void
__granite_simple_settings_page___lambda11__g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self)
{
	_granite_simple_settings_page___lambda11_ ((GraniteSimpleSettingsPage*) self);
}

static void
_granite_simple_settings_page___lambda12_ (GraniteSimpleSettingsPage* self)
{
	GtkLabel* _tmp0_;
	_tmp0_ = self->priv->title_label;
	if (_tmp0_ != NULL) {
		GtkLabel* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp1_ = self->priv->title_label;
		_tmp2_ = granite_simple_settings_page_get_title (self);
		_tmp3_ = _tmp2_;
		gtk_label_set_label (_tmp1_, _tmp3_);
	}
}

static void
__granite_simple_settings_page___lambda12__g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self)
{
	_granite_simple_settings_page___lambda12_ ((GraniteSimpleSettingsPage*) self);
}

static GObject *
granite_simple_settings_page_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GraniteSimpleSettingsPage * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GtkImage* _tmp2_;
	GtkImage* _tmp3_;
	GtkImage* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GtkLabel* _tmp10_;
	GtkLabel* _tmp11_;
	GtkStyleContext* _tmp12_;
	GtkGrid* header_area = NULL;
	GtkGrid* _tmp13_;
	GtkGrid* _tmp14_;
	GtkGrid* _tmp15_;
	GtkGrid* _tmp16_;
	GtkLabel* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gboolean _tmp32_;
	GtkGrid* _tmp40_;
	GtkGrid* _tmp41_;
	GtkGrid* _tmp42_;
	GtkGrid* _tmp43_;
	GtkGrid* _tmp44_;
	GtkButtonBox* _tmp45_;
	GtkButtonBox* _tmp46_;
	GtkButtonBox* _tmp47_;
	GtkButtonBox* _tmp48_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp49_;
	GtkGrid* _tmp50_;
	GtkGrid* _tmp51_;
	GtkGrid* _tmp52_;
	GtkGrid* _tmp53_;
	GtkGrid* _tmp54_;
	GtkGrid* _tmp55_;
	GtkGrid* _tmp56_;
	GtkGrid* _tmp57_;
	GtkButtonBox* _tmp58_;
	GtkGrid* _tmp59_;
	GtkButtonBox* _tmp60_;
	GtkButtonBox* _tmp61_;
	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);
	_tmp0_ = granite_simple_settings_page_get_icon_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp1_, (GtkIconSize) GTK_ICON_SIZE_DIALOG);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->header_icon);
	self->priv->header_icon = _tmp2_;
	_tmp3_ = self->priv->header_icon;
	gtk_image_set_pixel_size (_tmp3_, 48);
	_tmp4_ = self->priv->header_icon;
	gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	_tmp5_ = granite_simple_settings_page_get_title (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = (GtkLabel*) gtk_label_new (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->title_label);
	self->priv->title_label = _tmp7_;
	_tmp8_ = self->priv->title_label;
	gtk_label_set_ellipsize (_tmp8_, PANGO_ELLIPSIZE_END);
	_tmp9_ = self->priv->title_label;
	gtk_label_set_selectable (_tmp9_, TRUE);
	_tmp10_ = self->priv->title_label;
	gtk_label_set_xalign (_tmp10_, (gfloat) 0);
	_tmp11_ = self->priv->title_label;
	_tmp12_ = gtk_widget_get_style_context ((GtkWidget*) _tmp11_);
	gtk_style_context_add_class (_tmp12_, GRANITE_STYLE_CLASS_H2_LABEL);
	_tmp13_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp13_);
	header_area = _tmp13_;
	_tmp14_ = header_area;
	gtk_grid_set_column_spacing (_tmp14_, 12);
	_tmp15_ = header_area;
	gtk_grid_set_row_spacing (_tmp15_, 3);
	_tmp16_ = header_area;
	_tmp17_ = self->priv->title_label;
	gtk_grid_attach (_tmp16_, (GtkWidget*) _tmp17_, 1, 0, 1, 1);
	_tmp18_ = granite_simple_settings_page_get_description (self);
	_tmp19_ = _tmp18_;
	if (_tmp19_ != NULL) {
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		GtkLabel* _tmp22_;
		GtkLabel* _tmp23_;
		GtkLabel* _tmp24_;
		GtkLabel* _tmp25_;
		GtkGrid* _tmp26_;
		GtkImage* _tmp27_;
		GtkGrid* _tmp28_;
		GtkLabel* _tmp29_;
		_tmp20_ = granite_simple_settings_page_get_description (self);
		_tmp21_ = _tmp20_;
		_tmp22_ = (GtkLabel*) gtk_label_new (_tmp21_);
		g_object_ref_sink (_tmp22_);
		_g_object_unref0 (self->priv->description_label);
		self->priv->description_label = _tmp22_;
		_tmp23_ = self->priv->description_label;
		gtk_label_set_selectable (_tmp23_, TRUE);
		_tmp24_ = self->priv->description_label;
		gtk_label_set_xalign (_tmp24_, (gfloat) 0);
		_tmp25_ = self->priv->description_label;
		g_object_set (_tmp25_, "wrap", TRUE, NULL);
		_tmp26_ = header_area;
		_tmp27_ = self->priv->header_icon;
		gtk_grid_attach (_tmp26_, (GtkWidget*) _tmp27_, 0, 0, 1, 2);
		_tmp28_ = header_area;
		_tmp29_ = self->priv->description_label;
		gtk_grid_attach (_tmp28_, (GtkWidget*) _tmp29_, 1, 1, 1, 1);
	} else {
		GtkGrid* _tmp30_;
		GtkImage* _tmp31_;
		_tmp30_ = header_area;
		_tmp31_ = self->priv->header_icon;
		gtk_grid_attach (_tmp30_, (GtkWidget*) _tmp31_, 0, 0, 1, 1);
	}
	_tmp32_ = self->priv->_activatable;
	if (_tmp32_) {
		GtkSwitch* _tmp33_;
		GtkSwitch* _tmp34_;
		GtkSwitch* _tmp35_;
		GtkSwitch* _tmp36_;
		GtkSwitch* _tmp37_;
		GtkGrid* _tmp38_;
		GtkSwitch* _tmp39_;
		_tmp33_ = (GtkSwitch*) gtk_switch_new ();
		g_object_ref_sink (_tmp33_);
		_tmp34_ = _tmp33_;
		granite_simple_settings_page_set_status_switch (self, _tmp34_);
		_g_object_unref0 (_tmp34_);
		_tmp35_ = self->priv->_status_switch;
		gtk_widget_set_hexpand ((GtkWidget*) _tmp35_, TRUE);
		_tmp36_ = self->priv->_status_switch;
		gtk_widget_set_halign ((GtkWidget*) _tmp36_, GTK_ALIGN_END);
		_tmp37_ = self->priv->_status_switch;
		gtk_widget_set_valign ((GtkWidget*) _tmp37_, GTK_ALIGN_CENTER);
		_tmp38_ = header_area;
		_tmp39_ = self->priv->_status_switch;
		gtk_grid_attach (_tmp38_, (GtkWidget*) _tmp39_, 2, 0, 1, 1);
	}
	_tmp40_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp40_);
	_tmp41_ = _tmp40_;
	granite_simple_settings_page_set_content_area (self, _tmp41_);
	_g_object_unref0 (_tmp41_);
	_tmp42_ = self->priv->_content_area;
	gtk_grid_set_column_spacing (_tmp42_, 12);
	_tmp43_ = self->priv->_content_area;
	gtk_grid_set_row_spacing (_tmp43_, 12);
	_tmp44_ = self->priv->_content_area;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp44_, TRUE);
	_tmp45_ = (GtkButtonBox*) gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp45_);
	_tmp46_ = _tmp45_;
	granite_simple_settings_page_set_action_area (self, _tmp46_);
	_g_object_unref0 (_tmp46_);
	_tmp47_ = self->priv->_action_area;
	gtk_button_box_set_layout (_tmp47_, GTK_BUTTONBOX_END);
	_tmp48_ = self->priv->_action_area;
	gtk_box_set_spacing ((GtkBox*) _tmp48_, 6);
	_tmp49_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp49_);
	grid = _tmp49_;
	_tmp50_ = grid;
	g_object_set ((GtkWidget*) _tmp50_, "margin", 12, NULL);
	_tmp51_ = grid;
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp51_, GTK_ORIENTATION_VERTICAL);
	_tmp52_ = grid;
	gtk_grid_set_row_spacing (_tmp52_, 24);
	_tmp53_ = grid;
	_tmp54_ = header_area;
	gtk_container_add ((GtkContainer*) _tmp53_, (GtkWidget*) _tmp54_);
	_tmp55_ = grid;
	_tmp56_ = self->priv->_content_area;
	gtk_container_add ((GtkContainer*) _tmp55_, (GtkWidget*) _tmp56_);
	_tmp57_ = grid;
	_tmp58_ = self->priv->_action_area;
	gtk_container_add ((GtkContainer*) _tmp57_, (GtkWidget*) _tmp58_);
	_tmp59_ = grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp59_);
	granite_simple_settings_page_set_action_area_visibility (self);
	_tmp60_ = self->priv->_action_area;
	g_signal_connect_object ((GtkContainer*) _tmp60_, "add", (GCallback) _granite_simple_settings_page_set_action_area_visibility_gtk_container_add, self, 0);
	_tmp61_ = self->priv->_action_area;
	g_signal_connect_object ((GtkContainer*) _tmp61_, "remove", (GCallback) _granite_simple_settings_page_set_action_area_visibility_gtk_container_remove, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::icon-name", (GCallback) __granite_simple_settings_page___lambda11__g_object_notify, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::title", (GCallback) __granite_simple_settings_page___lambda12__g_object_notify, self, 0);
	_g_object_unref0 (grid);
	_g_object_unref0 (header_area);
	return obj;
}

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.ButtonbBox} 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_button_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));
	/**
	     * An icon name associated with #this
	     * Deprecated: Use #SettingsPage.icon_name instead.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SIMPLE_SETTINGS_PAGE_ICON_NAME_PROPERTY, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	/**
	     * A title associated with #this
	     * Deprecated: Use #SettingsPage.title instead.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SIMPLE_SETTINGS_PAGE_TITLE_PROPERTY, granite_simple_settings_page_properties[GRANITE_SIMPLE_SETTINGS_PAGE_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", 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->header_icon);
	_g_object_unref0 (self->priv->description_label);
	_g_object_unref0 (self->priv->title_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) NULL, (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;
		case GRANITE_SIMPLE_SETTINGS_PAGE_ICON_NAME_PROPERTY:
		g_value_set_string (value, granite_simple_settings_page_get_icon_name (self));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_TITLE_PROPERTY:
		g_value_set_string (value, granite_simple_settings_page_get_title (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;
		case GRANITE_SIMPLE_SETTINGS_PAGE_ICON_NAME_PROPERTY:
		granite_simple_settings_page_set_icon_name (self, g_value_get_string (value));
		break;
		case GRANITE_SIMPLE_SETTINGS_PAGE_TITLE_PROPERTY:
		granite_simple_settings_page_set_title (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

