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

/* notifications.vala
 *
 * Copyright (C) Red Hat, Inc
 *
 * This program 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Felipe Borges <felipeborges@gnome.org>
 *
 */

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

#define CONNECTIONS_NOTIFICATIONS_BAR_DEFAULT_TIMEOUT 6
#define CONNECTIONS_NOTIFICATIONS_BAR_MAX_NOTIFICATIONS 5
#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 CONNECTIONS_TYPE_NOTIFICATIONS_BAR (connections_notifications_bar_get_type ())
#define CONNECTIONS_NOTIFICATIONS_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBar))
#define CONNECTIONS_NOTIFICATIONS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBarClass))
#define CONNECTIONS_IS_NOTIFICATIONS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_NOTIFICATIONS_BAR))
#define CONNECTIONS_IS_NOTIFICATIONS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_NOTIFICATIONS_BAR))
#define CONNECTIONS_NOTIFICATIONS_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBarClass))

typedef struct _ConnectionsNotificationsBar ConnectionsNotificationsBar;
typedef struct _ConnectionsNotificationsBarClass ConnectionsNotificationsBarClass;
typedef struct _ConnectionsNotificationsBarPrivate ConnectionsNotificationsBarPrivate;
enum  {
	CONNECTIONS_NOTIFICATIONS_BAR_0_PROPERTY,
	CONNECTIONS_NOTIFICATIONS_BAR_ACTIVE_NOTIFICATION_PROPERTY,
	CONNECTIONS_NOTIFICATIONS_BAR_NUM_PROPERTIES
};
static GParamSpec* connections_notifications_bar_properties[CONNECTIONS_NOTIFICATIONS_BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define CONNECTIONS_TYPE_NOTIFICATION (connections_notification_get_type ())
#define CONNECTIONS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_NOTIFICATION, ConnectionsNotification))
#define CONNECTIONS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_NOTIFICATION, ConnectionsNotificationClass))
#define CONNECTIONS_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_NOTIFICATION))
#define CONNECTIONS_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_NOTIFICATION))
#define CONNECTIONS_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_NOTIFICATION, ConnectionsNotificationClass))

typedef struct _ConnectionsNotification ConnectionsNotification;
typedef struct _ConnectionsNotificationClass ConnectionsNotificationClass;
typedef void (*ConnectionsNotificationOKFunc) (gpointer user_data);
typedef void (*ConnectionsNotificationDismissFunc) (gpointer user_data);
typedef struct _ConnectionsNotificationPrivate ConnectionsNotificationPrivate;
enum  {
	CONNECTIONS_NOTIFICATION_0_PROPERTY,
	CONNECTIONS_NOTIFICATION_NUM_PROPERTIES
};
static GParamSpec* connections_notification_properties[CONNECTIONS_NOTIFICATION_NUM_PROPERTIES];
typedef struct _Block6Data Block6Data;
enum  {
	CONNECTIONS_NOTIFICATION_DISMISSED_SIGNAL,
	CONNECTIONS_NOTIFICATION_NUM_SIGNALS
};
static guint connections_notification_signals[CONNECTIONS_NOTIFICATION_NUM_SIGNALS] = {0};

struct _ConnectionsNotificationsBar {
	GtkBin parent_instance;
	ConnectionsNotificationsBarPrivate * priv;
};

struct _ConnectionsNotificationsBarClass {
	GtkBinClass parent_class;
};

struct _ConnectionsNotificationsBarPrivate {
	GtkWidget* _active_notification;
};

struct _ConnectionsNotification {
	GtkRevealer parent_instance;
	ConnectionsNotificationPrivate * priv;
};

struct _ConnectionsNotificationClass {
	GtkRevealerClass parent_class;
};

struct _ConnectionsNotificationPrivate {
	ConnectionsNotificationDismissFunc dismiss_func;
	gpointer dismiss_func_target;
	GDestroyNotify dismiss_func_target_destroy_notify;
	GtkLabel* message_label;
	GtkButton* ok_button;
	guint notification_timeout_id;
};

struct _Block6Data {
	int _ref_count_;
	ConnectionsNotification* self;
	ConnectionsNotificationOKFunc ok_func;
	gpointer ok_func_target;
	GDestroyNotify ok_func_target_destroy_notify;
};

static gint ConnectionsNotificationsBar_private_offset;
static gpointer connections_notifications_bar_parent_class = NULL;
static gint ConnectionsNotification_private_offset;
static gpointer connections_notification_parent_class = NULL;

VALA_EXTERN GType connections_notifications_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsNotificationsBar, g_object_unref)
VALA_EXTERN void connections_notifications_bar_display_for_error (ConnectionsNotificationsBar* self,
                                                      const gchar* message);
