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

/*
 * SPDX-License-Identifier: GPL-2.0-or-later
 * SPDX-FileCopyrightText: 2024 elementary, Inc. (https://elementary.io)
 */

#include "power.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.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  {
	POWER_WIDGETS_POWER_MODE_LIST_0_PROPERTY,
	POWER_WIDGETS_POWER_MODE_LIST_NUM_PROPERTIES
};
static GParamSpec* power_widgets_power_mode_list_properties[POWER_WIDGETS_POWER_MODE_LIST_NUM_PROPERTIES];

#define POWER_SERVICES_DBUS_INTERFACES_TYPE_POWER_PROFILE (power_services_dbus_interfaces_power_profile_get_type ())
#define POWER_SERVICES_DBUS_INTERFACES_POWER_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POWER_SERVICES_DBUS_INTERFACES_TYPE_POWER_PROFILE, PowerServicesDBusInterfacesPowerProfile))
#define POWER_SERVICES_DBUS_INTERFACES_IS_POWER_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POWER_SERVICES_DBUS_INTERFACES_TYPE_POWER_PROFILE))
#define POWER_SERVICES_DBUS_INTERFACES_POWER_PROFILE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), POWER_SERVICES_DBUS_INTERFACES_TYPE_POWER_PROFILE, PowerServicesDBusInterfacesPowerProfileIface))

typedef struct _PowerServicesDBusInterfacesPowerProfile PowerServicesDBusInterfacesPowerProfile;
typedef struct _PowerServicesDBusInterfacesPowerProfileIface PowerServicesDBusInterfacesPowerProfileIface;

#define POWER_SERVICES_DBUS_INTERFACES_TYPE_POWER_PROFILE_PROXY (power_services_dbus_interfaces_power_profile_proxy_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK (power_widgets_power_mode_list_power_mode_check_get_type ())
#define POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, PowerWidgetsPowerModeListPowerModeCheck))
#define POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, PowerWidgetsPowerModeListPowerModeCheckClass))
#define POWER_WIDGETS_POWER_MODE_LIST_IS_POWER_MODE_CHECK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK))
#define POWER_WIDGETS_POWER_MODE_LIST_IS_POWER_MODE_CHECK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK))
#define POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, PowerWidgetsPowerModeListPowerModeCheckClass))

typedef struct _PowerWidgetsPowerModeListPowerModeCheck PowerWidgetsPowerModeListPowerModeCheck;
typedef struct _PowerWidgetsPowerModeListPowerModeCheckClass PowerWidgetsPowerModeListPowerModeCheckClass;
typedef struct _PowerWidgetsPowerModeListPowerModeCheckPrivate PowerWidgetsPowerModeListPowerModeCheckPrivate;
enum  {
	POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_0_PROPERTY,
	POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_ICON_NAME_PROPERTY,
	POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_LABEL_PROPERTY,
	POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_NUM_PROPERTIES
};
static GParamSpec* power_widgets_power_mode_list_power_mode_check_properties[POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_NUM_PROPERTIES];
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_settings_schema_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_unref (var), NULL)))

struct _PowerWidgetsPowerModeListPrivate {
	gchar* settings_key;
	GtkRadioButton* saver_radio;
	GtkRadioButton* balanced_radio;
	GtkRadioButton* performance_radio;
};

struct _PowerServicesDBusInterfacesPowerProfileIface {
	GTypeInterface parent_iface;
	GHashTable** (*get_profiles) (PowerServicesDBusInterfacesPowerProfile* self, gint* result_length1);
	gchar* (*get_active_profile) (PowerServicesDBusInterfacesPowerProfile* self);
	void (*set_active_profile) (PowerServicesDBusInterfacesPowerProfile* self, const gchar* value);
};

struct _PowerWidgetsPowerModeListPowerModeCheck {
	GtkRadioButton parent_instance;
	PowerWidgetsPowerModeListPowerModeCheckPrivate * priv;
};

struct _PowerWidgetsPowerModeListPowerModeCheckClass {
	GtkRadioButtonClass parent_class;
};

struct _PowerWidgetsPowerModeListPowerModeCheckPrivate {
	gchar* _icon_name;
	gchar* _label;
};

static gint PowerWidgetsPowerModeList_private_offset;
static gpointer power_widgets_power_mode_list_parent_class = NULL;
static gboolean power_widgets_power_mode_list__successfully_initialized;
static gboolean power_widgets_power_mode_list__successfully_initialized = TRUE;
static PowerServicesDBusInterfacesPowerProfile* power_widgets_power_mode_list_pprofile;
static PowerServicesDBusInterfacesPowerProfile* power_widgets_power_mode_list_pprofile = NULL;
static PowerServicesDeviceManager* power_widgets_power_mode_list_device_manager;
static PowerServicesDeviceManager* power_widgets_power_mode_list_device_manager = NULL;
static GSettings* power_widgets_power_mode_list_settings;
static GSettings* power_widgets_power_mode_list_settings = NULL;
static gint PowerWidgetsPowerModeListPowerModeCheck_private_offset;
static gpointer power_widgets_power_mode_list_power_mode_check_parent_class = NULL;

