/* toast-overlay.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from toast-overlay.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.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 BOXES_TYPE_TOAST_OVERLAY (boxes_toast_overlay_get_type ())
#define BOXES_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay))
#define BOXES_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))
#define BOXES_IS_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_IS_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_TOAST_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))

typedef struct _BoxesToastOverlay BoxesToastOverlay;
typedef struct _BoxesToastOverlayClass BoxesToastOverlayClass;
typedef struct _BoxesToastOverlayPrivate BoxesToastOverlayPrivate;

#define BOXES_TYPE_TOAST (boxes_toast_get_type ())
#define BOXES_TOAST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST, BoxesToast))
#define BOXES_TOAST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST, BoxesToastClass))
#define BOXES_IS_TOAST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST))
#define BOXES_IS_TOAST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST))
#define BOXES_TOAST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST, BoxesToastClass))

typedef struct _BoxesToast BoxesToast;
typedef struct _BoxesToastClass BoxesToastClass;
enum  {
	BOXES_TOAST_OVERLAY_0_PROPERTY,
	BOXES_TOAST_OVERLAY_NUM_PROPERTIES
};
static GParamSpec* boxes_toast_overlay_properties[BOXES_TOAST_OVERLAY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BoxesToastOverlay {
	GtkOverlay parent_instance;
	BoxesToastOverlayPrivate * priv;
};

struct _BoxesToastOverlayClass {
	GtkOverlayClass parent_class;
};

struct _BoxesToastOverlayPrivate {
	BoxesToast* _toast;
};

static gint BoxesToastOverlay_private_offset;
static gpointer boxes_toast_overlay_parent_class = NULL;

VALA_EXTERN GType boxes_toast_overlay_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToastOverlay, g_object_unref)
VALA_EXTERN GType boxes_toast_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToast, g_object_unref)
VALA_EXTERN void boxes_toast_overlay_display_toast (BoxesToastOverlay* self,
                                        BoxesToast* toast);
static void boxes_toast_overlay_set_toast (BoxesToastOverlay* self,
                                    BoxesToast* value);
VALA_EXTERN void boxes_toast_overlay_dismiss (BoxesToastOverlay* self);
static BoxesToast* boxes_toast_overlay_get_toast (BoxesToastOverlay* self);
VALA_EXTERN void boxes_toast_dismiss (BoxesToast* self);
VALA_EXTERN BoxesToastOverlay* boxes_toast_overlay_new (void);
VALA_EXTERN BoxesToastOverlay* boxes_toast_overlay_construct (GType object_type);
static void boxes_toast_overlay_finalize (GObject * obj);
static GType boxes_toast_overlay_get_type_once (void);
static void _vala_boxes_toast_overlay_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_boxes_toast_overlay_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);

static inline gpointer
boxes_toast_overlay_get_instance_private (BoxesToastOverlay* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesToastOverlay_private_offset);
}

void
boxes_toast_overlay_display_toast (BoxesToastOverlay* self,
                                   BoxesToast* toast)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (toast != NULL);
	boxes_toast_overlay_set_toast (self, toast);
}

void
boxes_toast_overlay_dismiss (BoxesToastOverlay* self)
{
	BoxesToast* _tmp0_;
	BoxesToast* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_toast_overlay_get_toast (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		BoxesToast* _tmp2_;
		BoxesToast* _tmp3_;
		_tmp2_ = boxes_toast_overlay_get_toast (self);
		_tmp3_ = _tmp2_;
		boxes_toast_dismiss (_tmp3_);
		_g_object_unref0 (self->priv->_toast);
		self->priv->_toast = NULL;
	}
}

BoxesToastOverlay*
boxes_toast_overlay_construct (GType object_type)
{
	BoxesToastOverlay * self = NULL;
	self = (BoxesToastOverlay*) g_object_new (object_type, NULL);
	return self;
}

BoxesToastOverlay*
boxes_toast_overlay_new (void)
{
	return boxes_toast_overlay_construct (BOXES_TYPE_TOAST_OVERLAY);
}

static BoxesToast*
boxes_toast_overlay_get_toast (BoxesToastOverlay* self)
{
	BoxesToast* result;
	BoxesToast* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_toast;
	result = _tmp0_;
	return result;
}

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

static void
boxes_toast_overlay_set_toast (BoxesToastOverlay* self,
                               BoxesToast* value)
{
	BoxesToast* _tmp0_;
	BoxesToast* _tmp2_;
	BoxesToast* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_toast;
	if (_tmp0_ != NULL) {
		BoxesToast* _tmp1_;
		_tmp1_ = self->priv->_toast;
		boxes_toast_dismiss (_tmp1_);
	}
	_tmp2_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_toast);
	self->priv->_toast = _tmp2_;
	_tmp3_ = self->priv->_toast;
	gtk_overlay_add_overlay ((GtkOverlay*) self, (GtkWidget*) _tmp3_);
}

static void
boxes_toast_overlay_class_init (BoxesToastOverlayClass * klass,
                                gpointer klass_data)
{
	boxes_toast_overlay_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesToastOverlay_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_toast_overlay_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_toast_overlay_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_toast_overlay_finalize;
}

static void
boxes_toast_overlay_instance_init (BoxesToastOverlay * self,
                                   gpointer klass)
{
	self->priv = boxes_toast_overlay_get_instance_private (self);
}

static void
boxes_toast_overlay_finalize (GObject * obj)
{
	BoxesToastOverlay * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay);
	_g_object_unref0 (self->priv->_toast);
	G_OBJECT_CLASS (boxes_toast_overlay_parent_class)->finalize (obj);
}

static GType
boxes_toast_overlay_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesToastOverlayClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_toast_overlay_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesToastOverlay), 0, (GInstanceInitFunc) boxes_toast_overlay_instance_init, NULL };
	GType boxes_toast_overlay_type_id;
	boxes_toast_overlay_type_id = g_type_register_static (gtk_overlay_get_type (), "BoxesToastOverlay", &g_define_type_info, 0);
	BoxesToastOverlay_private_offset = g_type_add_instance_private (boxes_toast_overlay_type_id, sizeof (BoxesToastOverlayPrivate));
	return boxes_toast_overlay_type_id;
}

GType
boxes_toast_overlay_get_type (void)
{
	static volatile gsize boxes_toast_overlay_type_id__once = 0;
	if (g_once_init_enter (&boxes_toast_overlay_type_id__once)) {
		GType boxes_toast_overlay_type_id;
		boxes_toast_overlay_type_id = boxes_toast_overlay_get_type_once ();
		g_once_init_leave (&boxes_toast_overlay_type_id__once, boxes_toast_overlay_type_id);
	}
	return boxes_toast_overlay_type_id__once;
}

static void
_vala_boxes_toast_overlay_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	BoxesToastOverlay * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_boxes_toast_overlay_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	BoxesToastOverlay * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

