/* gitg-simple-notification.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-simple-notification.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2012 - Ignacio Casal Quinteiro
 *
 * gitg is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gitg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>
#include "libgitg-ext.h"
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <glib/gi18n-lib.h>

#define GITG_SIMPLE_NOTIFICATION_version VERSION
#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 GITG_TYPE_SIMPLE_NOTIFICATION (gitg_simple_notification_get_type ())
#define GITG_SIMPLE_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_SIMPLE_NOTIFICATION, GitgSimpleNotification))
#define GITG_SIMPLE_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_SIMPLE_NOTIFICATION, GitgSimpleNotificationClass))
#define GITG_IS_SIMPLE_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_SIMPLE_NOTIFICATION))
#define GITG_IS_SIMPLE_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_SIMPLE_NOTIFICATION))
#define GITG_SIMPLE_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_SIMPLE_NOTIFICATION, GitgSimpleNotificationClass))

typedef struct _GitgSimpleNotification GitgSimpleNotification;
typedef struct _GitgSimpleNotificationClass GitgSimpleNotificationClass;
typedef struct _GitgSimpleNotificationPrivate GitgSimpleNotificationPrivate;
enum  {
	GITG_SIMPLE_NOTIFICATION_0_PROPERTY,
	GITG_SIMPLE_NOTIFICATION_WIDGET_PROPERTY,
	GITG_SIMPLE_NOTIFICATION_TITLE_PROPERTY,
	GITG_SIMPLE_NOTIFICATION_MESSAGE_PROPERTY,
	GITG_SIMPLE_NOTIFICATION_NUM_PROPERTIES
};
static GParamSpec* gitg_simple_notification_properties[GITG_SIMPLE_NOTIFICATION_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block79Data Block79Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block80Data Block80Data;
typedef struct _Block81Data Block81Data;
typedef struct _Block82Data Block82Data;
typedef struct _Block83Data Block83Data;
enum  {
	GITG_SIMPLE_NOTIFICATION_CANCEL_SIGNAL,
	GITG_SIMPLE_NOTIFICATION_NUM_SIGNALS
};
static guint gitg_simple_notification_signals[GITG_SIMPLE_NOTIFICATION_NUM_SIGNALS] = {0};

struct _GitgSimpleNotification {
	GtkGrid parent_instance;
	GitgSimpleNotificationPrivate * priv;
};

struct _GitgSimpleNotificationClass {
	GtkGridClass parent_class;
};

struct _GitgSimpleNotificationPrivate {
	GtkSpinner* d_spinner;
	GtkImage* d_image_icon;
	GtkLabel* d_label_title;
	GtkLabel* d_label_message;
	GtkButton* d_button_cancel;
	gboolean d_finished;
};

struct _Block79Data {
	int _ref_count_;
	GitgSimpleNotification* self;
	gchar* message;
};

struct _Block80Data {
	int _ref_count_;
	GitgSimpleNotification* self;
	gchar* message;
};

struct _Block81Data {
	int _ref_count_;
	GitgSimpleNotification* self;
	gboolean auto_close;
};

struct _Block82Data {
	int _ref_count_;
	GitgSimpleNotification* self;
	gchar* value;
};

struct _Block83Data {
	int _ref_count_;
	GitgSimpleNotification* self;
	gchar* value;
};

static gint GitgSimpleNotification_private_offset;
static gpointer gitg_simple_notification_parent_class = NULL;
static GitgExtNotificationIface * gitg_simple_notification_gitg_ext_notification_parent_iface = NULL;

VALA_EXTERN GType gitg_simple_notification_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgSimpleNotification, g_object_unref)
VALA_EXTERN GitgSimpleNotification* gitg_simple_notification_new (const gchar* title,
                                                      const gchar* message);
VALA_EXTERN GitgSimpleNotification* gitg_simple_notification_construct (GType object_type,
                                                            const gchar* title,
                                                            const gchar* message);
VALA_EXTERN void gitg_simple_notification_success (GitgSimpleNotification* self,
                                       const gchar* message);
static Block79Data* block79_data_ref (Block79Data* _data79_);
static void block79_data_unref (void * _userdata_);
static gboolean __lambda6_ (Block79Data* _data79_);
VALA_EXTERN void gitg_simple_notification_set_message (GitgSimpleNotification* self,
                                           const gchar* value);
static void gitg_simple_notification_finish (GitgSimpleNotification* self,
                                      gboolean auto_close);
static gboolean ___lambda6__gsource_func (gpointer self);
VALA_EXTERN void gitg_simple_notification_error (GitgSimpleNotification* self,
                                     const gchar* message);
static Block80Data* block80_data_ref (Block80Data* _data80_);
static void block80_data_unref (void * _userdata_);
static gboolean __lambda9_ (Block80Data* _data80_);
static gboolean ___lambda9__gsource_func (gpointer self);
static Block81Data* block81_data_ref (Block81Data* _data81_);
static void block81_data_unref (void * _userdata_);
static gboolean __lambda8_ (Block81Data* _data81_);
static gboolean ___lambda8__gsource_func (gpointer self);
static void gitg_simple_notification_on_button_cancel_clicked (GitgSimpleNotification* self);
static void _gitg_simple_notification_on_button_cancel_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                            gpointer self);
VALA_EXTERN void gitg_simple_notification_set_title (GitgSimpleNotification* self,
                                         const gchar* value);
static Block82Data* block82_data_ref (Block82Data* _data82_);
static void block82_data_unref (void * _userdata_);
static gboolean _gitg_simple_notification_title___lambda10_ (Block82Data* _data82_);
static gboolean __gitg_simple_notification_title___lambda10__gsource_func (gpointer self);
static Block83Data* block83_data_ref (Block83Data* _data83_);
static void block83_data_unref (void * _userdata_);
static gboolean _gitg_simple_notification_message___lambda7_ (Block83Data* _data83_);
static gboolean __gitg_simple_notification_message___lambda7__gsource_func (gpointer self);
static void gitg_simple_notification_finalize (GObject * obj);
static GType gitg_simple_notification_get_type_once (void);
static void _vala_gitg_simple_notification_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_gitg_simple_notification_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);

static inline gpointer
gitg_simple_notification_get_instance_private (GitgSimpleNotification* self)
{
	return G_STRUCT_MEMBER_P (self, GitgSimpleNotification_private_offset);
}

GitgSimpleNotification*
gitg_simple_notification_construct (GType object_type,
                                    const gchar* title,
                                    const gchar* message)
{
	GitgSimpleNotification * self = NULL;
	GtkSpinner* _tmp0_;
	self = (GitgSimpleNotification*) g_object_new (object_type, "title", title, "message", message, NULL);
	_tmp0_ = self->priv->d_spinner;
	gtk_spinner_start (_tmp0_);
	return self;
}

GitgSimpleNotification*
gitg_simple_notification_new (const gchar* title,
                              const gchar* message)
{
	return gitg_simple_notification_construct (GITG_TYPE_SIMPLE_NOTIFICATION, title, message);
}

static Block79Data*
block79_data_ref (Block79Data* _data79_)
{
	g_atomic_int_inc (&_data79_->_ref_count_);
	return _data79_;
}

static void
block79_data_unref (void * _userdata_)
{
	Block79Data* _data79_;
	_data79_ = (Block79Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data79_->_ref_count_)) {
		GitgSimpleNotification* self;
		self = _data79_->self;
		_g_free0 (_data79_->message);
		_g_object_unref0 (self);
		g_slice_free (Block79Data, _data79_);
	}
}

static gboolean
__lambda6_ (Block79Data* _data79_)
{
	GitgSimpleNotification* self;
	GtkSpinner* _tmp0_;
	GtkSpinner* _tmp1_;
	GtkImage* _tmp2_;
	GtkImage* _tmp3_;
	GtkStyleContext* _tmp4_;
	gboolean result;
	self = _data79_->self;
	_tmp0_ = self->priv->d_spinner;
	gtk_spinner_stop (_tmp0_);
	_tmp1_ = self->priv->d_spinner;
	gtk_widget_hide ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->d_image_icon;
	g_object_set (_tmp2_, "icon-name", "emblem-ok-symbolic", NULL);
	_tmp3_ = self->priv->d_image_icon;
	gtk_widget_show ((GtkWidget*) _tmp3_);
	gitg_simple_notification_set_message (self, _data79_->message);
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp4_, "success");
	gitg_simple_notification_finish (self, TRUE);
	result = FALSE;
	return result;
}

static gboolean
___lambda6__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda6_ (self);
	return result;
}

void
gitg_simple_notification_success (GitgSimpleNotification* self,
                                  const gchar* message)
{
	Block79Data* _data79_;
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_data79_ = g_slice_new0 (Block79Data);
	_data79_->_ref_count_ = 1;
	_data79_->self = g_object_ref (self);
	_tmp0_ = g_strdup (message);
	_g_free0 (_data79_->message);
	_data79_->message = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda6__gsource_func, block79_data_ref (_data79_), block79_data_unref);
	block79_data_unref (_data79_);
	_data79_ = NULL;
}

static Block80Data*
block80_data_ref (Block80Data* _data80_)
{
	g_atomic_int_inc (&_data80_->_ref_count_);
	return _data80_;
}

static void
block80_data_unref (void * _userdata_)
{
	Block80Data* _data80_;
	_data80_ = (Block80Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data80_->_ref_count_)) {
		GitgSimpleNotification* self;
		self = _data80_->self;
		_g_free0 (_data80_->message);
		_g_object_unref0 (self);
		g_slice_free (Block80Data, _data80_);
	}
}

static gboolean
__lambda9_ (Block80Data* _data80_)
{
	GitgSimpleNotification* self;
	GtkSpinner* _tmp0_;
	GtkSpinner* _tmp1_;
	GtkImage* _tmp2_;
	GtkImage* _tmp3_;
	GtkStyleContext* _tmp4_;
	gboolean result;
	self = _data80_->self;
	_tmp0_ = self->priv->d_spinner;
	gtk_spinner_stop (_tmp0_);
	_tmp1_ = self->priv->d_spinner;
	gtk_widget_hide ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->d_image_icon;
	g_object_set (_tmp2_, "icon-name", "dialog-error-symbolic", NULL);
	_tmp3_ = self->priv->d_image_icon;
	gtk_widget_show ((GtkWidget*) _tmp3_);
	gitg_simple_notification_set_message (self, _data80_->message);
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp4_, "error");
	gitg_simple_notification_finish (self, FALSE);
	result = FALSE;
	return result;
}

static gboolean
___lambda9__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda9_ (self);
	return result;
}

void
gitg_simple_notification_error (GitgSimpleNotification* self,
                                const gchar* message)
{
	Block80Data* _data80_;
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_data80_ = g_slice_new0 (Block80Data);
	_data80_->_ref_count_ = 1;
	_data80_->self = g_object_ref (self);
	_tmp0_ = g_strdup (message);
	_g_free0 (_data80_->message);
	_data80_->message = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda9__gsource_func, block80_data_ref (_data80_), block80_data_unref);
	block80_data_unref (_data80_);
	_data80_ = NULL;
}

static Block81Data*
block81_data_ref (Block81Data* _data81_)
{
	g_atomic_int_inc (&_data81_->_ref_count_);
	return _data81_;
}

static void
block81_data_unref (void * _userdata_)
{
	Block81Data* _data81_;
	_data81_ = (Block81Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data81_->_ref_count_)) {
		GitgSimpleNotification* self;
		self = _data81_->self;
		_g_object_unref0 (self);
		g_slice_free (Block81Data, _data81_);
	}
}

static gboolean
__lambda8_ (Block81Data* _data81_)
{
	GitgSimpleNotification* self;
	GtkButton* _tmp0_;
	gboolean result;
	self = _data81_->self;
	self->priv->d_finished = TRUE;
	_tmp0_ = self->priv->d_button_cancel;
	gtk_button_set_label (_tmp0_, _ ("Close"));
	if (_data81_->auto_close) {
		g_signal_emit_by_name ((GitgExtNotification*) self, "close", (guint) 3000);
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda8__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda8_ (self);
	return result;
}

static void
gitg_simple_notification_finish (GitgSimpleNotification* self,
                                 gboolean auto_close)
{
	Block81Data* _data81_;
	g_return_if_fail (self != NULL);
	_data81_ = g_slice_new0 (Block81Data);
	_data81_->_ref_count_ = 1;
	_data81_->self = g_object_ref (self);
	_data81_->auto_close = auto_close;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda8__gsource_func, block81_data_ref (_data81_), block81_data_unref);
	block81_data_unref (_data81_);
	_data81_ = NULL;
}

static void
gitg_simple_notification_on_button_cancel_clicked (GitgSimpleNotification* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->d_finished) {
		g_signal_emit_by_name ((GitgExtNotification*) self, "close", (guint) 0);
	} else {
		g_signal_emit (self, gitg_simple_notification_signals[GITG_SIMPLE_NOTIFICATION_CANCEL_SIGNAL], 0);
	}
}

static void
_gitg_simple_notification_on_button_cancel_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self)
{
	gitg_simple_notification_on_button_cancel_clicked ((GitgSimpleNotification*) self);
}

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

static GtkWidget*
gitg_simple_notification_real_get_widget (GitgExtNotification* base)
{
	GtkWidget* result;
	GitgSimpleNotification* self;
	GtkWidget* _tmp0_;
	self = (GitgSimpleNotification*) base;
	_tmp0_ = _g_object_ref0 ((GtkWidget*) self);
	result = _tmp0_;
	return result;
}

static Block82Data*
block82_data_ref (Block82Data* _data82_)
{
	g_atomic_int_inc (&_data82_->_ref_count_);
	return _data82_;
}

static void
block82_data_unref (void * _userdata_)
{
	Block82Data* _data82_;
	_data82_ = (Block82Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data82_->_ref_count_)) {
		GitgSimpleNotification* self;
		self = _data82_->self;
		_g_free0 (_data82_->value);
		_g_object_unref0 (self);
		g_slice_free (Block82Data, _data82_);
	}
}

static gboolean
_gitg_simple_notification_title___lambda10_ (Block82Data* _data82_)
{
	GitgSimpleNotification* self;
	GtkLabel* _tmp0_;
	gboolean result;
	self = _data82_->self;
	_tmp0_ = self->priv->d_label_title;
	gtk_label_set_label (_tmp0_, _data82_->value);
	result = FALSE;
	return result;
}

static gboolean
__gitg_simple_notification_title___lambda10__gsource_func (gpointer self)
{
	gboolean result;
	result = _gitg_simple_notification_title___lambda10_ (self);
	return result;
}

void
gitg_simple_notification_set_title (GitgSimpleNotification* self,
                                    const gchar* value)
{
	Block82Data* _data82_;
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_data82_ = g_slice_new0 (Block82Data);
	_data82_->_ref_count_ = 1;
	_data82_->self = g_object_ref (self);
	_tmp0_ = g_strdup (value);
	_g_free0 (_data82_->value);
	_data82_->value = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __gitg_simple_notification_title___lambda10__gsource_func, block82_data_ref (_data82_), block82_data_unref);
	block82_data_unref (_data82_);
	_data82_ = NULL;
	g_object_notify_by_pspec ((GObject *) self, gitg_simple_notification_properties[GITG_SIMPLE_NOTIFICATION_TITLE_PROPERTY]);
}

static Block83Data*
block83_data_ref (Block83Data* _data83_)
{
	g_atomic_int_inc (&_data83_->_ref_count_);
	return _data83_;
}

static void
block83_data_unref (void * _userdata_)
{
	Block83Data* _data83_;
	_data83_ = (Block83Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data83_->_ref_count_)) {
		GitgSimpleNotification* self;
		self = _data83_->self;
		_g_free0 (_data83_->value);
		_g_object_unref0 (self);
		g_slice_free (Block83Data, _data83_);
	}
}

static gboolean
_gitg_simple_notification_message___lambda7_ (Block83Data* _data83_)
{
	GitgSimpleNotification* self;
	GtkLabel* _tmp0_;
	gboolean result;
	self = _data83_->self;
	_tmp0_ = self->priv->d_label_message;
	gtk_label_set_label (_tmp0_, _data83_->value);
	result = FALSE;
	return result;
}

static gboolean
__gitg_simple_notification_message___lambda7__gsource_func (gpointer self)
{
	gboolean result;
	result = _gitg_simple_notification_message___lambda7_ (self);
	return result;
}

void
gitg_simple_notification_set_message (GitgSimpleNotification* self,
                                      const gchar* value)
{
	Block83Data* _data83_;
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_data83_ = g_slice_new0 (Block83Data);
	_data83_->_ref_count_ = 1;
	_data83_->self = g_object_ref (self);
	_tmp0_ = g_strdup (value);
	_g_free0 (_data83_->value);
	_data83_->value = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __gitg_simple_notification_message___lambda7__gsource_func, block83_data_ref (_data83_), block83_data_unref);
	block83_data_unref (_data83_);
	_data83_ = NULL;
	g_object_notify_by_pspec ((GObject *) self, gitg_simple_notification_properties[GITG_SIMPLE_NOTIFICATION_MESSAGE_PROPERTY]);
}

static void
gitg_simple_notification_class_init (GitgSimpleNotificationClass * klass,
                                     gpointer klass_data)
{
	gitg_simple_notification_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgSimpleNotification_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_simple_notification_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_simple_notification_set_property;
	G_OBJECT_CLASS (klass)->finalize = gitg_simple_notification_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_SIMPLE_NOTIFICATION_WIDGET_PROPERTY, gitg_simple_notification_properties[GITG_SIMPLE_NOTIFICATION_WIDGET_PROPERTY] = g_param_spec_object ("widget", "widget", "widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_SIMPLE_NOTIFICATION_TITLE_PROPERTY, gitg_simple_notification_properties[GITG_SIMPLE_NOTIFICATION_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_SIMPLE_NOTIFICATION_MESSAGE_PROPERTY, gitg_simple_notification_properties[GITG_SIMPLE_NOTIFICATION_MESSAGE_PROPERTY] = g_param_spec_string ("message", "message", "message", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/gitg/ui/gitg-simple-notification.ui");
	gitg_simple_notification_signals[GITG_SIMPLE_NOTIFICATION_CANCEL_SIGNAL] = g_signal_new ("cancel", GITG_TYPE_SIMPLE_NOTIFICATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spinner", FALSE, GitgSimpleNotification_private_offset + G_STRUCT_OFFSET (GitgSimpleNotificationPrivate, d_spinner));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "image_icon", FALSE, GitgSimpleNotification_private_offset + G_STRUCT_OFFSET (GitgSimpleNotificationPrivate, d_image_icon));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "label_title", FALSE, GitgSimpleNotification_private_offset + G_STRUCT_OFFSET (GitgSimpleNotificationPrivate, d_label_title));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "label_message", FALSE, GitgSimpleNotification_private_offset + G_STRUCT_OFFSET (GitgSimpleNotificationPrivate, d_label_message));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "button_cancel", FALSE, GitgSimpleNotification_private_offset + G_STRUCT_OFFSET (GitgSimpleNotificationPrivate, d_button_cancel));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_button_cancel_clicked", G_CALLBACK(_gitg_simple_notification_on_button_cancel_clicked_gtk_button_clicked));
}

static void
gitg_simple_notification_gitg_ext_notification_interface_init (GitgExtNotificationIface * iface,
                                                               gpointer iface_data)
{
	gitg_simple_notification_gitg_ext_notification_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_widget = gitg_simple_notification_real_get_widget;
}

static void
gitg_simple_notification_instance_init (GitgSimpleNotification * self,
                                        gpointer klass)
{
	self->priv = gitg_simple_notification_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
gitg_simple_notification_finalize (GObject * obj)
{
	GitgSimpleNotification * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_SIMPLE_NOTIFICATION, GitgSimpleNotification);
	G_OBJECT_CLASS (gitg_simple_notification_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_simple_notification_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgSimpleNotificationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_simple_notification_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgSimpleNotification), 0, (GInstanceInitFunc) gitg_simple_notification_instance_init, NULL };
	static const GInterfaceInfo gitg_ext_notification_info = { (GInterfaceInitFunc) gitg_simple_notification_gitg_ext_notification_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gitg_simple_notification_type_id;
	gitg_simple_notification_type_id = g_type_register_static (gtk_grid_get_type (), "GitgSimpleNotification", &g_define_type_info, 0);
	g_type_add_interface_static (gitg_simple_notification_type_id, GITG_EXT_TYPE_NOTIFICATION, &gitg_ext_notification_info);
	GitgSimpleNotification_private_offset = g_type_add_instance_private (gitg_simple_notification_type_id, sizeof (GitgSimpleNotificationPrivate));
	return gitg_simple_notification_type_id;
}

GType
gitg_simple_notification_get_type (void)
{
	static gsize gitg_simple_notification_type_id__once = 0;
	if (g_once_init_enter (&gitg_simple_notification_type_id__once)) {
		GType gitg_simple_notification_type_id;
		gitg_simple_notification_type_id = gitg_simple_notification_get_type_once ();
		g_once_init_leave (&gitg_simple_notification_type_id__once, gitg_simple_notification_type_id);
	}
	return gitg_simple_notification_type_id__once;
}

static void
_vala_gitg_simple_notification_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	GitgSimpleNotification * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_SIMPLE_NOTIFICATION, GitgSimpleNotification);
	switch (property_id) {
		case GITG_SIMPLE_NOTIFICATION_WIDGET_PROPERTY:
		g_value_take_object (value, gitg_ext_notification_get_widget ((GitgExtNotification*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_simple_notification_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	GitgSimpleNotification * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_SIMPLE_NOTIFICATION, GitgSimpleNotification);
	switch (property_id) {
		case GITG_SIMPLE_NOTIFICATION_TITLE_PROPERTY:
		gitg_simple_notification_set_title (self, g_value_get_string (value));
		break;
		case GITG_SIMPLE_NOTIFICATION_MESSAGE_PROPERTY:
		gitg_simple_notification_set_message (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