VALA_EXTERN GType power_services_dbus_interfaces_power_profile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType power_services_dbus_interfaces_power_profile_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint power_services_dbus_interfaces_power_profile_register_object (void* object,
                                                                    GDBusConnection* connection,
                                                                    const gchar* path,
                                                                    GError** error);
static void power_widgets_power_mode_list_update_on_battery_state (PowerWidgetsPowerModeList* self);
VALA_EXTERN gchar* power_services_dbus_interfaces_power_profile_get_active_profile (PowerServicesDBusInterfacesPowerProfile* self);
static void power_widgets_power_mode_list_set_successfully_initialized (gboolean value);
static GType power_widgets_power_mode_list_power_mode_check_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static PowerWidgetsPowerModeListPowerModeCheck* power_widgets_power_mode_list_power_mode_check_new (const gchar* icon_name,
                                                                                             const gchar* label);
static PowerWidgetsPowerModeListPowerModeCheck* power_widgets_power_mode_list_power_mode_check_construct (GType object_type,
                                                                                                   const gchar* icon_name,
                                                                                                   const gchar* label);
static const gchar* power_widgets_power_mode_list_power_mode_check_get_icon_name (PowerWidgetsPowerModeListPowerModeCheck* self);
static void power_widgets_power_mode_list_power_mode_check_set_icon_name (PowerWidgetsPowerModeListPowerModeCheck* self,
                                                                   const gchar* value);
static const gchar* power_widgets_power_mode_list_power_mode_check_get_label (PowerWidgetsPowerModeListPowerModeCheck* self);
static void power_widgets_power_mode_list_power_mode_check_set_label (PowerWidgetsPowerModeListPowerModeCheck* self,
                                                               const gchar* value);
static GObject * power_widgets_power_mode_list_power_mode_check_constructor (GType type,
                                                                      guint n_construct_properties,
                                                                      GObjectConstructParam * construct_properties);
static void power_widgets_power_mode_list_power_mode_check_finalize (GObject * obj);
static GType power_widgets_power_mode_list_power_mode_check_get_type_once (void);
static void _vala_power_widgets_power_mode_list_power_mode_check_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec);
static void _vala_power_widgets_power_mode_list_power_mode_check_set_property (GObject * object,
                                                                        guint property_id,
                                                                        const GValue * value,
                                                                        GParamSpec * pspec);
static GObject * power_widgets_power_mode_list_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
VALA_EXTERN GHashTable** power_services_dbus_interfaces_power_profile_get_profiles (PowerServicesDBusInterfacesPowerProfile* self,
                                                                        gint* result_length1);
static void _power_widgets_power_mode_list___lambda9_ (PowerWidgetsPowerModeList* self);
static void __power_widgets_power_mode_list___lambda9__g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self);
static void _power_widgets_power_mode_list___lambda10_ (PowerWidgetsPowerModeList* self);
VALA_EXTERN void power_services_dbus_interfaces_power_profile_set_active_profile (PowerServicesDBusInterfacesPowerProfile* self,
                                                                      const gchar* value);
static void __power_widgets_power_mode_list___lambda10__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                            gpointer self);
static void _power_widgets_power_mode_list___lambda11_ (PowerWidgetsPowerModeList* self);
static void __power_widgets_power_mode_list___lambda11__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                            gpointer self);
static void _power_widgets_power_mode_list___lambda12_ (PowerWidgetsPowerModeList* self);
static void __power_widgets_power_mode_list___lambda12__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                            gpointer self);
static void power_widgets_power_mode_list_finalize (GObject * obj);
static GType power_widgets_power_mode_list_get_type_once (void);
static void _vala_power_widgets_power_mode_list_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_power_widgets_power_mode_list_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
power_widgets_power_mode_list_get_instance_private (PowerWidgetsPowerModeList* self)
{
	return G_STRUCT_MEMBER_P (self, PowerWidgetsPowerModeList_private_offset);
}

static void
power_widgets_power_mode_list_update_on_battery_state (PowerWidgetsPowerModeList* self)
{
	const gchar* _tmp0_ = NULL;
	PowerServicesDeviceManager* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = power_widgets_power_mode_list_device_manager;
	_tmp2_ = power_services_device_manager_get_on_battery (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp0_ = "profile-on-good-battery";
	} else {
		_tmp0_ = "profile-plugged-in";
	}
	_tmp4_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->settings_key);
	self->priv->settings_key = _tmp4_;
	power_widgets_power_mode_list_update_active_profile (self);
}