VALA_EXTERN GType connections_notification_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsNotification, g_object_unref)
VALA_EXTERN ConnectionsNotification* connections_notification_new (const gchar* message,
                                                       const gchar* ok_label,
                                                       ConnectionsNotificationOKFunc ok_func,
                                                       gpointer ok_func_target,
                                                       GDestroyNotify ok_func_target_destroy_notify,
                                                       ConnectionsNotificationDismissFunc dismiss_func,
                                                       gpointer dismiss_func_target,
                                                       GDestroyNotify dismiss_func_target_destroy_notify,
                                                       gint timeout);
VALA_EXTERN ConnectionsNotification* connections_notification_construct (GType object_type,
                                                             const gchar* message,
                                                             const gchar* ok_label,
                                                             ConnectionsNotificationOKFunc ok_func,
                                                             gpointer ok_func_target,
                                                             GDestroyNotify ok_func_target_destroy_notify,
                                                             ConnectionsNotificationDismissFunc dismiss_func,
                                                             gpointer dismiss_func_target,
                                                             GDestroyNotify dismiss_func_target_destroy_notify,
                                                             gint timeout);
VALA_EXTERN void connections_notifications_bar_set_active_notification (ConnectionsNotificationsBar* self,
                                                            GtkWidget* value);
VALA_EXTERN void connections_notifications_bar_display_for_action (ConnectionsNotificationsBar* self,
                                                       const gchar* message,
                                                       const gchar* ok_label,
                                                       ConnectionsNotificationOKFunc ok_func,
                                                       gpointer ok_func_target,
                                                       GDestroyNotify ok_func_target_destroy_notify,
                                                       ConnectionsNotificationDismissFunc dismiss_func,
                                                       gpointer dismiss_func_target,
                                                       GDestroyNotify dismiss_func_target_destroy_notify);
static void __lambda21_ (ConnectionsNotificationsBar* self);
static void ___lambda21__connections_notification_dismissed (ConnectionsNotification* _sender,
                                                      gpointer self);
VALA_EXTERN void connections_notifications_bar_dismiss (ConnectionsNotificationsBar* self);
VALA_EXTERN GtkWidget* connections_notifications_bar_get_active_notification (ConnectionsNotificationsBar* self);
VALA_EXTERN void connections_notification_dismiss (ConnectionsNotification* self);
VALA_EXTERN ConnectionsNotificationsBar* connections_notifications_bar_new (void);
VALA_EXTERN ConnectionsNotificationsBar* connections_notifications_bar_construct (GType object_type);
static GObject * connections_notifications_bar_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static void connections_notifications_bar_finalize (GObject * obj);
static GType connections_notifications_bar_get_type_once (void);
static void _vala_connections_notifications_bar_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_connections_notifications_bar_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static gboolean __lambda19_ (ConnectionsNotification* self);
static gboolean ___lambda19__gsource_func (gpointer self);
static void ___lambda20_ (Block6Data* _data6_);
static void ____lambda20__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void _connections_notification_dismiss_gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self);
static void connections_notification_finalize (GObject * obj);
static GType connections_notification_get_type_once (void);

static inline gpointer
connections_notifications_bar_get_instance_private (ConnectionsNotificationsBar* self)
{
	return G_STRUCT_MEMBER_P (self, ConnectionsNotificationsBar_private_offset);
}

void
connections_notifications_bar_display_for_error (ConnectionsNotificationsBar* self,
                                                 const gchar* message)
{
	ConnectionsNotification* notification = NULL;
	ConnectionsNotification* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = connections_notification_new (message, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CONNECTIONS_NOTIFICATIONS_BAR_DEFAULT_TIMEOUT);
	g_object_ref_sink (_tmp0_);
	notification = _tmp0_;
	connections_notifications_bar_set_active_notification (self, (GtkWidget*) notification);
	_g_object_unref0 (notification);
}

static void
__lambda21_ (ConnectionsNotificationsBar* self)
{
	connections_notifications_bar_set_active_notification (self, NULL);
}

