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

#include "omemo.h"
#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>

#define DINO_PLUGINS_OMEMO_NS_URI "eu.siacs.conversations.axolotl"
#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  {
	DINO_PLUGINS_OMEMO_MESSAGE_FLAG_0_PROPERTY,
	DINO_PLUGINS_OMEMO_MESSAGE_FLAG_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_message_flag_properties[DINO_PLUGINS_OMEMO_MESSAGE_FLAG_NUM_PROPERTIES];

static gpointer dino_plugins_omemo_message_flag_parent_class = NULL;

static gchar* dino_plugins_omemo_message_flag_real_get_ns (XmppMessageFlag* base);
static gchar* dino_plugins_omemo_message_flag_real_get_id (XmppMessageFlag* base);
static void dino_plugins_omemo_message_flag_finalize (GObject * obj);
static GType dino_plugins_omemo_message_flag_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

DinoPluginsOmemoMessageFlag*
dino_plugins_omemo_message_flag_get_flag (XmppMessageStanza* message)
{
	XmppMessageFlag* _tmp0_;
	DinoPluginsOmemoMessageFlag* result;
	g_return_val_if_fail (message != NULL, NULL);
	_tmp0_ = xmpp_message_stanza_get_flag (message, DINO_PLUGINS_OMEMO_NS_URI, DINO_PLUGINS_OMEMO_MESSAGE_FLAG_id);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, DINO_PLUGINS_OMEMO_TYPE_MESSAGE_FLAG, DinoPluginsOmemoMessageFlag);
	return result;
}

static gchar*
dino_plugins_omemo_message_flag_real_get_ns (XmppMessageFlag* base)
{
	DinoPluginsOmemoMessageFlag * self;
	gchar* _tmp0_;
	gchar* result;
	self = (DinoPluginsOmemoMessageFlag*) base;
	_tmp0_ = g_strdup (DINO_PLUGINS_OMEMO_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
dino_plugins_omemo_message_flag_real_get_id (XmppMessageFlag* base)
{
	DinoPluginsOmemoMessageFlag * self;
	gchar* _tmp0_;
	gchar* result;
	self = (DinoPluginsOmemoMessageFlag*) base;
	_tmp0_ = g_strdup (DINO_PLUGINS_OMEMO_MESSAGE_FLAG_id);
	result = _tmp0_;
	return result;
}

DinoPluginsOmemoMessageFlag*
dino_plugins_omemo_message_flag_construct (GType object_type)
{
	DinoPluginsOmemoMessageFlag * self = NULL;
	self = (DinoPluginsOmemoMessageFlag*) xmpp_message_flag_construct (object_type);
	return self;
}

DinoPluginsOmemoMessageFlag*
dino_plugins_omemo_message_flag_new (void)
{
	return dino_plugins_omemo_message_flag_construct (DINO_PLUGINS_OMEMO_TYPE_MESSAGE_FLAG);
}

static void
dino_plugins_omemo_message_flag_class_init (DinoPluginsOmemoMessageFlagClass * klass,
                                            gpointer klass_data)
{
	dino_plugins_omemo_message_flag_parent_class = g_type_class_peek_parent (klass);
	((XmppMessageFlagClass *) klass)->get_ns = (gchar* (*) (XmppMessageFlag*)) dino_plugins_omemo_message_flag_real_get_ns;
	((XmppMessageFlagClass *) klass)->get_id = (gchar* (*) (XmppMessageFlag*)) dino_plugins_omemo_message_flag_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_message_flag_finalize;
}

static void
dino_plugins_omemo_message_flag_instance_init (DinoPluginsOmemoMessageFlag * self,
                                               gpointer klass)
{
	self->decrypted = FALSE;
}

static void
dino_plugins_omemo_message_flag_finalize (GObject * obj)
{
	DinoPluginsOmemoMessageFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_TYPE_MESSAGE_FLAG, DinoPluginsOmemoMessageFlag);
	G_OBJECT_CLASS (dino_plugins_omemo_message_flag_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_message_flag_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoMessageFlagClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_message_flag_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoMessageFlag), 0, (GInstanceInitFunc) dino_plugins_omemo_message_flag_instance_init, NULL };
	GType dino_plugins_omemo_message_flag_type_id;
	dino_plugins_omemo_message_flag_type_id = g_type_register_static (XMPP_TYPE_MESSAGE_FLAG, "DinoPluginsOmemoMessageFlag", &g_define_type_info, 0);
	return dino_plugins_omemo_message_flag_type_id;
}

GType
dino_plugins_omemo_message_flag_get_type (void)
{
	static volatile gsize dino_plugins_omemo_message_flag_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_message_flag_type_id__once)) {
		GType dino_plugins_omemo_message_flag_type_id;
		dino_plugins_omemo_message_flag_type_id = dino_plugins_omemo_message_flag_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_message_flag_type_id__once, dino_plugins_omemo_message_flag_type_id);
	}
	return dino_plugins_omemo_message_flag_type_id__once;
}

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;
}