void
power_widgets_power_mode_list_update_active_profile (PowerWidgetsPowerModeList* self)
{
	GSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = power_widgets_power_mode_list_settings;
	if (_tmp0_ != NULL) {
		GSettings* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GQuark _tmp6_ = 0U;
		static GQuark _tmp5_label0 = 0;
		static GQuark _tmp5_label1 = 0;
		static GQuark _tmp5_label2 = 0;
		_tmp1_ = power_widgets_power_mode_list_settings;
		_tmp2_ = self->priv->settings_key;
		_tmp3_ = g_settings_get_string (_tmp1_, _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp6_ = (NULL == _tmp4_) ? 0 : g_quark_from_string (_tmp4_);
		g_free (_tmp4_);
		if (_tmp6_ == ((0 != _tmp5_label0) ? _tmp5_label0 : (_tmp5_label0 = g_quark_from_static_string ("power-saver")))) {
			switch (0) {
				default:
				{
					GtkRadioButton* _tmp7_;
					_tmp7_ = self->priv->saver_radio;
					gtk_toggle_button_set_active ((GtkToggleButton*) _tmp7_, TRUE);
					break;
				}
			}
		} else if (_tmp6_ == ((0 != _tmp5_label1) ? _tmp5_label1 : (_tmp5_label1 = g_quark_from_static_string ("balanced")))) {
			switch (0) {
				default:
				{
					GtkRadioButton* _tmp8_;
					_tmp8_ = self->priv->balanced_radio;
					gtk_toggle_button_set_active ((GtkToggleButton*) _tmp8_, TRUE);
					break;
				}
			}
		} else if (_tmp6_ == ((0 != _tmp5_label2) ? _tmp5_label2 : (_tmp5_label2 = g_quark_from_static_string ("performance")))) {
			switch (0) {
				default:
				{
					GtkRadioButton* _tmp9_;
					_tmp9_ = self->priv->performance_radio;
					gtk_toggle_button_set_active ((GtkToggleButton*) _tmp9_, TRUE);
					break;
				}
			}
		}
	} else {
		PowerServicesDBusInterfacesPowerProfile* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		GQuark _tmp15_ = 0U;
		static GQuark _tmp14_label0 = 0;
		static GQuark _tmp14_label1 = 0;
		static GQuark _tmp14_label2 = 0;
		_tmp10_ = power_widgets_power_mode_list_pprofile;
		_tmp11_ = power_services_dbus_interfaces_power_profile_get_active_profile (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		_tmp15_ = (NULL == _tmp13_) ? 0 : g_quark_from_string (_tmp13_);
		g_free (_tmp13_);
		if (_tmp15_ == ((0 != _tmp14_label0) ? _tmp14_label0 : (_tmp14_label0 = g_quark_from_static_string ("power-saver")))) {
			switch (0) {
				default:
				{
					GtkRadioButton* _tmp16_;
					_tmp16_ = self->priv->saver_radio;
					gtk_toggle_button_set_active ((GtkToggleButton*) _tmp16_, TRUE);
					break;
				}
			}
		} else if (_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("balanced")))) {
			switch (0) {
				default:
				{
					GtkRadioButton* _tmp17_;
					_tmp17_ = self->priv->balanced_radio;
					gtk_toggle_button_set_active ((GtkToggleButton*) _tmp17_, TRUE);
					break;
				}
			}
		} else if (_tmp15_ == ((0 != _tmp14_label2) ? _tmp14_label2 : (_tmp14_label2 = g_quark_from_static_string ("performance")))) {
			switch (0) {
				default:
				{
					GtkRadioButton* _tmp18_;
					_tmp18_ = self->priv->performance_radio;
					gtk_toggle_button_set_active ((GtkToggleButton*) _tmp18_, TRUE);
					break;
				}
			}
		}
	}
}

PowerWidgetsPowerModeList*
power_widgets_power_mode_list_construct (GType object_type)
{
	PowerWidgetsPowerModeList * self = NULL;
	self = (PowerWidgetsPowerModeList*) g_object_new (object_type, NULL);
	return self;
}

PowerWidgetsPowerModeList*
power_widgets_power_mode_list_new (void)
{
	return power_widgets_power_mode_list_construct (POWER_WIDGETS_TYPE_POWER_MODE_LIST);
}

gboolean
power_widgets_power_mode_list_get_successfully_initialized (void)
{
	gboolean result;
	result = power_widgets_power_mode_list__successfully_initialized;
	return result;
}

static void
power_widgets_power_mode_list_set_successfully_initialized (gboolean value)
{
	power_widgets_power_mode_list__successfully_initialized = value;
}

static inline gpointer
power_widgets_power_mode_list_power_mode_check_get_instance_private (PowerWidgetsPowerModeListPowerModeCheck* self)
{
	return G_STRUCT_MEMBER_P (self, PowerWidgetsPowerModeListPowerModeCheck_private_offset);
}

