/* notification.c generated by valac 0.23.3.6-62e8, the Vala compiler
 * generated from notification.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <libgd/gd.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>


#define BOXES_TYPE_NOTIFICATION (boxes_notification_get_type ())
#define BOXES_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATION, BoxesNotification))
#define BOXES_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATION, BoxesNotificationClass))
#define BOXES_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATION))
#define BOXES_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATION))
#define BOXES_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATION, BoxesNotificationClass))

typedef struct _BoxesNotification BoxesNotification;
typedef struct _BoxesNotificationClass BoxesNotificationClass;
typedef struct _BoxesNotificationPrivate BoxesNotificationPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block41Data Block41Data;

struct _BoxesNotification {
	GdNotification parent_instance;
	BoxesNotificationPrivate * priv;
};

struct _BoxesNotificationClass {
	GdNotificationClass parent_class;
};

struct _BoxesNotificationPrivate {
	GtkLabel* message_label;
	GtkLabel* ok_button_label;
	GtkButton* ok_button;
};

typedef void (*BoxesNotificationOKFunc) (void* user_data);
typedef void (*BoxesNotificationCancelFunc) (void* user_data);
struct _Block41Data {
	int _ref_count_;
	BoxesNotification* self;
	gboolean ok_pressed;
	BoxesNotificationOKFunc ok_func;
	gpointer ok_func_target;
	GDestroyNotify ok_func_target_destroy_notify;
	BoxesNotificationCancelFunc cancel_func;
	gpointer cancel_func_target;
	GDestroyNotify cancel_func_target_destroy_notify;
};


static gpointer boxes_notification_parent_class = NULL;

GType boxes_notification_get_type (void) G_GNUC_CONST;
#define BOXES_NOTIFICATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_NOTIFICATION, BoxesNotificationPrivate))
enum  {
	BOXES_NOTIFICATION_DUMMY_PROPERTY
};
#define BOXES_NOTIFICATION_DEFAULT_TIMEOUT 6
BoxesNotification* boxes_notification_new (const gchar* message, GtkMessageType message_type, const gchar* ok_label, BoxesNotificationOKFunc ok_func, void* ok_func_target, GDestroyNotify ok_func_target_destroy_notify, BoxesNotificationCancelFunc cancel_func, void* cancel_func_target, GDestroyNotify cancel_func_target_destroy_notify, gint timeout);
BoxesNotification* boxes_notification_construct (GType object_type, const gchar* message, GtkMessageType message_type, const gchar* ok_label, BoxesNotificationOKFunc ok_func, void* ok_func_target, GDestroyNotify ok_func_target_destroy_notify, BoxesNotificationCancelFunc cancel_func, void* cancel_func_target, GDestroyNotify cancel_func_target_destroy_notify, gint timeout);
static Block41Data* block41_data_ref (Block41Data* _data41_);
static void block41_data_unref (void * _userdata_);
static void __lambda21_ (Block41Data* _data41_);
static void ___lambda21__gd_notification_dismissed (GdNotification* _sender, gpointer self);
static void ___lambda22_ (Block41Data* _data41_);
static void ____lambda22__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void boxes_notification_finalize (GObject* obj);


static Block41Data* block41_data_ref (Block41Data* _data41_) {
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	g_atomic_int_inc (&_data41_->_ref_count_);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	return _data41_;
#line 82 "notification.c"
}


static void block41_data_unref (void * _userdata_) {
	Block41Data* _data41_;
	_data41_ = (Block41Data*) _userdata_;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	if (g_atomic_int_dec_and_test (&_data41_->_ref_count_)) {
#line 91 "notification.c"
		BoxesNotification* self;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		self = _data41_->self;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		(_data41_->ok_func_target_destroy_notify == NULL) ? NULL : (_data41_->ok_func_target_destroy_notify (_data41_->ok_func_target), NULL);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_data41_->ok_func = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_data41_->ok_func_target = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_data41_->ok_func_target_destroy_notify = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		(_data41_->cancel_func_target_destroy_notify == NULL) ? NULL : (_data41_->cancel_func_target_destroy_notify (_data41_->cancel_func_target), NULL);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_data41_->cancel_func = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_data41_->cancel_func_target = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_data41_->cancel_func_target_destroy_notify = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_g_object_unref0 (self);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		g_slice_free (Block41Data, _data41_);
#line 115 "notification.c"
	}
}


static void __lambda21_ (Block41Data* _data41_) {
	BoxesNotification* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
#line 27 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	self = _data41_->self;
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp1_ = _data41_->ok_pressed;
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	if (!_tmp1_) {
#line 130 "notification.c"
		BoxesNotificationCancelFunc _tmp2_ = NULL;
		void* _tmp2__target = NULL;
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp2_ = _data41_->cancel_func;
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp2__target = _data41_->cancel_func_target;
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp0_ = _tmp2_ != NULL;
#line 139 "notification.c"
	} else {
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp0_ = FALSE;
#line 143 "notification.c"
	}
#line 28 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	if (_tmp0_) {
#line 147 "notification.c"
		BoxesNotificationCancelFunc _tmp3_ = NULL;
		void* _tmp3__target = NULL;
#line 29 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp3_ = _data41_->cancel_func;
#line 29 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp3__target = _data41_->cancel_func_target;
#line 29 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp3_ (_tmp3__target);
#line 156 "notification.c"
	}
}


static void ___lambda21__gd_notification_dismissed (GdNotification* _sender, gpointer self) {
#line 27 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	__lambda21_ (self);
#line 164 "notification.c"
}


static void ___lambda22_ (Block41Data* _data41_) {
	BoxesNotification* self;
	BoxesNotificationOKFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
#line 37 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	self = _data41_->self;
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_pressed = TRUE;
#line 39 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp0_ = _data41_->ok_func;
#line 39 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp0__target = _data41_->ok_func_target;
#line 39 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	if (_tmp0_ != NULL) {
#line 182 "notification.c"
		BoxesNotificationOKFunc _tmp1_ = NULL;
		void* _tmp1__target = NULL;
#line 40 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp1_ = _data41_->ok_func;
#line 40 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp1__target = _data41_->ok_func_target;
#line 40 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp1_ (_tmp1__target);
#line 191 "notification.c"
	}
#line 41 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	gd_notification_dismiss ((GdNotification*) self);
#line 195 "notification.c"
}


static void ____lambda22__gtk_button_clicked (GtkButton* _sender, gpointer self) {
#line 37 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	___lambda22_ (self);
#line 202 "notification.c"
}


BoxesNotification* boxes_notification_construct (GType object_type, const gchar* message, GtkMessageType message_type, const gchar* ok_label, BoxesNotificationOKFunc ok_func, void* ok_func_target, GDestroyNotify ok_func_target_destroy_notify, BoxesNotificationCancelFunc cancel_func, void* cancel_func_target, GDestroyNotify cancel_func_target_destroy_notify, gint timeout) {
	BoxesNotification * self = NULL;
	Block41Data* _data41_;
	BoxesNotificationOKFunc _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	BoxesNotificationCancelFunc _tmp1_ = NULL;
	void* _tmp1__target = NULL;
	gint _tmp2_ = 0;
	GtkLabel* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	g_return_val_if_fail (message != NULL, NULL);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_ = g_slice_new0 (Block41Data);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->_ref_count_ = 1;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp0_ = ok_func;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp0__target = ok_func_target;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	(_data41_->ok_func_target_destroy_notify == NULL) ? NULL : (_data41_->ok_func_target_destroy_notify (_data41_->ok_func_target), NULL);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_func = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_func_target = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_func_target_destroy_notify = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_func = _tmp0_;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_func_target = _tmp0__target;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_func_target_destroy_notify = ok_func_target_destroy_notify;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp1_ = cancel_func;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp1__target = cancel_func_target;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	(_data41_->cancel_func_target_destroy_notify == NULL) ? NULL : (_data41_->cancel_func_target_destroy_notify (_data41_->cancel_func_target), NULL);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->cancel_func = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->cancel_func_target = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->cancel_func_target_destroy_notify = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->cancel_func = _tmp1_;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->cancel_func_target = _tmp1__target;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->cancel_func_target_destroy_notify = cancel_func_target_destroy_notify;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	self = (BoxesNotification*) g_object_new (object_type, NULL);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->self = g_object_ref (self);
#line 24 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp2_ = timeout;
#line 24 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	g_object_set ((GdNotification*) self, "timeout", _tmp2_, NULL);
#line 26 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_->ok_pressed = FALSE;
#line 27 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	g_signal_connect_data ((GdNotification*) self, "dismissed", (GCallback) ___lambda21__gd_notification_dismissed, block41_data_ref (_data41_), (GClosureNotify) block41_data_unref, 0);
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp3_ = self->priv->message_label;
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp4_ = message;
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	gtk_label_set_label (_tmp3_, _tmp4_);
#line 34 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_tmp5_ = ok_label;
#line 34 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	if (_tmp5_ != NULL) {
#line 281 "notification.c"
		GtkLabel* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		GtkButton* _tmp8_ = NULL;
		GtkButton* _tmp9_ = NULL;
#line 35 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp6_ = self->priv->ok_button_label;
#line 35 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp7_ = ok_label;
#line 35 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		gtk_label_set_label (_tmp6_, _tmp7_);
#line 37 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp8_ = self->priv->ok_button;
#line 37 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		g_signal_connect_data (_tmp8_, "clicked", (GCallback) ____lambda22__gtk_button_clicked, block41_data_ref (_data41_), (GClosureNotify) block41_data_unref, 0);
#line 44 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		_tmp9_ = self->priv->ok_button;
#line 44 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
		gtk_widget_show_all ((GtkWidget*) _tmp9_);
#line 300 "notification.c"
	}
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	block41_data_unref (_data41_);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_data41_ = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	return self;
#line 308 "notification.c"
}


BoxesNotification* boxes_notification_new (const gchar* message, GtkMessageType message_type, const gchar* ok_label, BoxesNotificationOKFunc ok_func, void* ok_func_target, GDestroyNotify ok_func_target_destroy_notify, BoxesNotificationCancelFunc cancel_func, void* cancel_func_target, GDestroyNotify cancel_func_target_destroy_notify, gint timeout) {
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	return boxes_notification_construct (BOXES_TYPE_NOTIFICATION, message, message_type, ok_label, ok_func, ok_func_target, ok_func_target_destroy_notify, cancel_func, cancel_func_target, cancel_func_target_destroy_notify, timeout);
#line 315 "notification.c"
}


static void boxes_notification_class_init (BoxesNotificationClass * klass) {
	gint BoxesNotification_private_offset;
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	boxes_notification_parent_class = g_type_class_peek_parent (klass);
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	g_type_class_add_private (klass, sizeof (BoxesNotificationPrivate));
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_notification_finalize;
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	BoxesNotification_private_offset = g_type_class_get_instance_private_offset (klass);
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/notification.ui");
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "message_label", FALSE, BoxesNotification_private_offset + G_STRUCT_OFFSET (BoxesNotificationPrivate, message_label));
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ok_button_label", FALSE, BoxesNotification_private_offset + G_STRUCT_OFFSET (BoxesNotificationPrivate, ok_button_label));
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ok_button", FALSE, BoxesNotification_private_offset + G_STRUCT_OFFSET (BoxesNotificationPrivate, ok_button));
#line 337 "notification.c"
}


static void boxes_notification_instance_init (BoxesNotification * self) {
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	self->priv = BOXES_NOTIFICATION_GET_PRIVATE (self);
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	gtk_widget_init_template (GTK_WIDGET (self));
#line 346 "notification.c"
}


static void boxes_notification_finalize (GObject* obj) {
	BoxesNotification * self;
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_NOTIFICATION, BoxesNotification);
#line 12 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_g_object_unref0 (self->priv->message_label);
#line 14 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_g_object_unref0 (self->priv->ok_button_label);
#line 16 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	_g_object_unref0 (self->priv->ok_button);
#line 5 "/home/zeenix/checkout/gnome/gnome-boxes/src/notification.vala"
	G_OBJECT_CLASS (boxes_notification_parent_class)->finalize (obj);
#line 362 "notification.c"
}


GType boxes_notification_get_type (void) {
	static volatile gsize boxes_notification_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_notification_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesNotificationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_notification_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesNotification), 0, (GInstanceInitFunc) boxes_notification_instance_init, NULL };
		GType boxes_notification_type_id;
		boxes_notification_type_id = g_type_register_static (gd_notification_get_type (), "BoxesNotification", &g_define_type_info, 0);
		g_once_init_leave (&boxes_notification_type_id__volatile, boxes_notification_type_id);
	}
	return boxes_notification_type_id__volatile;
}



