/* notifications.c generated by valac 0.56.3, 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_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 void (*ConnectionsAuthNotificationAuthFunc) (const gchar* username, const gchar* password, gpointer user_data);

#define CONNECTIONS_TYPE_AUTH_NOTIFICATION (connections_auth_notification_get_type ())
#define CONNECTIONS_AUTH_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_AUTH_NOTIFICATION, ConnectionsAuthNotification))
#define CONNECTIONS_AUTH_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_AUTH_NOTIFICATION, ConnectionsAuthNotificationClass))
#define CONNECTIONS_IS_AUTH_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_AUTH_NOTIFICATION))
#define CONNECTIONS_IS_AUTH_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_AUTH_NOTIFICATION))
#define CONNECTIONS_AUTH_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_AUTH_NOTIFICATION, ConnectionsAuthNotificationClass))

typedef struct _ConnectionsAuthNotification ConnectionsAuthNotification;
typedef struct _ConnectionsAuthNotificationClass ConnectionsAuthNotificationClass;
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};
typedef struct _ConnectionsAuthNotificationPrivate ConnectionsAuthNotificationPrivate;
enum  {
	CONNECTIONS_AUTH_NOTIFICATION_0_PROPERTY,
	CONNECTIONS_AUTH_NOTIFICATION_NUM_PROPERTIES
};
static GParamSpec* connections_auth_notification_properties[CONNECTIONS_AUTH_NOTIFICATION_NUM_PROPERTIES];
typedef struct _Block7Data Block7Data;
enum  {
	CONNECTIONS_AUTH_NOTIFICATION_DISMISSED_SIGNAL,
	CONNECTIONS_AUTH_NOTIFICATION_NUM_SIGNALS
};
static guint connections_auth_notification_signals[CONNECTIONS_AUTH_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;
};

struct _ConnectionsAuthNotification {
	GtkRevealer parent_instance;
	ConnectionsAuthNotificationPrivate * priv;
};

struct _ConnectionsAuthNotificationClass {
	GtkRevealerClass parent_class;
};

struct _ConnectionsAuthNotificationPrivate {
	gboolean auth_pressed;
	GtkLabel* title_label;
	GtkLabel* username_label;
	GtkEntry* username_entry;
	GtkEntry* password_entry;
	GtkButton* auth_button;
	ConnectionsAuthNotificationAuthFunc auth_func;
	gpointer auth_func_target;
	GDestroyNotify auth_func_target_destroy_notify;
};

struct _Block7Data {
	int _ref_count_;
	ConnectionsAuthNotification* self;
	ConnectionsNotificationDismissFunc dismiss_func;
	gpointer dismiss_func_target;
	GDestroyNotify dismiss_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;
static gint ConnectionsAuthNotification_private_offset;
static gpointer connections_auth_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 __lambda14_ (ConnectionsNotificationsBar* self);
static void ___lambda14__connections_notification_dismissed (ConnectionsNotification* _sender,
                                                      gpointer self);
VALA_EXTERN GType connections_auth_notification_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsAuthNotification, g_object_unref)
VALA_EXTERN ConnectionsAuthNotification* connections_notifications_bar_display_for_auth (ConnectionsNotificationsBar* self,
                                                                             const gchar* auth_string,
                                                                             ConnectionsAuthNotificationAuthFunc auth_func,
                                                                             gpointer auth_func_target,
                                                                             GDestroyNotify auth_func_target_destroy_notify,
                                                                             ConnectionsNotificationDismissFunc dismiss_func,
                                                                             gpointer dismiss_func_target,
                                                                             GDestroyNotify dismiss_func_target_destroy_notify,
                                                                             gboolean need_username);
VALA_EXTERN ConnectionsAuthNotification* connections_auth_notification_new (const gchar* auth_string,
                                                                ConnectionsAuthNotificationAuthFunc auth_func,
                                                                gpointer auth_func_target,
                                                                GDestroyNotify auth_func_target_destroy_notify,
                                                                ConnectionsNotificationDismissFunc dismiss_func,
                                                                gpointer dismiss_func_target,
                                                                GDestroyNotify dismiss_func_target_destroy_notify,
                                                                gboolean need_username);
VALA_EXTERN ConnectionsAuthNotification* connections_auth_notification_construct (GType object_type,
                                                                      const gchar* auth_string,
                                                                      ConnectionsAuthNotificationAuthFunc auth_func,
                                                                      gpointer auth_func_target,
                                                                      GDestroyNotify auth_func_target_destroy_notify,
                                                                      ConnectionsNotificationDismissFunc dismiss_func,
                                                                      gpointer dismiss_func_target,
                                                                      GDestroyNotify dismiss_func_target_destroy_notify,
                                                                      gboolean need_username);
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 void connections_auth_notification_dismiss (ConnectionsAuthNotification* 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 __lambda12_ (ConnectionsNotification* self);
static gboolean ___lambda12__gsource_func (gpointer self);
static void ___lambda13_ (Block6Data* _data6_);
static void ____lambda13__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 Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static void __lambda4_ (Block7Data* _data7_);
static void ___lambda4__connections_auth_notification_dismissed (ConnectionsAuthNotification* _sender,
                                                          gpointer self);
static void connections_auth_notification_on_username_entry_map (ConnectionsAuthNotification* self);
static void _connections_auth_notification_on_username_entry_map_gtk_widget_map (GtkWidget* _sender,
                                                                          gpointer self);
static void connections_auth_notification_on_username_entry_activated (ConnectionsAuthNotification* self);
static void _connections_auth_notification_on_username_entry_activated_gtk_entry_activate (GtkEntry* _sender,
                                                                                    gpointer self);
static void connections_auth_notification_on_password_entry_map (ConnectionsAuthNotification* self);
static void _connections_auth_notification_on_password_entry_map_gtk_widget_map (GtkWidget* _sender,
                                                                          gpointer self);
static void connections_auth_notification_on_password_entry_activated (ConnectionsAuthNotification* self);
static void _connections_auth_notification_on_password_entry_activated_gtk_entry_activate (GtkEntry* _sender,
                                                                                    gpointer self);
static void connections_auth_notification_on_auth_button_clicked (ConnectionsAuthNotification* self);
static void _connections_auth_notification_on_auth_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                               gpointer self);
static void connections_auth_notification_finalize (GObject * obj);
static GType connections_auth_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
__lambda14_ (ConnectionsNotificationsBar* self)
{
	connections_notifications_bar_set_active_notification (self, NULL);
}

static void
___lambda14__connections_notification_dismissed (ConnectionsNotification* _sender,
                                                 gpointer self)
{
	__lambda14_ ((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) ___lambda14__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;
}

ConnectionsAuthNotification*
connections_notifications_bar_display_for_auth (ConnectionsNotificationsBar* self,
                                                const gchar* auth_string,
                                                ConnectionsAuthNotificationAuthFunc auth_func,
                                                gpointer auth_func_target,
                                                GDestroyNotify auth_func_target_destroy_notify,
                                                ConnectionsNotificationDismissFunc dismiss_func,
                                                gpointer dismiss_func_target,
                                                GDestroyNotify dismiss_func_target_destroy_notify,
                                                gboolean need_username)
{
	ConnectionsAuthNotification* notification = NULL;
	ConnectionsAuthNotificationAuthFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	ConnectionsNotificationDismissFunc _tmp1_;
	gpointer _tmp1__target;
	GDestroyNotify _tmp1__target_destroy_notify;
	ConnectionsAuthNotification* _tmp2_;
	ConnectionsAuthNotification* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (auth_string != NULL, NULL);
	_tmp0_ = auth_func;
	_tmp0__target = auth_func_target;
	_tmp0__target_destroy_notify = auth_func_target_destroy_notify;
	auth_func = NULL;
	auth_func_target = NULL;
	auth_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_auth_notification_new (auth_string, _tmp0_, _tmp0__target, _tmp0__target_destroy_notify, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify, need_username);
	g_object_ref_sink (_tmp2_);
	notification = _tmp2_;
	connections_notifications_bar_set_active_notification (self, (GtkWidget*) notification);
	result = notification;
	(auth_func_target_destroy_notify == NULL) ? NULL : (auth_func_target_destroy_notify (auth_func_target), NULL);
	auth_func = NULL;
	auth_func_target = NULL;
	auth_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;
	return result;
}

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);
		} else {
			GtkWidget* _tmp8_;
			GtkWidget* _tmp9_;
			_tmp8_ = connections_notifications_bar_get_active_notification (self);
			_tmp9_ = _tmp8_;
			if (CONNECTIONS_IS_AUTH_NOTIFICATION (_tmp9_)) {
				ConnectionsAuthNotification* notification = NULL;
				GtkWidget* _tmp10_;
				GtkWidget* _tmp11_;
				ConnectionsAuthNotification* _tmp12_;
				ConnectionsAuthNotification* _tmp13_;
				_tmp10_ = connections_notifications_bar_get_active_notification (self);
				_tmp11_ = _tmp10_;
				_tmp12_ = _g_object_ref0 (CONNECTIONS_IS_AUTH_NOTIFICATION (_tmp11_) ? ((ConnectionsAuthNotification*) _tmp11_) : NULL);
				notification = _tmp12_;
				_tmp13_ = notification;
				connections_auth_notification_dismiss (_tmp13_);
				_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;
	gtk_container_add ((GtkContainer*) self, _tmp3_);
	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
__lambda12_ (ConnectionsNotification* self)
{
	gboolean result;
	self->priv->notification_timeout_id = (guint) 0;
	connections_notification_dismiss (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda12__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda12_ ((ConnectionsNotification*) self);
	return result;
}

static void
___lambda13_ (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
____lambda13__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	___lambda13_ (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, ___lambda12__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) ____lambda13__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;
}

static inline gpointer
connections_auth_notification_get_instance_private (ConnectionsAuthNotification* self)
{
	return G_STRUCT_MEMBER_P (self, ConnectionsAuthNotification_private_offset);
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		ConnectionsAuthNotification* self;
		self = _data7_->self;
		(_data7_->dismiss_func_target_destroy_notify == NULL) ? NULL : (_data7_->dismiss_func_target_destroy_notify (_data7_->dismiss_func_target), NULL);
		_data7_->dismiss_func = NULL;
		_data7_->dismiss_func_target = NULL;
		_data7_->dismiss_func_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static void
__lambda4_ (Block7Data* _data7_)
{
	ConnectionsAuthNotification* self;
	gboolean _tmp0_ = FALSE;
	self = _data7_->self;
	if (!self->priv->auth_pressed) {
		_tmp0_ = _data7_->dismiss_func != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		_data7_->dismiss_func (_data7_->dismiss_func_target);
	}
}

static void
___lambda4__connections_auth_notification_dismissed (ConnectionsAuthNotification* _sender,
                                                     gpointer self)
{
	__lambda4_ (self);
}

ConnectionsAuthNotification*
connections_auth_notification_construct (GType object_type,
                                         const gchar* auth_string,
                                         ConnectionsAuthNotificationAuthFunc auth_func,
                                         gpointer auth_func_target,
                                         GDestroyNotify auth_func_target_destroy_notify,
                                         ConnectionsNotificationDismissFunc dismiss_func,
                                         gpointer dismiss_func_target,
                                         GDestroyNotify dismiss_func_target_destroy_notify,
                                         gboolean need_username)
{
	ConnectionsAuthNotification * self = NULL;
	Block7Data* _data7_;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkEntry* _tmp2_;
	ConnectionsAuthNotificationAuthFunc _tmp3_;
	gpointer _tmp3__target;
	GDestroyNotify _tmp3__target_destroy_notify;
	g_return_val_if_fail (auth_string != NULL, NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	(_data7_->dismiss_func_target_destroy_notify == NULL) ? NULL : (_data7_->dismiss_func_target_destroy_notify (_data7_->dismiss_func_target), NULL);
	_data7_->dismiss_func = NULL;
	_data7_->dismiss_func_target = NULL;
	_data7_->dismiss_func_target_destroy_notify = NULL;
	_data7_->dismiss_func = dismiss_func;
	_data7_->dismiss_func_target = dismiss_func_target;
	_data7_->dismiss_func_target_destroy_notify = dismiss_func_target_destroy_notify;
	self = (ConnectionsAuthNotification*) g_object_new (object_type, NULL);
	_data7_->self = g_object_ref (self);
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, TRUE);
	_tmp0_ = self->priv->title_label;
	gtk_label_set_label (_tmp0_, auth_string);
	_tmp1_ = self->priv->username_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, need_username);
	_tmp2_ = self->priv->username_entry;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, need_username);
	_tmp3_ = auth_func;
	_tmp3__target = auth_func_target;
	_tmp3__target_destroy_notify = auth_func_target_destroy_notify;
	auth_func = NULL;
	auth_func_target = NULL;
	auth_func_target_destroy_notify = NULL;
	(self->priv->auth_func_target_destroy_notify == NULL) ? NULL : (self->priv->auth_func_target_destroy_notify (self->priv->auth_func_target), NULL);
	self->priv->auth_func = NULL;
	self->priv->auth_func_target = NULL;
	self->priv->auth_func_target_destroy_notify = NULL;
	self->priv->auth_func = _tmp3_;
	self->priv->auth_func_target = _tmp3__target;
	self->priv->auth_func_target_destroy_notify = _tmp3__target_destroy_notify;
	g_signal_connect_data (self, "dismissed", (GCallback) ___lambda4__connections_auth_notification_dismissed, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	(auth_func_target_destroy_notify == NULL) ? NULL : (auth_func_target_destroy_notify (auth_func_target), NULL);
	auth_func = NULL;
	auth_func_target = NULL;
	auth_func_target_destroy_notify = NULL;
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return self;
}

ConnectionsAuthNotification*
connections_auth_notification_new (const gchar* auth_string,
                                   ConnectionsAuthNotificationAuthFunc auth_func,
                                   gpointer auth_func_target,
                                   GDestroyNotify auth_func_target_destroy_notify,
                                   ConnectionsNotificationDismissFunc dismiss_func,
                                   gpointer dismiss_func_target,
                                   GDestroyNotify dismiss_func_target_destroy_notify,
                                   gboolean need_username)
{
	return connections_auth_notification_construct (CONNECTIONS_TYPE_AUTH_NOTIFICATION, auth_string, auth_func, auth_func_target, auth_func_target_destroy_notify, dismiss_func, dismiss_func_target, dismiss_func_target_destroy_notify, need_username);
}

static void
connections_auth_notification_on_username_entry_map (ConnectionsAuthNotification* self)
{
	GtkEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->username_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

static void
_connections_auth_notification_on_username_entry_map_gtk_widget_map (GtkWidget* _sender,
                                                                     gpointer self)
{
	connections_auth_notification_on_username_entry_map ((ConnectionsAuthNotification*) self);
}

static void
connections_auth_notification_on_username_entry_activated (ConnectionsAuthNotification* self)
{
	GtkEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->password_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

static void
_connections_auth_notification_on_username_entry_activated_gtk_entry_activate (GtkEntry* _sender,
                                                                               gpointer self)
{
	connections_auth_notification_on_username_entry_activated ((ConnectionsAuthNotification*) self);
}

static void
connections_auth_notification_on_password_entry_map (ConnectionsAuthNotification* self)
{
	GtkEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->password_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

static void
_connections_auth_notification_on_password_entry_map_gtk_widget_map (GtkWidget* _sender,
                                                                     gpointer self)
{
	connections_auth_notification_on_password_entry_map ((ConnectionsAuthNotification*) self);
}

static void
connections_auth_notification_on_password_entry_activated (ConnectionsAuthNotification* self)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->auth_button;
	g_signal_emit_by_name (_tmp0_, "activate");
}

static void
_connections_auth_notification_on_password_entry_activated_gtk_entry_activate (GtkEntry* _sender,
                                                                               gpointer self)
{
	connections_auth_notification_on_password_entry_activated ((ConnectionsAuthNotification*) self);
}

static void
connections_auth_notification_on_auth_button_clicked (ConnectionsAuthNotification* self)
{
	ConnectionsAuthNotificationAuthFunc _tmp0_;
	gpointer _tmp0__target;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->auth_func;
	_tmp0__target = self->priv->auth_func_target;
	if (_tmp0_ != NULL) {
		ConnectionsAuthNotificationAuthFunc _tmp1_;
		gpointer _tmp1__target;
		GtkEntry* _tmp2_;
		const gchar* _tmp3_;
		GtkEntry* _tmp4_;
		const gchar* _tmp5_;
		_tmp1_ = self->priv->auth_func;
		_tmp1__target = self->priv->auth_func_target;
		_tmp2_ = self->priv->username_entry;
		_tmp3_ = gtk_entry_get_text (_tmp2_);
		_tmp4_ = self->priv->password_entry;
		_tmp5_ = gtk_entry_get_text (_tmp4_);
		_tmp1_ (_tmp3_, _tmp5_, _tmp1__target);
	}
	self->priv->auth_pressed = TRUE;
	connections_auth_notification_dismiss (self);
}

static void
_connections_auth_notification_on_auth_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self)
{
	connections_auth_notification_on_auth_button_clicked ((ConnectionsAuthNotification*) self);
}

void
connections_auth_notification_dismiss (ConnectionsAuthNotification* self)
{
	g_return_if_fail (self != NULL);
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, FALSE);
	g_signal_emit (self, connections_auth_notification_signals[CONNECTIONS_AUTH_NOTIFICATION_DISMISSED_SIGNAL], 0);
}

static void
connections_auth_notification_class_init (ConnectionsAuthNotificationClass * klass,
                                          gpointer klass_data)
{
	connections_auth_notification_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConnectionsAuthNotification_private_offset);
	G_OBJECT_CLASS (klass)->finalize = connections_auth_notification_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Connections/ui/auth-notification.ui");
	connections_auth_notification_signals[CONNECTIONS_AUTH_NOTIFICATION_DISMISSED_SIGNAL] = g_signal_new ("dismissed", CONNECTIONS_TYPE_AUTH_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), "title_label", FALSE, ConnectionsAuthNotification_private_offset + G_STRUCT_OFFSET (ConnectionsAuthNotificationPrivate, title_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "username_label", FALSE, ConnectionsAuthNotification_private_offset + G_STRUCT_OFFSET (ConnectionsAuthNotificationPrivate, username_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "username_entry", FALSE, ConnectionsAuthNotification_private_offset + G_STRUCT_OFFSET (ConnectionsAuthNotificationPrivate, username_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "password_entry", FALSE, ConnectionsAuthNotification_private_offset + G_STRUCT_OFFSET (ConnectionsAuthNotificationPrivate, password_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "auth_button", FALSE, ConnectionsAuthNotification_private_offset + G_STRUCT_OFFSET (ConnectionsAuthNotificationPrivate, auth_button));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_username_entry_map", G_CALLBACK(_connections_auth_notification_on_username_entry_map_gtk_widget_map));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_username_entry_activated", G_CALLBACK(_connections_auth_notification_on_username_entry_activated_gtk_entry_activate));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_password_entry_map", G_CALLBACK(_connections_auth_notification_on_password_entry_map_gtk_widget_map));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_password_entry_activated", G_CALLBACK(_connections_auth_notification_on_password_entry_activated_gtk_entry_activate));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_auth_button_clicked", G_CALLBACK(_connections_auth_notification_on_auth_button_clicked_gtk_button_clicked));
}

static void
connections_auth_notification_instance_init (ConnectionsAuthNotification * self,
                                             gpointer klass)
{
	self->priv = connections_auth_notification_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
connections_auth_notification_finalize (GObject * obj)
{
	ConnectionsAuthNotification * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONNECTIONS_TYPE_AUTH_NOTIFICATION, ConnectionsAuthNotification);
	(self->priv->auth_func_target_destroy_notify == NULL) ? NULL : (self->priv->auth_func_target_destroy_notify (self->priv->auth_func_target), NULL);
	self->priv->auth_func = NULL;
	self->priv->auth_func_target = NULL;
	self->priv->auth_func_target_destroy_notify = NULL;
	G_OBJECT_CLASS (connections_auth_notification_parent_class)->finalize (obj);
}

static GType
connections_auth_notification_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConnectionsAuthNotificationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) connections_auth_notification_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConnectionsAuthNotification), 0, (GInstanceInitFunc) connections_auth_notification_instance_init, NULL };
	GType connections_auth_notification_type_id;
	connections_auth_notification_type_id = g_type_register_static (gtk_revealer_get_type (), "ConnectionsAuthNotification", &g_define_type_info, 0);
	ConnectionsAuthNotification_private_offset = g_type_add_instance_private (connections_auth_notification_type_id, sizeof (ConnectionsAuthNotificationPrivate));
	return connections_auth_notification_type_id;
}

GType
connections_auth_notification_get_type (void)
{
	static volatile gsize connections_auth_notification_type_id__once = 0;
	if (g_once_init_enter (&connections_auth_notification_type_id__once)) {
		GType connections_auth_notification_type_id;
		connections_auth_notification_type_id = connections_auth_notification_get_type_once ();
		g_once_init_leave (&connections_auth_notification_type_id__once, connections_auth_notification_type_id);
	}
	return connections_auth_notification_type_id__once;
}

