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

/**/
/*  Copyright (C) 2016 Rico Tzschichholz*/
/**/
/*  This file is part of Plank.*/
/**/
/*  Plank 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.*/
/**/
/*  Plank 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, see <http://www.gnu.org/licenses/>.*/
/**/

#include <glib-object.h>
#include <glib.h>
#include "plank.h"
#include <gio/gio.h>
#include "plank-internal.h"
#include <stdlib.h>
#include <string.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 PLANK_TYPE_ENVIRONMENT_SETTINGS (plank_environment_settings_get_type ())
#define PLANK_ENVIRONMENT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANK_TYPE_ENVIRONMENT_SETTINGS, PlankEnvironmentSettings))
#define PLANK_ENVIRONMENT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLANK_TYPE_ENVIRONMENT_SETTINGS, PlankEnvironmentSettingsClass))
#define PLANK_IS_ENVIRONMENT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLANK_TYPE_ENVIRONMENT_SETTINGS))
#define PLANK_IS_ENVIRONMENT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLANK_TYPE_ENVIRONMENT_SETTINGS))
#define PLANK_ENVIRONMENT_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLANK_TYPE_ENVIRONMENT_SETTINGS, PlankEnvironmentSettingsClass))

typedef struct _PlankEnvironmentSettings PlankEnvironmentSettings;
typedef struct _PlankEnvironmentSettingsClass PlankEnvironmentSettingsClass;
typedef struct _PlankEnvironmentSettingsPrivate PlankEnvironmentSettingsPrivate;

#define PLANK_TYPE_DESKTOP_NOFICATIONS (plank_desktop_nofications_get_type ())
#define PLANK_DESKTOP_NOFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANK_TYPE_DESKTOP_NOFICATIONS, PlankDesktopNofications))
#define PLANK_IS_DESKTOP_NOFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLANK_TYPE_DESKTOP_NOFICATIONS))
#define PLANK_DESKTOP_NOFICATIONS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PLANK_TYPE_DESKTOP_NOFICATIONS, PlankDesktopNoficationsIface))

