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

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <handy.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include "gnome-games.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 GAMES_TYPE_PREFERENCES_PAGE (games_preferences_page_get_type ())
#define GAMES_PREFERENCES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_PREFERENCES_PAGE, GamesPreferencesPage))
#define GAMES_PREFERENCES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_PREFERENCES_PAGE, GamesPreferencesPageClass))
#define GAMES_IS_PREFERENCES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_PREFERENCES_PAGE))
#define GAMES_IS_PREFERENCES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_PREFERENCES_PAGE))
#define GAMES_PREFERENCES_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_PREFERENCES_PAGE, GamesPreferencesPageClass))

typedef struct _GamesPreferencesPage GamesPreferencesPage;
typedef struct _GamesPreferencesPageClass GamesPreferencesPageClass;
typedef struct _GamesPreferencesPagePrivate GamesPreferencesPagePrivate;

#define GAMES_TYPE_PREFERENCES_PAGE_VIDEO (games_preferences_page_video_get_type ())
#define GAMES_PREFERENCES_PAGE_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_PREFERENCES_PAGE_VIDEO, GamesPreferencesPageVideo))
#define GAMES_PREFERENCES_PAGE_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_PREFERENCES_PAGE_VIDEO, GamesPreferencesPageVideoClass))
#define GAMES_IS_PREFERENCES_PAGE_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_PREFERENCES_PAGE_VIDEO))
#define GAMES_IS_PREFERENCES_PAGE_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_PREFERENCES_PAGE_VIDEO))
#define GAMES_PREFERENCES_PAGE_VIDEO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_PREFERENCES_PAGE_VIDEO, GamesPreferencesPageVideoClass))

typedef struct _GamesPreferencesPageVideo GamesPreferencesPageVideo;
typedef struct _GamesPreferencesPageVideoClass GamesPreferencesPageVideoClass;
typedef struct _GamesPreferencesPageVideoPrivate GamesPreferencesPageVideoPrivate;
enum  {
	GAMES_PREFERENCES_PAGE_VIDEO_0_PROPERTY,
	GAMES_PREFERENCES_PAGE_VIDEO_FILTER_ACTIVE_PROPERTY,
	GAMES_PREFERENCES_PAGE_VIDEO_NUM_PROPERTIES
};
static GParamSpec* games_preferences_page_video_properties[GAMES_PREFERENCES_PAGE_VIDEO_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block19Data Block19Data;

struct _GamesPreferencesPage {
	GtkBin parent_instance;
	GamesPreferencesPagePrivate * priv;
};

struct _GamesPreferencesPageClass {
	GtkBinClass parent_class;
};

struct _GamesPreferencesPageVideo {
	GamesPreferencesPage parent_instance;
	GamesPreferencesPageVideoPrivate * priv;
};

struct _GamesPreferencesPageVideoClass {
	GamesPreferencesPageClass parent_class;
};

struct _GamesPreferencesPageVideoPrivate {
	gchar* _filter_active;
	HdyPreferencesGroup* filter_group;
	gchar** filter_display_names;
	gint filter_display_names_length1;
	gint _filter_display_names_size_;
	gchar** filter_names;
	gint filter_names_length1;
	gint _filter_names_size_;
	GSettings* settings;
	GtkRadioButton* filter_radios[3];
};

struct _Block19Data {
	int _ref_count_;
	GamesPreferencesPageVideo* self;
	gint i;
};

static gint GamesPreferencesPageVideo_private_offset;
static gpointer games_preferences_page_video_parent_class = NULL;

VALA_EXTERN GType games_preferences_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_preferences_page_video_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesPreferencesPageVideo* games_preferences_page_video_new (void);
VALA_EXTERN GamesPreferencesPageVideo* games_preferences_page_video_construct (GType object_type);
VALA_EXTERN GamesPreferencesPage* games_preferences_page_new (void);
VALA_EXTERN GamesPreferencesPage* games_preferences_page_construct (GType object_type);
VALA_EXTERN const gchar* games_preferences_page_video_get_filter_active (GamesPreferencesPageVideo* self);
VALA_EXTERN void games_preferences_page_video_set_filter_active (GamesPreferencesPageVideo* self,
                                                     const gchar* value);
static GObject * games_preferences_page_video_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static void _games_preferences_page_video______lambda89_ (GamesPreferencesPageVideo* self,
                                                   GtkToggleButton* radio);
static void __games_preferences_page_video______lambda89__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                              gpointer self);
static void _games_preferences_page_video______lambda90_ (Block19Data* _data19_);
static void __games_preferences_page_video______lambda90__hdy_action_row_activated (HdyActionRow* _sender,
                                                                             gpointer self);
