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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * 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 3 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
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <pango/pango.h>
#include <float.h>
#include <math.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_0_PROPERTY,
	WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_SECTION_PROPERTY,
	WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_NUM_PROPERTIES
};
static GParamSpec* widgets_section_picker_section_picker_row_properties[WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block43Data Block43Data;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_UPDATE_SECTION_SIGNAL,
	WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_NUM_SIGNALS
};
static guint widgets_section_picker_section_picker_row_signals[WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_NUM_SIGNALS] = {0};

struct _WidgetsSectionPickerSectionPickerRowPrivate {
	ObjectsSection* _section;
	GtkLabel* name_label;
};

struct _Block43Data {
	int _ref_count_;
	WidgetsSectionPickerSectionPickerRow* self;
	GtkRevealer* selected_revealer;
};

static gint WidgetsSectionPickerSectionPickerRow_private_offset;
static gpointer widgets_section_picker_section_picker_row_parent_class = NULL;

static GObject * widgets_section_picker_section_picker_row_constructor (GType type,
                                                                 guint n_construct_properties,
                                                                 GObjectConstructParam * construct_properties);
static Block43Data* block43_data_ref (Block43Data* _data43_);
static void block43_data_unref (void * _userdata_);
static void _widgets_section_picker_section_picker_row___lambda121_ (WidgetsSectionPickerSectionPickerRow* self);
static void __widgets_section_picker_section_picker_row___lambda121__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                         gint n_press,
                                                                                         gdouble x,
                                                                                         gdouble y,
                                                                                         gpointer self);
static void _widgets_section_picker_section_picker_row___lambda122_ (Block43Data* _data43_,
                                                              ServicesEventBus* type,
                                                              const gchar* id);
static void __widgets_section_picker_section_picker_row___lambda122__services_event_bus_section_picker_changed (ServicesEventBus* _sender,
                                                                                                         const gchar* id,
                                                                                                         gpointer self);
static void widgets_section_picker_section_picker_row_finalize (GObject * obj);
static GType widgets_section_picker_section_picker_row_get_type_once (void);
static void _vala_widgets_section_picker_section_picker_row_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static void _vala_widgets_section_picker_section_picker_row_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 _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
widgets_section_picker_section_picker_row_get_instance_private (WidgetsSectionPickerSectionPickerRow* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsSectionPickerSectionPickerRow_private_offset);
}

WidgetsSectionPickerSectionPickerRow*
widgets_section_picker_section_picker_row_construct (GType object_type,
                                                     ObjectsSection* section)
{
	WidgetsSectionPickerSectionPickerRow * self = NULL;
	g_return_val_if_fail (section != NULL, NULL);
	self = (WidgetsSectionPickerSectionPickerRow*) g_object_new (object_type, "section", section, NULL);
	return self;
}

WidgetsSectionPickerSectionPickerRow*
widgets_section_picker_section_picker_row_new (ObjectsSection* section)
{
	return widgets_section_picker_section_picker_row_construct (WIDGETS_SECTION_PICKER_TYPE_SECTION_PICKER_ROW, section);
}

WidgetsSectionPickerSectionPickerRow*
widgets_section_picker_section_picker_row_construct_for_no_section (GType object_type)
{
	WidgetsSectionPickerSectionPickerRow * self = NULL;
	ObjectsSection* no_section = NULL;
	ObjectsSection* _tmp0_;
	_tmp0_ = objects_section_new ();
	no_section = _tmp0_;
	objects_base_object_set_id ((ObjectsBaseObject*) no_section, "");
	objects_base_object_set_name ((ObjectsBaseObject*) no_section, _ ("No Section"));
	self = (WidgetsSectionPickerSectionPickerRow*) g_object_new (object_type, "section", no_section, NULL);
	_g_object_unref0 (no_section);
	return self;
}

WidgetsSectionPickerSectionPickerRow*
widgets_section_picker_section_picker_row_new_for_no_section (void)
{
	return widgets_section_picker_section_picker_row_construct_for_no_section (WIDGETS_SECTION_PICKER_TYPE_SECTION_PICKER_ROW);
}

ObjectsSection*
widgets_section_picker_section_picker_row_get_section (WidgetsSectionPickerSectionPickerRow* self)
{
	ObjectsSection* result;
	ObjectsSection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_section;
	result = _tmp0_;
	return result;
}

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