static void
___lambda21__connections_notification_dismissed (ConnectionsNotification* _sender,
                                                 gpointer self)
{
	__lambda21_ ((ConnectionsNotificationsBar*) self);
}

void
connections_notifications_bar_display_for_action (ConnectionsNotificationsBar* self,
                                                  const gchar* message,
                                                  const gchar* ok_label,
                                                  ConnectionsNotificationOKFunc ok_func,
                                                  gpointer ok_func_target,
                                                  GDestroyNotify ok_func_target_destroy_notify,
                                                  ConnectionsNotificationDismissFunc dismiss_func,
                                                  gpointer dismiss_func_target,
                                                  GDestroyNotify dismiss_func_target_destroy_notify)
{
	ConnectionsNotification* notification = NULL;
	ConnectionsNotificationOKFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	ConnectionsNotificationDismissFunc _tmp1_;
	gpointer _tmp1__target;
	GDestroyNotify _tmp1__target_destroy_notify;
	ConnectionsNotification* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = ok_func;
	_tmp0__target = ok_func_target;
	_tmp0__target_destroy_notify = ok_func_target_destroy_notify;
	ok_func = NULL;
	ok_func_target = NULL;
	ok_func_target_destroy_notify = NULL;
	_tmp1_ = dismiss_func;
	_tmp1__target = dismiss_func_target;
	_tmp1__target_destroy_notify = dismiss_func_target_destroy_notify;
	dismiss_func = NULL;
	dismiss_func_target = NULL;
	dismiss_func_target_destroy_notify = NULL;
	_tmp2_ = connections_notification_new (message, ok_label, _tmp0_, _tmp0__target, _tmp0__target_destroy_notify, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify, CONNECTIONS_NOTIFICATIONS_BAR_DEFAULT_TIMEOUT);
	g_object_ref_sink (_tmp2_);
	notification = _tmp2_;
	g_signal_connect_object (notification, "dismissed", (GCallback) ___lambda21__connections_notification_dismissed, self, 0);
	connections_notifications_bar_set_active_notification (self, (GtkWidget*) notification);
	_g_object_unref0 (notification);
	(ok_func_target_destroy_notify == NULL) ? NULL : (ok_func_target_destroy_notify (ok_func_target), NULL);
	ok_func = NULL;
	ok_func_target = NULL;
	ok_func_target_destroy_notify = NULL;
	(dismiss_func_target_destroy_notify == NULL) ? NULL : (dismiss_func_target_destroy_notify (dismiss_func_target), NULL);
	dismiss_func = NULL;
	dismiss_func_target = NULL;
	dismiss_func_target_destroy_notify = NULL;
}

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

void
connections_notifications_bar_dismiss (ConnectionsNotificationsBar* self)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = connections_notifications_bar_get_active_notification (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		_tmp2_ = connections_notifications_bar_get_active_notification (self);
		_tmp3_ = _tmp2_;
		if (CONNECTIONS_IS_NOTIFICATION (_tmp3_)) {
			ConnectionsNotification* notification = NULL;
			GtkWidget* _tmp4_;
			GtkWidget* _tmp5_;
			ConnectionsNotification* _tmp6_;
			ConnectionsNotification* _tmp7_;
			_tmp4_ = connections_notifications_bar_get_active_notification (self);
			_tmp5_ = _tmp4_;
			_tmp6_ = _g_object_ref0 (CONNECTIONS_IS_NOTIFICATION (_tmp5_) ? ((ConnectionsNotification*) _tmp5_) : NULL);
			notification = _tmp6_;
			_tmp7_ = notification;
			connections_notification_dismiss (_tmp7_);
			_g_object_unref0 (notification);
		}
		connections_notifications_bar_set_active_notification (self, NULL);
	}
}

ConnectionsNotificationsBar*
connections_notifications_bar_construct (GType object_type)
{
	ConnectionsNotificationsBar * self = NULL;
	self = (ConnectionsNotificationsBar*) g_object_new (object_type, NULL);
	return self;
}

ConnectionsNotificationsBar*
connections_notifications_bar_new (void)
{
	return connections_notifications_bar_construct (CONNECTIONS_TYPE_NOTIFICATIONS_BAR);
}

GtkWidget*
connections_notifications_bar_get_active_notification (ConnectionsNotificationsBar* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_active_notification;
	result = _tmp0_;
	return result;
}

