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

/*
 * Copyright 2011-2018 elementary, Inc. (https://elementary.io)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#include "power.h"
#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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_DEVICE_ROW_0_PROPERTY,
	POWER_WIDGETS_DEVICE_ROW_BATTERY_PROPERTY,
	POWER_WIDGETS_DEVICE_ROW_NUM_PROPERTIES
};
static GParamSpec* power_widgets_device_row_properties[POWER_WIDGETS_DEVICE_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))
typedef struct _Block1Data Block1Data;

struct _PowerWidgetsDeviceRowPrivate {
	PowerServicesDevice* _battery;
	GtkImage* battery_image;
	GtkImage* device_image;
};

struct _Block1Data {
	int _ref_count_;
	PowerWidgetsDeviceRow* self;
	GtkLabel* title_label;
};

static gint PowerWidgetsDeviceRow_private_offset;
static gpointer power_widgets_device_row_parent_class = NULL;

static void power_widgets_device_row_update_icons (PowerWidgetsDeviceRow* self);
static gchar* power_widgets_device_row_get_title (PowerWidgetsDeviceRow* self);
static GObject * power_widgets_device_row_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void _power_widgets_device_row___lambda13_ (Block1Data* _data1_);
static void __power_widgets_device_row___lambda13__power_services_device_properties_updated (PowerServicesDevice* _sender,
                                                                                      gpointer self);
static void power_widgets_device_row_finalize (GObject * obj);
static GType power_widgets_device_row_get_type_once (void);
static void _vala_power_widgets_device_row_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_power_widgets_device_row_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);

static inline gpointer
power_widgets_device_row_get_instance_private (PowerWidgetsDeviceRow* self)
{
	return G_STRUCT_MEMBER_P (self, PowerWidgetsDeviceRow_private_offset);
}

PowerWidgetsDeviceRow*
power_widgets_device_row_construct (GType object_type,
                                    PowerServicesDevice* battery)
{
	PowerWidgetsDeviceRow * self = NULL;
	g_return_val_if_fail (battery != NULL, NULL);
	self = (PowerWidgetsDeviceRow*) g_object_new (object_type, "battery", battery, NULL);
	return self;
}

PowerWidgetsDeviceRow*
power_widgets_device_row_new (PowerServicesDevice* battery)
{
	return power_widgets_device_row_construct (POWER_WIDGETS_TYPE_DEVICE_ROW, battery);
}

static void
power_widgets_device_row_update_icons (PowerWidgetsDeviceRow* self)
{
	const gchar* icon_name = NULL;
	PowerServicesDevice* _tmp0_;
	PowerServicesDeviceType _tmp1_;
	PowerServicesDeviceType _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_battery;
	_tmp1_ = power_services_device_get_device_type (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = power_services_device_type_get_icon_name (_tmp2_);
	icon_name = _tmp3_;
	_tmp4_ = icon_name;
	if (_tmp4_ != NULL) {
		GtkImage* _tmp5_;
		const gchar* _tmp6_;
		GtkImage* _tmp7_;
		PowerServicesDevice* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp5_ = self->priv->device_image;
		_tmp6_ = icon_name;
		g_object_set (_tmp5_, "icon-name", _tmp6_, NULL);
		_tmp7_ = self->priv->battery_image;
		_tmp8_ = self->priv->_battery;
		_tmp9_ = power_services_device_get_icon_name_for_battery (_tmp8_);
		_tmp10_ = _tmp9_;
		g_object_set (_tmp7_, "icon-name", _tmp10_, NULL);
		_g_free0 (_tmp10_);
	} else {
		GtkImage* _tmp11_;
		GtkImage* _tmp12_;
		PowerServicesDevice* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp11_ = self->priv->battery_image;
		gtk_image_clear (_tmp11_);
		_tmp12_ = self->priv->device_image;
		_tmp13_ = self->priv->_battery;
		_tmp14_ = power_services_device_get_icon_name_for_battery (_tmp13_);
		_tmp15_ = _tmp14_;
		g_object_set (_tmp12_, "icon-name", _tmp15_, NULL);
		_g_free0 (_tmp15_);
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gchar*
power_widgets_device_row_get_title (PowerWidgetsDeviceRow* self)
{
	gchar* type_string = NULL;
	PowerServicesDevice* _tmp0_;
	PowerServicesDeviceType _tmp1_;
	PowerServicesDeviceType _tmp2_;
	const gchar* _tmp15_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	type_string = NULL;
	_tmp0_ = self->priv->_battery;
	_tmp1_ = power_services_device_get_device_type (_tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case POWER_SERVICES_DEVICE_TYPE_COMPUTER:
		case POWER_SERVICES_DEVICE_TYPE_PHONE:
		case POWER_SERVICES_DEVICE_TYPE_TABLET:
		{
			PowerServicesDevice* _tmp3_;
			const gchar* _tmp4_;
			const gchar* _tmp5_;
			_tmp3_ = self->priv->_battery;
			_tmp4_ = power_services_device_get_model (_tmp3_);
			_tmp5_ = _tmp4_;
			if (g_strcmp0 (_tmp5_, "") != 0) {
				PowerServicesDevice* _tmp6_;
				const gchar* _tmp7_;
				const gchar* _tmp8_;
				gchar* _tmp9_;
				_tmp6_ = self->priv->_battery;
				_tmp7_ = power_services_device_get_model (_tmp6_);
				_tmp8_ = _tmp7_;
				_tmp9_ = g_strdup (_tmp8_);
				_g_free0 (type_string);
				type_string = _tmp9_;
			}
			break;
		}
		default:
		{
			PowerServicesDevice* _tmp10_;
			PowerServicesDeviceType _tmp11_;
			PowerServicesDeviceType _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp10_ = self->priv->_battery;
			_tmp11_ = power_services_device_get_device_type (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = power_services_device_type_get_name (_tmp12_);
			_tmp14_ = g_strdup (_tmp13_);
			_g_free0 (type_string);
			type_string = _tmp14_;
			break;
		}
	}
	_tmp15_ = type_string;
	if (_tmp15_ == NULL) {
		gboolean _tmp16_ = FALSE;
		PowerServicesDevice* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp17_ = self->priv->_battery;
		_tmp18_ = power_services_device_get_vendor (_tmp17_);
		_tmp19_ = _tmp18_;
		if (_tmp19_ != NULL) {
			PowerServicesDevice* _tmp20_;
			const gchar* _tmp21_;
			const gchar* _tmp22_;
			gchar* _tmp23_;
			gchar* _tmp24_;
			_tmp20_ = self->priv->_battery;
			_tmp21_ = power_services_device_get_vendor (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = string_strip (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp16_ = g_strcmp0 (_tmp24_, "") != 0;
			_g_free0 (_tmp24_);
		} else {
			_tmp16_ = FALSE;
		}
		if (_tmp16_) {
			PowerServicesDevice* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			gchar* _tmp28_;
			_tmp25_ = self->priv->_battery;
			_tmp26_ = power_services_device_get_vendor (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = g_strdup_printf ("%s %s", _tmp27_, _ ("Device"));
			_g_free0 (type_string);
			type_string = _tmp28_;
		} else {
			gboolean _tmp29_ = FALSE;
			PowerServicesDevice* _tmp30_;
			const gchar* _tmp31_;
			const gchar* _tmp32_;
			_tmp30_ = self->priv->_battery;
			_tmp31_ = power_services_device_get_model (_tmp30_);
			_tmp32_ = _tmp31_;
			if (_tmp32_ != NULL) {
				PowerServicesDevice* _tmp33_;
				const gchar* _tmp34_;
				const gchar* _tmp35_;
				gchar* _tmp36_;
				gchar* _tmp37_;
				_tmp33_ = self->priv->_battery;
				_tmp34_ = power_services_device_get_model (_tmp33_);
				_tmp35_ = _tmp34_;
				_tmp36_ = string_strip (_tmp35_);
				_tmp37_ = _tmp36_;
				_tmp29_ = g_strcmp0 (_tmp37_, "") != 0;
				_g_free0 (_tmp37_);
			} else {
				_tmp29_ = FALSE;
			}
			if (_tmp29_) {
				PowerServicesDevice* _tmp38_;
				const gchar* _tmp39_;
				const gchar* _tmp40_;
				gchar* _tmp41_;
				_tmp38_ = self->priv->_battery;
				_tmp39_ = power_services_device_get_model (_tmp38_);
				_tmp40_ = _tmp39_;
				_tmp41_ = g_strdup (_tmp40_);
				_g_free0 (type_string);
				type_string = _tmp41_;
			} else {
				gchar* _tmp42_;
				_tmp42_ = g_strdup (_ ("Device"));
				_g_free0 (type_string);
				type_string = _tmp42_;
			}
		}
	}
	_tmp43_ = type_string;
	_tmp44_ = g_strdup_printf ("<b>%s</b>", _tmp43_);
	result = _tmp44_;
	_g_free0 (type_string);
	return result;
}

PowerServicesDevice*
power_widgets_device_row_get_battery (PowerWidgetsDeviceRow* self)
{
	PowerServicesDevice* result;
	PowerServicesDevice* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_battery;
	result = _tmp0_;
	return result;
}

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

static void
power_widgets_device_row_set_battery (PowerWidgetsDeviceRow* self,
                                      PowerServicesDevice* value)
{
	PowerServicesDevice* old_value;
	g_return_if_fail (self != NULL);
	old_value = power_widgets_device_row_get_battery (self);
	if (old_value != value) {
		PowerServicesDevice* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_battery);
		self->priv->_battery = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, power_widgets_device_row_properties[POWER_WIDGETS_DEVICE_ROW_BATTERY_PROPERTY]);
	}
}

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

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

static void
_power_widgets_device_row___lambda13_ (Block1Data* _data1_)
{
	PowerWidgetsDeviceRow* self;
	GtkLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = _data1_->self;
	power_widgets_device_row_update_icons (self);
	_tmp0_ = _data1_->title_label;
	_tmp1_ = power_widgets_device_row_get_title (self);
	_tmp2_ = _tmp1_;
	gtk_label_set_markup (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
}

static void
__power_widgets_device_row___lambda13__power_services_device_properties_updated (PowerServicesDevice* _sender,
                                                                                 gpointer self)
{
	_power_widgets_device_row___lambda13_ (self);
}

static GObject *
power_widgets_device_row_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PowerWidgetsDeviceRow * self;
	Block1Data* _data1_;
	GtkImage* _tmp0_ = NULL;
	GtkImage* _tmp1_ = NULL;
	GtkOverlay* overlay = NULL;
	GtkOverlay* _tmp2_;
	GtkOverlay* _tmp3_;
	GtkImage* _tmp4_;
	GtkOverlay* _tmp5_;
	GtkImage* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GtkLabel* _tmp9_ = NULL;
	GtkLabel* _tmp10_;
	GtkLabel* info_label = NULL;
	GtkLabel* _tmp11_ = NULL;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp12_ = NULL;
	GtkGrid* _tmp13_;
	GtkOverlay* _tmp14_;
	GtkGrid* _tmp15_;
	GtkLabel* _tmp16_;
	GtkGrid* _tmp17_;
	GtkLabel* _tmp18_;
	GtkGrid* _tmp19_;
	PowerServicesDevice* _tmp20_;
	PowerServicesDevice* _tmp21_;
	GtkLabel* _tmp22_;
	parent_class = G_OBJECT_CLASS (power_widgets_device_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, POWER_WIDGETS_TYPE_DEVICE_ROW, PowerWidgetsDeviceRow);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = (GtkImage*) gtk_image_new_from_icon_name ("battery", (GtkIconSize) GTK_ICON_SIZE_DIALOG);
	gtk_image_set_pixel_size (_tmp0_, 48);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 3);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->device_image);
	self->priv->device_image = _tmp0_;
	_tmp1_ = (GtkImage*) gtk_image_new ();
	gtk_image_set_pixel_size (_tmp1_, 32);
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->battery_image);
	self->priv->battery_image = _tmp1_;
	_tmp2_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp2_);
	overlay = _tmp2_;
	_tmp3_ = overlay;
	_tmp4_ = self->priv->device_image;
	gtk_container_add ((GtkContainer*) _tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = overlay;
	_tmp6_ = self->priv->battery_image;
	gtk_overlay_add_overlay (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = power_widgets_device_row_get_title (self);
	_tmp8_ = _tmp7_;
	_tmp9_ = (GtkLabel*) gtk_label_new (_tmp8_);
	gtk_label_set_use_markup (_tmp9_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp9_, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) _tmp9_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	_data1_->title_label = _tmp10_;
	_tmp11_ = (GtkLabel*) gtk_label_new ("");
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp11_);
	info_label = _tmp11_;
	_tmp12_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp12_, 3);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp12_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp12_, 3);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp12_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp12_, 12);
	g_object_ref_sink (_tmp12_);
	grid = _tmp12_;
	_tmp13_ = grid;
	_tmp14_ = overlay;
	gtk_grid_attach (_tmp13_, (GtkWidget*) _tmp14_, 0, 0, 1, 2);
	_tmp15_ = grid;
	_tmp16_ = _data1_->title_label;
	gtk_grid_attach (_tmp15_, (GtkWidget*) _tmp16_, 1, 0, 1, 1);
	_tmp17_ = grid;
	_tmp18_ = info_label;
	gtk_grid_attach (_tmp17_, (GtkWidget*) _tmp18_, 1, 1, 1, 1);
	_tmp19_ = grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp19_);
	power_widgets_device_row_update_icons (self);
	_tmp20_ = self->priv->_battery;
	g_signal_connect_data (_tmp20_, "properties-updated", (GCallback) __power_widgets_device_row___lambda13__power_services_device_properties_updated, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp21_ = self->priv->_battery;
	_tmp22_ = info_label;
	g_object_bind_property_with_closures ((GObject*) _tmp21_, "description", (GObject*) _tmp22_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_g_object_unref0 (grid);
	_g_object_unref0 (info_label);
	_g_object_unref0 (overlay);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return obj;
}

static void
power_widgets_device_row_class_init (PowerWidgetsDeviceRowClass * klass,
                                     gpointer klass_data)
{
	power_widgets_device_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PowerWidgetsDeviceRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_power_widgets_device_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_power_widgets_device_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = power_widgets_device_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = power_widgets_device_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), POWER_WIDGETS_DEVICE_ROW_BATTERY_PROPERTY, power_widgets_device_row_properties[POWER_WIDGETS_DEVICE_ROW_BATTERY_PROPERTY] = g_param_spec_object ("battery", "battery", "battery", POWER_SERVICES_TYPE_DEVICE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
power_widgets_device_row_instance_init (PowerWidgetsDeviceRow * self,
                                        gpointer klass)
{
	self->priv = power_widgets_device_row_get_instance_private (self);
}

static void
power_widgets_device_row_finalize (GObject * obj)
{
	PowerWidgetsDeviceRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, POWER_WIDGETS_TYPE_DEVICE_ROW, PowerWidgetsDeviceRow);
	_g_object_unref0 (self->priv->_battery);
	_g_object_unref0 (self->priv->battery_image);
	_g_object_unref0 (self->priv->device_image);
	G_OBJECT_CLASS (power_widgets_device_row_parent_class)->finalize (obj);
}

static GType
power_widgets_device_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PowerWidgetsDeviceRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) power_widgets_device_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PowerWidgetsDeviceRow), 0, (GInstanceInitFunc) power_widgets_device_row_instance_init, NULL };
	GType power_widgets_device_row_type_id;
	power_widgets_device_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "PowerWidgetsDeviceRow", &g_define_type_info, 0);
	PowerWidgetsDeviceRow_private_offset = g_type_add_instance_private (power_widgets_device_row_type_id, sizeof (PowerWidgetsDeviceRowPrivate));
	return power_widgets_device_row_type_id;
}

GType
power_widgets_device_row_get_type (void)
{
	static volatile gsize power_widgets_device_row_type_id__once = 0;
	if (g_once_init_enter (&power_widgets_device_row_type_id__once)) {
		GType power_widgets_device_row_type_id;
		power_widgets_device_row_type_id = power_widgets_device_row_get_type_once ();
		g_once_init_leave (&power_widgets_device_row_type_id__once, power_widgets_device_row_type_id);
	}
	return power_widgets_device_row_type_id__once;
}

static void
_vala_power_widgets_device_row_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	PowerWidgetsDeviceRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, POWER_WIDGETS_TYPE_DEVICE_ROW, PowerWidgetsDeviceRow);
	switch (property_id) {
		case POWER_WIDGETS_DEVICE_ROW_BATTERY_PROPERTY:
		g_value_set_object (value, power_widgets_device_row_get_battery (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_power_widgets_device_row_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	PowerWidgetsDeviceRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, POWER_WIDGETS_TYPE_DEVICE_ROW, PowerWidgetsDeviceRow);
	switch (property_id) {
		case POWER_WIDGETS_DEVICE_ROW_BATTERY_PROPERTY:
		power_widgets_device_row_set_battery (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