static void
widgets_section_picker_section_picker_row_set_section (WidgetsSectionPickerSectionPickerRow* self,
                                                       ObjectsSection* value)
{
	ObjectsSection* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_section_picker_section_picker_row_get_section (self);
	if (old_value != value) {
		ObjectsSection* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_section);
		self->priv->_section = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_section_picker_section_picker_row_properties[WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_SECTION_PROPERTY]);
	}
}

static Block43Data*
block43_data_ref (Block43Data* _data43_)
{
	g_atomic_int_inc (&_data43_->_ref_count_);
	return _data43_;
}

static void
block43_data_unref (void * _userdata_)
{
	Block43Data* _data43_;
	_data43_ = (Block43Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data43_->_ref_count_)) {
		WidgetsSectionPickerSectionPickerRow* self;
		self = _data43_->self;
		_g_object_unref0 (_data43_->selected_revealer);
		_g_object_unref0 (self);
		g_slice_free (Block43Data, _data43_);
	}
}

static void
_widgets_section_picker_section_picker_row___lambda121_ (WidgetsSectionPickerSectionPickerRow* self)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	ObjectsSection* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_section;
	_tmp3_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_emit_by_name (_tmp1_, "section-picker-changed", _tmp4_);
	_g_object_unref0 (_tmp1_);
}

static void
__widgets_section_picker_section_picker_row___lambda121__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                    gint n_press,
                                                                                    gdouble x,
                                                                                    gdouble y,
                                                                                    gpointer self)
{
	_widgets_section_picker_section_picker_row___lambda121_ ((WidgetsSectionPickerSectionPickerRow*) self);
}

static void
_widgets_section_picker_section_picker_row___lambda122_ (Block43Data* _data43_,
                                                         ServicesEventBus* type,
                                                         const gchar* id)
{
	WidgetsSectionPickerSectionPickerRow* self;
	GtkRevealer* _tmp0_;
	ObjectsSection* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	self = _data43_->self;
	g_return_if_fail (type != NULL);
	g_return_if_fail (id != NULL);
	_tmp0_ = _data43_->selected_revealer;
	_tmp1_ = self->priv->_section;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, g_strcmp0 (_tmp3_, id) == 0);
}

static void
__widgets_section_picker_section_picker_row___lambda122__services_event_bus_section_picker_changed (ServicesEventBus* _sender,
                                                                                                    const gchar* id,
                                                                                                    gpointer self)
{
	_widgets_section_picker_section_picker_row___lambda122_ (self, _sender, id);
}