static PowerWidgetsPowerModeListPowerModeCheck*
power_widgets_power_mode_list_power_mode_check_construct (GType object_type,
                                                          const gchar* icon_name,
                                                          const gchar* label)
{
	PowerWidgetsPowerModeListPowerModeCheck * self = NULL;
	g_return_val_if_fail (icon_name != NULL, NULL);
	g_return_val_if_fail (label != NULL, NULL);
	self = (PowerWidgetsPowerModeListPowerModeCheck*) g_object_new (object_type, "icon-name", icon_name, "label", label, NULL);
	return self;
}

static PowerWidgetsPowerModeListPowerModeCheck*
power_widgets_power_mode_list_power_mode_check_new (const gchar* icon_name,
                                                    const gchar* label)
{
	return power_widgets_power_mode_list_power_mode_check_construct (POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, icon_name, label);
}

static const gchar*
power_widgets_power_mode_list_power_mode_check_get_icon_name (PowerWidgetsPowerModeListPowerModeCheck* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_name;
	result = _tmp0_;
	return result;
}

static void
power_widgets_power_mode_list_power_mode_check_set_icon_name (PowerWidgetsPowerModeListPowerModeCheck* self,
                                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = power_widgets_power_mode_list_power_mode_check_get_icon_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_icon_name);
		self->priv->_icon_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, power_widgets_power_mode_list_power_mode_check_properties[POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_ICON_NAME_PROPERTY]);
	}
}

static const gchar*
power_widgets_power_mode_list_power_mode_check_get_label (PowerWidgetsPowerModeListPowerModeCheck* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}

static void
power_widgets_power_mode_list_power_mode_check_set_label (PowerWidgetsPowerModeListPowerModeCheck* self,
                                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = power_widgets_power_mode_list_power_mode_check_get_label (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_label);
		self->priv->_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, power_widgets_power_mode_list_power_mode_check_properties[POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_LABEL_PROPERTY]);
	}
}

static GObject *
power_widgets_power_mode_list_power_mode_check_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PowerWidgetsPowerModeListPowerModeCheck * self;
	GtkImage* image = NULL;
	const gchar* _tmp0_;
	GtkImage* _tmp1_;
	GtkLabel* label_widget = NULL;
	const gchar* _tmp2_;
	GtkLabel* _tmp3_;
	GtkBox* box = NULL;
	GtkBox* _tmp4_ = NULL;
	GtkBox* _tmp5_;
	GtkImage* _tmp6_;
	GtkBox* _tmp7_;
	GtkLabel* _tmp8_;
	GtkBox* _tmp9_;
	GtkStyleContext* _tmp10_;
	parent_class = G_OBJECT_CLASS (power_widgets_power_mode_list_power_mode_check_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, PowerWidgetsPowerModeListPowerModeCheck);
	_tmp0_ = self->priv->_icon_name;
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp0_, (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp1_);
	image = _tmp1_;
	_tmp2_ = self->priv->_label;
	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	label_widget = _tmp3_;
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
	gtk_widget_set_halign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp4_, 3);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp4_, 2);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 3);
	g_object_ref_sink (_tmp4_);
	box = _tmp4_;
	_tmp5_ = box;
	_tmp6_ = image;
	gtk_container_add ((GtkContainer*) _tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = box;
	_tmp8_ = label_widget;
	gtk_container_add ((GtkContainer*) _tmp7_, (GtkWidget*) _tmp8_);
	_tmp9_ = box;
	g_object_set ((GtkContainer*) self, "child", (GtkWidget*) _tmp9_, NULL);
	_tmp10_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp10_, "image-button");
	_g_object_unref0 (box);
	_g_object_unref0 (label_widget);
	_g_object_unref0 (image);
	return obj;
}