static void games_preferences_page_video_finalize (GObject * obj);
static GType games_preferences_page_video_get_type_once (void);
static void _vala_games_preferences_page_video_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_games_preferences_page_video_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
games_preferences_page_video_get_instance_private (GamesPreferencesPageVideo* self)
{
	return G_STRUCT_MEMBER_P (self, GamesPreferencesPageVideo_private_offset);
}

GamesPreferencesPageVideo*
games_preferences_page_video_construct (GType object_type)
{
	GamesPreferencesPageVideo * self = NULL;
	self = (GamesPreferencesPageVideo*) games_preferences_page_construct (object_type);
	return self;
}

GamesPreferencesPageVideo*
games_preferences_page_video_new (void)
{
	return games_preferences_page_video_construct (GAMES_TYPE_PREFERENCES_PAGE_VIDEO);
}

const gchar*
games_preferences_page_video_get_filter_active (GamesPreferencesPageVideo* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_filter_active;
	result = _tmp0_;
	return result;
}

void
games_preferences_page_video_set_filter_active (GamesPreferencesPageVideo* self,
                                                const gchar* value)
{
	gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gchar** _tmp2_;
				gint _tmp2__length1;
				GtkRadioButton* _tmp3_;
				gchar** _tmp4_;
				gint _tmp4__length1;
				const gchar* _tmp5_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->filter_names;
				_tmp2__length1 = self->priv->filter_names_length1;
				if (!(i < _tmp2__length1)) {
					break;
				}
				_tmp3_ = self->priv->filter_radios[i];
				_tmp4_ = self->priv->filter_names;
				_tmp4__length1 = self->priv->filter_names_length1;
				_tmp5_ = _tmp4_[i];
				gtk_toggle_button_set_active ((GtkToggleButton*) _tmp3_, g_strcmp0 (value, _tmp5_) == 0);
			}
		}
	}
	_tmp6_ = g_strdup (value);
	_g_free0 (self->priv->_filter_active);
	self->priv->_filter_active = _tmp6_;
	g_object_notify_by_pspec ((GObject *) self, games_preferences_page_video_properties[GAMES_PREFERENCES_PAGE_VIDEO_FILTER_ACTIVE_PROPERTY]);
}

static Block19Data*
block19_data_ref (Block19Data* _data19_)
{
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}

static void
block19_data_unref (void * _userdata_)
{
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		GamesPreferencesPageVideo* self;
		self = _data19_->self;
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}

static void
_games_preferences_page_video______lambda89_ (GamesPreferencesPageVideo* self,
                                              GtkToggleButton* radio)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (radio != NULL);
	_tmp0_ = gtk_toggle_button_get_active (radio);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	_tmp2_ = gtk_widget_get_name ((GtkWidget*) radio);
	_tmp3_ = _tmp2_;
	games_preferences_page_video_set_filter_active (self, _tmp3_);
}

static void
__games_preferences_page_video______lambda89__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                         gpointer self)
{
	_games_preferences_page_video______lambda89_ ((GamesPreferencesPageVideo*) self, _sender);
}

static void
_games_preferences_page_video______lambda90_ (Block19Data* _data19_)
{
	GamesPreferencesPageVideo* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	const gchar* _tmp1_;
	self = _data19_->self;
	_tmp0_ = self->priv->filter_names;
	_tmp0__length1 = self->priv->filter_names_length1;
	_tmp1_ = _tmp0_[_data19_->i];
	games_preferences_page_video_set_filter_active (self, _tmp1_);
}

static void
__games_preferences_page_video______lambda90__hdy_action_row_activated (HdyActionRow* _sender,
                                                                        gpointer self)
{
	_games_preferences_page_video______lambda90_ (self);
}