static GObject *
widgets_section_picker_section_picker_row_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsSectionPickerSectionPickerRow * self;
	Block43Data* _data43_;
	GtkGrid* color_grid = NULL;
	gchar* _tmp0_;
	gchar** _tmp1_;
	GtkGrid* _tmp2_ = NULL;
	Util* _tmp3_;
	Util* _tmp4_;
	Util* _tmp5_;
	Util* _tmp6_;
	ObjectsSection* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GtkGrid* _tmp12_;
	ObjectsSection* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	GtkLabel* _tmp16_;
	GtkLabel* _tmp17_;
	GtkLabel* _tmp18_;
	GtkImage* selected_icon = NULL;
	GtkImage* _tmp19_ = NULL;
	GtkImage* _tmp20_;
	GtkImage* _tmp21_;
	GtkWidget* _tmp22_;
	GtkRevealer* _tmp23_ = NULL;
	GtkImage* order_icon = NULL;
	gchar* _tmp24_;
	gchar** _tmp25_;
	GtkImage* _tmp26_ = NULL;
	GtkBox* content_box = NULL;
	GtkBox* _tmp27_ = NULL;
	GtkBox* _tmp28_;
	GtkGrid* _tmp29_;
	GtkBox* _tmp30_;
	GtkLabel* _tmp31_;
	GtkBox* _tmp32_;
	GtkRevealer* _tmp33_;
	GtkBox* _tmp34_;
	GtkGestureClick* select_gesture = NULL;
	GtkGestureClick* _tmp35_;
	GtkGestureClick* _tmp36_;
	GtkEventController* _tmp37_;
	GtkGestureClick* _tmp38_;
	ServicesEventBus* _tmp39_;
	ServicesEventBus* _tmp40_;
	parent_class = G_OBJECT_CLASS (widgets_section_picker_section_picker_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_SECTION_PICKER_TYPE_SECTION_PICKER_ROW, WidgetsSectionPickerSectionPickerRow);
	_data43_ = g_slice_new0 (Block43Data);
	_data43_->_ref_count_ = 1;
	_data43_->self = g_object_ref (self);
	gtk_widget_add_css_class ((GtkWidget*) self, "border-radius-6");
	_tmp0_ = g_strdup ("event-bar");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = (GtkGrid*) gtk_grid_new ();
	g_object_set ((GtkWidget*) _tmp2_, "width-request", 3, NULL);
	g_object_set ((GtkWidget*) _tmp2_, "height-request", 16, NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp2_, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp2_, _tmp1_);
	_tmp1_ = (_vala_array_free (_tmp1_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp2_);
	color_grid = _tmp2_;
	_tmp3_ = util_get_default ();
	_tmp4_ = _tmp3_;
	_tmp5_ = util_get_default ();
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->_section;
	_tmp8_ = objects_base_object_get_color ((ObjectsBaseObject*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = util_get_color (_tmp6_, _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = color_grid;
	util_set_widget_color (_tmp4_, _tmp11_, (GtkWidget*) _tmp12_);
	_g_free0 (_tmp11_);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (_tmp4_);
	_tmp13_ = self->priv->_section;
	_tmp14_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = (GtkLabel*) gtk_label_new (_tmp15_);
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->name_label);
	self->priv->name_label = _tmp16_;
	_tmp17_ = self->priv->name_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp17_, GTK_ALIGN_CENTER);
	_tmp18_ = self->priv->name_label;
	gtk_label_set_ellipsize (_tmp18_, PANGO_ELLIPSIZE_END);
	_tmp19_ = (GtkImage*) gtk_image_new_from_icon_name ("checkmark-small-symbolic");
	gtk_image_set_pixel_size (_tmp19_, 16);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp19_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp19_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp19_, GTK_ALIGN_END);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp19_, 3);
	g_object_ref_sink (_tmp19_);
	selected_icon = _tmp19_;
	_tmp20_ = selected_icon;
	gtk_widget_add_css_class ((GtkWidget*) _tmp20_, "color-primary");
	_tmp21_ = selected_icon;
	_tmp22_ = _g_object_ref0 ((GtkWidget*) _tmp21_);
	_tmp23_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp23_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_revealer_set_child (_tmp23_, _tmp22_);
	_g_object_unref0 (_tmp22_);
	g_object_ref_sink (_tmp23_);
	_data43_->selected_revealer = _tmp23_;
	_tmp24_ = g_strdup ("dimmed");
	_tmp25_ = g_new0 (gchar*, 1 + 1);
	_tmp25_[0] = _tmp24_;
	_tmp26_ = (GtkImage*) gtk_image_new_from_icon_name ("list-drag-handle-symbolic");
	gtk_widget_set_css_classes ((GtkWidget*) _tmp26_, _tmp25_);
	_tmp25_ = (_vala_array_free (_tmp25_, 1, (GDestroyNotify) g_free), NULL);
	gtk_image_set_pixel_size (_tmp26_, 12);
	g_object_ref_sink (_tmp26_);
	order_icon = _tmp26_;
	_tmp27_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp27_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp27_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp27_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp27_, 6);
	g_object_ref_sink (_tmp27_);
	content_box = _tmp27_;
	_tmp28_ = content_box;
	_tmp29_ = color_grid;
	gtk_box_append (_tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = content_box;
	_tmp31_ = self->priv->name_label;
	gtk_box_append (_tmp30_, (GtkWidget*) _tmp31_);
	_tmp32_ = content_box;
	_tmp33_ = _data43_->selected_revealer;
	gtk_box_append (_tmp32_, (GtkWidget*) _tmp33_);
	_tmp34_ = content_box;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp34_);
	_tmp35_ = (GtkGestureClick*) gtk_gesture_click_new ();
	select_gesture = _tmp35_;
	_tmp36_ = select_gesture;
	_tmp37_ = _g_object_ref0 ((GtkEventController*) _tmp36_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp37_);
	_tmp38_ = select_gesture;
	g_signal_connect_object (_tmp38_, "pressed", (GCallback) __widgets_section_picker_section_picker_row___lambda121__gtk_gesture_click_pressed, self, 0);
	_tmp39_ = services_event_bus_get_default ();
	_tmp40_ = _tmp39_;
	g_signal_connect_data (_tmp40_, "section-picker-changed", (GCallback) __widgets_section_picker_section_picker_row___lambda122__services_event_bus_section_picker_changed, block43_data_ref (_data43_), (GClosureNotify) block43_data_unref, 0);
	_g_object_unref0 (_tmp40_);
	_g_object_unref0 (select_gesture);
	_g_object_unref0 (content_box);
	_g_object_unref0 (order_icon);
	_g_object_unref0 (selected_icon);
	_g_object_unref0 (color_grid);
	block43_data_unref (_data43_);
	_data43_ = NULL;
	return obj;
}