static void
power_widgets_power_mode_list_power_mode_check_class_init (PowerWidgetsPowerModeListPowerModeCheckClass * klass,
                                                           gpointer klass_data)
{
	power_widgets_power_mode_list_power_mode_check_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PowerWidgetsPowerModeListPowerModeCheck_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_power_widgets_power_mode_list_power_mode_check_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_power_widgets_power_mode_list_power_mode_check_set_property;
	G_OBJECT_CLASS (klass)->constructor = power_widgets_power_mode_list_power_mode_check_constructor;
	G_OBJECT_CLASS (klass)->finalize = power_widgets_power_mode_list_power_mode_check_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_ICON_NAME_PROPERTY, power_widgets_power_mode_list_power_mode_check_properties[POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_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_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_LABEL_PROPERTY, power_widgets_power_mode_list_power_mode_check_properties[POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_LABEL_PROPERTY] = g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
power_widgets_power_mode_list_power_mode_check_instance_init (PowerWidgetsPowerModeListPowerModeCheck * self,
                                                              gpointer klass)
{
	self->priv = power_widgets_power_mode_list_power_mode_check_get_instance_private (self);
}

static void
power_widgets_power_mode_list_power_mode_check_finalize (GObject * obj)
{
	PowerWidgetsPowerModeListPowerModeCheck * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, PowerWidgetsPowerModeListPowerModeCheck);
	_g_free0 (self->priv->_icon_name);
	_g_free0 (self->priv->_label);
	G_OBJECT_CLASS (power_widgets_power_mode_list_power_mode_check_parent_class)->finalize (obj);
}

static GType
power_widgets_power_mode_list_power_mode_check_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PowerWidgetsPowerModeListPowerModeCheckClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) power_widgets_power_mode_list_power_mode_check_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PowerWidgetsPowerModeListPowerModeCheck), 0, (GInstanceInitFunc) power_widgets_power_mode_list_power_mode_check_instance_init, NULL };
	GType power_widgets_power_mode_list_power_mode_check_type_id;
	power_widgets_power_mode_list_power_mode_check_type_id = g_type_register_static (gtk_radio_button_get_type (), "PowerWidgetsPowerModeListPowerModeCheck", &g_define_type_info, 0);
	PowerWidgetsPowerModeListPowerModeCheck_private_offset = g_type_add_instance_private (power_widgets_power_mode_list_power_mode_check_type_id, sizeof (PowerWidgetsPowerModeListPowerModeCheckPrivate));
	return power_widgets_power_mode_list_power_mode_check_type_id;
}

static GType
power_widgets_power_mode_list_power_mode_check_get_type (void)
{
	static volatile gsize power_widgets_power_mode_list_power_mode_check_type_id__once = 0;
	if (g_once_init_enter (&power_widgets_power_mode_list_power_mode_check_type_id__once)) {
		GType power_widgets_power_mode_list_power_mode_check_type_id;
		power_widgets_power_mode_list_power_mode_check_type_id = power_widgets_power_mode_list_power_mode_check_get_type_once ();
		g_once_init_leave (&power_widgets_power_mode_list_power_mode_check_type_id__once, power_widgets_power_mode_list_power_mode_check_type_id);
	}
	return power_widgets_power_mode_list_power_mode_check_type_id__once;
}

static void
_vala_power_widgets_power_mode_list_power_mode_check_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec)
{
	PowerWidgetsPowerModeListPowerModeCheck * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, PowerWidgetsPowerModeListPowerModeCheck);
	switch (property_id) {
		case POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_ICON_NAME_PROPERTY:
		g_value_set_string (value, power_widgets_power_mode_list_power_mode_check_get_icon_name (self));
		break;
		case POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_LABEL_PROPERTY:
		g_value_set_string (value, power_widgets_power_mode_list_power_mode_check_get_label (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_power_widgets_power_mode_list_power_mode_check_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec)
{
	PowerWidgetsPowerModeListPowerModeCheck * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, POWER_WIDGETS_POWER_MODE_LIST_TYPE_POWER_MODE_CHECK, PowerWidgetsPowerModeListPowerModeCheck);
	switch (property_id) {
		case POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_ICON_NAME_PROPERTY:
		power_widgets_power_mode_list_power_mode_check_set_icon_name (self, g_value_get_string (value));
		break;
		case POWER_WIDGETS_POWER_MODE_LIST_POWER_MODE_CHECK_LABEL_PROPERTY:
		power_widgets_power_mode_list_power_mode_check_set_label (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

static void
_power_widgets_power_mode_list___lambda9_ (PowerWidgetsPowerModeList* self)
{
	power_widgets_power_mode_list_update_on_battery_state (self);
}

static void
__power_widgets_power_mode_list___lambda9__g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self)
{
	_power_widgets_power_mode_list___lambda9_ ((PowerWidgetsPowerModeList*) self);
}

static void
_power_widgets_power_mode_list___lambda10_ (PowerWidgetsPowerModeList* self)
{
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->saver_radio;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = power_widgets_power_mode_list_settings;
		if (_tmp3_ != NULL) {
			GSettings* _tmp4_;
			const gchar* _tmp5_;
			_tmp4_ = power_widgets_power_mode_list_settings;
			_tmp5_ = self->priv->settings_key;
			g_settings_set_string (_tmp4_, _tmp5_, "power-saver");
		} else {
			PowerServicesDBusInterfacesPowerProfile* _tmp6_;
			_tmp6_ = power_widgets_power_mode_list_pprofile;
			power_services_dbus_interfaces_power_profile_set_active_profile (_tmp6_, "power-saver");
		}
	}
}

static void
__power_widgets_power_mode_list___lambda10__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                       gpointer self)
{
	_power_widgets_power_mode_list___lambda10_ ((PowerWidgetsPowerModeList*) self);
}

static void
_power_widgets_power_mode_list___lambda11_ (PowerWidgetsPowerModeList* self)
{
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->balanced_radio;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = power_widgets_power_mode_list_settings;
		if (_tmp3_ != NULL) {
			GSettings* _tmp4_;
			const gchar* _tmp5_;
			_tmp4_ = power_widgets_power_mode_list_settings;
			_tmp5_ = self->priv->settings_key;
			g_settings_set_string (_tmp4_, _tmp5_, "balanced");
		} else {
			PowerServicesDBusInterfacesPowerProfile* _tmp6_;
			_tmp6_ = power_widgets_power_mode_list_pprofile;
			power_services_dbus_interfaces_power_profile_set_active_profile (_tmp6_, "balanced");
		}
	}
}