void
connections_notifications_bar_set_active_notification (ConnectionsNotificationsBar* self,
                                                       GtkWidget* value)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_active_notification;
	if (_tmp0_ != NULL) {
		GtkWidget* _tmp1_;
		_tmp1_ = self->priv->_active_notification;
		gtk_container_remove ((GtkContainer*) self, _tmp1_);
	}
	_tmp2_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_active_notification);
	self->priv->_active_notification = _tmp2_;
	_tmp3_ = self->priv->_active_notification;
	if (_tmp3_ != NULL) {
		GtkWidget* _tmp4_;
		_tmp4_ = self->priv->_active_notification;
		gtk_container_add ((GtkContainer*) self, _tmp4_);
	}
	g_object_notify_by_pspec ((GObject *) self, connections_notifications_bar_properties[CONNECTIONS_NOTIFICATIONS_BAR_ACTIVE_NOTIFICATION_PROPERTY]);
}

static GObject *
connections_notifications_bar_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ConnectionsNotificationsBar * self;
	GtkStyleContext* _tmp0_;
	parent_class = G_OBJECT_CLASS (connections_notifications_bar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBar);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_START);
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp0_, "transparent-bg");
	return obj;
}

static void
connections_notifications_bar_class_init (ConnectionsNotificationsBarClass * klass,
                                          gpointer klass_data)
{
	connections_notifications_bar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConnectionsNotificationsBar_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_connections_notifications_bar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_connections_notifications_bar_set_property;
	G_OBJECT_CLASS (klass)->constructor = connections_notifications_bar_constructor;
	G_OBJECT_CLASS (klass)->finalize = connections_notifications_bar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONNECTIONS_NOTIFICATIONS_BAR_ACTIVE_NOTIFICATION_PROPERTY, connections_notifications_bar_properties[CONNECTIONS_NOTIFICATIONS_BAR_ACTIVE_NOTIFICATION_PROPERTY] = g_param_spec_object ("active-notification", "active-notification", "active-notification", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
connections_notifications_bar_instance_init (ConnectionsNotificationsBar * self,
                                             gpointer klass)
{
	self->priv = connections_notifications_bar_get_instance_private (self);
}

static void
connections_notifications_bar_finalize (GObject * obj)
{
	ConnectionsNotificationsBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBar);
	_g_object_unref0 (self->priv->_active_notification);
	G_OBJECT_CLASS (connections_notifications_bar_parent_class)->finalize (obj);
}

static GType
connections_notifications_bar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConnectionsNotificationsBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) connections_notifications_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConnectionsNotificationsBar), 0, (GInstanceInitFunc) connections_notifications_bar_instance_init, NULL };
	GType connections_notifications_bar_type_id;
	connections_notifications_bar_type_id = g_type_register_static (gtk_bin_get_type (), "ConnectionsNotificationsBar", &g_define_type_info, 0);
	ConnectionsNotificationsBar_private_offset = g_type_add_instance_private (connections_notifications_bar_type_id, sizeof (ConnectionsNotificationsBarPrivate));
	return connections_notifications_bar_type_id;
}

GType
connections_notifications_bar_get_type (void)
{
	static volatile gsize connections_notifications_bar_type_id__once = 0;
	if (g_once_init_enter (&connections_notifications_bar_type_id__once)) {
		GType connections_notifications_bar_type_id;
		connections_notifications_bar_type_id = connections_notifications_bar_get_type_once ();
		g_once_init_leave (&connections_notifications_bar_type_id__once, connections_notifications_bar_type_id);
	}
	return connections_notifications_bar_type_id__once;
}