static void
widgets_section_picker_section_picker_row_class_init (WidgetsSectionPickerSectionPickerRowClass * klass,
                                                      gpointer klass_data)
{
	widgets_section_picker_section_picker_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsSectionPickerSectionPickerRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_section_picker_section_picker_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_section_picker_section_picker_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_section_picker_section_picker_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_section_picker_section_picker_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_SECTION_PROPERTY, widgets_section_picker_section_picker_row_properties[WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_SECTION_PROPERTY] = g_param_spec_object ("section", "section", "section", OBJECTS_TYPE_SECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	widgets_section_picker_section_picker_row_signals[WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_UPDATE_SECTION_SIGNAL] = g_signal_new ("update-section", WIDGETS_SECTION_PICKER_TYPE_SECTION_PICKER_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
widgets_section_picker_section_picker_row_instance_init (WidgetsSectionPickerSectionPickerRow * self,
                                                         gpointer klass)
{
	self->priv = widgets_section_picker_section_picker_row_get_instance_private (self);
}

static void
widgets_section_picker_section_picker_row_finalize (GObject * obj)
{
	WidgetsSectionPickerSectionPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_SECTION_PICKER_TYPE_SECTION_PICKER_ROW, WidgetsSectionPickerSectionPickerRow);
	_g_object_unref0 (self->priv->_section);
	_g_object_unref0 (self->priv->name_label);
	G_OBJECT_CLASS (widgets_section_picker_section_picker_row_parent_class)->finalize (obj);
}

static GType
widgets_section_picker_section_picker_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsSectionPickerSectionPickerRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_section_picker_section_picker_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsSectionPickerSectionPickerRow), 0, (GInstanceInitFunc) widgets_section_picker_section_picker_row_instance_init, NULL };
	GType widgets_section_picker_section_picker_row_type_id;
	widgets_section_picker_section_picker_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "WidgetsSectionPickerSectionPickerRow", &g_define_type_info, 0);
	WidgetsSectionPickerSectionPickerRow_private_offset = g_type_add_instance_private (widgets_section_picker_section_picker_row_type_id, sizeof (WidgetsSectionPickerSectionPickerRowPrivate));
	return widgets_section_picker_section_picker_row_type_id;
}

GType
widgets_section_picker_section_picker_row_get_type (void)
{
	static volatile gsize widgets_section_picker_section_picker_row_type_id__once = 0;
	if (g_once_init_enter (&widgets_section_picker_section_picker_row_type_id__once)) {
		GType widgets_section_picker_section_picker_row_type_id;
		widgets_section_picker_section_picker_row_type_id = widgets_section_picker_section_picker_row_get_type_once ();
		g_once_init_leave (&widgets_section_picker_section_picker_row_type_id__once, widgets_section_picker_section_picker_row_type_id);
	}
	return widgets_section_picker_section_picker_row_type_id__once;
}

static void
_vala_widgets_section_picker_section_picker_row_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	WidgetsSectionPickerSectionPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_SECTION_PICKER_TYPE_SECTION_PICKER_ROW, WidgetsSectionPickerSectionPickerRow);
	switch (property_id) {
		case WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_SECTION_PROPERTY:
		g_value_set_object (value, widgets_section_picker_section_picker_row_get_section (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_section_picker_section_picker_row_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec)
{
	WidgetsSectionPickerSectionPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_SECTION_PICKER_TYPE_SECTION_PICKER_ROW, WidgetsSectionPickerSectionPickerRow);
	switch (property_id) {
		case WIDGETS_SECTION_PICKER_SECTION_PICKER_ROW_SECTION_PROPERTY:
		widgets_section_picker_section_picker_row_set_section (self, g_value_get_object (value));
		break;
		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);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