static void
__power_widgets_power_mode_list___lambda11__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                       gpointer self)
{
	_power_widgets_power_mode_list___lambda11_ ((PowerWidgetsPowerModeList*) self);
}

static void
_power_widgets_power_mode_list___lambda12_ (PowerWidgetsPowerModeList* self)
{
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->performance_radio;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GSettings* _tmp3_;
		_tmp3_ = power_widgets_power_mode_list_settings;
		if (_tmp3_ != NULL) {
			GSettings* _tmp4_;
			const gchar* _tmp5_;
			_tmp4_ = power_widgets_power_mode_list_settings;
			_tmp5_ = self->priv->settings_key;
			g_settings_set_string (_tmp4_, _tmp5_, "performance");
		} else {
			PowerServicesDBusInterfacesPowerProfile* _tmp6_;
			_tmp6_ = power_widgets_power_mode_list_pprofile;
			power_services_dbus_interfaces_power_profile_set_active_profile (_tmp6_, "performance");
		}
	}
}

static void
__power_widgets_power_mode_list___lambda12__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                       gpointer self)
{
	_power_widgets_power_mode_list___lambda12_ ((PowerWidgetsPowerModeList*) self);
}

static GObject *
power_widgets_power_mode_list_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PowerWidgetsPowerModeList * self;
	PowerServicesDBusInterfacesPowerProfile* _tmp0_;
	PowerWidgetsPowerModeListPowerModeCheck* _tmp1_;
	GtkRadioButton* _tmp2_;
	GtkRadioButton* _tmp3_;
	PowerWidgetsPowerModeListPowerModeCheck* _tmp4_ = NULL;
	GtkRadioButton* _tmp5_;
	GtkRadioButton* _tmp6_;
	PowerWidgetsPowerModeListPowerModeCheck* _tmp7_ = NULL;
	PowerServicesDBusInterfacesPowerProfile* _tmp8_;
	GHashTable** _tmp9_;
	gint _tmp9__length1;
	gint _tmp10_ = 0;
	GHashTable** _tmp11_;
	gint _tmp11__length1;
	PowerServicesDeviceManager* _tmp21_;
	GtkRadioButton* _tmp22_;
	GtkRadioButton* _tmp23_;
	GtkRadioButton* _tmp24_;
	parent_class = G_OBJECT_CLASS (power_widgets_power_mode_list_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, POWER_WIDGETS_TYPE_POWER_MODE_LIST, PowerWidgetsPowerModeList);
	_tmp0_ = power_widgets_power_mode_list_pprofile;
	if (_tmp0_ == NULL) {
		return obj;
	}
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	gtk_widget_set_margin_start ((GtkWidget*) self, 6);
	gtk_widget_set_margin_top ((GtkWidget*) self, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) self, 6);
	gtk_widget_set_margin_end ((GtkWidget*) self, 6);
	_tmp1_ = power_widgets_power_mode_list_power_mode_check_new ("power-mode-powersaver-symbolic", _ ("Power Saver"));
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->saver_radio);
	self->priv->saver_radio = (GtkRadioButton*) _tmp1_;
	_tmp2_ = self->priv->saver_radio;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = power_widgets_power_mode_list_power_mode_check_new ("power-mode-balanced-symbolic", _ ("Balanced"));
	g_object_set ((GtkRadioButton*) _tmp4_, "group", _tmp3_, NULL);
	_g_object_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->balanced_radio);
	self->priv->balanced_radio = (GtkRadioButton*) _tmp4_;
	_tmp5_ = self->priv->saver_radio;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_tmp7_ = power_widgets_power_mode_list_power_mode_check_new ("power-mode-performance-symbolic", _ ("Performance"));
	g_object_set ((GtkRadioButton*) _tmp7_, "group", _tmp6_, NULL);
	_g_object_unref0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->performance_radio);
	self->priv->performance_radio = (GtkRadioButton*) _tmp7_;
	_tmp8_ = power_widgets_power_mode_list_pprofile;
	_tmp9_ = power_services_dbus_interfaces_power_profile_get_profiles (_tmp8_, &_tmp10_);
	_tmp9__length1 = _tmp10_;
	_tmp11_ = _tmp9_;
	_tmp11__length1 = _tmp9__length1;
	{
		GHashTable** profile_collection = NULL;
		gint profile_collection_length1 = 0;
		gint _profile_collection_size_ = 0;
		gint profile_it = 0;
		profile_collection = _tmp11_;
		profile_collection_length1 = _tmp11__length1;
		for (profile_it = 0; profile_it < profile_collection_length1; profile_it = profile_it + 1) {
			GHashTable* profile = NULL;
			profile = profile_collection[profile_it];
			{
				GHashTable* _tmp12_;
				gconstpointer _tmp13_;
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				GQuark _tmp17_ = 0U;
				static GQuark _tmp16_label0 = 0;
				static GQuark _tmp16_label1 = 0;
				static GQuark _tmp16_label2 = 0;
				_tmp12_ = profile;
				_tmp13_ = g_hash_table_lookup (_tmp12_, "Profile");
				_tmp14_ = g_variant_get_string ((GVariant*) _tmp13_, NULL);
				_tmp15_ = _tmp14_;
				_tmp17_ = (NULL == _tmp15_) ? 0 : g_quark_from_string (_tmp15_);
				if (_tmp17_ == ((0 != _tmp16_label0) ? _tmp16_label0 : (_tmp16_label0 = g_quark_from_static_string ("power-saver")))) {
					switch (0) {
						default:
						{
							GtkRadioButton* _tmp18_;
							_tmp18_ = self->priv->saver_radio;
							gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp18_);
							break;
						}
					}
				} else if (_tmp17_ == ((0 != _tmp16_label1) ? _tmp16_label1 : (_tmp16_label1 = g_quark_from_static_string ("balanced")))) {
					switch (0) {
						default:
						{
							GtkRadioButton* _tmp19_;
							_tmp19_ = self->priv->balanced_radio;
							gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp19_);
							break;
						}
					}
				} else if (_tmp17_ == ((0 != _tmp16_label2) ? _tmp16_label2 : (_tmp16_label2 = g_quark_from_static_string ("performance")))) {
					switch (0) {
						default:
						{
							GtkRadioButton* _tmp20_;
							_tmp20_ = self->priv->performance_radio;
							gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp20_);
							break;
						}
					}
				}
			}
		}
		profile_collection = (_vala_array_free (profile_collection, profile_collection_length1, (GDestroyNotify) g_hash_table_unref), NULL);
	}
	power_widgets_power_mode_list_update_on_battery_state (self);
	_tmp21_ = power_widgets_power_mode_list_device_manager;
	g_signal_connect_object ((GObject*) _tmp21_, "notify::on-battery", (GCallback) __power_widgets_power_mode_list___lambda9__g_object_notify, self, 0);
	_tmp22_ = self->priv->saver_radio;
	g_signal_connect_object ((GtkToggleButton*) _tmp22_, "toggled", (GCallback) __power_widgets_power_mode_list___lambda10__gtk_toggle_button_toggled, self, 0);
	_tmp23_ = self->priv->balanced_radio;
	g_signal_connect_object ((GtkToggleButton*) _tmp23_, "toggled", (GCallback) __power_widgets_power_mode_list___lambda11__gtk_toggle_button_toggled, self, 0);
	_tmp24_ = self->priv->performance_radio;
	g_signal_connect_object ((GtkToggleButton*) _tmp24_, "toggled", (GCallback) __power_widgets_power_mode_list___lambda12__gtk_toggle_button_toggled, self, 0);
	return obj;
}