typedef struct _PlankDesktopNofications PlankDesktopNofications;
typedef struct _PlankDesktopNoficationsIface PlankDesktopNoficationsIface;
enum  {
	PLANK_ENVIRONMENT_SETTINGS_0_PROPERTY,
	PLANK_ENVIRONMENT_SETTINGS_SHOW_NOTIFICATIONS_PROPERTY,
	PLANK_ENVIRONMENT_SETTINGS_NUM_PROPERTIES
};
static GParamSpec* plank_environment_settings_properties[PLANK_ENVIRONMENT_SETTINGS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS (plank_gnome_desktop_notifications_get_type ())
#define PLANK_GNOME_DESKTOP_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, PlankGnomeDesktopNotifications))
#define PLANK_GNOME_DESKTOP_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, PlankGnomeDesktopNotificationsClass))
#define PLANK_IS_GNOME_DESKTOP_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS))
#define PLANK_IS_GNOME_DESKTOP_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS))
#define PLANK_GNOME_DESKTOP_NOTIFICATIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, PlankGnomeDesktopNotificationsClass))

typedef struct _PlankGnomeDesktopNotifications PlankGnomeDesktopNotifications;
typedef struct _PlankGnomeDesktopNotificationsClass PlankGnomeDesktopNotificationsClass;

#define PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS (plank_pantheon_desktop_notifications_get_type ())
#define PLANK_PANTHEON_DESKTOP_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, PlankPantheonDesktopNotifications))
#define PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, PlankPantheonDesktopNotificationsClass))
#define PLANK_IS_PANTHEON_DESKTOP_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS))
#define PLANK_IS_PANTHEON_DESKTOP_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS))
#define PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, PlankPantheonDesktopNotificationsClass))

typedef struct _PlankPantheonDesktopNotifications PlankPantheonDesktopNotifications;
typedef struct _PlankPantheonDesktopNotificationsClass PlankPantheonDesktopNotificationsClass;
typedef struct _PlankPantheonDesktopNotificationsPrivate PlankPantheonDesktopNotificationsPrivate;
enum  {
	PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_0_PROPERTY,
	PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY,
	PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_NUM_PROPERTIES
};
static GParamSpec* plank_pantheon_desktop_notifications_properties[PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_NUM_PROPERTIES];
typedef struct _PlankGnomeDesktopNotificationsPrivate PlankGnomeDesktopNotificationsPrivate;
enum  {
	PLANK_GNOME_DESKTOP_NOTIFICATIONS_0_PROPERTY,
	PLANK_GNOME_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY,
	PLANK_GNOME_DESKTOP_NOTIFICATIONS_NUM_PROPERTIES
};
static GParamSpec* plank_gnome_desktop_notifications_properties[PLANK_GNOME_DESKTOP_NOTIFICATIONS_NUM_PROPERTIES];

struct _PlankEnvironmentSettings {
	GObject parent_instance;
	PlankEnvironmentSettingsPrivate * priv;
};

struct _PlankEnvironmentSettingsClass {
	GObjectClass parent_class;
};

struct _PlankDesktopNoficationsIface {
	GTypeInterface parent_iface;
	gboolean (*get_ShowNotifications) (PlankDesktopNofications* self);
	void (*set_ShowNotifications) (PlankDesktopNofications* self, gboolean value);
};

struct _PlankEnvironmentSettingsPrivate {
	gboolean _ShowNotifications;
	PlankDesktopNofications* notifications;
};

struct _PlankPantheonDesktopNotifications {
	PlankSettings parent_instance;
	PlankPantheonDesktopNotificationsPrivate * priv;
};

struct _PlankPantheonDesktopNotificationsClass {
	PlankSettingsClass parent_class;
};

struct _PlankPantheonDesktopNotificationsPrivate {
	gboolean _ShowNotifications;
};

struct _PlankGnomeDesktopNotifications {
	PlankSettings parent_instance;
	PlankGnomeDesktopNotificationsPrivate * priv;
};

struct _PlankGnomeDesktopNotificationsClass {
	PlankSettingsClass parent_class;
};

struct _PlankGnomeDesktopNotificationsPrivate {
	gboolean _ShowNotifications;
};

static gint PlankEnvironmentSettings_private_offset;
static gpointer plank_environment_settings_parent_class = NULL;
static PlankEnvironmentSettings* plank_environment_settings_instance;
static PlankEnvironmentSettings* plank_environment_settings_instance = NULL;
static gint PlankPantheonDesktopNotifications_private_offset;
static gpointer plank_pantheon_desktop_notifications_parent_class = NULL;
static PlankPantheonDesktopNotifications* plank_pantheon_desktop_notifications_instance;
static PlankPantheonDesktopNotifications* plank_pantheon_desktop_notifications_instance = NULL;
static PlankDesktopNoficationsIface * plank_pantheon_desktop_notifications_plank_desktop_nofications_parent_iface = NULL;
static gint PlankGnomeDesktopNotifications_private_offset;
static gpointer plank_gnome_desktop_notifications_parent_class = NULL;
static PlankGnomeDesktopNotifications* plank_gnome_desktop_notifications_instance;
static PlankGnomeDesktopNotifications* plank_gnome_desktop_notifications_instance = NULL;
static PlankDesktopNoficationsIface * plank_gnome_desktop_notifications_plank_desktop_nofications_parent_iface = NULL;

VALA_EXTERN GType plank_environment_settings_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType plank_desktop_nofications_get_type (void) G_GNUC_CONST ;
static void plank_environment_settings_notifications_changed (PlankEnvironmentSettings* self);
static void _plank_environment_settings_notifications_changed_g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self);
VALA_EXTERN PlankEnvironmentSettings* plank_environment_settings_get_instance (void);
static PlankEnvironmentSettings* plank_environment_settings_new (void);
static PlankEnvironmentSettings* plank_environment_settings_construct (GType object_type);
VALA_EXTERN gboolean plank_desktop_nofications_get_ShowNotifications (PlankDesktopNofications* self);
static void plank_environment_settings_set_ShowNotifications (PlankEnvironmentSettings* self,
                                                       gboolean value);
VALA_EXTERN gboolean plank_environment_settings_get_ShowNotifications (PlankEnvironmentSettings* self);
static GObject * plank_environment_settings_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
VALA_EXTERN PlankXdgSessionDesktop plank_get_xdg_session_desktop (void);
VALA_EXTERN GType plank_gnome_desktop_notifications_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PlankGnomeDesktopNotifications* plank_gnome_desktop_notifications_try_get_instance (void);
VALA_EXTERN GType plank_pantheon_desktop_notifications_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PlankPantheonDesktopNotifications* plank_pantheon_desktop_notifications_try_get_instance (void);
static void plank_environment_settings_finalize (GObject * obj);
static GType plank_environment_settings_get_type_once (void);
static void _vala_plank_environment_settings_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_plank_environment_settings_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
VALA_EXTERN void plank_desktop_nofications_set_ShowNotifications (PlankDesktopNofications* self,
                                                      gboolean value);
