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

/*
 * Copyright 2019-2025 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gdesktopappinfo.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <granite-7.h>
#include <pango/pango.h>
#include <float.h>
#include <math.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define NOTIFICATIONS_TYPE_ABSTRACT_BUBBLE (notifications_abstract_bubble_get_type ())
#define NOTIFICATIONS_ABSTRACT_BUBBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFICATIONS_TYPE_ABSTRACT_BUBBLE, NotificationsAbstractBubble))
#define NOTIFICATIONS_ABSTRACT_BUBBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NOTIFICATIONS_TYPE_ABSTRACT_BUBBLE, NotificationsAbstractBubbleClass))
#define NOTIFICATIONS_IS_ABSTRACT_BUBBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTIFICATIONS_TYPE_ABSTRACT_BUBBLE))
#define NOTIFICATIONS_IS_ABSTRACT_BUBBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NOTIFICATIONS_TYPE_ABSTRACT_BUBBLE))
#define NOTIFICATIONS_ABSTRACT_BUBBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NOTIFICATIONS_TYPE_ABSTRACT_BUBBLE, NotificationsAbstractBubbleClass))

typedef struct _NotificationsAbstractBubble NotificationsAbstractBubble;
typedef struct _NotificationsAbstractBubbleClass NotificationsAbstractBubbleClass;
typedef struct _NotificationsAbstractBubblePrivate NotificationsAbstractBubblePrivate;
typedef enum  {
	NOTIFICATIONS_CLOSE_REASON_EXPIRED = 1,
	NOTIFICATIONS_CLOSE_REASON_DISMISSED = 2,
	NOTIFICATIONS_CLOSE_REASON_CLOSE_NOTIFICATION_CALL = 3,
	NOTIFICATIONS_CLOSE_REASON_UNDEFINED = 4
} NotificationsCloseReason;

#define NOTIFICATIONS_TYPE_CLOSE_REASON (notifications_close_reason_get_type ())

#define NOTIFICATIONS_TYPE_BUBBLE (notifications_bubble_get_type ())
#define NOTIFICATIONS_BUBBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFICATIONS_TYPE_BUBBLE, NotificationsBubble))
#define NOTIFICATIONS_BUBBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NOTIFICATIONS_TYPE_BUBBLE, NotificationsBubbleClass))
#define NOTIFICATIONS_IS_BUBBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTIFICATIONS_TYPE_BUBBLE))
#define NOTIFICATIONS_IS_BUBBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NOTIFICATIONS_TYPE_BUBBLE))
#define NOTIFICATIONS_BUBBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NOTIFICATIONS_TYPE_BUBBLE, NotificationsBubbleClass))

typedef struct _NotificationsBubble NotificationsBubble;
typedef struct _NotificationsBubbleClass NotificationsBubbleClass;
typedef struct _NotificationsBubblePrivate NotificationsBubblePrivate;

#define NOTIFICATIONS_TYPE_NOTIFICATION (notifications_notification_get_type ())
#define NOTIFICATIONS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFICATIONS_TYPE_NOTIFICATION, NotificationsNotification))
#define NOTIFICATIONS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NOTIFICATIONS_TYPE_NOTIFICATION, NotificationsNotificationClass))
#define NOTIFICATIONS_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTIFICATIONS_TYPE_NOTIFICATION))
#define NOTIFICATIONS_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NOTIFICATIONS_TYPE_NOTIFICATION))
#define NOTIFICATIONS_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NOTIFICATIONS_TYPE_NOTIFICATION, NotificationsNotificationClass))

typedef struct _NotificationsNotification NotificationsNotification;
typedef struct _NotificationsNotificationClass NotificationsNotificationClass;
enum  {
	NOTIFICATIONS_BUBBLE_0_PROPERTY,
	NOTIFICATIONS_BUBBLE_NOTIFICATION_PROPERTY,
	NOTIFICATIONS_BUBBLE_NUM_PROPERTIES
};
static GParamSpec* notifications_bubble_properties[NOTIFICATIONS_BUBBLE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define NOTIFICATIONS_BUBBLE_TYPE_CONTENTS (notifications_bubble_contents_get_type ())
#define NOTIFICATIONS_BUBBLE_CONTENTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, NotificationsBubbleContents))
#define NOTIFICATIONS_BUBBLE_CONTENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, NotificationsBubbleContentsClass))
#define NOTIFICATIONS_BUBBLE_IS_CONTENTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTIFICATIONS_BUBBLE_TYPE_CONTENTS))
#define NOTIFICATIONS_BUBBLE_IS_CONTENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NOTIFICATIONS_BUBBLE_TYPE_CONTENTS))
#define NOTIFICATIONS_BUBBLE_CONTENTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, NotificationsBubbleContentsClass))

typedef struct _NotificationsBubbleContents NotificationsBubbleContents;
typedef struct _NotificationsBubbleContentsClass NotificationsBubbleContentsClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _NotificationsBubbleContentsPrivate NotificationsBubbleContentsPrivate;
enum  {
	NOTIFICATIONS_BUBBLE_CONTENTS_0_PROPERTY,
	NOTIFICATIONS_BUBBLE_CONTENTS_NOTIFICATION_PROPERTY,
	NOTIFICATIONS_BUBBLE_CONTENTS_NUM_PROPERTIES
};
static GParamSpec* notifications_bubble_contents_properties[NOTIFICATIONS_BUBBLE_CONTENTS_NUM_PROPERTIES];

#define NOTIFICATIONS_TYPE_MASKED_IMAGE (notifications_masked_image_get_type ())
#define NOTIFICATIONS_MASKED_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTIFICATIONS_TYPE_MASKED_IMAGE, NotificationsMaskedImage))
#define NOTIFICATIONS_MASKED_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NOTIFICATIONS_TYPE_MASKED_IMAGE, NotificationsMaskedImageClass))
#define NOTIFICATIONS_IS_MASKED_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTIFICATIONS_TYPE_MASKED_IMAGE))
#define NOTIFICATIONS_IS_MASKED_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NOTIFICATIONS_TYPE_MASKED_IMAGE))
#define NOTIFICATIONS_MASKED_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NOTIFICATIONS_TYPE_MASKED_IMAGE, NotificationsMaskedImageClass))

typedef struct _NotificationsMaskedImage NotificationsMaskedImage;
typedef struct _NotificationsMaskedImageClass NotificationsMaskedImageClass;

#define NOTIFICATIONS_NOTIFICATION_TYPE_BUTTON (notifications_notification_button_get_type ())
typedef struct _NotificationsNotificationButton NotificationsNotificationButton;
#define _notifications_notification_button_free0(var) ((var == NULL) ? NULL : (var = (notifications_notification_button_free (var), NULL)))

struct _NotificationsAbstractBubble {
	GtkWindow parent_instance;
	NotificationsAbstractBubblePrivate * priv;
	GtkStack* content_area;
};

struct _NotificationsAbstractBubbleClass {
	GtkWindowClass parent_class;
};

struct _NotificationsBubble {
	NotificationsAbstractBubble parent_instance;
	NotificationsBubblePrivate * priv;
};

struct _NotificationsBubbleClass {
	NotificationsAbstractBubbleClass parent_class;
};

struct _NotificationsBubblePrivate {
	NotificationsNotification* _notification;
	GtkGestureClick* click_gesture;
};

struct _NotificationsBubbleContents {
	GtkGrid parent_instance;
	NotificationsBubbleContentsPrivate * priv;
};

struct _NotificationsBubbleContentsClass {
	GtkGridClass parent_class;
};

struct _NotificationsBubbleContentsPrivate {
	NotificationsNotification* _notification;
};

struct _NotificationsNotificationButton {
	gchar* label;
	gchar* action_name;
};

static gint NotificationsBubble_private_offset;
static gpointer notifications_bubble_parent_class = NULL;
static gint NotificationsBubbleContents_private_offset;
static gpointer notifications_bubble_contents_parent_class = NULL;

VALA_EXTERN GType notifications_abstract_bubble_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NotificationsAbstractBubble, g_object_unref)
VALA_EXTERN GType notifications_close_reason_get_type (void) G_GNUC_CONST ;
static void notifications_abstract_bubble_closed (NotificationsAbstractBubble* self,
                                           NotificationsCloseReason reason);
VALA_EXTERN GType notifications_bubble_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NotificationsBubble, g_object_unref)
VALA_EXTERN GType notifications_notification_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NotificationsNotification, g_object_unref)
VALA_EXTERN NotificationsBubble* notifications_bubble_new (NotificationsNotification* notification);
VALA_EXTERN NotificationsBubble* notifications_bubble_construct (GType object_type,
                                                     NotificationsNotification* notification);
static void notifications_bubble_released (NotificationsBubble* self);
VALA_EXTERN NotificationsNotification* notifications_bubble_get_notification (NotificationsBubble* self);
VALA_EXTERN const gchar* notifications_notification_get_default_action_name (NotificationsNotification* self);
VALA_EXTERN GVariant* notifications_notification_get_default_action_target (NotificationsNotification* self);
VALA_EXTERN GDesktopAppInfo* notifications_notification_get_app_info (NotificationsNotification* self);
static void ___lambda7_ (NotificationsBubble* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ____lambda7__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
VALA_EXTERN void notifications_bubble_set_notification (NotificationsBubble* self,
                                            NotificationsNotification* value);
VALA_EXTERN void notifications_abstract_bubble_set_timeout (NotificationsAbstractBubble* self,
                                                guint32 value);
static GType notifications_bubble_contents_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NotificationsBubbleContents, g_object_unref)
static NotificationsBubbleContents* notifications_bubble_contents_new (NotificationsNotification* notification);
static NotificationsBubbleContents* notifications_bubble_contents_construct (GType object_type,
                                                                      NotificationsNotification* notification);
VALA_EXTERN GNotificationPriority notifications_notification_get_priority (NotificationsNotification* self);
static void _notifications_bubble_notification___lambda6_ (NotificationsBubble* self);
VALA_EXTERN const gchar* notifications_notification_get_app_name (NotificationsNotification* self);
VALA_EXTERN const gchar* notifications_notification_get_summary (NotificationsNotification* self);
VALA_EXTERN const gchar* notifications_notification_get_body (NotificationsNotification* self);
static void __notifications_bubble_notification___lambda6__gtk_widget_map (GtkWidget* _sender,
                                                                    gpointer self);
static NotificationsNotification* notifications_bubble_contents_get_notification (NotificationsBubbleContents* self);
static void notifications_bubble_contents_set_notification (NotificationsBubbleContents* self,
                                                     NotificationsNotification* value);
static GObject * notifications_bubble_contents_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
VALA_EXTERN GIcon* notifications_notification_get_primary_icon (NotificationsNotification* self);
VALA_EXTERN GType notifications_masked_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NotificationsMaskedImage, g_object_unref)
VALA_EXTERN NotificationsMaskedImage* notifications_notification_get_image (NotificationsNotification* self);
VALA_EXTERN GIcon* notifications_notification_get_badge_icon (NotificationsNotification* self);
VALA_EXTERN GType notifications_notification_button_get_type (void) G_GNUC_CONST ;
VALA_EXTERN NotificationsNotificationButton* notifications_notification_button_dup (const NotificationsNotificationButton* self);
VALA_EXTERN void notifications_notification_button_free (NotificationsNotificationButton* self);
VALA_EXTERN void notifications_notification_button_copy (const NotificationsNotificationButton* self,
                                             NotificationsNotificationButton* dest);
VALA_EXTERN void notifications_notification_button_destroy (NotificationsNotificationButton* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (NotificationsNotificationButton, notifications_notification_button_destroy)
VALA_EXTERN GPtrArray* notifications_notification_get_buttons (NotificationsNotification* self);
static void notifications_bubble_contents_finalize (GObject * obj);
static GType notifications_bubble_contents_get_type_once (void);
static void _vala_notifications_bubble_contents_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_notifications_bubble_contents_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static GObject * notifications_bubble_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static void _notifications_bubble_released_gtk_gesture_click_released (GtkGestureClick* _sender,
                                                                gint n_press,
                                                                gdouble x,
                                                                gdouble y,
                                                                gpointer self);
static void notifications_bubble_finalize (GObject * obj);
static GType notifications_bubble_get_type_once (void);
static void _vala_notifications_bubble_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_notifications_bubble_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
notifications_bubble_get_instance_private (NotificationsBubble* self)
{
	return G_STRUCT_MEMBER_P (self, NotificationsBubble_private_offset);
}

NotificationsBubble*
notifications_bubble_construct (GType object_type,
                                NotificationsNotification* notification)
{
	NotificationsBubble * self = NULL;
	g_return_val_if_fail (notification != NULL, NULL);
	self = (NotificationsBubble*) g_object_new (object_type, "notification", notification, NULL);
	return self;
}

NotificationsBubble*
notifications_bubble_new (NotificationsNotification* notification)
{
	return notifications_bubble_construct (NOTIFICATIONS_TYPE_BUBBLE, notification);
}

static void
___lambda7_ (NotificationsBubble* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		g_app_info_launch_uris_finish (G_TYPE_CHECK_INSTANCE_CAST (obj, g_app_info_get_type (), GAppInfo), res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		g_signal_emit_by_name ((NotificationsAbstractBubble*) self, "closed", NOTIFICATIONS_CLOSE_REASON_UNDEFINED);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		g_warning ("Bubble.vala:72: Unable to launch app: %s", _tmp1_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda7__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	___lambda7_ ((NotificationsBubble*) self, source_object, res);
	g_object_unref (self);
}

static void
notifications_bubble_released (NotificationsBubble* self)
{
	NotificationsNotification* _tmp0_;
	NotificationsNotification* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	NotificationsNotification* _tmp17_;
	NotificationsNotification* _tmp18_;
	GDesktopAppInfo* _tmp19_;
	GDesktopAppInfo* _tmp20_;
	GtkGestureClick* _tmp25_;
	g_return_if_fail (self != NULL);
	_tmp0_ = notifications_bubble_get_notification (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = notifications_notification_get_default_action_name (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		NotificationsNotification* _tmp4_;
		NotificationsNotification* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		NotificationsNotification* _tmp8_;
		NotificationsNotification* _tmp9_;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		NotificationsNotification* _tmp13_;
		NotificationsNotification* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		_tmp4_ = notifications_bubble_get_notification (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = notifications_notification_get_default_action_name (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = notifications_bubble_get_notification (self);
		_tmp9_ = _tmp8_;
		_tmp10_ = notifications_notification_get_default_action_target (_tmp9_);
		_tmp11_ = _tmp10_;
		if (gtk_widget_activate_action_variant ((GtkWidget*) self, _tmp7_, _tmp11_)) {
			GtkGestureClick* _tmp12_;
			_tmp12_ = self->priv->click_gesture;
			gtk_gesture_set_state ((GtkGesture*) _tmp12_, GTK_EVENT_SEQUENCE_CLAIMED);
			return;
		}
		_tmp13_ = notifications_bubble_get_notification (self);
		_tmp14_ = _tmp13_;
		_tmp15_ = notifications_notification_get_default_action_name (_tmp14_);
		_tmp16_ = _tmp15_;
		g_warning ("Bubble.vala:63: cannot activate action '%s': no action group match pre" \
"fix.", _tmp16_);
	}
	_tmp17_ = notifications_bubble_get_notification (self);
	_tmp18_ = _tmp17_;
	_tmp19_ = notifications_notification_get_app_info (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_ != NULL) {
		NotificationsNotification* _tmp21_;
		NotificationsNotification* _tmp22_;
		GDesktopAppInfo* _tmp23_;
		GDesktopAppInfo* _tmp24_;
		_tmp21_ = notifications_bubble_get_notification (self);
		_tmp22_ = _tmp21_;
		_tmp23_ = notifications_notification_get_app_info (_tmp22_);
		_tmp24_ = _tmp23_;
		g_app_info_launch_uris_async ((GAppInfo*) _tmp24_, NULL, NULL, NULL, ____lambda7__gasync_ready_callback, g_object_ref (self));
	}
	_tmp25_ = self->priv->click_gesture;
	gtk_gesture_set_state ((GtkGesture*) _tmp25_, GTK_EVENT_SEQUENCE_CLAIMED);
}

NotificationsNotification*
notifications_bubble_get_notification (NotificationsBubble* self)
{
	NotificationsNotification* result;
	NotificationsNotification* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_notification;
	result = _tmp0_;
	return result;
}

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

static void
_notifications_bubble_notification___lambda6_ (NotificationsBubble* self)
{
	GtkRoot* _tmp0_;
	NotificationsNotification* _tmp1_;
	NotificationsNotification* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	NotificationsNotification* _tmp5_;
	NotificationsNotification* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	NotificationsNotification* _tmp9_;
	NotificationsNotification* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = notifications_bubble_get_notification (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = notifications_notification_get_app_name (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = notifications_bubble_get_notification (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = notifications_notification_get_summary (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = notifications_bubble_get_notification (self);
	_tmp10_ = _tmp9_;
	_tmp11_ = notifications_notification_get_body (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup_printf (_ ("Notification from %s: %s %s"), _tmp4_, _tmp8_, _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_accessible_announce ((GtkAccessible*) G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_window_get_type (), GtkWindow), _tmp14_, GTK_ACCESSIBLE_ANNOUNCEMENT_PRIORITY_HIGH);
	_g_free0 (_tmp14_);
}

static void
__notifications_bubble_notification___lambda6__gtk_widget_map (GtkWidget* _sender,
                                                               gpointer self)
{
	_notifications_bubble_notification___lambda6_ ((NotificationsBubble*) self);
}

void
notifications_bubble_set_notification (NotificationsBubble* self,
                                       NotificationsNotification* value)
{
	NotificationsNotification* _tmp0_;
	NotificationsBubbleContents* contents = NULL;
	NotificationsBubbleContents* _tmp1_;
	GNotificationPriority _tmp2_;
	GNotificationPriority _tmp3_;
	GtkStack* _tmp5_;
	NotificationsBubbleContents* _tmp6_;
	GtkStack* _tmp7_;
	NotificationsBubbleContents* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_notification);
	self->priv->_notification = _tmp0_;
	notifications_abstract_bubble_set_timeout ((NotificationsAbstractBubble*) self, (guint32) 0);
	_tmp1_ = notifications_bubble_contents_new (value);
	g_object_ref_sink (_tmp1_);
	contents = _tmp1_;
	_tmp2_ = notifications_notification_get_priority (value);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == G_NOTIFICATION_PRIORITY_URGENT) {
		NotificationsBubbleContents* _tmp4_;
		_tmp4_ = contents;
		gtk_widget_add_css_class ((GtkWidget*) _tmp4_, "urgent");
	} else {
		notifications_abstract_bubble_set_timeout ((NotificationsAbstractBubble*) self, (guint32) 4000);
	}
	_tmp5_ = ((NotificationsAbstractBubble*) self)->content_area;
	_tmp6_ = contents;
	gtk_stack_add_child (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = ((NotificationsAbstractBubble*) self)->content_area;
	_tmp8_ = contents;
	gtk_stack_set_visible_child (_tmp7_, (GtkWidget*) _tmp8_);
	g_signal_connect_object ((GtkWidget*) self, "map", (GCallback) __notifications_bubble_notification___lambda6__gtk_widget_map, self, 0);
	_g_object_unref0 (contents);
	g_object_notify_by_pspec ((GObject *) self, notifications_bubble_properties[NOTIFICATIONS_BUBBLE_NOTIFICATION_PROPERTY]);
}

static inline gpointer
notifications_bubble_contents_get_instance_private (NotificationsBubbleContents* self)
{
	return G_STRUCT_MEMBER_P (self, NotificationsBubbleContents_private_offset);
}

static NotificationsBubbleContents*
notifications_bubble_contents_construct (GType object_type,
                                         NotificationsNotification* notification)
{
	NotificationsBubbleContents * self = NULL;
	g_return_val_if_fail (notification != NULL, NULL);
	self = (NotificationsBubbleContents*) g_object_new (object_type, "notification", notification, NULL);
	return self;
}

static NotificationsBubbleContents*
notifications_bubble_contents_new (NotificationsNotification* notification)
{
	return notifications_bubble_contents_construct (NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, notification);
}

static NotificationsNotification*
notifications_bubble_contents_get_notification (NotificationsBubbleContents* self)
{
	NotificationsNotification* result;
	NotificationsNotification* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_notification;
	result = _tmp0_;
	return result;
}

static void
notifications_bubble_contents_set_notification (NotificationsBubbleContents* self,
                                                NotificationsNotification* value)
{
	NotificationsNotification* old_value;
	g_return_if_fail (self != NULL);
	old_value = notifications_bubble_contents_get_notification (self);
	if (old_value != value) {
		NotificationsNotification* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_notification);
		self->priv->_notification = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, notifications_bubble_contents_properties[NOTIFICATIONS_BUBBLE_CONTENTS_NOTIFICATION_PROPERTY]);
	}
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gint
vala_g_ptr_array_get_length (GPtrArray* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint) self->len;
	return result;
}

static gpointer
_notifications_notification_button_dup0 (gpointer self)
{
	return self ? notifications_notification_button_dup (self) : NULL;
}

static GObject *
notifications_bubble_contents_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	NotificationsBubbleContents * self;
	GtkImage* app_image = NULL;
	NotificationsNotification* _tmp0_;
	GIcon* _tmp1_;
	GIcon* _tmp2_;
	GtkImage* _tmp3_;
	GtkOverlay* image_overlay = NULL;
	GtkOverlay* _tmp4_;
	GtkOverlay* _tmp5_;
	NotificationsNotification* _tmp6_;
	NotificationsMaskedImage* _tmp7_;
	NotificationsMaskedImage* _tmp8_;
	GtkLabel* title_label = NULL;
	NotificationsNotification* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	GtkLabel* _tmp33_ = NULL;
	GtkLabel* _tmp34_;
	GtkLabel* body_label = NULL;
	NotificationsNotification* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GtkLabel* _tmp38_ = NULL;
	NotificationsNotification* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	GtkOverlay* _tmp66_;
	GtkLabel* _tmp67_;
	GtkLabel* _tmp68_;
	NotificationsNotification* _tmp69_;
	GPtrArray* _tmp70_;
	GPtrArray* _tmp71_;
	gint _tmp72_;
	gint _tmp73_;
	parent_class = G_OBJECT_CLASS (notifications_bubble_contents_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, NotificationsBubbleContents);
	_tmp0_ = self->priv->_notification;
	_tmp1_ = notifications_notification_get_primary_icon (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = (GtkImage*) gtk_image_new_from_gicon (_tmp2_);
	g_object_ref_sink (_tmp3_);
	app_image = _tmp3_;
	_tmp4_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp4_);
	image_overlay = _tmp4_;
	_tmp5_ = image_overlay;
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_START);
	_tmp6_ = self->priv->_notification;
	_tmp7_ = notifications_notification_get_image (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ != NULL) {
		GtkImage* _tmp9_;
		GtkImage* _tmp10_;
		GtkImage* _tmp11_;
		GtkOverlay* _tmp12_;
		NotificationsNotification* _tmp13_;
		NotificationsMaskedImage* _tmp14_;
		NotificationsMaskedImage* _tmp15_;
		GtkOverlay* _tmp16_;
		GtkImage* _tmp17_;
		_tmp9_ = app_image;
		gtk_image_set_pixel_size (_tmp9_, 24);
		_tmp10_ = app_image;
		_tmp11_ = app_image;
		gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_END);
		gtk_widget_set_halign ((GtkWidget*) _tmp10_, GTK_ALIGN_END);
		_tmp12_ = image_overlay;
		_tmp13_ = self->priv->_notification;
		_tmp14_ = notifications_notification_get_image (_tmp13_);
		_tmp15_ = _tmp14_;
		gtk_overlay_set_child (_tmp12_, (GtkWidget*) _tmp15_);
		_tmp16_ = image_overlay;
		_tmp17_ = app_image;
		gtk_overlay_add_overlay (_tmp16_, (GtkWidget*) _tmp17_);
	} else {
		GtkImage* _tmp18_;
		GtkOverlay* _tmp19_;
		GtkImage* _tmp20_;
		NotificationsNotification* _tmp21_;
		GIcon* _tmp22_;
		GIcon* _tmp23_;
		_tmp18_ = app_image;
		gtk_image_set_pixel_size (_tmp18_, 48);
		_tmp19_ = image_overlay;
		_tmp20_ = app_image;
		gtk_overlay_set_child (_tmp19_, (GtkWidget*) _tmp20_);
		_tmp21_ = self->priv->_notification;
		_tmp22_ = notifications_notification_get_badge_icon (_tmp21_);
		_tmp23_ = _tmp22_;
		if (_tmp23_ != NULL) {
			GtkImage* badge_image = NULL;
			NotificationsNotification* _tmp24_;
			GIcon* _tmp25_;
			GIcon* _tmp26_;
			GtkImage* _tmp27_ = NULL;
			GtkOverlay* _tmp28_;
			GtkImage* _tmp29_;
			_tmp24_ = self->priv->_notification;
			_tmp25_ = notifications_notification_get_badge_icon (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = (GtkImage*) gtk_image_new_from_gicon (_tmp26_);
			gtk_widget_set_halign ((GtkWidget*) _tmp27_, GTK_ALIGN_END);
			gtk_widget_set_valign ((GtkWidget*) _tmp27_, GTK_ALIGN_END);
			gtk_image_set_pixel_size (_tmp27_, 24);
			g_object_ref_sink (_tmp27_);
			badge_image = _tmp27_;
			_tmp28_ = image_overlay;
			_tmp29_ = badge_image;
			gtk_overlay_add_overlay (_tmp28_, (GtkWidget*) _tmp29_);
			_g_object_unref0 (badge_image);
		}
	}
	_tmp30_ = self->priv->_notification;
	_tmp31_ = notifications_notification_get_summary (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = (GtkLabel*) gtk_label_new (_tmp32_);
	gtk_label_set_ellipsize (_tmp33_, PANGO_ELLIPSIZE_END);
	gtk_label_set_max_width_chars (_tmp33_, 33);
	gtk_widget_set_valign ((GtkWidget*) _tmp33_, GTK_ALIGN_END);
	gtk_label_set_width_chars (_tmp33_, 33);
	gtk_label_set_xalign (_tmp33_, (gfloat) 0);
	g_object_ref_sink (_tmp33_);
	title_label = _tmp33_;
	_tmp34_ = title_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp34_, "title");
	_tmp35_ = self->priv->_notification;
	_tmp36_ = notifications_notification_get_body (_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = (GtkLabel*) gtk_label_new (_tmp37_);
	gtk_label_set_ellipsize (_tmp38_, PANGO_ELLIPSIZE_END);
	gtk_label_set_lines (_tmp38_, 2);
	gtk_label_set_max_width_chars (_tmp38_, 33);
	gtk_label_set_use_markup (_tmp38_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp38_, GTK_ALIGN_START);
	gtk_label_set_width_chars (_tmp38_, 33);
	gtk_label_set_wrap (_tmp38_, TRUE);
	gtk_label_set_wrap_mode (_tmp38_, PANGO_WRAP_WORD_CHAR);
	gtk_label_set_xalign (_tmp38_, (gfloat) 0);
	g_object_ref_sink (_tmp38_);
	body_label = _tmp38_;
	_tmp39_ = self->priv->_notification;
	_tmp40_ = notifications_notification_get_body (_tmp39_);
	_tmp41_ = _tmp40_;
	if (string_contains (_tmp41_, "\n")) {
		gchar** lines = NULL;
		NotificationsNotification* _tmp42_;
		const gchar* _tmp43_;
		const gchar* _tmp44_;
		gchar** _tmp45_;
		gchar** _tmp46_;
		gint lines_length1;
		gint _lines_size_;
		gchar* stripped_body = NULL;
		gchar** _tmp47_;
		gint _tmp47__length1;
		const gchar* _tmp48_;
		gchar* _tmp49_;
		GtkLabel* _tmp61_;
		const gchar* _tmp62_;
		gchar* _tmp63_;
		gchar* _tmp64_;
		GtkLabel* _tmp65_;
		_tmp42_ = self->priv->_notification;
		_tmp43_ = notifications_notification_get_body (_tmp42_);
		_tmp44_ = _tmp43_;
		_tmp46_ = _tmp45_ = g_strsplit (_tmp44_, "\n", 0);
		lines = _tmp46_;
		lines_length1 = _vala_array_length (_tmp45_);
		_lines_size_ = lines_length1;
		_tmp47_ = lines;
		_tmp47__length1 = lines_length1;
		_tmp48_ = _tmp47_[0];
		_tmp49_ = g_strconcat (_tmp48_, "\n", NULL);
		stripped_body = _tmp49_;
		{
			gint i = 0;
			i = 1;
			{
				gboolean _tmp50_ = FALSE;
				_tmp50_ = TRUE;
				while (TRUE) {
					gchar** _tmp52_;
					gint _tmp52__length1;
					const gchar* _tmp53_;
					gchar** _tmp54_;
					gint _tmp54__length1;
					const gchar* _tmp55_;
					gchar* _tmp56_;
					gchar* _tmp57_;
					gchar* _tmp58_;
					gchar* _tmp59_;
					gchar* _tmp60_;
					if (!_tmp50_) {
						gint _tmp51_;
						_tmp51_ = i;
						i = _tmp51_ + 1;
					}
					_tmp50_ = FALSE;
					_tmp52_ = lines;
					_tmp52__length1 = lines_length1;
					if (!(i < _tmp52__length1)) {
						break;
					}
					_tmp53_ = stripped_body;
					_tmp54_ = lines;
					_tmp54__length1 = lines_length1;
					_tmp55_ = _tmp54_[i];
					_tmp56_ = string_strip (_tmp55_);
					_tmp57_ = _tmp56_;
					_tmp58_ = g_strconcat (_tmp57_, "", NULL);
					_tmp59_ = _tmp58_;
					_tmp60_ = g_strconcat (_tmp53_, _tmp59_, NULL);
					_g_free0 (stripped_body);
					stripped_body = _tmp60_;
					_g_free0 (_tmp59_);
					_g_free0 (_tmp57_);
				}
			}
		}
		_tmp61_ = body_label;
		_tmp62_ = stripped_body;
		_tmp63_ = string_strip (_tmp62_);
		_tmp64_ = _tmp63_;
		gtk_label_set_label (_tmp61_, _tmp64_);
		_g_free0 (_tmp64_);
		_tmp65_ = body_label;
		gtk_label_set_lines (_tmp65_, 1);
		_g_free0 (stripped_body);
		lines = (_vala_array_free (lines, lines_length1, (GDestroyNotify) g_free), NULL);
	}
	gtk_grid_set_column_spacing ((GtkGrid*) self, 6);
	_tmp66_ = image_overlay;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp66_, 0, 0, 1, 2);
	_tmp67_ = title_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp67_, 1, 0, 1, 1);
	_tmp68_ = body_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp68_, 1, 1, 1, 1);
	_tmp69_ = self->priv->_notification;
	_tmp70_ = notifications_notification_get_buttons (_tmp69_);
	_tmp71_ = _tmp70_;
	_tmp72_ = vala_g_ptr_array_get_length (_tmp71_);
	_tmp73_ = _tmp72_;
	if (_tmp73_ > 0) {
		GtkBox* action_area = NULL;
		GtkBox* _tmp74_ = NULL;
		GtkBox* _tmp75_;
		NotificationsNotification* _tmp76_;
		GPtrArray* _tmp77_;
		GPtrArray* _tmp78_;
		GtkBox* _tmp88_;
		_tmp74_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
		gtk_widget_set_halign ((GtkWidget*) _tmp74_, GTK_ALIGN_END);
		gtk_box_set_homogeneous (_tmp74_, TRUE);
		g_object_ref_sink (_tmp74_);
		action_area = _tmp74_;
		_tmp75_ = action_area;
		gtk_widget_add_css_class ((GtkWidget*) _tmp75_, "buttonbox");
		_tmp76_ = self->priv->_notification;
		_tmp77_ = notifications_notification_get_buttons (_tmp76_);
		_tmp78_ = _tmp77_;
		{
			GPtrArray* button_collection = NULL;
			guint button_index = 0U;
			button_collection = _tmp78_;
			for (button_index = 0; button_index < button_collection->len; button_index = button_index + 1) {
				NotificationsNotificationButton* _tmp79_;
				NotificationsNotificationButton* button = NULL;
				_tmp79_ = _notifications_notification_button_dup0 ((NotificationsNotificationButton*) g_ptr_array_index (button_collection, button_index));
				button = _tmp79_;
				{
					GtkBox* _tmp80_;
					NotificationsNotificationButton* _tmp81_;
					const gchar* _tmp82_;
					NotificationsNotificationButton* _tmp83_;
					const gchar* _tmp84_;
					gchar* _tmp85_;
					GtkButton* _tmp86_ = NULL;
					GtkButton* _tmp87_;
					_tmp80_ = action_area;
					_tmp81_ = button;
					_tmp82_ = (*_tmp81_).label;
					_tmp83_ = button;
					_tmp84_ = (*_tmp83_).action_name;
					_tmp85_ = g_strdup (_tmp84_);
					_tmp86_ = (GtkButton*) gtk_button_new_with_label (_tmp82_);
					gtk_actionable_set_action_name ((GtkActionable*) _tmp86_, _tmp85_);
					_g_free0 (_tmp85_);
					g_object_ref_sink (_tmp86_);
					_tmp87_ = _tmp86_;
					gtk_box_append (_tmp80_, (GtkWidget*) _tmp87_);
					_g_object_unref0 (_tmp87_);
					_notifications_notification_button_free0 (button);
				}
			}
		}
		_tmp88_ = action_area;
		gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp88_, 0, 2, 2, 1);
		_g_object_unref0 (action_area);
	}
	_g_object_unref0 (body_label);
	_g_object_unref0 (title_label);
	_g_object_unref0 (image_overlay);
	_g_object_unref0 (app_image);
	return obj;
}

static void
notifications_bubble_contents_class_init (NotificationsBubbleContentsClass * klass,
                                          gpointer klass_data)
{
	notifications_bubble_contents_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &NotificationsBubbleContents_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_notifications_bubble_contents_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_notifications_bubble_contents_set_property;
	G_OBJECT_CLASS (klass)->constructor = notifications_bubble_contents_constructor;
	G_OBJECT_CLASS (klass)->finalize = notifications_bubble_contents_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), NOTIFICATIONS_BUBBLE_CONTENTS_NOTIFICATION_PROPERTY, notifications_bubble_contents_properties[NOTIFICATIONS_BUBBLE_CONTENTS_NOTIFICATION_PROPERTY] = g_param_spec_object ("notification", "notification", "notification", NOTIFICATIONS_TYPE_NOTIFICATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
notifications_bubble_contents_instance_init (NotificationsBubbleContents * self,
                                             gpointer klass)
{
	self->priv = notifications_bubble_contents_get_instance_private (self);
}

static void
notifications_bubble_contents_finalize (GObject * obj)
{
	NotificationsBubbleContents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, NotificationsBubbleContents);
	_g_object_unref0 (self->priv->_notification);
	G_OBJECT_CLASS (notifications_bubble_contents_parent_class)->finalize (obj);
}

static GType
notifications_bubble_contents_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (NotificationsBubbleContentsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) notifications_bubble_contents_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NotificationsBubbleContents), 0, (GInstanceInitFunc) notifications_bubble_contents_instance_init, NULL };
	GType notifications_bubble_contents_type_id;
	notifications_bubble_contents_type_id = g_type_register_static (gtk_grid_get_type (), "NotificationsBubbleContents", &g_define_type_info, 0);
	NotificationsBubbleContents_private_offset = g_type_add_instance_private (notifications_bubble_contents_type_id, sizeof (NotificationsBubbleContentsPrivate));
	return notifications_bubble_contents_type_id;
}

static GType
notifications_bubble_contents_get_type (void)
{
	static volatile gsize notifications_bubble_contents_type_id__once = 0;
	if (g_once_init_enter (&notifications_bubble_contents_type_id__once)) {
		GType notifications_bubble_contents_type_id;
		notifications_bubble_contents_type_id = notifications_bubble_contents_get_type_once ();
		g_once_init_leave (&notifications_bubble_contents_type_id__once, notifications_bubble_contents_type_id);
	}
	return notifications_bubble_contents_type_id__once;
}

static void
_vala_notifications_bubble_contents_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	NotificationsBubbleContents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, NotificationsBubbleContents);
	switch (property_id) {
		case NOTIFICATIONS_BUBBLE_CONTENTS_NOTIFICATION_PROPERTY:
		g_value_set_object (value, notifications_bubble_contents_get_notification (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_notifications_bubble_contents_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	NotificationsBubbleContents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, NOTIFICATIONS_BUBBLE_TYPE_CONTENTS, NotificationsBubbleContents);
	switch (property_id) {
		case NOTIFICATIONS_BUBBLE_CONTENTS_NOTIFICATION_PROPERTY:
		notifications_bubble_contents_set_notification (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_notifications_bubble_released_gtk_gesture_click_released (GtkGestureClick* _sender,
                                                           gint n_press,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self)
{
	notifications_bubble_released ((NotificationsBubble*) self);
}

static GObject *
notifications_bubble_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	NotificationsBubble * self;
	GtkGestureClick* _tmp0_ = NULL;
	GtkGestureClick* _tmp1_;
	GtkGestureClick* _tmp2_;
	GtkEventController* _tmp3_;
	parent_class = G_OBJECT_CLASS (notifications_bubble_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NOTIFICATIONS_TYPE_BUBBLE, NotificationsBubble);
	_tmp0_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_event_controller_set_propagation_phase ((GtkEventController*) _tmp0_, GTK_PHASE_BUBBLE);
	_g_object_unref0 (self->priv->click_gesture);
	self->priv->click_gesture = _tmp0_;
	_tmp1_ = self->priv->click_gesture;
	g_signal_connect_object (_tmp1_, "released", (GCallback) _notifications_bubble_released_gtk_gesture_click_released, self, 0);
	_tmp2_ = self->priv->click_gesture;
	_tmp3_ = _g_object_ref0 ((GtkEventController*) _tmp2_);
	gtk_widget_add_controller (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp3_);
	return obj;
}

static void
notifications_bubble_class_init (NotificationsBubbleClass * klass,
                                 gpointer klass_data)
{
	notifications_bubble_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &NotificationsBubble_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_notifications_bubble_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_notifications_bubble_set_property;
	G_OBJECT_CLASS (klass)->constructor = notifications_bubble_constructor;
	G_OBJECT_CLASS (klass)->finalize = notifications_bubble_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), NOTIFICATIONS_BUBBLE_NOTIFICATION_PROPERTY, notifications_bubble_properties[NOTIFICATIONS_BUBBLE_NOTIFICATION_PROPERTY] = g_param_spec_object ("notification", "notification", "notification", NOTIFICATIONS_TYPE_NOTIFICATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
notifications_bubble_instance_init (NotificationsBubble * self,
                                    gpointer klass)
{
	self->priv = notifications_bubble_get_instance_private (self);
}

static void
notifications_bubble_finalize (GObject * obj)
{
	NotificationsBubble * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, NOTIFICATIONS_TYPE_BUBBLE, NotificationsBubble);
	_g_object_unref0 (self->priv->_notification);
	_g_object_unref0 (self->priv->click_gesture);
	G_OBJECT_CLASS (notifications_bubble_parent_class)->finalize (obj);
}

static GType
notifications_bubble_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (NotificationsBubbleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) notifications_bubble_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NotificationsBubble), 0, (GInstanceInitFunc) notifications_bubble_instance_init, NULL };
	GType notifications_bubble_type_id;
	notifications_bubble_type_id = g_type_register_static (NOTIFICATIONS_TYPE_ABSTRACT_BUBBLE, "NotificationsBubble", &g_define_type_info, 0);
	NotificationsBubble_private_offset = g_type_add_instance_private (notifications_bubble_type_id, sizeof (NotificationsBubblePrivate));
	return notifications_bubble_type_id;
}

GType
notifications_bubble_get_type (void)
{
	static volatile gsize notifications_bubble_type_id__once = 0;
	if (g_once_init_enter (&notifications_bubble_type_id__once)) {
		GType notifications_bubble_type_id;
		notifications_bubble_type_id = notifications_bubble_get_type_once ();
		g_once_init_leave (&notifications_bubble_type_id__once, notifications_bubble_type_id);
	}
	return notifications_bubble_type_id__once;
}

static void
_vala_notifications_bubble_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	NotificationsBubble * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, NOTIFICATIONS_TYPE_BUBBLE, NotificationsBubble);
	switch (property_id) {
		case NOTIFICATIONS_BUBBLE_NOTIFICATION_PROPERTY:
		g_value_set_object (value, notifications_bubble_get_notification (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_notifications_bubble_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	NotificationsBubble * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, NOTIFICATIONS_TYPE_BUBBLE, NotificationsBubble);
	switch (property_id) {
		case NOTIFICATIONS_BUBBLE_NOTIFICATION_PROPERTY:
		notifications_bubble_set_notification (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