static void
_vala_connections_notifications_bar_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	ConnectionsNotificationsBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBar);
	switch (property_id) {
		case CONNECTIONS_NOTIFICATIONS_BAR_ACTIVE_NOTIFICATION_PROPERTY:
		g_value_set_object (value, connections_notifications_bar_get_active_notification (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_connections_notifications_bar_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	ConnectionsNotificationsBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBar);
	switch (property_id) {
		case CONNECTIONS_NOTIFICATIONS_BAR_ACTIVE_NOTIFICATION_PROPERTY:
		connections_notifications_bar_set_active_notification (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
connections_notification_get_instance_private (ConnectionsNotification* self)
{
	return G_STRUCT_MEMBER_P (self, ConnectionsNotification_private_offset);
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		ConnectionsNotification* self;
		self = _data6_->self;
		(_data6_->ok_func_target_destroy_notify == NULL) ? NULL : (_data6_->ok_func_target_destroy_notify (_data6_->ok_func_target), NULL);
		_data6_->ok_func = NULL;
		_data6_->ok_func_target = NULL;
		_data6_->ok_func_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static gboolean
__lambda19_ (ConnectionsNotification* self)
{
	gboolean result;
	self->priv->notification_timeout_id = (guint) 0;
	connections_notification_dismiss (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda19__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda19_ ((ConnectionsNotification*) self);
	return result;
}

static void
___lambda20_ (Block6Data* _data6_)
{
	ConnectionsNotification* self;
	self = _data6_->self;
	if (_data6_->ok_func != NULL) {
		_data6_->ok_func (_data6_->ok_func_target);
	}
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, FALSE);
	g_signal_emit (self, connections_notification_signals[CONNECTIONS_NOTIFICATION_DISMISSED_SIGNAL], 0);
	if (self->priv->notification_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->notification_timeout_id);
		self->priv->notification_timeout_id = (guint) 0;
	}
}

static void
____lambda20__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	___lambda20_ (self);
}

ConnectionsNotification*
connections_notification_construct (GType object_type,
                                    const gchar* message,
                                    const gchar* ok_label,
                                    ConnectionsNotificationOKFunc ok_func,
                                    gpointer ok_func_target,
                                    GDestroyNotify ok_func_target_destroy_notify,
                                    ConnectionsNotificationDismissFunc dismiss_func,
                                    gpointer dismiss_func_target,
                                    GDestroyNotify dismiss_func_target_destroy_notify,
                                    gint timeout)
{
	ConnectionsNotification * self = NULL;
	Block6Data* _data6_;
	ConnectionsNotificationDismissFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	GtkLabel* _tmp1_;
	g_return_val_if_fail (message != NULL, NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	(_data6_->ok_func_target_destroy_notify == NULL) ? NULL : (_data6_->ok_func_target_destroy_notify (_data6_->ok_func_target), NULL);
	_data6_->ok_func = NULL;
	_data6_->ok_func_target = NULL;
	_data6_->ok_func_target_destroy_notify = NULL;
	_data6_->ok_func = ok_func;
	_data6_->ok_func_target = ok_func_target;
	_data6_->ok_func_target_destroy_notify = ok_func_target_destroy_notify;
	self = (ConnectionsNotification*) g_object_new (object_type, NULL);
	_data6_->self = g_object_ref (self);
	_tmp0_ = dismiss_func;
	_tmp0__target = dismiss_func_target;
	_tmp0__target_destroy_notify = dismiss_func_target_destroy_notify;
	dismiss_func = NULL;
	dismiss_func_target = NULL;
	dismiss_func_target_destroy_notify = NULL;
	(self->priv->dismiss_func_target_destroy_notify == NULL) ? NULL : (self->priv->dismiss_func_target_destroy_notify (self->priv->dismiss_func_target), NULL);
	self->priv->dismiss_func = NULL;
	self->priv->dismiss_func_target = NULL;
	self->priv->dismiss_func_target_destroy_notify = NULL;
	self->priv->dismiss_func = _tmp0_;
	self->priv->dismiss_func_target = _tmp0__target;
	self->priv->dismiss_func_target_destroy_notify = _tmp0__target_destroy_notify;
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, TRUE);
	_tmp1_ = self->priv->message_label;
	gtk_label_set_label (_tmp1_, message);
	self->priv->notification_timeout_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) timeout, ___lambda19__gsource_func, g_object_ref (self), g_object_unref);
	if (ok_label != NULL) {
		GtkButton* _tmp2_;
		GtkButton* _tmp3_;
		GtkButton* _tmp4_;
		_tmp2_ = self->priv->ok_button;
		gtk_button_set_label (_tmp2_, ok_label);
		_tmp3_ = self->priv->ok_button;
		g_signal_connect_data (_tmp3_, "clicked", (GCallback) ____lambda20__gtk_button_clicked, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
		_tmp4_ = self->priv->ok_button;
		gtk_widget_show_all ((GtkWidget*) _tmp4_);
	}
	(dismiss_func_target_destroy_notify == NULL) ? NULL : (dismiss_func_target_destroy_notify (dismiss_func_target), NULL);
	dismiss_func = NULL;
	dismiss_func_target = NULL;
	dismiss_func_target_destroy_notify = NULL;
	block6_data_unref (_data6_);
	_data6_ = NULL;
	return self;
}

ConnectionsNotification*
connections_notification_new (const gchar* message,
                              const gchar* ok_label,
                              ConnectionsNotificationOKFunc ok_func,
                              gpointer ok_func_target,
                              GDestroyNotify ok_func_target_destroy_notify,
                              ConnectionsNotificationDismissFunc dismiss_func,
                              gpointer dismiss_func_target,
                              GDestroyNotify dismiss_func_target_destroy_notify,
                              gint timeout)
{
	return connections_notification_construct (CONNECTIONS_TYPE_NOTIFICATION, message, ok_label, ok_func, ok_func_target, ok_func_target_destroy_notify, dismiss_func, dismiss_func_target, dismiss_func_target_destroy_notify, timeout);
}

void
connections_notification_dismiss (ConnectionsNotification* self)
{
	ConnectionsNotificationDismissFunc _tmp0_;
	gpointer _tmp0__target;
	g_return_if_fail (self != NULL);
	g_signal_emit (self, connections_notification_signals[CONNECTIONS_NOTIFICATION_DISMISSED_SIGNAL], 0);
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, FALSE);
	_tmp0_ = self->priv->dismiss_func;
	_tmp0__target = self->priv->dismiss_func_target;
	if (_tmp0_ != NULL) {
		ConnectionsNotificationDismissFunc _tmp1_;
		gpointer _tmp1__target;
		_tmp1_ = self->priv->dismiss_func;
		_tmp1__target = self->priv->dismiss_func_target;
		_tmp1_ (_tmp1__target);
	}
	if (self->priv->notification_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->notification_timeout_id);
		self->priv->notification_timeout_id = (guint) 0;
	}
}