static void
power_widgets_power_mode_list_base_init (PowerWidgetsPowerModeListClass * klass)
{
	PowerServicesDeviceManager* _tmp0_;
	PowerServicesDeviceManager* _tmp1_;
	GSettingsSchema* schema = NULL;
	GSettingsSchemaSource* _tmp2_;
	GSettingsSchema* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GSettingsSchema* _tmp6_;
	GError* _inner_error0_ = NULL;
	_tmp0_ = power_services_device_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (power_widgets_power_mode_list_device_manager);
	power_widgets_power_mode_list_device_manager = _tmp1_;
	_tmp2_ = g_settings_schema_source_get_default ();
	_tmp3_ = g_settings_schema_source_lookup (_tmp2_, "io.elementary.settings-daemon.power", TRUE);
	schema = _tmp3_;
	_tmp6_ = schema;
	if (_tmp6_ != NULL) {
		GSettingsSchema* _tmp7_;
		_tmp7_ = schema;
		_tmp5_ = g_settings_schema_has_key (_tmp7_, "profile-plugged-in");
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GSettingsSchema* _tmp8_;
		_tmp8_ = schema;
		_tmp4_ = g_settings_schema_has_key (_tmp8_, "profile-on-good-battery");
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GSettings* _tmp9_;
		_tmp9_ = g_settings_new ("io.elementary.settings-daemon.power");
		_g_object_unref0 (power_widgets_power_mode_list_settings);
		power_widgets_power_mode_list_settings = _tmp9_;
	} else {
		g_warning ("PowerModeList.vala:25: settings-daemon schema not found, will connect " \
"to power-profiles-daemon directly");
	}
	{
		PowerServicesDBusInterfacesPowerProfile* _tmp10_ = NULL;
		PowerServicesDBusInterfacesPowerProfile* _tmp11_;
		PowerServicesDBusInterfacesPowerProfile* _tmp12_;
		_tmp11_ = (PowerServicesDBusInterfacesPowerProfile*) g_initable_new (POWER_SERVICES_DBUS_INTERFACES_TYPE_POWER_PROFILE_PROXY, NULL, &_inner_error0_, "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", POWER_SERVICES_DBUS_INTERFACES_POWER_PROFILES_DAEMON_NAME, "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", POWER_SERVICES_DBUS_INTERFACES_POWER_PROFILES_DAEMON_PATH, "g-interface-name", "net.hadess.PowerProfiles", NULL);
		_tmp10_ = (PowerServicesDBusInterfacesPowerProfile*) _tmp11_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp12_ = _tmp10_;
		_tmp10_ = NULL;
		_g_object_unref0 (power_widgets_power_mode_list_pprofile);
		power_widgets_power_mode_list_pprofile = _tmp12_;
		_g_object_unref0 (_tmp10_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		g_critical ("PowerModeList.vala:37: %s", _tmp14_);
		power_widgets_power_mode_list_set_successfully_initialized (FALSE);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_settings_schema_unref0 (schema);
		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_);
	}
	_g_settings_schema_unref0 (schema);
}