static GObject *
games_preferences_page_video_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GamesPreferencesPageVideo * self;
	GSettings* _tmp23_;
	GSettings* _tmp24_;
	parent_class = G_OBJECT_CLASS (games_preferences_page_video_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_PREFERENCES_PAGE_VIDEO, GamesPreferencesPageVideo);
	{
		Block19Data* _data19_;
		_data19_ = g_slice_new0 (Block19Data);
		_data19_->_ref_count_ = 1;
		_data19_->self = g_object_ref (self);
		_data19_->i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gchar** _tmp2_;
				gint _tmp2__length1;
				HdyActionRow* row = NULL;
				HdyActionRow* _tmp3_;
				HdyActionRow* _tmp4_;
				gchar** _tmp5_;
				gint _tmp5__length1;
				const gchar* _tmp6_;
				GtkRadioButton* _tmp7_;
				GtkRadioButton* _tmp8_;
				GtkRadioButton* _tmp9_;
				gchar** _tmp10_;
				gint _tmp10__length1;
				const gchar* _tmp11_;
				GtkRadioButton* _tmp12_;
				GtkRadioButton* _tmp13_;
				GtkRadioButton* _tmp14_;
				HdyActionRow* _tmp15_;
				GtkRadioButton* _tmp16_;
				HdyActionRow* _tmp17_;
				GtkRadioButton* _tmp18_;
				HdyActionRow* _tmp19_;
				HdyActionRow* _tmp20_;
				HdyPreferencesGroup* _tmp21_;
				HdyActionRow* _tmp22_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = _data19_->i;
					_data19_->i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->filter_display_names;
				_tmp2__length1 = self->priv->filter_display_names_length1;
				if (!(_data19_->i < _tmp2__length1)) {
					break;
				}
				_tmp3_ = (HdyActionRow*) hdy_action_row_new ();
				g_object_ref_sink (_tmp3_);
				row = _tmp3_;
				_tmp4_ = row;
				_tmp5_ = self->priv->filter_display_names;
				_tmp5__length1 = self->priv->filter_display_names_length1;
				_tmp6_ = _tmp5_[_data19_->i];
				hdy_preferences_row_set_title ((HdyPreferencesRow*) _tmp4_, _tmp6_);
				_tmp7_ = self->priv->filter_radios[0];
				_tmp8_ = (GtkRadioButton*) gtk_radio_button_new_from_widget (_tmp7_);
				g_object_ref_sink (_tmp8_);
				_g_object_unref0 (self->priv->filter_radios[_data19_->i]);
				self->priv->filter_radios[_data19_->i] = _tmp8_;
				_tmp9_ = self->priv->filter_radios[_data19_->i];
				_tmp10_ = self->priv->filter_names;
				_tmp10__length1 = self->priv->filter_names_length1;
				_tmp11_ = _tmp10_[_data19_->i];
				gtk_widget_set_name ((GtkWidget*) _tmp9_, _tmp11_);
				_tmp12_ = self->priv->filter_radios[_data19_->i];
				gtk_widget_set_valign ((GtkWidget*) _tmp12_, GTK_ALIGN_CENTER);
				_tmp13_ = self->priv->filter_radios[_data19_->i];
				gtk_widget_set_can_focus ((GtkWidget*) _tmp13_, FALSE);
				_tmp14_ = self->priv->filter_radios[_data19_->i];
				g_signal_connect_object ((GtkToggleButton*) _tmp14_, "toggled", (GCallback) __games_preferences_page_video______lambda89__gtk_toggle_button_toggled, self, 0);
				_tmp15_ = row;
				_tmp16_ = self->priv->filter_radios[_data19_->i];
				hdy_action_row_add_prefix (_tmp15_, (GtkWidget*) _tmp16_);
				_tmp17_ = row;
				_tmp18_ = self->priv->filter_radios[_data19_->i];
				hdy_action_row_set_activatable_widget (_tmp17_, (GtkWidget*) _tmp18_);
				_tmp19_ = row;
				gtk_widget_show_all ((GtkWidget*) _tmp19_);
				_tmp20_ = row;
				g_signal_connect_data (_tmp20_, "activated", (GCallback) __games_preferences_page_video______lambda90__hdy_action_row_activated, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
				_tmp21_ = self->priv->filter_group;
				_tmp22_ = row;
				gtk_container_add ((GtkContainer*) _tmp21_, (GtkWidget*) _tmp22_);
				_g_object_unref0 (row);
			}
		}
		block19_data_unref (_data19_);
		_data19_ = NULL;
	}
	_tmp23_ = g_settings_new ("org.gnome.Games");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp23_;
	_tmp24_ = self->priv->settings;
	g_settings_bind (_tmp24_, "video-filter", (GObject*) self, "filter-active", G_SETTINGS_BIND_DEFAULT);
	return obj;
}

