/* gitg-ext-user-query.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-ext-user-query.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2014 - Jesse van den Kieboom
 *
 * gitg is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gitg 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 gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include "libgitg-ext.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <stdarg.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  {
	GITG_EXT_USER_QUERY_RESPONSE_0_PROPERTY,
	GITG_EXT_USER_QUERY_RESPONSE_NUM_PROPERTIES
};
static GParamSpec* gitg_ext_user_query_response_properties[GITG_EXT_USER_QUERY_RESPONSE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	GITG_EXT_USER_QUERY_0_PROPERTY,
	GITG_EXT_USER_QUERY_TITLE_PROPERTY,
	GITG_EXT_USER_QUERY_MESSAGE_PROPERTY,
	GITG_EXT_USER_QUERY_MESSAGE_TYPE_PROPERTY,
	GITG_EXT_USER_QUERY_DEFAULT_RESPONSE_PROPERTY,
	GITG_EXT_USER_QUERY_DEFAULT_IS_DESTRUCTIVE_PROPERTY,
	GITG_EXT_USER_QUERY_MESSAGE_USE_MARKUP_PROPERTY,
	GITG_EXT_USER_QUERY_NUM_PROPERTIES
};
static GParamSpec* gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_NUM_PROPERTIES];
enum  {
	GITG_EXT_USER_QUERY_QUIT_SIGNAL,
	GITG_EXT_USER_QUERY_RESPONSE_SIGNAL,
	GITG_EXT_USER_QUERY_NUM_SIGNALS
};
static guint gitg_ext_user_query_signals[GITG_EXT_USER_QUERY_NUM_SIGNALS] = {0};

struct _GitgExtUserQueryPrivate {
	gchar* _title;
	gchar* _message;
	GtkMessageType _message_type;
	GtkResponseType _default_response;
	gboolean _default_is_destructive;
	gboolean _message_use_markup;
};

static gpointer gitg_ext_user_query_response_parent_class = NULL;
static gint GitgExtUserQuery_private_offset;
static gpointer gitg_ext_user_query_parent_class = NULL;

static void gitg_ext_user_query_response_finalize (GObject * obj);
static GType gitg_ext_user_query_response_get_type_once (void);
static GitgExtUserQueryResponse** _vala_array_dup2 (GitgExtUserQueryResponse** self,
                                             gssize length);
static GitgExtUserQueryResponse** _vala_array_dup3 (GitgExtUserQueryResponse** self,
                                             gssize length);
static void _vala_array_add1 (GitgExtUserQueryResponse** * array,
                       gint* length,
                       gint* size,
                       GitgExtUserQueryResponse* value);
static void g_cclosure_user_marshal_BOOLEAN__ENUM (GClosure * closure,
                                            GValue * return_value,
                                            guint n_param_values,
                                            const GValue * param_values,
                                            gpointer invocation_hint,
                                            gpointer marshal_data);
static void gitg_ext_user_query_finalize (GObject * obj);
static GType gitg_ext_user_query_get_type_once (void);
static void _vala_gitg_ext_user_query_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_gitg_ext_user_query_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);

GitgExtUserQueryResponse*
gitg_ext_user_query_response_construct (GType object_type,
                                        const gchar* text,
                                        GtkResponseType response_type)
{
	GitgExtUserQueryResponse * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (text != NULL, NULL);
	self = (GitgExtUserQueryResponse*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (text);
	_g_free0 (self->text);
	self->text = _tmp0_;
	self->response_type = response_type;
	return self;
}

GitgExtUserQueryResponse*
gitg_ext_user_query_response_new (const gchar* text,
                                  GtkResponseType response_type)
{
	return gitg_ext_user_query_response_construct (GITG_EXT_TYPE_USER_QUERY_RESPONSE, text, response_type);
}

static void
gitg_ext_user_query_response_class_init (GitgExtUserQueryResponseClass * klass,
                                         gpointer klass_data)
{
	gitg_ext_user_query_response_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = gitg_ext_user_query_response_finalize;
}

static void
gitg_ext_user_query_response_instance_init (GitgExtUserQueryResponse * self,
                                            gpointer klass)
{
}

static void
gitg_ext_user_query_response_finalize (GObject * obj)
{
	GitgExtUserQueryResponse * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_EXT_TYPE_USER_QUERY_RESPONSE, GitgExtUserQueryResponse);
	_g_free0 (self->text);
	G_OBJECT_CLASS (gitg_ext_user_query_response_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_ext_user_query_response_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgExtUserQueryResponseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_ext_user_query_response_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgExtUserQueryResponse), 0, (GInstanceInitFunc) gitg_ext_user_query_response_instance_init, NULL };
	GType gitg_ext_user_query_response_type_id;
	gitg_ext_user_query_response_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgExtUserQueryResponse", &g_define_type_info, 0);
	return gitg_ext_user_query_response_type_id;
}

GType
gitg_ext_user_query_response_get_type (void)
{
	static gsize gitg_ext_user_query_response_type_id__once = 0;
	if (g_once_init_enter (&gitg_ext_user_query_response_type_id__once)) {
		GType gitg_ext_user_query_response_type_id;
		gitg_ext_user_query_response_type_id = gitg_ext_user_query_response_get_type_once ();
		g_once_init_leave (&gitg_ext_user_query_response_type_id__once, gitg_ext_user_query_response_type_id);
	}
	return gitg_ext_user_query_response_type_id__once;
}

static inline gpointer
gitg_ext_user_query_get_instance_private (GitgExtUserQuery* self)
{
	return G_STRUCT_MEMBER_P (self, GitgExtUserQuery_private_offset);
}

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

static GitgExtUserQueryResponse**
_vala_array_dup2 (GitgExtUserQueryResponse** self,
                  gssize length)
{
	if (length >= 0) {
		GitgExtUserQueryResponse** result;
		gssize i;
		result = g_new0 (GitgExtUserQueryResponse*, length + 1);
		for (i = 0; i < length; i++) {
			GitgExtUserQueryResponse* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

GitgExtUserQueryResponse**
gitg_ext_user_query_get_responses (GitgExtUserQuery* self,
                                   gint* result_length1)
{
	GitgExtUserQueryResponse** _tmp0_;
	gint _tmp0__length1;
	GitgExtUserQueryResponse** _tmp1_;
	gint _tmp1__length1;
	GitgExtUserQueryResponse** _tmp2_;
	gint _tmp2__length1;
	GitgExtUserQueryResponse** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_responses;
	_tmp0__length1 = self->_responses_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup2 (_tmp0_, _tmp0__length1) : _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static GitgExtUserQueryResponse**
_vala_array_dup3 (GitgExtUserQueryResponse** self,
                  gssize length)
{
	if (length >= 0) {
		GitgExtUserQueryResponse** result;
		gssize i;
		result = g_new0 (GitgExtUserQueryResponse*, length + 1);
		for (i = 0; i < length; i++) {
			GitgExtUserQueryResponse* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

void
gitg_ext_user_query_set_responses (GitgExtUserQuery* self,
                                   GitgExtUserQueryResponse** value,
                                   gint value_length1)
{
	GitgExtUserQueryResponse** _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = (value != NULL) ? _vala_array_dup3 (value, value_length1) : value;
	_tmp0__length1 = value_length1;
	self->_responses = (_vala_array_free (self->_responses, self->_responses_length1, (GDestroyNotify) g_object_unref), NULL);
	self->_responses = _tmp0_;
	self->_responses_length1 = _tmp0__length1;
}

static void
_vala_array_add1 (GitgExtUserQueryResponse** * array,
                  gint* length,
                  gint* size,
                  GitgExtUserQueryResponse* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GitgExtUserQueryResponse*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

GitgExtUserQuery*
gitg_ext_user_query_constructv_full (GType object_type,
                                     const gchar* title,
                                     const gchar* message,
                                     GtkMessageType message_type,
                                     va_list _vala_va_list)
{
	GitgExtUserQuery * self = NULL;
	va_list l = {0};
	GitgExtUserQueryResponse** resps = NULL;
	GitgExtUserQueryResponse** _tmp0_;
	gint resps_length1;
	gint _resps_size_;
	GitgExtUserQueryResponse** _tmp6_;
	gint _tmp6__length1;
	GitgExtUserQueryResponse** _tmp7_;
	gint _tmp7__length1;
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (message != NULL, NULL);
	self = (GitgExtUserQuery*) g_object_new (object_type, "title", title, "message", message, "message-type", message_type, NULL);
	va_copy (l, _vala_va_list);
	_tmp0_ = g_new0 (GitgExtUserQueryResponse*, 0 + 1);
	resps = _tmp0_;
	resps_length1 = 0;
	_resps_size_ = resps_length1;
	while (TRUE) {
		gchar* text = NULL;
		const gchar* _tmp1_;
		gchar* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		GitgExtUserQueryResponse* _tmp5_;
		_tmp1_ = va_arg (l, gchar*);
		_tmp2_ = g_strdup (_tmp1_);
		text = _tmp2_;
		_tmp3_ = text;
		if (_tmp3_ == NULL) {
			_g_free0 (text);
			break;
		}
		_tmp4_ = text;
		_tmp5_ = gitg_ext_user_query_response_new (_tmp4_, va_arg (l, GtkResponseType));
		_vala_array_add1 (&resps, &resps_length1, &_resps_size_, _tmp5_);
		_g_free0 (text);
	}
	_tmp6_ = resps;
	_tmp6__length1 = resps_length1;
	gitg_ext_user_query_set_responses (self, _tmp6_, (gint) _tmp6__length1);
	_tmp7_ = resps;
	_tmp7__length1 = resps_length1;
	if (_tmp7__length1 > 0) {
		GitgExtUserQueryResponse** _tmp8_;
		gint _tmp8__length1;
		GitgExtUserQueryResponse** _tmp9_;
		gint _tmp9__length1;
		GitgExtUserQueryResponse* _tmp10_;
		_tmp8_ = resps;
		_tmp8__length1 = resps_length1;
		_tmp9_ = resps;
		_tmp9__length1 = resps_length1;
		_tmp10_ = _tmp8_[_tmp9__length1 - 1];
		gitg_ext_user_query_set_default_response (self, _tmp10_->response_type);
	}
	resps = (_vala_array_free (resps, resps_length1, (GDestroyNotify) g_object_unref), NULL);
	va_end (l);
	return self;
}

GitgExtUserQuery*
gitg_ext_user_query_new_full (const gchar* title,
                              const gchar* message,
                              GtkMessageType message_type,
                              ...)
{
	va_list _vala_va_list_obj;
	va_start (_vala_va_list_obj, message_type);
	return gitg_ext_user_query_constructv_full (GITG_EXT_TYPE_USER_QUERY, title, message, message_type, _vala_va_list_obj);
}

GitgExtUserQuery*
gitg_ext_user_query_construct_full (GType object_type,
                                    const gchar* title,
                                    const gchar* message,
                                    GtkMessageType message_type,
                                    ...)
{
	va_list _vala_va_list_obj;
	va_start (_vala_va_list_obj, message_type);
	return gitg_ext_user_query_constructv_full (object_type, title, message, message_type, _vala_va_list_obj);
}

GitgExtUserQuery*
gitg_ext_user_query_construct (GType object_type)
{
	GitgExtUserQuery * self = NULL;
	self = (GitgExtUserQuery*) g_object_new (object_type, NULL);
	return self;
}

GitgExtUserQuery*
gitg_ext_user_query_new (void)
{
	return gitg_ext_user_query_construct (GITG_EXT_TYPE_USER_QUERY);
}

const gchar*
gitg_ext_user_query_get_title (GitgExtUserQuery* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

void
gitg_ext_user_query_set_title (GitgExtUserQuery* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_ext_user_query_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_TITLE_PROPERTY]);
	}
}

const gchar*
gitg_ext_user_query_get_message (GitgExtUserQuery* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_message;
	result = _tmp0_;
	return result;
}

void
gitg_ext_user_query_set_message (GitgExtUserQuery* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_ext_user_query_get_message (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_message);
		self->priv->_message = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_MESSAGE_PROPERTY]);
	}
}

GtkMessageType
gitg_ext_user_query_get_message_type (GitgExtUserQuery* self)
{
	GtkMessageType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_message_type;
	return result;
}

void
gitg_ext_user_query_set_message_type (GitgExtUserQuery* self,
                                      GtkMessageType value)
{
	GtkMessageType old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_ext_user_query_get_message_type (self);
	if (old_value != value) {
		self->priv->_message_type = value;
		g_object_notify_by_pspec ((GObject *) self, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_MESSAGE_TYPE_PROPERTY]);
	}
}

GtkResponseType
gitg_ext_user_query_get_default_response (GitgExtUserQuery* self)
{
	GtkResponseType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_default_response;
	return result;
}

void
gitg_ext_user_query_set_default_response (GitgExtUserQuery* self,
                                          GtkResponseType value)
{
	GtkResponseType old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_ext_user_query_get_default_response (self);
	if (old_value != value) {
		self->priv->_default_response = value;
		g_object_notify_by_pspec ((GObject *) self, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_DEFAULT_RESPONSE_PROPERTY]);
	}
}

gboolean
gitg_ext_user_query_get_default_is_destructive (GitgExtUserQuery* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_default_is_destructive;
	return result;
}

void
gitg_ext_user_query_set_default_is_destructive (GitgExtUserQuery* self,
                                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_ext_user_query_get_default_is_destructive (self);
	if (old_value != value) {
		self->priv->_default_is_destructive = value;
		g_object_notify_by_pspec ((GObject *) self, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_DEFAULT_IS_DESTRUCTIVE_PROPERTY]);
	}
}

gboolean
gitg_ext_user_query_get_message_use_markup (GitgExtUserQuery* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_message_use_markup;
	return result;
}

void
gitg_ext_user_query_set_message_use_markup (GitgExtUserQuery* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_ext_user_query_get_message_use_markup (self);
	if (old_value != value) {
		self->priv->_message_use_markup = value;
		g_object_notify_by_pspec ((GObject *) self, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_MESSAGE_USE_MARKUP_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_BOOLEAN__ENUM (GClosure * closure,
                                       GValue * return_value,
                                       guint n_param_values,
                                       const GValue * param_values,
                                       gpointer invocation_hint,
                                       gpointer marshal_data)
{
	typedef gboolean (*GMarshalFunc_BOOLEAN__ENUM) (gpointer data1, gint arg_1, gpointer data2);
	register GMarshalFunc_BOOLEAN__ENUM callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	gboolean v_return;
	cc = (GCClosure *) closure;
	g_return_if_fail (return_value != NULL);
	g_return_if_fail (n_param_values == 2);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_BOOLEAN__ENUM) (marshal_data ? marshal_data : cc->callback);
	v_return = callback (data1, g_value_get_enum (param_values + 1), data2);
	g_value_set_boolean (return_value, v_return);
}

static void
gitg_ext_user_query_class_init (GitgExtUserQueryClass * klass,
                                gpointer klass_data)
{
	gitg_ext_user_query_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgExtUserQuery_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_ext_user_query_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_ext_user_query_set_property;
	G_OBJECT_CLASS (klass)->finalize = gitg_ext_user_query_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_EXT_USER_QUERY_TITLE_PROPERTY, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_EXT_USER_QUERY_MESSAGE_PROPERTY, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_MESSAGE_PROPERTY] = g_param_spec_string ("message", "message", "message", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_EXT_USER_QUERY_MESSAGE_TYPE_PROPERTY, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_MESSAGE_TYPE_PROPERTY] = g_param_spec_enum ("message-type", "message-type", "message-type", gtk_message_type_get_type (), 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_EXT_USER_QUERY_DEFAULT_RESPONSE_PROPERTY, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_DEFAULT_RESPONSE_PROPERTY] = g_param_spec_enum ("default-response", "default-response", "default-response", gtk_response_type_get_type (), GTK_RESPONSE_CLOSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_EXT_USER_QUERY_DEFAULT_IS_DESTRUCTIVE_PROPERTY, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_DEFAULT_IS_DESTRUCTIVE_PROPERTY] = g_param_spec_boolean ("default-is-destructive", "default-is-destructive", "default-is-destructive", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_EXT_USER_QUERY_MESSAGE_USE_MARKUP_PROPERTY, gitg_ext_user_query_properties[GITG_EXT_USER_QUERY_MESSAGE_USE_MARKUP_PROPERTY] = g_param_spec_boolean ("message-use-markup", "message-use-markup", "message-use-markup", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gitg_ext_user_query_signals[GITG_EXT_USER_QUERY_QUIT_SIGNAL] = g_signal_new ("quit", GITG_EXT_TYPE_USER_QUERY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gitg_ext_user_query_signals[GITG_EXT_USER_QUERY_RESPONSE_SIGNAL] = g_signal_new ("response", GITG_EXT_TYPE_USER_QUERY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_BOOLEAN__ENUM, G_TYPE_BOOLEAN, 1, gtk_response_type_get_type ());
}

static void
gitg_ext_user_query_instance_init (GitgExtUserQuery * self,
                                   gpointer klass)
{
	self->priv = gitg_ext_user_query_get_instance_private (self);
	self->priv->_default_response = GTK_RESPONSE_CLOSE;
}

static void
gitg_ext_user_query_finalize (GObject * obj)
{
	GitgExtUserQuery * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_EXT_TYPE_USER_QUERY, GitgExtUserQuery);
	_g_free0 (self->priv->_title);
	_g_free0 (self->priv->_message);
	self->_responses = (_vala_array_free (self->_responses, self->_responses_length1, (GDestroyNotify) g_object_unref), NULL);
	G_OBJECT_CLASS (gitg_ext_user_query_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_ext_user_query_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgExtUserQueryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_ext_user_query_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgExtUserQuery), 0, (GInstanceInitFunc) gitg_ext_user_query_instance_init, NULL };
	GType gitg_ext_user_query_type_id;
	gitg_ext_user_query_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgExtUserQuery", &g_define_type_info, 0);
	GitgExtUserQuery_private_offset = g_type_add_instance_private (gitg_ext_user_query_type_id, sizeof (GitgExtUserQueryPrivate));
	return gitg_ext_user_query_type_id;
}

GType
gitg_ext_user_query_get_type (void)
{
	static gsize gitg_ext_user_query_type_id__once = 0;
	if (g_once_init_enter (&gitg_ext_user_query_type_id__once)) {
		GType gitg_ext_user_query_type_id;
		gitg_ext_user_query_type_id = gitg_ext_user_query_get_type_once ();
		g_once_init_leave (&gitg_ext_user_query_type_id__once, gitg_ext_user_query_type_id);
	}
	return gitg_ext_user_query_type_id__once;
}

static void
_vala_gitg_ext_user_query_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	GitgExtUserQuery * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_EXT_TYPE_USER_QUERY, GitgExtUserQuery);
	switch (property_id) {
		case GITG_EXT_USER_QUERY_TITLE_PROPERTY:
		g_value_set_string (value, gitg_ext_user_query_get_title (self));
		break;
		case GITG_EXT_USER_QUERY_MESSAGE_PROPERTY:
		g_value_set_string (value, gitg_ext_user_query_get_message (self));
		break;
		case GITG_EXT_USER_QUERY_MESSAGE_TYPE_PROPERTY:
		g_value_set_enum (value, gitg_ext_user_query_get_message_type (self));
		break;
		case GITG_EXT_USER_QUERY_DEFAULT_RESPONSE_PROPERTY:
		g_value_set_enum (value, gitg_ext_user_query_get_default_response (self));
		break;
		case GITG_EXT_USER_QUERY_DEFAULT_IS_DESTRUCTIVE_PROPERTY:
		g_value_set_boolean (value, gitg_ext_user_query_get_default_is_destructive (self));
		break;
		case GITG_EXT_USER_QUERY_MESSAGE_USE_MARKUP_PROPERTY:
		g_value_set_boolean (value, gitg_ext_user_query_get_message_use_markup (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_ext_user_query_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	GitgExtUserQuery * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_EXT_TYPE_USER_QUERY, GitgExtUserQuery);
	switch (property_id) {
		case GITG_EXT_USER_QUERY_TITLE_PROPERTY:
		gitg_ext_user_query_set_title (self, g_value_get_string (value));
		break;
		case GITG_EXT_USER_QUERY_MESSAGE_PROPERTY:
		gitg_ext_user_query_set_message (self, g_value_get_string (value));
		break;
		case GITG_EXT_USER_QUERY_MESSAGE_TYPE_PROPERTY:
		gitg_ext_user_query_set_message_type (self, g_value_get_enum (value));
		break;
		case GITG_EXT_USER_QUERY_DEFAULT_RESPONSE_PROPERTY:
		gitg_ext_user_query_set_default_response (self, g_value_get_enum (value));
		break;
		case GITG_EXT_USER_QUERY_DEFAULT_IS_DESTRUCTIVE_PROPERTY:
		gitg_ext_user_query_set_default_is_destructive (self, g_value_get_boolean (value));
		break;
		case GITG_EXT_USER_QUERY_MESSAGE_USE_MARKUP_PROPERTY:
		gitg_ext_user_query_set_message_use_markup (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);
}

