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

#include "xmpp-vala.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.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  {
	XMPP_CONFERENCE_0_PROPERTY,
	XMPP_CONFERENCE_JID_PROPERTY,
	XMPP_CONFERENCE_AUTOJOIN_PROPERTY,
	XMPP_CONFERENCE_NICK_PROPERTY,
	XMPP_CONFERENCE_NAME_PROPERTY,
	XMPP_CONFERENCE_PASSWORD_PROPERTY,
	XMPP_CONFERENCE_NUM_PROPERTIES
};
static GParamSpec* xmpp_conference_properties[XMPP_CONFERENCE_NUM_PROPERTIES];
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _XmppConferencePrivate {
	XmppJid* _jid;
	gboolean _autojoin;
	gchar* _nick;
	gchar* _name;
	gchar* _password;
};

static gint XmppConference_private_offset;
static gpointer xmpp_conference_parent_class = NULL;

static void xmpp_conference_finalize (GObject * obj);
static GType xmpp_conference_get_type_once (void);
static void _vala_xmpp_conference_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_xmpp_conference_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_conference_get_instance_private (XmppConference* self)
{
	return G_STRUCT_MEMBER_P (self, XmppConference_private_offset);
}

gboolean
xmpp_conference_equals (XmppConference* self,
                        XmppConference* c)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (c != NULL, FALSE);
	result = xmpp_conference_equals_func (self, c);
	return result;
}

gboolean
xmpp_conference_equals_func (XmppConference* a,
                             XmppConference* b)
{
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gboolean result;
	g_return_val_if_fail (a != NULL, FALSE);
	g_return_val_if_fail (b != NULL, FALSE);
	_tmp0_ = xmpp_conference_get_jid (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_conference_get_jid (b);
	_tmp3_ = _tmp2_;
	result = xmpp_jid_equals_func (_tmp1_, _tmp3_);
	return result;
}

guint
xmpp_conference_hash_func (XmppConference* a)
{
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	guint result;
	g_return_val_if_fail (a != NULL, 0U);
	_tmp0_ = xmpp_conference_get_jid (a);
	_tmp1_ = _tmp0_;
	result = xmpp_jid_hash_func (_tmp1_);
	return result;
}

XmppConference*
xmpp_conference_construct (GType object_type)
{
	XmppConference * self = NULL;
	self = (XmppConference*) g_object_new (object_type, NULL);
	return self;
}

XmppConference*
xmpp_conference_new (void)
{
	return xmpp_conference_construct (XMPP_TYPE_CONFERENCE);
}

XmppJid*
xmpp_conference_get_jid (XmppConference* self)
{
	XmppConferenceClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->get_jid) {
		return _klass_->get_jid (self);
	}
	return NULL;
}

static XmppJid*
xmpp_conference_real_get_jid (XmppConference* base)
{
	XmppJid* result;
	XmppConference* self;
	XmppJid* _tmp0_;
	self = base;
	_tmp0_ = self->priv->_jid;
	result = _tmp0_;
	return result;
}

void
xmpp_conference_set_jid (XmppConference* self,
                         XmppJid* value)
{
	XmppConferenceClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->set_jid) {
		_klass_->set_jid (self, value);
	}
}

static gpointer
_xmpp_jid_ref0 (gpointer self)
{
	return self ? xmpp_jid_ref (self) : NULL;
}

static void
xmpp_conference_real_set_jid (XmppConference* base,
                              XmppJid* value)
{
	XmppConference* self;
	XmppJid* old_value;
	self = base;
	old_value = xmpp_conference_real_get_jid (base);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_jid);
		self->priv->_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_conference_properties[XMPP_CONFERENCE_JID_PROPERTY]);
	}
}

gboolean
xmpp_conference_get_autojoin (XmppConference* self)
{
	XmppConferenceClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->get_autojoin) {
		return _klass_->get_autojoin (self);
	}
	return FALSE;
}

static gboolean
xmpp_conference_real_get_autojoin (XmppConference* base)
{
	gboolean result;
	XmppConference* self;
	self = base;
	result = self->priv->_autojoin;
	return result;
}

void
xmpp_conference_set_autojoin (XmppConference* self,
                              gboolean value)
{
	XmppConferenceClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->set_autojoin) {
		_klass_->set_autojoin (self, value);
	}
}

