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

/*
 * Copyright 2017–2021 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

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

#define GRANITE_TYPE_SETTINGS_SIDEBAR_ROW (granite_settings_sidebar_row_get_type ())
#define GRANITE_SETTINGS_SIDEBAR_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, GraniteSettingsSidebarRow))
#define GRANITE_SETTINGS_SIDEBAR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, GraniteSettingsSidebarRowClass))
#define GRANITE_IS_SETTINGS_SIDEBAR_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRANITE_TYPE_SETTINGS_SIDEBAR_ROW))
#define GRANITE_IS_SETTINGS_SIDEBAR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRANITE_TYPE_SETTINGS_SIDEBAR_ROW))
#define GRANITE_SETTINGS_SIDEBAR_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, GraniteSettingsSidebarRowClass))

typedef struct _GraniteSettingsSidebarRow GraniteSettingsSidebarRow;
typedef struct _GraniteSettingsSidebarRowClass GraniteSettingsSidebarRowClass;
typedef struct _GraniteSettingsSidebarRowPrivate GraniteSettingsSidebarRowPrivate;
enum  {
	GRANITE_SETTINGS_SIDEBAR_ROW_0_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_TYPE_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_DISPLAY_WIDGET_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_HEADER_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_PAGE_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_ICON_NAME_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_TITLE_PROPERTY,
	GRANITE_SETTINGS_SIDEBAR_ROW_NUM_PROPERTIES
};
static GParamSpec* granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_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 _GraniteSettingsSidebarRow {
	GtkListBoxRow parent_instance;
	GraniteSettingsSidebarRowPrivate * priv;
};

struct _GraniteSettingsSidebarRowClass {
	GtkListBoxRowClass parent_class;
};

struct _GraniteSettingsSidebarRowPrivate {
	GtkWidget* _display_widget;
	gchar* _header;
	GraniteSettingsPage* _page;
	GtkImage* status_icon;
	GtkLabel* status_label;
	GtkLabel* title_label;
	gchar* _icon_name;
	gchar* _title;
};

static gint GraniteSettingsSidebarRow_private_offset;
static gpointer granite_settings_sidebar_row_parent_class = NULL;

 G_GNUC_INTERNAL GType granite_settings_sidebar_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL void granite_settings_sidebar_row_set_status_type (GraniteSettingsSidebarRow* self,
                                                   GraniteSettingsPageStatusType value);
 G_GNUC_INTERNAL GtkWidget* granite_settings_sidebar_row_get_display_widget (GraniteSettingsSidebarRow* self);
static void granite_settings_sidebar_row_set_display_widget (GraniteSettingsSidebarRow* self,
                                                      GtkWidget* value);
 G_GNUC_INTERNAL const gchar* granite_settings_sidebar_row_get_header (GraniteSettingsSidebarRow* self);
 G_GNUC_INTERNAL void granite_settings_sidebar_row_set_header (GraniteSettingsSidebarRow* self,
                                              const gchar* value);
 G_GNUC_INTERNAL GraniteSettingsPage* granite_settings_sidebar_row_get_page (GraniteSettingsSidebarRow* self);
static void granite_settings_sidebar_row_set_page (GraniteSettingsSidebarRow* self,
                                            GraniteSettingsPage* value);
 G_GNUC_INTERNAL const gchar* granite_settings_sidebar_row_get_icon_name (GraniteSettingsSidebarRow* self);
 G_GNUC_INTERNAL void granite_settings_sidebar_row_set_icon_name (GraniteSettingsSidebarRow* self,
                                                 const gchar* value);
 G_GNUC_INTERNAL void granite_settings_sidebar_row_set_status (GraniteSettingsSidebarRow* self,
                                              const gchar* value);
 G_GNUC_INTERNAL const gchar* granite_settings_sidebar_row_get_title (GraniteSettingsSidebarRow* self);
 G_GNUC_INTERNAL void granite_settings_sidebar_row_set_title (GraniteSettingsSidebarRow* self,
                                             const gchar* value);
 G_GNUC_INTERNAL GraniteSettingsSidebarRow* granite_settings_sidebar_row_new (GraniteSettingsPage* page);
 G_GNUC_INTERNAL GraniteSettingsSidebarRow* granite_settings_sidebar_row_construct (GType object_type,
                                                                   GraniteSettingsPage* page);
static GObject * granite_settings_sidebar_row_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
static void granite_settings_sidebar_row_finalize (GObject * obj);
static GType granite_settings_sidebar_row_get_type_once (void);
static void _vala_granite_settings_sidebar_row_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_granite_settings_sidebar_row_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec);

static inline gpointer
granite_settings_sidebar_row_get_instance_private (GraniteSettingsSidebarRow* self)
{
	return G_STRUCT_MEMBER_P (self, GraniteSettingsSidebarRow_private_offset);
}

 G_GNUC_INTERNAL void
granite_settings_sidebar_row_set_status_type (GraniteSettingsSidebarRow* self,
                                              GraniteSettingsPageStatusType value)
{
	g_return_if_fail (self != NULL);
	switch (value) {
		case GRANITE_SETTINGS_PAGE_STATUS_TYPE_ERROR:
		{
			GtkImage* _tmp0_;
			_tmp0_ = self->priv->status_icon;
			g_object_set (_tmp0_, "icon-name", "emblem-error", NULL);
			break;
		}
		case GRANITE_SETTINGS_PAGE_STATUS_TYPE_OFFLINE:
		{
			GtkImage* _tmp1_;
			_tmp1_ = self->priv->status_icon;
			g_object_set (_tmp1_, "icon-name", "emblem-disabled", NULL);
			break;
		}
		case GRANITE_SETTINGS_PAGE_STATUS_TYPE_SUCCESS:
		{
			GtkImage* _tmp2_;
			_tmp2_ = self->priv->status_icon;
			g_object_set (_tmp2_, "icon-name", "emblem-enabled", NULL);
			break;
		}
		case GRANITE_SETTINGS_PAGE_STATUS_TYPE_WARNING:
		{
			GtkImage* _tmp3_;
			_tmp3_ = self->priv->status_icon;
			g_object_set (_tmp3_, "icon-name", "emblem-warning", NULL);
			break;
		}
		case GRANITE_SETTINGS_PAGE_STATUS_TYPE_NONE:
		{
			GtkImage* _tmp4_;
			_tmp4_ = self->priv->status_icon;
			gtk_image_clear (_tmp4_);
			break;
		}
		default:
		break;
	}
	g_object_notify_by_pspec ((GObject *) self, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_TYPE_PROPERTY]);
}

 G_GNUC_INTERNAL GtkWidget*
granite_settings_sidebar_row_get_display_widget (GraniteSettingsSidebarRow* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_widget;
	result = _tmp0_;
	return result;
}

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

static void
granite_settings_sidebar_row_set_display_widget (GraniteSettingsSidebarRow* self,
                                                 GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_settings_sidebar_row_get_display_widget (self);
	if (old_value != value) {
		GtkWidget* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_display_widget);
		self->priv->_display_widget = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_DISPLAY_WIDGET_PROPERTY]);
	}
}

 G_GNUC_INTERNAL const gchar*
granite_settings_sidebar_row_get_header (GraniteSettingsSidebarRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_header;
	result = _tmp0_;
	return result;
}

 G_GNUC_INTERNAL void
granite_settings_sidebar_row_set_header (GraniteSettingsSidebarRow* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_settings_sidebar_row_get_header (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_header);
		self->priv->_header = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_HEADER_PROPERTY]);
	}
}

 G_GNUC_INTERNAL GraniteSettingsPage*
granite_settings_sidebar_row_get_page (GraniteSettingsSidebarRow* self)
{
	GraniteSettingsPage* result;
	GraniteSettingsPage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_page;
	result = _tmp0_;
	return result;
}

static void
granite_settings_sidebar_row_set_page (GraniteSettingsSidebarRow* self,
                                       GraniteSettingsPage* value)
{
	GraniteSettingsPage* old_value;
	g_return_if_fail (self != NULL);
	old_value = granite_settings_sidebar_row_get_page (self);
	if (old_value != value) {
		self->priv->_page = value;
		g_object_notify_by_pspec ((GObject *) self, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_PAGE_PROPERTY]);
	}
}

 G_GNUC_INTERNAL const gchar*
granite_settings_sidebar_row_get_icon_name (GraniteSettingsSidebarRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_name;
	result = _tmp0_;
	return result;
}

 G_GNUC_INTERNAL void
granite_settings_sidebar_row_set_icon_name (GraniteSettingsSidebarRow* self,
                                            const gchar* value)
{
	gchar* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_icon_name);
	self->priv->_icon_name = _tmp0_;
	_tmp1_ = self->priv->_display_widget;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_image_get_type ())) {
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		_tmp2_ = self->priv->_display_widget;
		g_object_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_image_get_type (), GtkImage), "icon-name", value, NULL);
		_tmp3_ = self->priv->_display_widget;
		gtk_image_set_icon_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_image_get_type (), GtkImage), GTK_ICON_SIZE_LARGE);
	}
	g_object_notify_by_pspec ((GObject *) self, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_ICON_NAME_PROPERTY]);
}

 G_GNUC_INTERNAL void
granite_settings_sidebar_row_set_status (GraniteSettingsSidebarRow* self,
                                         const gchar* value)
{
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->status_label;
	gtk_label_set_label (_tmp0_, value);
	_tmp1_ = self->priv->status_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, TRUE);
	g_object_notify_by_pspec ((GObject *) self, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_PROPERTY]);
}

 G_GNUC_INTERNAL const gchar*
granite_settings_sidebar_row_get_title (GraniteSettingsSidebarRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

 G_GNUC_INTERNAL void
granite_settings_sidebar_row_set_title (GraniteSettingsSidebarRow* self,
                                        const gchar* value)
{
	gchar* _tmp0_;
	GtkLabel* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_title);
	self->priv->_title = _tmp0_;
	_tmp1_ = self->priv->title_label;
	gtk_label_set_label (_tmp1_, value);
	g_object_notify_by_pspec ((GObject *) self, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_TITLE_PROPERTY]);
}

 G_GNUC_INTERNAL GraniteSettingsSidebarRow*
granite_settings_sidebar_row_construct (GType object_type,
                                        GraniteSettingsPage* page)
{
	GraniteSettingsSidebarRow * self = NULL;
	g_return_val_if_fail (page != NULL, NULL);
	self = (GraniteSettingsSidebarRow*) g_object_new (object_type, "page", page, NULL);
	return self;
}

 G_GNUC_INTERNAL GraniteSettingsSidebarRow*
granite_settings_sidebar_row_new (GraniteSettingsPage* page)
{
	return granite_settings_sidebar_row_construct (GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, page);
}

static GObject *
granite_settings_sidebar_row_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GraniteSettingsSidebarRow * self;
	GraniteSettingsPage* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_;
	GtkImage* _tmp5_ = NULL;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* _tmp7_;
	GraniteSettingsPage* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GtkOverlay* overlay = NULL;
	GtkOverlay* _tmp19_;
	GtkOverlay* _tmp20_;
	GtkWidget* _tmp21_;
	GtkOverlay* _tmp22_;
	GtkImage* _tmp23_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp24_;
	GtkGrid* _tmp25_;
	GtkOverlay* _tmp26_;
	GtkGrid* _tmp27_;
	GtkLabel* _tmp28_;
	GtkGrid* _tmp29_;
	GtkLabel* _tmp30_;
	GtkGrid* _tmp31_;
	GraniteSettingsPage* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	GraniteSettingsPage* _tmp35_;
	GraniteSettingsPage* _tmp36_;
	GraniteSettingsPage* _tmp37_;
	GraniteSettingsPage* _tmp38_;
	GraniteSettingsPage* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	GraniteSettingsPage* _tmp45_;
	GraniteSettingsPageStatusType _tmp46_;
	GraniteSettingsPageStatusType _tmp47_;
	parent_class = G_OBJECT_CLASS (granite_settings_sidebar_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, GraniteSettingsSidebarRow);
	_tmp0_ = self->priv->_page;
	_tmp1_ = granite_settings_page_get_title (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp2_);
	gtk_label_set_ellipsize (_tmp3_, PANGO_ELLIPSIZE_END);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp3_, TRUE);
	gtk_label_set_xalign (_tmp3_, (gfloat) 0);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->title_label);
	self->priv->title_label = _tmp3_;
	_tmp4_ = self->priv->title_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp4_, GRANITE_STYLE_CLASS_H3_LABEL);
	_tmp5_ = (GtkImage*) gtk_image_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->status_icon);
	self->priv->status_icon = _tmp5_;
	_tmp6_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_label_set_use_markup (_tmp6_, TRUE);
	gtk_label_set_ellipsize (_tmp6_, PANGO_ELLIPSIZE_END);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp6_, TRUE);
	gtk_label_set_xalign (_tmp6_, (gfloat) 0);
	gtk_widget_set_visible ((GtkWidget*) _tmp6_, FALSE);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->status_label);
	self->priv->status_label = _tmp6_;
	_tmp7_ = self->priv->status_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp7_, GRANITE_STYLE_CLASS_SMALL_LABEL);
	_tmp8_ = self->priv->_page;
	_tmp9_ = granite_settings_page_get_icon_name (_tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp10_ != NULL) {
		GtkImage* _tmp11_;
		GtkImage* _tmp12_;
		GraniteSettingsPage* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		_tmp11_ = (GtkImage*) gtk_image_new ();
		g_object_ref_sink (_tmp11_);
		_tmp12_ = _tmp11_;
		granite_settings_sidebar_row_set_display_widget (self, (GtkWidget*) _tmp12_);
		_g_object_unref0 (_tmp12_);
		_tmp13_ = self->priv->_page;
		_tmp14_ = granite_settings_page_get_icon_name (_tmp13_);
		_tmp15_ = _tmp14_;
		granite_settings_sidebar_row_set_icon_name (self, _tmp15_);
	} else {
		GraniteSettingsPage* _tmp16_;
		GtkWidget* _tmp17_;
		GtkWidget* _tmp18_;
		_tmp16_ = self->priv->_page;
		_tmp17_ = granite_settings_page_get_display_widget (_tmp16_);
		_tmp18_ = _tmp17_;
		granite_settings_sidebar_row_set_display_widget (self, _tmp18_);
	}
	_tmp19_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp19_);
	overlay = _tmp19_;
	_tmp20_ = overlay;
	_tmp21_ = self->priv->_display_widget;
	gtk_overlay_set_child (_tmp20_, _tmp21_);
	_tmp22_ = overlay;
	_tmp23_ = self->priv->status_icon;
	gtk_overlay_add_overlay (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp24_);
	grid = _tmp24_;
	_tmp25_ = grid;
	_tmp26_ = overlay;
	gtk_grid_attach (_tmp25_, (GtkWidget*) _tmp26_, 0, 0, 1, 2);
	_tmp27_ = grid;
	_tmp28_ = self->priv->title_label;
	gtk_grid_attach (_tmp27_, (GtkWidget*) _tmp28_, 1, 0, 1, 1);
	_tmp29_ = grid;
	_tmp30_ = self->priv->status_label;
	gtk_grid_attach (_tmp29_, (GtkWidget*) _tmp30_, 1, 1, 1, 1);
	_tmp31_ = grid;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp31_);
	_tmp32_ = self->priv->_page;
	_tmp33_ = granite_settings_page_get_header (_tmp32_);
	_tmp34_ = _tmp33_;
	granite_settings_sidebar_row_set_header (self, _tmp34_);
	_tmp35_ = self->priv->_page;
	g_object_bind_property_with_closures ((GObject*) _tmp35_, "icon-name", (GObject*) self, "icon-name", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp36_ = self->priv->_page;
	g_object_bind_property_with_closures ((GObject*) _tmp36_, "status", (GObject*) self, "status", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp37_ = self->priv->_page;
	g_object_bind_property_with_closures ((GObject*) _tmp37_, "status-type", (GObject*) self, "status-type", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp38_ = self->priv->_page;
	g_object_bind_property_with_closures ((GObject*) _tmp38_, "title", (GObject*) self, "title", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp39_ = self->priv->_page;
	_tmp40_ = granite_settings_page_get_status (_tmp39_);
	_tmp41_ = _tmp40_;
	if (_tmp41_ != NULL) {
		GraniteSettingsPage* _tmp42_;
		const gchar* _tmp43_;
		const gchar* _tmp44_;
		_tmp42_ = self->priv->_page;
		_tmp43_ = granite_settings_page_get_status (_tmp42_);
		_tmp44_ = _tmp43_;
		granite_settings_sidebar_row_set_status (self, _tmp44_);
	}
	_tmp45_ = self->priv->_page;
	_tmp46_ = granite_settings_page_get_status_type (_tmp45_);
	_tmp47_ = _tmp46_;
	if (_tmp47_ != GRANITE_SETTINGS_PAGE_STATUS_TYPE_NONE) {
		GraniteSettingsPage* _tmp48_;
		GraniteSettingsPageStatusType _tmp49_;
		GraniteSettingsPageStatusType _tmp50_;
		_tmp48_ = self->priv->_page;
		_tmp49_ = granite_settings_page_get_status_type (_tmp48_);
		_tmp50_ = _tmp49_;
		granite_settings_sidebar_row_set_status_type (self, _tmp50_);
	}
	_g_object_unref0 (grid);
	_g_object_unref0 (overlay);
	return obj;
}

static void
granite_settings_sidebar_row_class_init (GraniteSettingsSidebarRowClass * klass,
                                         gpointer klass_data)
{
	granite_settings_sidebar_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GraniteSettingsSidebarRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_granite_settings_sidebar_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_granite_settings_sidebar_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = granite_settings_sidebar_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = granite_settings_sidebar_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_TYPE_PROPERTY, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_TYPE_PROPERTY] = g_param_spec_enum ("status-type", "status-type", "status-type", GRANITE_SETTINGS_PAGE_TYPE_STATUS_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SETTINGS_SIDEBAR_ROW_DISPLAY_WIDGET_PROPERTY, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_DISPLAY_WIDGET_PROPERTY] = g_param_spec_object ("display-widget", "display-widget", "display-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SETTINGS_SIDEBAR_ROW_HEADER_PROPERTY, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_HEADER_PROPERTY] = g_param_spec_string ("header", "header", "header", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SETTINGS_SIDEBAR_ROW_PAGE_PROPERTY, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_PAGE_PROPERTY] = g_param_spec_object ("page", "page", "page", GRANITE_TYPE_SETTINGS_PAGE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SETTINGS_SIDEBAR_ROW_ICON_NAME_PROPERTY, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_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_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_PROPERTY, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_PROPERTY] = g_param_spec_string ("status", "status", "status", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRANITE_SETTINGS_SIDEBAR_ROW_TITLE_PROPERTY, granite_settings_sidebar_row_properties[GRANITE_SETTINGS_SIDEBAR_ROW_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
granite_settings_sidebar_row_instance_init (GraniteSettingsSidebarRow * self,
                                            gpointer klass)
{
	self->priv = granite_settings_sidebar_row_get_instance_private (self);
}

static void
granite_settings_sidebar_row_finalize (GObject * obj)
{
	GraniteSettingsSidebarRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, GraniteSettingsSidebarRow);
	_g_object_unref0 (self->priv->_display_widget);
	_g_free0 (self->priv->_header);
	_g_object_unref0 (self->priv->status_icon);
	_g_object_unref0 (self->priv->status_label);
	_g_object_unref0 (self->priv->title_label);
	_g_free0 (self->priv->_icon_name);
	_g_free0 (self->priv->_title);
	G_OBJECT_CLASS (granite_settings_sidebar_row_parent_class)->finalize (obj);
}

static GType
granite_settings_sidebar_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraniteSettingsSidebarRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) granite_settings_sidebar_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraniteSettingsSidebarRow), 0, (GInstanceInitFunc) granite_settings_sidebar_row_instance_init, NULL };
	GType granite_settings_sidebar_row_type_id;
	granite_settings_sidebar_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "GraniteSettingsSidebarRow", &g_define_type_info, 0);
	GraniteSettingsSidebarRow_private_offset = g_type_add_instance_private (granite_settings_sidebar_row_type_id, sizeof (GraniteSettingsSidebarRowPrivate));
	return granite_settings_sidebar_row_type_id;
}

 G_GNUC_INTERNAL GType
granite_settings_sidebar_row_get_type (void)
{
	static volatile gsize granite_settings_sidebar_row_type_id__once = 0;
	if (g_once_init_enter (&granite_settings_sidebar_row_type_id__once)) {
		GType granite_settings_sidebar_row_type_id;
		granite_settings_sidebar_row_type_id = granite_settings_sidebar_row_get_type_once ();
		g_once_init_leave (&granite_settings_sidebar_row_type_id__once, granite_settings_sidebar_row_type_id);
	}
	return granite_settings_sidebar_row_type_id__once;
}

static void
_vala_granite_settings_sidebar_row_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	GraniteSettingsSidebarRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, GraniteSettingsSidebarRow);
	switch (property_id) {
		case GRANITE_SETTINGS_SIDEBAR_ROW_DISPLAY_WIDGET_PROPERTY:
		g_value_set_object (value, granite_settings_sidebar_row_get_display_widget (self));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_HEADER_PROPERTY:
		g_value_set_string (value, granite_settings_sidebar_row_get_header (self));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_PAGE_PROPERTY:
		g_value_set_object (value, granite_settings_sidebar_row_get_page (self));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_ICON_NAME_PROPERTY:
		g_value_set_string (value, granite_settings_sidebar_row_get_icon_name (self));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_TITLE_PROPERTY:
		g_value_set_string (value, granite_settings_sidebar_row_get_title (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_granite_settings_sidebar_row_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	GraniteSettingsSidebarRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRANITE_TYPE_SETTINGS_SIDEBAR_ROW, GraniteSettingsSidebarRow);
	switch (property_id) {
		case GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_TYPE_PROPERTY:
		granite_settings_sidebar_row_set_status_type (self, g_value_get_enum (value));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_DISPLAY_WIDGET_PROPERTY:
		granite_settings_sidebar_row_set_display_widget (self, g_value_get_object (value));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_HEADER_PROPERTY:
		granite_settings_sidebar_row_set_header (self, g_value_get_string (value));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_PAGE_PROPERTY:
		granite_settings_sidebar_row_set_page (self, g_value_get_object (value));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_ICON_NAME_PROPERTY:
		granite_settings_sidebar_row_set_icon_name (self, g_value_get_string (value));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_STATUS_PROPERTY:
		granite_settings_sidebar_row_set_status (self, g_value_get_string (value));
		break;
		case GRANITE_SETTINGS_SIDEBAR_ROW_TITLE_PROPERTY:
		granite_settings_sidebar_row_set_title (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