static void
power_widgets_power_mode_list_class_init (PowerWidgetsPowerModeListClass * klass,
                                          gpointer klass_data)
{
	power_widgets_power_mode_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PowerWidgetsPowerModeList_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_power_widgets_power_mode_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_power_widgets_power_mode_list_set_property;
	G_OBJECT_CLASS (klass)->constructor = power_widgets_power_mode_list_constructor;
	G_OBJECT_CLASS (klass)->finalize = power_widgets_power_mode_list_finalize;
}

static void
power_widgets_power_mode_list_instance_init (PowerWidgetsPowerModeList * self,
                                             gpointer klass)
{
	self->priv = power_widgets_power_mode_list_get_instance_private (self);
}

static void
power_widgets_power_mode_list_finalize (GObject * obj)
{
	PowerWidgetsPowerModeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, POWER_WIDGETS_TYPE_POWER_MODE_LIST, PowerWidgetsPowerModeList);
	_g_free0 (self->priv->settings_key);
	_g_object_unref0 (self->priv->saver_radio);
	_g_object_unref0 (self->priv->balanced_radio);
	_g_object_unref0 (self->priv->performance_radio);
	G_OBJECT_CLASS (power_widgets_power_mode_list_parent_class)->finalize (obj);
}

static GType
power_widgets_power_mode_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PowerWidgetsPowerModeListClass), (GBaseInitFunc) power_widgets_power_mode_list_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) power_widgets_power_mode_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PowerWidgetsPowerModeList), 0, (GInstanceInitFunc) power_widgets_power_mode_list_instance_init, NULL };
	GType power_widgets_power_mode_list_type_id;
	power_widgets_power_mode_list_type_id = g_type_register_static (gtk_box_get_type (), "PowerWidgetsPowerModeList", &g_define_type_info, 0);
	PowerWidgetsPowerModeList_private_offset = g_type_add_instance_private (power_widgets_power_mode_list_type_id, sizeof (PowerWidgetsPowerModeListPrivate));
	return power_widgets_power_mode_list_type_id;
}

GType
power_widgets_power_mode_list_get_type (void)
{
	static volatile gsize power_widgets_power_mode_list_type_id__once = 0;
	if (g_once_init_enter (&power_widgets_power_mode_list_type_id__once)) {
		GType power_widgets_power_mode_list_type_id;
		power_widgets_power_mode_list_type_id = power_widgets_power_mode_list_get_type_once ();
		g_once_init_leave (&power_widgets_power_mode_list_type_id__once, power_widgets_power_mode_list_type_id);
	}
	return power_widgets_power_mode_list_type_id__once;
}

static void
_vala_power_widgets_power_mode_list_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	PowerWidgetsPowerModeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, POWER_WIDGETS_TYPE_POWER_MODE_LIST, PowerWidgetsPowerModeList);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_power_widgets_power_mode_list_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	PowerWidgetsPowerModeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, POWER_WIDGETS_TYPE_POWER_MODE_LIST, PowerWidgetsPowerModeList);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