static void
games_preferences_page_video_class_init (GamesPreferencesPageVideoClass * klass,
                                         gpointer klass_data)
{
	games_preferences_page_video_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesPreferencesPageVideo_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_preferences_page_video_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_preferences_page_video_set_property;
	G_OBJECT_CLASS (klass)->constructor = games_preferences_page_video_constructor;
	G_OBJECT_CLASS (klass)->finalize = games_preferences_page_video_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PREFERENCES_PAGE_VIDEO_FILTER_ACTIVE_PROPERTY, games_preferences_page_video_properties[GAMES_PREFERENCES_PAGE_VIDEO_FILTER_ACTIVE_PROPERTY] = g_param_spec_string ("filter-active", "filter-active", "filter-active", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Games/preferences/preferences-page-video.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filter_group", FALSE, GamesPreferencesPageVideo_private_offset + G_STRUCT_OFFSET (GamesPreferencesPageVideoPrivate, filter_group));
}

static void
games_preferences_page_video_instance_init (GamesPreferencesPageVideo * self,
                                            gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	self->priv = games_preferences_page_video_get_instance_private (self);
	_tmp0_ = g_strdup (_ ("Smooth"));
	_tmp1_ = g_strdup (_ ("Sharp"));
	_tmp2_ = g_strdup (_ ("CRT"));
	_tmp3_ = g_new0 (gchar*, 3 + 1);
	_tmp3_[0] = _tmp0_;
	_tmp3_[1] = _tmp1_;
	_tmp3_[2] = _tmp2_;
	self->priv->filter_display_names = _tmp3_;
	self->priv->filter_display_names_length1 = 3;
	self->priv->_filter_display_names_size_ = self->priv->filter_display_names_length1;
	_tmp4_ = g_strdup ("smooth");
	_tmp5_ = g_strdup ("sharp");
	_tmp6_ = g_strdup ("crt");
	_tmp7_ = g_new0 (gchar*, 3 + 1);
	_tmp7_[0] = _tmp4_;
	_tmp7_[1] = _tmp5_;
	_tmp7_[2] = _tmp6_;
	self->priv->filter_names = _tmp7_;
	self->priv->filter_names_length1 = 3;
	self->priv->_filter_names_size_ = self->priv->filter_names_length1;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_preferences_page_video_finalize (GObject * obj)
{
	GamesPreferencesPageVideo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_PREFERENCES_PAGE_VIDEO, GamesPreferencesPageVideo);
	_g_free0 (self->priv->_filter_active);
	self->priv->filter_display_names = (_vala_array_free (self->priv->filter_display_names, self->priv->filter_display_names_length1, (GDestroyNotify) g_free), NULL);
	self->priv->filter_names = (_vala_array_free (self->priv->filter_names, self->priv->filter_names_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->settings);
	_vala_array_destroy (self->priv->filter_radios, 3, (GDestroyNotify) g_object_unref);
	G_OBJECT_CLASS (games_preferences_page_video_parent_class)->finalize (obj);
}

static GType
games_preferences_page_video_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesPreferencesPageVideoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_preferences_page_video_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesPreferencesPageVideo), 0, (GInstanceInitFunc) games_preferences_page_video_instance_init, NULL };
	GType games_preferences_page_video_type_id;
	games_preferences_page_video_type_id = g_type_register_static (GAMES_TYPE_PREFERENCES_PAGE, "GamesPreferencesPageVideo", &g_define_type_info, 0);
	GamesPreferencesPageVideo_private_offset = g_type_add_instance_private (games_preferences_page_video_type_id, sizeof (GamesPreferencesPageVideoPrivate));
	return games_preferences_page_video_type_id;
}

GType
games_preferences_page_video_get_type (void)
{
	static volatile gsize games_preferences_page_video_type_id__once = 0;
	if (g_once_init_enter (&games_preferences_page_video_type_id__once)) {
		GType games_preferences_page_video_type_id;
		games_preferences_page_video_type_id = games_preferences_page_video_get_type_once ();
		g_once_init_leave (&games_preferences_page_video_type_id__once, games_preferences_page_video_type_id);
	}
	return games_preferences_page_video_type_id__once;
}

static void
_vala_games_preferences_page_video_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	GamesPreferencesPageVideo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_PREFERENCES_PAGE_VIDEO, GamesPreferencesPageVideo);
	switch (property_id) {
		case GAMES_PREFERENCES_PAGE_VIDEO_FILTER_ACTIVE_PROPERTY:
		g_value_set_string (value, games_preferences_page_video_get_filter_active (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_preferences_page_video_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	GamesPreferencesPageVideo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_PREFERENCES_PAGE_VIDEO, GamesPreferencesPageVideo);
	switch (property_id) {
		case GAMES_PREFERENCES_PAGE_VIDEO_FILTER_ACTIVE_PROPERTY:
		games_preferences_page_video_set_filter_active (self, g_value_get_string (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;
}

