/* LabelPicker.c generated by valac 0.56.19, the Vala compiler
 * generated from LabelPicker.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 <adwaita.h>
#include <glib-object.h>
#include "planify.h"
#include <gee.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DIALOGS_TYPE_LABEL_PICKER (dialogs_label_picker_get_type ())
#define DIALOGS_LABEL_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_TYPE_LABEL_PICKER, DialogsLabelPicker))
#define DIALOGS_LABEL_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_TYPE_LABEL_PICKER, DialogsLabelPickerClass))
#define DIALOGS_IS_LABEL_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_TYPE_LABEL_PICKER))
#define DIALOGS_IS_LABEL_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_TYPE_LABEL_PICKER))
#define DIALOGS_LABEL_PICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_TYPE_LABEL_PICKER, DialogsLabelPickerClass))

typedef struct _DialogsLabelPicker DialogsLabelPicker;
typedef struct _DialogsLabelPickerClass DialogsLabelPickerClass;
typedef struct _DialogsLabelPickerPrivate DialogsLabelPickerPrivate;
enum  {
	DIALOGS_LABEL_PICKER_0_PROPERTY,
	DIALOGS_LABEL_PICKER_PICKER_TYPE_PROPERTY,
	DIALOGS_LABEL_PICKER_LABELS_PROPERTY,
	DIALOGS_LABEL_PICKER_BUTTON_TEXT_PROPERTY,
	DIALOGS_LABEL_PICKER_NUM_PROPERTIES
};
static GParamSpec* dialogs_label_picker_properties[DIALOGS_LABEL_PICKER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	DIALOGS_LABEL_PICKER_LABELS_CHANGED_SIGNAL,
	DIALOGS_LABEL_PICKER_NUM_SIGNALS
};
static guint dialogs_label_picker_signals[DIALOGS_LABEL_PICKER_NUM_SIGNALS] = {0};

struct _DialogsLabelPicker {
	AdwDialog parent_instance;
	DialogsLabelPickerPrivate * priv;
};

struct _DialogsLabelPickerClass {
	AdwDialogClass parent_class;
};

struct _DialogsLabelPickerPrivate {
	LabelPickerType _picker_type;
	WidgetsLabelsPickerCore* labels_picker_core;
	WidgetsLoadingButton* button;
	GeeHashMap* signal_map;
};

static gint DialogsLabelPicker_private_offset;
static gpointer dialogs_label_picker_parent_class = NULL;

VALA_EXTERN GType dialogs_label_picker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsLabelPicker, g_object_unref)
VALA_EXTERN DialogsLabelPicker* dialogs_label_picker_new (LabelPickerType picker_type);
VALA_EXTERN DialogsLabelPicker* dialogs_label_picker_construct (GType object_type,
                                                    LabelPickerType picker_type);
VALA_EXTERN void dialogs_label_picker_add_labels (DialogsLabelPicker* self,
                                      ObjectsSource* source);
VALA_EXTERN void dialogs_label_picker_add_labels_list (DialogsLabelPicker* self,
                                           GeeArrayList* labels_list);
VALA_EXTERN void dialogs_label_picker_clean_up (DialogsLabelPicker* self);
VALA_EXTERN LabelPickerType dialogs_label_picker_get_picker_type (DialogsLabelPicker* self);
static void dialogs_label_picker_set_picker_type (DialogsLabelPicker* self,
                                           LabelPickerType value);
VALA_EXTERN void dialogs_label_picker_set_labels (DialogsLabelPicker* self,
                                      GeeArrayList* value);
VALA_EXTERN void dialogs_label_picker_set_button_text (DialogsLabelPicker* self,
                                           const gchar* value);
static GObject * dialogs_label_picker_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static void _dialogs_label_picker___lambda61_ (DialogsLabelPicker* self);
static void __dialogs_label_picker___lambda61__gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self);
static void _dialogs_label_picker___lambda62_ (DialogsLabelPicker* self);
static void __dialogs_label_picker___lambda62__widgets_labels_picker_core_close (WidgetsLabelsPickerCore* _sender,
                                                                          gpointer self);
static void _dialogs_label_picker___lambda63_ (DialogsLabelPicker* self);
static void __dialogs_label_picker___lambda63__adw_dialog_closed (AdwDialog* _sender,
                                                           gpointer self);
static void dialogs_label_picker_finalize (GObject * obj);
static GType dialogs_label_picker_get_type_once (void);
static void _vala_dialogs_label_picker_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_dialogs_label_picker_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
dialogs_label_picker_get_instance_private (DialogsLabelPicker* self)
{
	return G_STRUCT_MEMBER_P (self, DialogsLabelPicker_private_offset);
}

DialogsLabelPicker*
dialogs_label_picker_construct (GType object_type,
                                LabelPickerType picker_type)
{
	DialogsLabelPicker * self = NULL;
	self = (DialogsLabelPicker*) g_object_new (object_type, "picker-type", picker_type, "title", _ ("Labels"), "content-width", 320, "content-height", 450, NULL);
	return self;
}

DialogsLabelPicker*
dialogs_label_picker_new (LabelPickerType picker_type)
{
	return dialogs_label_picker_construct (DIALOGS_TYPE_LABEL_PICKER, picker_type);
}

void
dialogs_label_picker_add_labels (DialogsLabelPicker* self,
                                 ObjectsSource* source)
{
	WidgetsLabelsPickerCore* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	_tmp0_ = self->priv->labels_picker_core;
	widgets_labels_picker_core_set_source (_tmp0_, source);
}

void
dialogs_label_picker_add_labels_list (DialogsLabelPicker* self,
                                      GeeArrayList* labels_list)
{
	WidgetsLabelsPickerCore* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (labels_list != NULL);
	_tmp0_ = self->priv->labels_picker_core;
	widgets_labels_picker_core_add_labels_list (_tmp0_, labels_list);
}

void
dialogs_label_picker_clean_up (DialogsLabelPicker* self)
{
	GeeHashMap* _tmp15_;
	WidgetsLabelsPickerCore* _tmp16_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->signal_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) _tmp11_, (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->priv->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
	_tmp16_ = self->priv->labels_picker_core;
	if (_tmp16_ != NULL) {
		WidgetsLabelsPickerCore* _tmp17_;
		_tmp17_ = self->priv->labels_picker_core;
		widgets_labels_picker_core_clean_up (_tmp17_);
	}
}

LabelPickerType
dialogs_label_picker_get_picker_type (DialogsLabelPicker* self)
{
	LabelPickerType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_picker_type;
	return result;
}

static void
dialogs_label_picker_set_picker_type (DialogsLabelPicker* self,
                                      LabelPickerType value)
{
	LabelPickerType old_value;
	g_return_if_fail (self != NULL);
	old_value = dialogs_label_picker_get_picker_type (self);
	if (old_value != value) {
		self->priv->_picker_type = value;
		g_object_notify_by_pspec ((GObject *) self, dialogs_label_picker_properties[DIALOGS_LABEL_PICKER_PICKER_TYPE_PROPERTY]);
	}
}

void
dialogs_label_picker_set_labels (DialogsLabelPicker* self,
                                 GeeArrayList* value)
{
	WidgetsLabelsPickerCore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->labels_picker_core;
	widgets_labels_picker_core_set_labels (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, dialogs_label_picker_properties[DIALOGS_LABEL_PICKER_LABELS_PROPERTY]);
}

void
dialogs_label_picker_set_button_text (DialogsLabelPicker* self,
                                      const gchar* value)
{
	WidgetsLoadingButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->button;
	gtk_button_set_label ((GtkButton*) _tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, dialogs_label_picker_properties[DIALOGS_LABEL_PICKER_BUTTON_TEXT_PROPERTY]);
}

static void
_dialogs_label_picker___lambda61_ (DialogsLabelPicker* self)
{
	WidgetsLabelsPickerCore* _tmp0_;
	GeeHashMap* _tmp1_;
	_tmp0_ = self->priv->labels_picker_core;
	_tmp1_ = _tmp0_->picked;
	g_signal_emit (self, dialogs_label_picker_signals[DIALOGS_LABEL_PICKER_LABELS_CHANGED_SIGNAL], 0, _tmp1_);
	adw_dialog_close ((AdwDialog*) self);
}

static void
__dialogs_label_picker___lambda61__gtk_button_clicked (GtkButton* _sender,
                                                       gpointer self)
{
	_dialogs_label_picker___lambda61_ ((DialogsLabelPicker*) self);
}

static void
_dialogs_label_picker___lambda62_ (DialogsLabelPicker* self)
{
	WidgetsLabelsPickerCore* _tmp0_;
	GeeHashMap* _tmp1_;
	_tmp0_ = self->priv->labels_picker_core;
	_tmp1_ = _tmp0_->picked;
	g_signal_emit (self, dialogs_label_picker_signals[DIALOGS_LABEL_PICKER_LABELS_CHANGED_SIGNAL], 0, _tmp1_);
	adw_dialog_close ((AdwDialog*) self);
}

static void
__dialogs_label_picker___lambda62__widgets_labels_picker_core_close (WidgetsLabelsPickerCore* _sender,
                                                                     gpointer self)
{
	_dialogs_label_picker___lambda62_ ((DialogsLabelPicker*) self);
}

static void
_dialogs_label_picker___lambda63_ (DialogsLabelPicker* self)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	dialogs_label_picker_clean_up (self);
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name (_tmp1_, "connect-typing-accel");
	_g_object_unref0 (_tmp1_);
}

static void
__dialogs_label_picker___lambda63__adw_dialog_closed (AdwDialog* _sender,
                                                      gpointer self)
{
	_dialogs_label_picker___lambda63_ ((DialogsLabelPicker*) self);
}

static GObject *
dialogs_label_picker_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DialogsLabelPicker * self;
	AdwHeaderBar* headerbar = NULL;
	AdwHeaderBar* _tmp0_;
	AdwHeaderBar* _tmp1_;
	LabelPickerType _tmp2_;
	WidgetsLabelsPickerCore* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	WidgetsLoadingButton* _tmp6_ = NULL;
	AdwToolbarView* toolbar_view = NULL;
	AdwToolbarView* _tmp7_;
	AdwToolbarView* _tmp8_;
	AdwHeaderBar* _tmp9_;
	AdwToolbarView* _tmp10_;
	WidgetsLoadingButton* _tmp11_;
	AdwToolbarView* _tmp12_;
	WidgetsLabelsPickerCore* _tmp13_;
	AdwToolbarView* _tmp14_;
	ServicesEventBus* _tmp15_;
	ServicesEventBus* _tmp16_;
	GeeHashMap* _tmp17_;
	WidgetsLoadingButton* _tmp18_;
	gulong _tmp19_;
	WidgetsLoadingButton* _tmp20_;
	GeeHashMap* _tmp21_;
	WidgetsLabelsPickerCore* _tmp22_;
	gulong _tmp23_;
	WidgetsLabelsPickerCore* _tmp24_;
	parent_class = G_OBJECT_CLASS (dialogs_label_picker_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_TYPE_LABEL_PICKER, DialogsLabelPicker);
	_tmp0_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp0_);
	headerbar = _tmp0_;
	_tmp1_ = headerbar;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "flat");
	_tmp2_ = self->priv->_picker_type;
	_tmp3_ = widgets_labels_picker_core_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->labels_picker_core);
	self->priv->labels_picker_core = _tmp3_;
	_tmp4_ = g_strdup ("suggested-action");
	_tmp5_ = g_new0 (gchar*, 1 + 1);
	_tmp5_[0] = _tmp4_;
	_tmp6_ = widgets_loading_button_new (LOADING_BUTTON_TYPE_LABEL, _ ("Filter"));
	gtk_widget_set_margin_top ((GtkWidget*) _tmp6_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp6_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp6_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp6_, 12);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->button);
	self->priv->button = _tmp6_;
	_tmp7_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp7_);
	toolbar_view = _tmp7_;
	_tmp8_ = toolbar_view;
	_tmp9_ = headerbar;
	adw_toolbar_view_add_top_bar (_tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = toolbar_view;
	_tmp11_ = self->priv->button;
	adw_toolbar_view_add_bottom_bar (_tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = toolbar_view;
	_tmp13_ = self->priv->labels_picker_core;
	adw_toolbar_view_set_content (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = toolbar_view;
	adw_dialog_set_child ((AdwDialog*) self, (GtkWidget*) _tmp14_);
	_tmp15_ = services_event_bus_get_default ();
	_tmp16_ = _tmp15_;
	g_signal_emit_by_name (_tmp16_, "disconnect-typing-accel");
	_g_object_unref0 (_tmp16_);
	_tmp17_ = self->priv->signal_map;
	_tmp18_ = self->priv->button;
	_tmp19_ = g_signal_connect_object ((GtkButton*) _tmp18_, "clicked", (GCallback) __dialogs_label_picker___lambda61__gtk_button_clicked, self, 0);
	_tmp20_ = self->priv->button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, (gpointer) ((guintptr) _tmp19_), (GObject*) _tmp20_);
	_tmp21_ = self->priv->signal_map;
	_tmp22_ = self->priv->labels_picker_core;
	_tmp23_ = g_signal_connect_object (_tmp22_, "close", (GCallback) __dialogs_label_picker___lambda62__widgets_labels_picker_core_close, self, 0);
	_tmp24_ = self->priv->labels_picker_core;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp21_, (gpointer) ((guintptr) _tmp23_), (GObject*) _tmp24_);
	g_signal_connect_object ((AdwDialog*) self, "closed", (GCallback) __dialogs_label_picker___lambda63__adw_dialog_closed, self, 0);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (headerbar);
	return obj;
}

static void
dialogs_label_picker_class_init (DialogsLabelPickerClass * klass,
                                 gpointer klass_data)
{
	dialogs_label_picker_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DialogsLabelPicker_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dialogs_label_picker_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dialogs_label_picker_set_property;
	G_OBJECT_CLASS (klass)->constructor = dialogs_label_picker_constructor;
	G_OBJECT_CLASS (klass)->finalize = dialogs_label_picker_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DIALOGS_LABEL_PICKER_PICKER_TYPE_PROPERTY, dialogs_label_picker_properties[DIALOGS_LABEL_PICKER_PICKER_TYPE_PROPERTY] = g_param_spec_enum ("picker-type", "picker-type", "picker-type", TYPE_LABEL_PICKER_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DIALOGS_LABEL_PICKER_LABELS_PROPERTY, dialogs_label_picker_properties[DIALOGS_LABEL_PICKER_LABELS_PROPERTY] = g_param_spec_object ("labels", "labels", "labels", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DIALOGS_LABEL_PICKER_BUTTON_TEXT_PROPERTY, dialogs_label_picker_properties[DIALOGS_LABEL_PICKER_BUTTON_TEXT_PROPERTY] = g_param_spec_string ("button-text", "button-text", "button-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	dialogs_label_picker_signals[DIALOGS_LABEL_PICKER_LABELS_CHANGED_SIGNAL] = g_signal_new ("labels-changed", DIALOGS_TYPE_LABEL_PICKER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GEE_TYPE_HASH_MAP);
}

static void
dialogs_label_picker_instance_init (DialogsLabelPicker * self,
                                    gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = dialogs_label_picker_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signal_map = _tmp0_;
}

static void
dialogs_label_picker_finalize (GObject * obj)
{
	DialogsLabelPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_TYPE_LABEL_PICKER, DialogsLabelPicker);
	g_debug ("LabelPicker.vala:53: Destroying - Dialogs.LabelPicker\n");
	_g_object_unref0 (self->priv->labels_picker_core);
	_g_object_unref0 (self->priv->button);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (dialogs_label_picker_parent_class)->finalize (obj);
}

static GType
dialogs_label_picker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DialogsLabelPickerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dialogs_label_picker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DialogsLabelPicker), 0, (GInstanceInitFunc) dialogs_label_picker_instance_init, NULL };
	GType dialogs_label_picker_type_id;
	dialogs_label_picker_type_id = g_type_register_static (adw_dialog_get_type (), "DialogsLabelPicker", &g_define_type_info, 0);
	DialogsLabelPicker_private_offset = g_type_add_instance_private (dialogs_label_picker_type_id, sizeof (DialogsLabelPickerPrivate));
	return dialogs_label_picker_type_id;
}

GType
dialogs_label_picker_get_type (void)
{
	static volatile gsize dialogs_label_picker_type_id__once = 0;
	if (g_once_init_enter (&dialogs_label_picker_type_id__once)) {
		GType dialogs_label_picker_type_id;
		dialogs_label_picker_type_id = dialogs_label_picker_get_type_once ();
		g_once_init_leave (&dialogs_label_picker_type_id__once, dialogs_label_picker_type_id);
	}
	return dialogs_label_picker_type_id__once;
}

static void
_vala_dialogs_label_picker_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	DialogsLabelPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DIALOGS_TYPE_LABEL_PICKER, DialogsLabelPicker);
	switch (property_id) {
		case DIALOGS_LABEL_PICKER_PICKER_TYPE_PROPERTY:
		g_value_set_enum (value, dialogs_label_picker_get_picker_type (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dialogs_label_picker_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	DialogsLabelPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DIALOGS_TYPE_LABEL_PICKER, DialogsLabelPicker);
	switch (property_id) {
		case DIALOGS_LABEL_PICKER_PICKER_TYPE_PROPERTY:
		dialogs_label_picker_set_picker_type (self, g_value_get_enum (value));
		break;
		case DIALOGS_LABEL_PICKER_LABELS_PROPERTY:
		dialogs_label_picker_set_labels (self, g_value_get_object (value));
		break;
		case DIALOGS_LABEL_PICKER_BUTTON_TEXT_PROPERTY:
		dialogs_label_picker_set_button_text (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);
}