static GType plank_desktop_nofications_get_type_once (void);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
VALA_EXTERN PlankPantheonDesktopNotifications* plank_pantheon_desktop_notifications_new (void);
VALA_EXTERN PlankPantheonDesktopNotifications* plank_pantheon_desktop_notifications_construct (GType object_type);
static void plank_pantheon_desktop_notifications_finalize (GObject * obj);
static GType plank_pantheon_desktop_notifications_get_type_once (void);
static void _vala_plank_pantheon_desktop_notifications_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_plank_pantheon_desktop_notifications_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);
VALA_EXTERN PlankGnomeDesktopNotifications* plank_gnome_desktop_notifications_new (void);
VALA_EXTERN PlankGnomeDesktopNotifications* plank_gnome_desktop_notifications_construct (GType object_type);
static void plank_gnome_desktop_notifications_finalize (GObject * obj);
static GType plank_gnome_desktop_notifications_get_type_once (void);
static void _vala_plank_gnome_desktop_notifications_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec);
static void _vala_plank_gnome_desktop_notifications_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 gssize _vala_array_length (gpointer array);

static inline gpointer
plank_environment_settings_get_instance_private (PlankEnvironmentSettings* self)
{
	return G_STRUCT_MEMBER_P (self, PlankEnvironmentSettings_private_offset);
}

static void
_plank_environment_settings_notifications_changed_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self)
{
	plank_environment_settings_notifications_changed ((PlankEnvironmentSettings*) self);
}

PlankEnvironmentSettings*
plank_environment_settings_get_instance (void)
{
	PlankEnvironmentSettings* _tmp0_;
	PlankEnvironmentSettings* _tmp2_;
	PlankEnvironmentSettings* result;
	_tmp0_ = plank_environment_settings_instance;
	if (_tmp0_ == NULL) {
		PlankEnvironmentSettings* _tmp1_;
		_tmp1_ = plank_environment_settings_new ();
		_g_object_unref0 (plank_environment_settings_instance);
		plank_environment_settings_instance = _tmp1_;
	}
	_tmp2_ = plank_environment_settings_instance;
	result = _tmp2_;
	return result;
}

static PlankEnvironmentSettings*
plank_environment_settings_construct (GType object_type)
{
	PlankEnvironmentSettings * self = NULL;
	self = (PlankEnvironmentSettings*) g_object_new (object_type, NULL);
	return self;
}

static PlankEnvironmentSettings*
plank_environment_settings_new (void)
{
	return plank_environment_settings_construct (PLANK_TYPE_ENVIRONMENT_SETTINGS);
}

static void
plank_environment_settings_notifications_changed (PlankEnvironmentSettings* self)
{
	PlankDesktopNofications* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->notifications;
	_tmp1_ = plank_desktop_nofications_get_ShowNotifications (_tmp0_);
	_tmp2_ = _tmp1_;
	plank_environment_settings_set_ShowNotifications (self, _tmp2_);
}

gboolean
plank_environment_settings_get_ShowNotifications (PlankEnvironmentSettings* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_ShowNotifications;
	return result;
}

static void
plank_environment_settings_set_ShowNotifications (PlankEnvironmentSettings* self,
                                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = plank_environment_settings_get_ShowNotifications (self);
	if (old_value != value) {
		self->priv->_ShowNotifications = value;
		g_object_notify_by_pspec ((GObject *) self, plank_environment_settings_properties[PLANK_ENVIRONMENT_SETTINGS_SHOW_NOTIFICATIONS_PROPERTY]);
	}
}

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