static void
_connections_notification_dismiss_gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self)
{
	connections_notification_dismiss ((ConnectionsNotification*) self);
}

static void
connections_notification_class_init (ConnectionsNotificationClass * klass,
                                     gpointer klass_data)
{
	connections_notification_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConnectionsNotification_private_offset);
	G_OBJECT_CLASS (klass)->finalize = connections_notification_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Connections/ui/notification.ui");
	connections_notification_signals[CONNECTIONS_NOTIFICATION_DISMISSED_SIGNAL] = g_signal_new ("dismissed", CONNECTIONS_TYPE_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), "message_label", FALSE, ConnectionsNotification_private_offset + G_STRUCT_OFFSET (ConnectionsNotificationPrivate, message_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ok_button", FALSE, ConnectionsNotification_private_offset + G_STRUCT_OFFSET (ConnectionsNotificationPrivate, ok_button));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "dismiss", G_CALLBACK(_connections_notification_dismiss_gtk_button_clicked));
}

static void
connections_notification_instance_init (ConnectionsNotification * self,
                                        gpointer klass)
{
	self->priv = connections_notification_get_instance_private (self);
	self->priv->notification_timeout_id = (guint) 0;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
connections_notification_finalize (GObject * obj)
{
	ConnectionsNotification * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONNECTIONS_TYPE_NOTIFICATION, ConnectionsNotification);
	(self->priv->dismiss_func_target_destroy_notify == NULL) ? NULL : (self->priv->dismiss_func_target_destroy_notify (self->priv->dismiss_func_target), NULL);
	self->priv->dismiss_func = NULL;
	self->priv->dismiss_func_target = NULL;
	self->priv->dismiss_func_target_destroy_notify = NULL;
	G_OBJECT_CLASS (connections_notification_parent_class)->finalize (obj);
}

static GType
connections_notification_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConnectionsNotificationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) connections_notification_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConnectionsNotification), 0, (GInstanceInitFunc) connections_notification_instance_init, NULL };
	GType connections_notification_type_id;
	connections_notification_type_id = g_type_register_static (gtk_revealer_get_type (), "ConnectionsNotification", &g_define_type_info, 0);
	ConnectionsNotification_private_offset = g_type_add_instance_private (connections_notification_type_id, sizeof (ConnectionsNotificationPrivate));
	return connections_notification_type_id;
}

GType
connections_notification_get_type (void)
{
	static volatile gsize connections_notification_type_id__once = 0;
	if (g_once_init_enter (&connections_notification_type_id__once)) {
		GType connections_notification_type_id;
		connections_notification_type_id = connections_notification_get_type_once ();
		g_once_init_leave (&connections_notification_type_id__once, connections_notification_type_id);
	}
	return connections_notification_type_id__once;
}