static void
xmpp_conference_real_set_autojoin (XmppConference* base,
                                   gboolean value)
{
	XmppConference* self;
	gboolean old_value;
	self = base;
	old_value = xmpp_conference_real_get_autojoin (base);
	if (old_value != value) {
		self->priv->_autojoin = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_conference_properties[XMPP_CONFERENCE_AUTOJOIN_PROPERTY]);
	}
}

const gchar*
xmpp_conference_get_nick (XmppConference* self)
{
	XmppConferenceClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->get_nick) {
		return _klass_->get_nick (self);
	}
	return NULL;
}

static const gchar*
xmpp_conference_real_get_nick (XmppConference* base)
{
	const gchar* result;
	XmppConference* self;
	const gchar* _tmp0_;
	self = base;
	_tmp0_ = self->priv->_nick;
	result = _tmp0_;
	return result;
}

void
xmpp_conference_set_nick (XmppConference* self,
                          const gchar* value)
{
	XmppConferenceClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->set_nick) {
		_klass_->set_nick (self, value);
	}
}

static void
xmpp_conference_real_set_nick (XmppConference* base,
                               const gchar* value)
{
	XmppConference* self;
	gchar* old_value;
	self = base;
	old_value = xmpp_conference_real_get_nick (base);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_nick);
		self->priv->_nick = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_conference_properties[XMPP_CONFERENCE_NICK_PROPERTY]);
	}
}

const gchar*
xmpp_conference_get_name (XmppConference* self)
{
	XmppConferenceClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->get_name) {
		return _klass_->get_name (self);
	}
	return NULL;
}

static const gchar*
xmpp_conference_real_get_name (XmppConference* base)
{
	const gchar* result;
	XmppConference* self;
	const gchar* _tmp0_;
	self = base;
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
xmpp_conference_set_name (XmppConference* self,
                          const gchar* value)
{
	XmppConferenceClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->set_name) {
		_klass_->set_name (self, value);
	}
}

static void
xmpp_conference_real_set_name (XmppConference* base,
                               const gchar* value)
{
	XmppConference* self;
	gchar* old_value;
	self = base;
	old_value = xmpp_conference_real_get_name (base);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_conference_properties[XMPP_CONFERENCE_NAME_PROPERTY]);
	}
}

const gchar*
xmpp_conference_get_password (XmppConference* self)
{
	XmppConferenceClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->get_password) {
		return _klass_->get_password (self);
	}
	return NULL;
}

static const gchar*
xmpp_conference_real_get_password (XmppConference* base)
{
	const gchar* result;
	XmppConference* self;
	const gchar* _tmp0_;
	self = base;
	_tmp0_ = self->priv->_password;
	result = _tmp0_;
	return result;
}

void
xmpp_conference_set_password (XmppConference* self,
                              const gchar* value)
{
	XmppConferenceClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_CONFERENCE_GET_CLASS (self);
	if (_klass_->set_password) {
		_klass_->set_password (self, value);
	}
}

static void
xmpp_conference_real_set_password (XmppConference* base,
                                   const gchar* value)
{
	XmppConference* self;
	gchar* old_value;
	self = base;
	old_value = xmpp_conference_real_get_password (base);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_password);
		self->priv->_password = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_conference_properties[XMPP_CONFERENCE_PASSWORD_PROPERTY]);
	}
}