static GObject *
plank_environment_settings_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PlankEnvironmentSettings * self;
	PlankDesktopNofications* _tmp4_;
	parent_class = G_OBJECT_CLASS (plank_environment_settings_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PLANK_TYPE_ENVIRONMENT_SETTINGS, PlankEnvironmentSettings);
	switch (plank_get_xdg_session_desktop ()) {
		case PLANK_XDG_SESSION_DESKTOP_GNOME:
		{
			PlankGnomeDesktopNotifications* _tmp0_;
			PlankDesktopNofications* _tmp1_;
			_tmp0_ = plank_gnome_desktop_notifications_try_get_instance ();
			_tmp1_ = _g_object_ref0 ((PlankDesktopNofications*) _tmp0_);
			_g_object_unref0 (self->priv->notifications);
			self->priv->notifications = _tmp1_;
			break;
		}
		case PLANK_XDG_SESSION_DESKTOP_PANTHEON:
		{
			PlankPantheonDesktopNotifications* _tmp2_;
			PlankDesktopNofications* _tmp3_;
			_tmp2_ = plank_pantheon_desktop_notifications_try_get_instance ();
			_tmp3_ = _g_object_ref0 ((PlankDesktopNofications*) _tmp2_);
			_g_object_unref0 (self->priv->notifications);
			self->priv->notifications = _tmp3_;
			break;
		}
		default:
		{
			_g_object_unref0 (self->priv->notifications);
			self->priv->notifications = NULL;
			break;
		}
	}
	_tmp4_ = self->priv->notifications;
	if (_tmp4_ != NULL) {
		PlankDesktopNofications* _tmp5_;
		plank_environment_settings_notifications_changed (self);
		_tmp5_ = self->priv->notifications;
		g_signal_connect_object ((GObject*) _tmp5_, "notify", (GCallback) _plank_environment_settings_notifications_changed_g_object_notify, self, 0);
	}
	return obj;
}

static void
plank_environment_settings_class_init (PlankEnvironmentSettingsClass * klass,
                                       gpointer klass_data)
{
	plank_environment_settings_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PlankEnvironmentSettings_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_plank_environment_settings_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_plank_environment_settings_set_property;
	G_OBJECT_CLASS (klass)->constructor = plank_environment_settings_constructor;
	G_OBJECT_CLASS (klass)->finalize = plank_environment_settings_finalize;
	/**
	 * Whether the environment allows an application to draw the user's attention
	 * e.g. "Do not disturb"-mode is disabled or not
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PLANK_ENVIRONMENT_SETTINGS_SHOW_NOTIFICATIONS_PROPERTY, plank_environment_settings_properties[PLANK_ENVIRONMENT_SETTINGS_SHOW_NOTIFICATIONS_PROPERTY] = g_param_spec_boolean ("ShowNotifications", "show-notifications", "ShowNotifications", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
plank_environment_settings_instance_init (PlankEnvironmentSettings * self,
                                          gpointer klass)
{
	self->priv = plank_environment_settings_get_instance_private (self);
	self->priv->_ShowNotifications = TRUE;
}

static void
plank_environment_settings_finalize (GObject * obj)
{
	PlankEnvironmentSettings * self;
	PlankDesktopNofications* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PLANK_TYPE_ENVIRONMENT_SETTINGS, PlankEnvironmentSettings);
	_tmp0_ = self->priv->notifications;
	if (_tmp0_ != NULL) {
		PlankDesktopNofications* _tmp1_;
		guint _tmp2_;
		_tmp1_ = self->priv->notifications;
		g_signal_parse_name ("notify", G_TYPE_OBJECT, &_tmp2_, NULL, FALSE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _plank_environment_settings_notifications_changed_g_object_notify, self);
	}
	_g_object_unref0 (self->priv->notifications);
	G_OBJECT_CLASS (plank_environment_settings_parent_class)->finalize (obj);
}

/**
 * Summons settings of the currently running destop-session to use for improving
 * integration like appearance and behaviour
 */
static GType
plank_environment_settings_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PlankEnvironmentSettingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) plank_environment_settings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlankEnvironmentSettings), 0, (GInstanceInitFunc) plank_environment_settings_instance_init, NULL };
	GType plank_environment_settings_type_id;
	plank_environment_settings_type_id = g_type_register_static (G_TYPE_OBJECT, "PlankEnvironmentSettings", &g_define_type_info, 0);
	PlankEnvironmentSettings_private_offset = g_type_add_instance_private (plank_environment_settings_type_id, sizeof (PlankEnvironmentSettingsPrivate));
	return plank_environment_settings_type_id;
}

GType
plank_environment_settings_get_type (void)
{
	static volatile gsize plank_environment_settings_type_id__once = 0;
	if (g_once_init_enter (&plank_environment_settings_type_id__once)) {
		GType plank_environment_settings_type_id;
		plank_environment_settings_type_id = plank_environment_settings_get_type_once ();
		g_once_init_leave (&plank_environment_settings_type_id__once, plank_environment_settings_type_id);
	}
	return plank_environment_settings_type_id__once;
}

