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

#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.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

static GType xmpp_xep_pixbuf_storage_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
xmpp_xep_pixbuf_storage_store (XmppXepPixbufStorage* self,
                               const gchar* id,
                               GBytes* data)
{
	XmppXepPixbufStorageIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = XMPP_XEP_PIXBUF_STORAGE_GET_INTERFACE (self);
	if (_iface_->store) {
		_iface_->store (self, id, data);
	}
}

gboolean
xmpp_xep_pixbuf_storage_has_image (XmppXepPixbufStorage* self,
                                   const gchar* id)
{
	XmppXepPixbufStorageIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = XMPP_XEP_PIXBUF_STORAGE_GET_INTERFACE (self);
	if (_iface_->has_image) {
		return _iface_->has_image (self, id);
	}
	return FALSE;
}

void
xmpp_xep_pixbuf_storage_get_image (XmppXepPixbufStorage* self,
                                   const gchar* id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	XmppXepPixbufStorageIface* _iface_;
	_iface_ = XMPP_XEP_PIXBUF_STORAGE_GET_INTERFACE (self);
	if (_iface_->get_image) {
		_iface_->get_image (self, id, _callback_, _user_data_);
	}
}

GdkPixbuf*
xmpp_xep_pixbuf_storage_get_image_finish (XmppXepPixbufStorage* self,
                                          GAsyncResult* _res_)
{
	XmppXepPixbufStorageIface* _iface_;
	_iface_ = XMPP_XEP_PIXBUF_STORAGE_GET_INTERFACE (self);
	if (_iface_->get_image_finish) {
		return _iface_->get_image_finish (self, _res_);
	}
	return NULL;
}

static void
xmpp_xep_pixbuf_storage_default_init (XmppXepPixbufStorageIface * iface,
                                      gpointer iface_data)
{
}

static GType
xmpp_xep_pixbuf_storage_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepPixbufStorageIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_pixbuf_storage_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType xmpp_xep_pixbuf_storage_type_id;
	xmpp_xep_pixbuf_storage_type_id = g_type_register_static (G_TYPE_INTERFACE, "XmppXepPixbufStorage", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (xmpp_xep_pixbuf_storage_type_id, G_TYPE_OBJECT);
	return xmpp_xep_pixbuf_storage_type_id;
}

GType
xmpp_xep_pixbuf_storage_get_type (void)
{
	static volatile gsize xmpp_xep_pixbuf_storage_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_pixbuf_storage_type_id__once)) {
		GType xmpp_xep_pixbuf_storage_type_id;
		xmpp_xep_pixbuf_storage_type_id = xmpp_xep_pixbuf_storage_get_type_once ();
		g_once_init_leave (&xmpp_xep_pixbuf_storage_type_id__once, xmpp_xep_pixbuf_storage_type_id);
	}
	return xmpp_xep_pixbuf_storage_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;
}