static void
xmpp_conference_class_init (XmppConferenceClass * klass,
                            gpointer klass_data)
{
	xmpp_conference_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppConference_private_offset);
	XMPP_CONFERENCE_CLASS (klass)->get_jid = (XmppJid* (*) (XmppConference*)) xmpp_conference_real_get_jid;
	XMPP_CONFERENCE_CLASS (klass)->set_jid = (void (*) (XmppConference*, XmppJid*)) xmpp_conference_real_set_jid;
	XMPP_CONFERENCE_CLASS (klass)->get_autojoin = (gboolean (*) (XmppConference*)) xmpp_conference_real_get_autojoin;
	XMPP_CONFERENCE_CLASS (klass)->set_autojoin = (void (*) (XmppConference*, gboolean)) xmpp_conference_real_set_autojoin;
	XMPP_CONFERENCE_CLASS (klass)->get_nick = (const gchar* (*) (XmppConference*)) xmpp_conference_real_get_nick;
	XMPP_CONFERENCE_CLASS (klass)->set_nick = (void (*) (XmppConference*, const gchar*)) xmpp_conference_real_set_nick;
	XMPP_CONFERENCE_CLASS (klass)->get_name = (const gchar* (*) (XmppConference*)) xmpp_conference_real_get_name;
	XMPP_CONFERENCE_CLASS (klass)->set_name = (void (*) (XmppConference*, const gchar*)) xmpp_conference_real_set_name;
	XMPP_CONFERENCE_CLASS (klass)->get_password = (const gchar* (*) (XmppConference*)) xmpp_conference_real_get_password;
	XMPP_CONFERENCE_CLASS (klass)->set_password = (void (*) (XmppConference*, const gchar*)) xmpp_conference_real_set_password;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_conference_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_conference_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_conference_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_CONFERENCE_JID_PROPERTY, xmpp_conference_properties[XMPP_CONFERENCE_JID_PROPERTY] = xmpp_param_spec_jid ("jid", "jid", "jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_CONFERENCE_AUTOJOIN_PROPERTY, xmpp_conference_properties[XMPP_CONFERENCE_AUTOJOIN_PROPERTY] = g_param_spec_boolean ("autojoin", "autojoin", "autojoin", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_CONFERENCE_NICK_PROPERTY, xmpp_conference_properties[XMPP_CONFERENCE_NICK_PROPERTY] = g_param_spec_string ("nick", "nick", "nick", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_CONFERENCE_NAME_PROPERTY, xmpp_conference_properties[XMPP_CONFERENCE_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_CONFERENCE_PASSWORD_PROPERTY, xmpp_conference_properties[XMPP_CONFERENCE_PASSWORD_PROPERTY] = g_param_spec_string ("password", "password", "password", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
xmpp_conference_instance_init (XmppConference * self,
                               gpointer klass)
{
	self->priv = xmpp_conference_get_instance_private (self);
}

static void
xmpp_conference_finalize (GObject * obj)
{
	XmppConference * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_TYPE_CONFERENCE, XmppConference);
	_xmpp_jid_unref0 (self->priv->_jid);
	_g_free0 (self->priv->_nick);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_password);
	G_OBJECT_CLASS (xmpp_conference_parent_class)->finalize (obj);
}

static GType
xmpp_conference_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppConferenceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_conference_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppConference), 0, (GInstanceInitFunc) xmpp_conference_instance_init, NULL };
	GType xmpp_conference_type_id;
	xmpp_conference_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppConference", &g_define_type_info, 0);
	XmppConference_private_offset = g_type_add_instance_private (xmpp_conference_type_id, sizeof (XmppConferencePrivate));
	return xmpp_conference_type_id;
}

GType
xmpp_conference_get_type (void)
{
	static volatile gsize xmpp_conference_type_id__once = 0;
	if (g_once_init_enter (&xmpp_conference_type_id__once)) {
		GType xmpp_conference_type_id;
		xmpp_conference_type_id = xmpp_conference_get_type_once ();
		g_once_init_leave (&xmpp_conference_type_id__once, xmpp_conference_type_id);
	}
	return xmpp_conference_type_id__once;
}

static void
_vala_xmpp_conference_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	XmppConference * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_TYPE_CONFERENCE, XmppConference);
	switch (property_id) {
		case XMPP_CONFERENCE_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_conference_get_jid (self));
		break;
		case XMPP_CONFERENCE_AUTOJOIN_PROPERTY:
		g_value_set_boolean (value, xmpp_conference_get_autojoin (self));
		break;
		case XMPP_CONFERENCE_NICK_PROPERTY:
		g_value_set_string (value, xmpp_conference_get_nick (self));
		break;
		case XMPP_CONFERENCE_NAME_PROPERTY:
		g_value_set_string (value, xmpp_conference_get_name (self));
		break;
		case XMPP_CONFERENCE_PASSWORD_PROPERTY:
		g_value_set_string (value, xmpp_conference_get_password (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_conference_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	XmppConference * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_TYPE_CONFERENCE, XmppConference);
	switch (property_id) {
		case XMPP_CONFERENCE_JID_PROPERTY:
		xmpp_conference_set_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_CONFERENCE_AUTOJOIN_PROPERTY:
		xmpp_conference_set_autojoin (self, g_value_get_boolean (value));
		break;
		case XMPP_CONFERENCE_NICK_PROPERTY:
		xmpp_conference_set_nick (self, g_value_get_string (value));
		break;
		case XMPP_CONFERENCE_NAME_PROPERTY:
		xmpp_conference_set_name (self, g_value_get_string (value));
		break;
		case XMPP_CONFERENCE_PASSWORD_PROPERTY:
		xmpp_conference_set_password (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