static void
_vala_plank_environment_settings_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	PlankEnvironmentSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PLANK_TYPE_ENVIRONMENT_SETTINGS, PlankEnvironmentSettings);
	switch (property_id) {
		case PLANK_ENVIRONMENT_SETTINGS_SHOW_NOTIFICATIONS_PROPERTY:
		g_value_set_boolean (value, plank_environment_settings_get_ShowNotifications (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_plank_environment_settings_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	PlankEnvironmentSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PLANK_TYPE_ENVIRONMENT_SETTINGS, PlankEnvironmentSettings);
	switch (property_id) {
		case PLANK_ENVIRONMENT_SETTINGS_SHOW_NOTIFICATIONS_PROPERTY:
		plank_environment_settings_set_ShowNotifications (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gboolean
plank_desktop_nofications_get_ShowNotifications (PlankDesktopNofications* self)
{
	PlankDesktopNoficationsIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PLANK_DESKTOP_NOFICATIONS_GET_INTERFACE (self);
	if (_iface_->get_ShowNotifications) {
		return _iface_->get_ShowNotifications (self);
	}
	return FALSE;
}

void
plank_desktop_nofications_set_ShowNotifications (PlankDesktopNofications* self,
                                                 gboolean value)
{
	PlankDesktopNoficationsIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PLANK_DESKTOP_NOFICATIONS_GET_INTERFACE (self);
	if (_iface_->set_ShowNotifications) {
		_iface_->set_ShowNotifications (self, value);
	}
}

static void
plank_desktop_nofications_default_init (PlankDesktopNoficationsIface * iface,
                                        gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_boolean ("ShowNotifications", "ShowNotifications", "ShowNotifications", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static GType
plank_desktop_nofications_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PlankDesktopNoficationsIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) plank_desktop_nofications_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType plank_desktop_nofications_type_id;
	plank_desktop_nofications_type_id = g_type_register_static (G_TYPE_INTERFACE, "PlankDesktopNofications", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (plank_desktop_nofications_type_id, G_TYPE_OBJECT);
	return plank_desktop_nofications_type_id;
}

GType
plank_desktop_nofications_get_type (void)
{
	static volatile gsize plank_desktop_nofications_type_id__once = 0;
	if (g_once_init_enter (&plank_desktop_nofications_type_id__once)) {
		GType plank_desktop_nofications_type_id;
		plank_desktop_nofications_type_id = plank_desktop_nofications_get_type_once ();
		g_once_init_leave (&plank_desktop_nofications_type_id__once, plank_desktop_nofications_type_id);
	}
	return plank_desktop_nofications_type_id__once;
}

static inline gpointer
plank_pantheon_desktop_notifications_get_instance_private (PlankPantheonDesktopNotifications* self)
{
	return G_STRUCT_MEMBER_P (self, PlankPantheonDesktopNotifications_private_offset);
}

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

PlankPantheonDesktopNotifications*
plank_pantheon_desktop_notifications_try_get_instance (void)
{
	PlankPantheonDesktopNotifications* _tmp0_;
	PlankPantheonDesktopNotifications* _tmp11_;
	PlankPantheonDesktopNotifications* result;
	_tmp0_ = plank_pantheon_desktop_notifications_instance;
	if (_tmp0_ == NULL) {
		GSettings* settings = NULL;
		GSettings* _tmp1_;
		gboolean _tmp2_ = FALSE;
		GSettings* _tmp3_;
		_tmp1_ = plank_try_create_settings ("org.pantheon.desktop.gala.notifications", NULL);
		settings = _tmp1_;
		_tmp3_ = settings;
		if (_tmp3_ != NULL) {
			GSettings* _tmp4_;
			gchar** _tmp5_;
			gchar** _tmp6_;
			gchar** _tmp7_;
			gint _tmp7__length1;
			_tmp4_ = settings;
			_tmp6_ = _tmp5_ = g_settings_list_keys (_tmp4_);
			_tmp7_ = _tmp6_;
			_tmp7__length1 = _vala_array_length (_tmp5_);
			_tmp2_ = _vala_string_array_contains (_tmp7_, _vala_array_length (_tmp5_), "do-not-disturb");
			_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			GSettings* _tmp8_;
			GObject* _tmp9_;
			GObject* _tmp10_;
			_tmp8_ = settings;
			_tmp9_ = g_object_new (PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, "settings", _tmp8_, "bind-flags", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_INVERT_BOOLEAN, NULL, NULL);
			_tmp10_ = G_IS_INITIALLY_UNOWNED (_tmp9_) ? g_object_ref_sink (_tmp9_) : _tmp9_;
			_g_object_unref0 (plank_pantheon_desktop_notifications_instance);
			plank_pantheon_desktop_notifications_instance = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, PlankPantheonDesktopNotifications);
		}
		_g_object_unref0 (settings);
	}
	_tmp11_ = plank_pantheon_desktop_notifications_instance;
	result = _tmp11_;
	return result;
}

PlankPantheonDesktopNotifications*
plank_pantheon_desktop_notifications_construct (GType object_type)
{
	PlankPantheonDesktopNotifications * self = NULL;
	self = (PlankPantheonDesktopNotifications*) g_object_new (object_type, NULL);
	return self;
}

PlankPantheonDesktopNotifications*
plank_pantheon_desktop_notifications_new (void)
{
	return plank_pantheon_desktop_notifications_construct (PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS);
}

static gboolean
plank_pantheon_desktop_notifications_real_get_ShowNotifications (PlankDesktopNofications* base)
{
	gboolean result;
	PlankPantheonDesktopNotifications* self;
	self = (PlankPantheonDesktopNotifications*) base;
	result = self->priv->_ShowNotifications;
	return result;
}

static void
plank_pantheon_desktop_notifications_real_set_ShowNotifications (PlankDesktopNofications* base,
                                                                 gboolean value)
{
	PlankPantheonDesktopNotifications* self;
	gboolean old_value;
	self = (PlankPantheonDesktopNotifications*) base;
	old_value = plank_pantheon_desktop_notifications_real_get_ShowNotifications (base);
	if (old_value != value) {
		self->priv->_ShowNotifications = value;
		g_object_notify_by_pspec ((GObject *) self, plank_pantheon_desktop_notifications_properties[PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY]);
	}
}

static void
plank_pantheon_desktop_notifications_class_init (PlankPantheonDesktopNotificationsClass * klass,
                                                 gpointer klass_data)
{
	plank_pantheon_desktop_notifications_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PlankPantheonDesktopNotifications_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_plank_pantheon_desktop_notifications_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_plank_pantheon_desktop_notifications_set_property;
	G_OBJECT_CLASS (klass)->finalize = plank_pantheon_desktop_notifications_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY, plank_pantheon_desktop_notifications_properties[PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY] = g_param_spec_boolean ("ShowNotifications", "do-not-disturb", "ShowNotifications", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
plank_pantheon_desktop_notifications_plank_desktop_nofications_interface_init (PlankDesktopNoficationsIface * iface,
                                                                               gpointer iface_data)
{
	plank_pantheon_desktop_notifications_plank_desktop_nofications_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_ShowNotifications = plank_pantheon_desktop_notifications_real_get_ShowNotifications;
	iface->set_ShowNotifications = plank_pantheon_desktop_notifications_real_set_ShowNotifications;
}

static void
plank_pantheon_desktop_notifications_instance_init (PlankPantheonDesktopNotifications * self,
                                                    gpointer klass)
{
	self->priv = plank_pantheon_desktop_notifications_get_instance_private (self);
}

static void
plank_pantheon_desktop_notifications_finalize (GObject * obj)
{
	PlankPantheonDesktopNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, PlankPantheonDesktopNotifications);
	G_OBJECT_CLASS (plank_pantheon_desktop_notifications_parent_class)->finalize (obj);
}

static GType
plank_pantheon_desktop_notifications_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PlankPantheonDesktopNotificationsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) plank_pantheon_desktop_notifications_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlankPantheonDesktopNotifications), 0, (GInstanceInitFunc) plank_pantheon_desktop_notifications_instance_init, NULL };
	static const GInterfaceInfo plank_desktop_nofications_info = { (GInterfaceInitFunc) plank_pantheon_desktop_notifications_plank_desktop_nofications_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType plank_pantheon_desktop_notifications_type_id;
	plank_pantheon_desktop_notifications_type_id = g_type_register_static (PLANK_TYPE_SETTINGS, "PlankPantheonDesktopNotifications", &g_define_type_info, 0);
	g_type_add_interface_static (plank_pantheon_desktop_notifications_type_id, PLANK_TYPE_DESKTOP_NOFICATIONS, &plank_desktop_nofications_info);
	PlankPantheonDesktopNotifications_private_offset = g_type_add_instance_private (plank_pantheon_desktop_notifications_type_id, sizeof (PlankPantheonDesktopNotificationsPrivate));
	return plank_pantheon_desktop_notifications_type_id;
}

GType
plank_pantheon_desktop_notifications_get_type (void)
{
	static volatile gsize plank_pantheon_desktop_notifications_type_id__once = 0;
	if (g_once_init_enter (&plank_pantheon_desktop_notifications_type_id__once)) {
		GType plank_pantheon_desktop_notifications_type_id;
		plank_pantheon_desktop_notifications_type_id = plank_pantheon_desktop_notifications_get_type_once ();
		g_once_init_leave (&plank_pantheon_desktop_notifications_type_id__once, plank_pantheon_desktop_notifications_type_id);
	}
	return plank_pantheon_desktop_notifications_type_id__once;
}

static void
_vala_plank_pantheon_desktop_notifications_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	PlankPantheonDesktopNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, PlankPantheonDesktopNotifications);
	switch (property_id) {
		case PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY:
		g_value_set_boolean (value, plank_desktop_nofications_get_ShowNotifications ((PlankDesktopNofications*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_plank_pantheon_desktop_notifications_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	PlankPantheonDesktopNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PLANK_TYPE_PANTHEON_DESKTOP_NOTIFICATIONS, PlankPantheonDesktopNotifications);
	switch (property_id) {
		case PLANK_PANTHEON_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY:
		plank_desktop_nofications_set_ShowNotifications ((PlankDesktopNofications*) self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
plank_gnome_desktop_notifications_get_instance_private (PlankGnomeDesktopNotifications* self)
{
	return G_STRUCT_MEMBER_P (self, PlankGnomeDesktopNotifications_private_offset);
}

PlankGnomeDesktopNotifications*
plank_gnome_desktop_notifications_try_get_instance (void)
{
	PlankGnomeDesktopNotifications* _tmp0_;
	PlankGnomeDesktopNotifications* _tmp11_;
	PlankGnomeDesktopNotifications* result;
	_tmp0_ = plank_gnome_desktop_notifications_instance;
	if (_tmp0_ == NULL) {
		GSettings* settings = NULL;
		GSettings* _tmp1_;
		gboolean _tmp2_ = FALSE;
		GSettings* _tmp3_;
		_tmp1_ = plank_try_create_settings ("org.gnome.desktop.notifications", NULL);
		settings = _tmp1_;
		_tmp3_ = settings;
		if (_tmp3_ != NULL) {
			GSettings* _tmp4_;
			gchar** _tmp5_;
			gchar** _tmp6_;
			gchar** _tmp7_;
			gint _tmp7__length1;
			_tmp4_ = settings;
			_tmp6_ = _tmp5_ = g_settings_list_keys (_tmp4_);
			_tmp7_ = _tmp6_;
			_tmp7__length1 = _vala_array_length (_tmp5_);
			_tmp2_ = _vala_string_array_contains (_tmp7_, _vala_array_length (_tmp5_), "show-banners");
			_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			GSettings* _tmp8_;
			GObject* _tmp9_;
			GObject* _tmp10_;
			_tmp8_ = settings;
			_tmp9_ = g_object_new (PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, "settings", _tmp8_, "bind-flags", G_SETTINGS_BIND_GET, NULL, NULL);
			_tmp10_ = G_IS_INITIALLY_UNOWNED (_tmp9_) ? g_object_ref_sink (_tmp9_) : _tmp9_;
			_g_object_unref0 (plank_gnome_desktop_notifications_instance);
			plank_gnome_desktop_notifications_instance = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, PlankGnomeDesktopNotifications);
		}
		_g_object_unref0 (settings);
	}
	_tmp11_ = plank_gnome_desktop_notifications_instance;
	result = _tmp11_;
	return result;
}

PlankGnomeDesktopNotifications*
plank_gnome_desktop_notifications_construct (GType object_type)
{
	PlankGnomeDesktopNotifications * self = NULL;
	self = (PlankGnomeDesktopNotifications*) g_object_new (object_type, NULL);
	return self;
}

PlankGnomeDesktopNotifications*
plank_gnome_desktop_notifications_new (void)
{
	return plank_gnome_desktop_notifications_construct (PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS);
}

static gboolean
plank_gnome_desktop_notifications_real_get_ShowNotifications (PlankDesktopNofications* base)
{
	gboolean result;
	PlankGnomeDesktopNotifications* self;
	self = (PlankGnomeDesktopNotifications*) base;
	result = self->priv->_ShowNotifications;
	return result;
}

static void
plank_gnome_desktop_notifications_real_set_ShowNotifications (PlankDesktopNofications* base,
                                                              gboolean value)
{
	PlankGnomeDesktopNotifications* self;
	gboolean old_value;
	self = (PlankGnomeDesktopNotifications*) base;
	old_value = plank_gnome_desktop_notifications_real_get_ShowNotifications (base);
	if (old_value != value) {
		self->priv->_ShowNotifications = value;
		g_object_notify_by_pspec ((GObject *) self, plank_gnome_desktop_notifications_properties[PLANK_GNOME_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY]);
	}
}

static void
plank_gnome_desktop_notifications_class_init (PlankGnomeDesktopNotificationsClass * klass,
                                              gpointer klass_data)
{
	plank_gnome_desktop_notifications_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PlankGnomeDesktopNotifications_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_plank_gnome_desktop_notifications_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_plank_gnome_desktop_notifications_set_property;
	G_OBJECT_CLASS (klass)->finalize = plank_gnome_desktop_notifications_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PLANK_GNOME_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY, plank_gnome_desktop_notifications_properties[PLANK_GNOME_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY] = g_param_spec_boolean ("ShowNotifications", "show-banners", "ShowNotifications", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
plank_gnome_desktop_notifications_plank_desktop_nofications_interface_init (PlankDesktopNoficationsIface * iface,
                                                                            gpointer iface_data)
{
	plank_gnome_desktop_notifications_plank_desktop_nofications_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_ShowNotifications = plank_gnome_desktop_notifications_real_get_ShowNotifications;
	iface->set_ShowNotifications = plank_gnome_desktop_notifications_real_set_ShowNotifications;
}

static void
plank_gnome_desktop_notifications_instance_init (PlankGnomeDesktopNotifications * self,
                                                 gpointer klass)
{
	self->priv = plank_gnome_desktop_notifications_get_instance_private (self);
}

static void
plank_gnome_desktop_notifications_finalize (GObject * obj)
{
	PlankGnomeDesktopNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, PlankGnomeDesktopNotifications);
	G_OBJECT_CLASS (plank_gnome_desktop_notifications_parent_class)->finalize (obj);
}

static GType
plank_gnome_desktop_notifications_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PlankGnomeDesktopNotificationsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) plank_gnome_desktop_notifications_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlankGnomeDesktopNotifications), 0, (GInstanceInitFunc) plank_gnome_desktop_notifications_instance_init, NULL };
	static const GInterfaceInfo plank_desktop_nofications_info = { (GInterfaceInitFunc) plank_gnome_desktop_notifications_plank_desktop_nofications_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType plank_gnome_desktop_notifications_type_id;
	plank_gnome_desktop_notifications_type_id = g_type_register_static (PLANK_TYPE_SETTINGS, "PlankGnomeDesktopNotifications", &g_define_type_info, 0);
	g_type_add_interface_static (plank_gnome_desktop_notifications_type_id, PLANK_TYPE_DESKTOP_NOFICATIONS, &plank_desktop_nofications_info);
	PlankGnomeDesktopNotifications_private_offset = g_type_add_instance_private (plank_gnome_desktop_notifications_type_id, sizeof (PlankGnomeDesktopNotificationsPrivate));
	return plank_gnome_desktop_notifications_type_id;
}

GType
plank_gnome_desktop_notifications_get_type (void)
{
	static volatile gsize plank_gnome_desktop_notifications_type_id__once = 0;
	if (g_once_init_enter (&plank_gnome_desktop_notifications_type_id__once)) {
		GType plank_gnome_desktop_notifications_type_id;
		plank_gnome_desktop_notifications_type_id = plank_gnome_desktop_notifications_get_type_once ();
		g_once_init_leave (&plank_gnome_desktop_notifications_type_id__once, plank_gnome_desktop_notifications_type_id);
	}
	return plank_gnome_desktop_notifications_type_id__once;
}

static void
_vala_plank_gnome_desktop_notifications_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec)
{
	PlankGnomeDesktopNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, PlankGnomeDesktopNotifications);
	switch (property_id) {
		case PLANK_GNOME_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY:
		g_value_set_boolean (value, plank_desktop_nofications_get_ShowNotifications ((PlankDesktopNofications*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_plank_gnome_desktop_notifications_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec)
{
	PlankGnomeDesktopNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PLANK_TYPE_GNOME_DESKTOP_NOTIFICATIONS, PlankGnomeDesktopNotifications);
	switch (property_id) {
		case PLANK_GNOME_DESKTOP_NOTIFICATIONS_SHOW_NOTIFICATIONS_PROPERTY:
		plank_desktop_nofications_set_ShowNotifications ((PlankDesktopNofications*) self, g_value_get_boolean (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 gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

