/* expandableGroup.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from expandableGroup.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <adwaita.h>
#include <string.h>
#include <graphene-gobject.h>
#include <gsk/gsk.h>

#define SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_NUM_STACKED_NOTIFICATIONS 3
#define SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_COLLAPSED_NOTIFICATION_OFFSET 8
#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 SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP (sway_notification_center_expandable_group_get_type ())
#define SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup))
#define SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroupClass))
#define SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP))
#define SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP))
#define SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroupClass))

typedef struct _SwayNotificationCenterExpandableGroup SwayNotificationCenterExpandableGroup;
typedef struct _SwayNotificationCenterExpandableGroupClass SwayNotificationCenterExpandableGroupClass;
typedef struct _SwayNotificationCenterExpandableGroupPrivate SwayNotificationCenterExpandableGroupPrivate;

#define TYPE_ANIMATION_VALUE_TARGET (animation_value_target_get_type ())
#define ANIMATION_VALUE_TARGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ANIMATION_VALUE_TARGET, AnimationValueTarget))
#define ANIMATION_VALUE_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ANIMATION_VALUE_TARGET, AnimationValueTargetClass))
#define IS_ANIMATION_VALUE_TARGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ANIMATION_VALUE_TARGET))
#define IS_ANIMATION_VALUE_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ANIMATION_VALUE_TARGET))
#define ANIMATION_VALUE_TARGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ANIMATION_VALUE_TARGET, AnimationValueTargetClass))

typedef struct _AnimationValueTarget AnimationValueTarget;
typedef struct _AnimationValueTargetClass AnimationValueTargetClass;
enum  {
	SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_IS_EXPANDED_PROPERTY,
	SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_N_CHILDREN_PROPERTY,
	SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_expandable_group_properties[SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef void (*AnimationValueTargetcallback) (gdouble value, gpointer user_data);
typedef gboolean (*SwayNotificationCenterExpandableGroupWidgetFilterDelegate) (GtkWidget* widget, gpointer user_data);

#define TYPE_WIDGET_ALLOC (widget_alloc_get_type ())
typedef struct _WidgetAlloc WidgetAlloc;
typedef void (*SwayNotificationCenterExpandableGroupcompute_height_iter_cb) (GtkWidget* child, WidgetAlloc* widget_alloc, gint index, WidgetAlloc* first_alloc, gpointer user_data);

#define TYPE_WIDGET_HEIGHTS (widget_heights_get_type ())
typedef struct _WidgetHeights WidgetHeights;
typedef struct _Block13Data Block13Data;
#define _gsk_transform_unref0(var) ((var == NULL) ? NULL : (var = (gsk_transform_unref (var), NULL)))
typedef void (*SwayNotificationCenterExpandableGroupon_expand_change) (gboolean state, gpointer user_data);

struct _SwayNotificationCenterExpandableGroup {
	GtkWidget parent_instance;
	SwayNotificationCenterExpandableGroupPrivate * priv;
	GList* visible_widgets;
};

struct _SwayNotificationCenterExpandableGroupClass {
	GtkWidgetClass parent_class;
};

struct _SwayNotificationCenterExpandableGroupPrivate {
	gboolean _is_expanded;
	gdouble animation_progress;
	AnimationValueTarget* animation_target;
	AdwTimedAnimation* animation;
	guint _n_children;
	GList* widgets;
	GtkViewport* viewport;
};

struct _WidgetAlloc {
	gfloat y;
	gint height;
};

struct _WidgetHeights {
	gint min_height;
	gint nat_height;
};

struct _Block13Data {
	int _ref_count_;
	SwayNotificationCenterExpandableGroup* self;
	gfloat max_height;
	gint width;
	gint baseline;
};

static gint SwayNotificationCenterExpandableGroup_private_offset;
static gpointer sway_notification_center_expandable_group_parent_class = NULL;

VALA_EXTERN GType sway_notification_center_expandable_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterExpandableGroup, g_object_unref)
VALA_EXTERN GType animation_value_target_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AnimationValueTarget, g_object_unref)
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN SwayNotificationCenterExpandableGroup* sway_notification_center_expandable_group_new (GtkViewport* viewport,
                                                                                      guint animation_duration);
VALA_EXTERN SwayNotificationCenterExpandableGroup* sway_notification_center_expandable_group_construct (GType object_type,
                                                                                            GtkViewport* viewport,
                                                                                            guint animation_duration);
static void __lambda19_ (SwayNotificationCenterExpandableGroup* self);
static void ___lambda19__gtk_adjustment_value_changed (GtkAdjustment* _sender,
                                                gpointer self);
static void sway_notification_center_expandable_group_animation_value_cb (SwayNotificationCenterExpandableGroup* self,
                                                                   gdouble progress);
static void _sway_notification_center_expandable_group_animation_value_cb_animation_value_targetcallback (gdouble value,
                                                                                                   gpointer self);
VALA_EXTERN AnimationValueTarget* animation_value_target_new (gfloat init_value,
                                                  AnimationValueTargetcallback cb,
                                                  gpointer cb_target);
VALA_EXTERN AnimationValueTarget* animation_value_target_construct (GType object_type,
                                                        gfloat init_value,
                                                        AnimationValueTargetcallback cb,
                                                        gpointer cb_target);
VALA_EXTERN AdwPropertyAnimationTarget* animation_value_target_get_animation_target (AnimationValueTarget* self);
static void sway_notification_center_expandable_group_animation_done_cb (SwayNotificationCenterExpandableGroup* self);
static void _sway_notification_center_expandable_group_animation_done_cb_adw_animation_done (AdwAnimation* _sender,
                                                                                      gpointer self);
VALA_EXTERN void sway_notification_center_expandable_group_set_expanded (SwayNotificationCenterExpandableGroup* self,
                                                             gboolean value);
static void sway_notification_center_expandable_group_real_dispose (GObject* base);
static GtkSizeRequestMode sway_notification_center_expandable_group_real_get_request_mode (GtkWidget* base);
static void sway_notification_center_expandable_group_real_compute_expand_internal (GtkWidget* base,
                                                                             gboolean* hexpand_p,
                                                                             gboolean* vexpand_p);
VALA_EXTERN gboolean sway_notification_center_expandable_group_get_is_expanded (SwayNotificationCenterExpandableGroup* self);
static void sway_notification_center_expandable_group_set_is_expanded (SwayNotificationCenterExpandableGroup* self,
                                                                gboolean value);
static void sway_notification_center_expandable_group_animate (SwayNotificationCenterExpandableGroup* self,
                                                        gdouble to);
VALA_EXTERN void sway_notification_center_expandable_group_add (SwayNotificationCenterExpandableGroup* self,
                                                    GtkWidget* widget);
VALA_EXTERN guint sway_notification_center_expandable_group_get_n_children (SwayNotificationCenterExpandableGroup* self);
static void sway_notification_center_expandable_group_set_n_children (SwayNotificationCenterExpandableGroup* self,
                                                               guint value);
VALA_EXTERN void sway_notification_center_expandable_group_remove (SwayNotificationCenterExpandableGroup* self,
                                                       GtkWidget* widget);
VALA_EXTERN void sway_notification_center_expandable_group_remove_all (SwayNotificationCenterExpandableGroup* self);
VALA_EXTERN GtkWidget* sway_notification_center_expandable_group_get_first_widget (SwayNotificationCenterExpandableGroup* self,
                                                                       SwayNotificationCenterExpandableGroupWidgetFilterDelegate filter,
                                                                       gpointer filter_target);
VALA_EXTERN gboolean sway_notification_center_expandable_group_is_empty (SwayNotificationCenterExpandableGroup* self);
VALA_EXTERN GType widget_alloc_get_type (void) G_GNUC_CONST ;
VALA_EXTERN WidgetAlloc* widget_alloc_dup (const WidgetAlloc* self);
VALA_EXTERN void widget_alloc_free (WidgetAlloc* self);
static void sway_notification_center_expandable_group_compute_height (SwayNotificationCenterExpandableGroup* self,
                                                               gint width,
                                                               gint height,
                                                               SwayNotificationCenterExpandableGroupcompute_height_iter_cb iter_callback,
                                                               gpointer iter_callback_target);
VALA_EXTERN GType widget_heights_get_type (void) G_GNUC_CONST ;
VALA_EXTERN WidgetHeights* widget_heights_dup (const WidgetHeights* self);
VALA_EXTERN void widget_heights_free (WidgetHeights* self);
VALA_EXTERN void widget_alloc_init (WidgetAlloc *self);
static inline gboolean sway_notification_center_expandable_group_is_outside_bounds (SwayNotificationCenterExpandableGroup* self,
                                                                      gfloat y,
                                                                      gint height,
                                                                      gfloat max_height);
static void sway_notification_center_expandable_group_real_size_allocate (GtkWidget* base,
                                                                   gint width,
                                                                   gint height,
                                                                   gint baseline);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static void __lambda20_ (Block13Data* _data13_,
                  GtkWidget* child,
                  WidgetAlloc* child_allocation,
                  gint index,
                  WidgetAlloc* target_alloc);
static void ___lambda20__swaynotificationcenterexpandablegroupcompute_height_iter_cb (GtkWidget* child,
                                                                               WidgetAlloc* widget_alloc,
                                                                               gint index,
                                                                               WidgetAlloc* first_alloc,
                                                                               gpointer self);
static void sway_notification_center_expandable_group_real_measure (GtkWidget* base,
                                                             GtkOrientation orientation,
                                                             gint for_size,
                                                             gint* minimum,
                                                             gint* natural,
                                                             gint* minimum_baseline,
                                                             gint* natural_baseline);
static void sway_notification_center_expandable_group_get_height_for_latest_notifications (SwayNotificationCenterExpandableGroup* self,
                                                                                    gint for_size,
                                                                                    gint* minimum,
                                                                                    gint* natural);
VALA_EXTERN gdouble sway_notification_center_functions_lerp (gdouble a,
                                                 gdouble b,
                                                 gdouble t);
static gdouble sway_notification_center_expandable_group_get_animation_progress_inv (SwayNotificationCenterExpandableGroup* self);
static void sway_notification_center_expandable_group_real_snapshot (GtkWidget* base,
                                                              GtkSnapshot* snapshot);
static void sway_notification_center_expandable_group_finalize (GObject * obj);
static GType sway_notification_center_expandable_group_get_type_once (void);
static void _vala_sway_notification_center_expandable_group_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static void _vala_sway_notification_center_expandable_group_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec);

static inline gpointer
sway_notification_center_expandable_group_get_instance_private (SwayNotificationCenterExpandableGroup* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterExpandableGroup_private_offset);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
__lambda19_ (SwayNotificationCenterExpandableGroup* self)
{
	gtk_widget_queue_allocate (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

static void
___lambda19__gtk_adjustment_value_changed (GtkAdjustment* _sender,
                                           gpointer self)
{
	__lambda19_ ((SwayNotificationCenterExpandableGroup*) self);
}

static void
_sway_notification_center_expandable_group_animation_value_cb_animation_value_targetcallback (gdouble value,
                                                                                              gpointer self)
{
	sway_notification_center_expandable_group_animation_value_cb ((SwayNotificationCenterExpandableGroup*) self, value);
}

static void
_sway_notification_center_expandable_group_animation_done_cb_adw_animation_done (AdwAnimation* _sender,
                                                                                 gpointer self)
{
	sway_notification_center_expandable_group_animation_done_cb ((SwayNotificationCenterExpandableGroup*) self);
}

SwayNotificationCenterExpandableGroup*
sway_notification_center_expandable_group_construct (GType object_type,
                                                     GtkViewport* viewport,
                                                     guint animation_duration)
{
	SwayNotificationCenterExpandableGroup * self = NULL;
	GtkAdjustment* _tmp0_;
	GtkAdjustment* _tmp1_;
	AnimationValueTarget* _tmp2_;
	AnimationValueTarget* _tmp3_;
	AdwPropertyAnimationTarget* _tmp4_;
	AdwTimedAnimation* _tmp5_;
	AdwTimedAnimation* _tmp6_;
	AdwTimedAnimation* _tmp7_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (viewport, gtk_viewport_get_type ()), NULL);
	self = (SwayNotificationCenterExpandableGroup*) g_object_new (object_type, NULL);
	self->priv->viewport = viewport;
	_tmp0_ = gtk_scrollable_get_vadjustment (G_TYPE_CHECK_INSTANCE_CAST (viewport, gtk_scrollable_get_type (), GtkScrollable));
	_tmp1_ = _tmp0_;
	g_signal_connect_object (_tmp1_, "value-changed", (GCallback) ___lambda19__gtk_adjustment_value_changed, self, 0);
	gtk_widget_set_can_focus (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp2_ = animation_value_target_new (1.0f, _sway_notification_center_expandable_group_animation_value_cb_animation_value_targetcallback, self);
	if (_tmp2_) {
		g_object_set_data ((GObject *) _tmp2_, "vala-creation-function", "SwayNotificationCenter.ExpandableGroup.new");
	}
	_g_object_unref0 (self->priv->animation_target);
	self->priv->animation_target = _tmp2_;
	_tmp3_ = self->priv->animation_target;
	_tmp4_ = animation_value_target_get_animation_target (_tmp3_);
	_tmp5_ = (AdwTimedAnimation*) adw_timed_animation_new (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), 1.0, 0.0, animation_duration, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, adw_animation_target_get_type (), AdwAnimationTarget));
	if (_tmp5_) {
		g_object_set_data ((GObject *) _tmp5_, "vala-creation-function", "SwayNotificationCenter.ExpandableGroup.new");
	}
	_g_object_unref0 (self->priv->animation);
	self->priv->animation = _tmp5_;
	_tmp6_ = self->priv->animation;
	adw_timed_animation_set_easing (_tmp6_, ADW_EASE_IN_OUT_CUBIC);
	_tmp7_ = self->priv->animation;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, adw_animation_get_type (), AdwAnimation), "done", (GCallback) _sway_notification_center_expandable_group_animation_done_cb_adw_animation_done, self, 0);
	sway_notification_center_expandable_group_set_expanded (self, FALSE);
	return self;
}

SwayNotificationCenterExpandableGroup*
sway_notification_center_expandable_group_new (GtkViewport* viewport,
                                               guint animation_duration)
{
	return sway_notification_center_expandable_group_construct (SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, viewport, animation_duration);
}

static inline gboolean
vala_g_list_is_empty (GList* self)
{
	gboolean result;
	result = ((GList*) self) == NULL;
	return result;
}

static void
sway_notification_center_expandable_group_real_dispose (GObject* base)
{
	SwayNotificationCenterExpandableGroup * self;
	GList* _tmp3_;
	GList* _tmp7_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	while (TRUE) {
		GList* _tmp0_;
		GList* _tmp1_;
		GList* _tmp2_;
		_tmp0_ = self->priv->widgets;
		if (!(!vala_g_list_is_empty (_tmp0_))) {
			break;
		}
		_tmp1_ = self->priv->widgets;
		_tmp2_ = g_list_nth (_tmp1_, (guint) 0);
		self->priv->widgets = g_list_delete_link (self->priv->widgets, _tmp2_);
	}
	_tmp3_ = self->priv->widgets;
	g_warn_if_fail (vala_g_list_is_empty (_tmp3_));
	while (TRUE) {
		GList* _tmp4_;
		GList* _tmp5_;
		GList* _tmp6_;
		_tmp4_ = self->visible_widgets;
		if (!(!vala_g_list_is_empty (_tmp4_))) {
			break;
		}
		_tmp5_ = self->visible_widgets;
		_tmp6_ = g_list_nth (_tmp5_, (guint) 0);
		self->visible_widgets = g_list_delete_link (self->visible_widgets, _tmp6_);
	}
	_tmp7_ = self->visible_widgets;
	g_warn_if_fail (vala_g_list_is_empty (_tmp7_));
	G_OBJECT_CLASS (sway_notification_center_expandable_group_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), G_TYPE_OBJECT, GObject));
}

static GtkSizeRequestMode
sway_notification_center_expandable_group_real_get_request_mode (GtkWidget* base)
{
	SwayNotificationCenterExpandableGroup * self;
	GList* _tmp0_;
	GtkSizeRequestMode result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	_tmp0_ = self->priv->widgets;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp0_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			GtkWidget* item = NULL;
			item = (GtkWidget*) item_it->data;
			{
				GtkWidget* _tmp1_;
				_tmp1_ = item;
				if (gtk_widget_get_request_mode (_tmp1_) != GTK_SIZE_REQUEST_CONSTANT_SIZE) {
					result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
					return result;
				}
			}
		}
	}
	result = GTK_SIZE_REQUEST_CONSTANT_SIZE;
	return result;
}

static void
sway_notification_center_expandable_group_real_compute_expand_internal (GtkWidget* base,
                                                                        gboolean* hexpand_p,
                                                                        gboolean* vexpand_p)
{
	SwayNotificationCenterExpandableGroup * self;
	gboolean _vala_hexpand_p = FALSE;
	gboolean _vala_vexpand_p = FALSE;
	GList* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	_vala_hexpand_p = FALSE;
	_vala_vexpand_p = FALSE;
	_tmp0_ = self->priv->widgets;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp0_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			GtkWidget* item = NULL;
			item = (GtkWidget*) item_it->data;
			{
				GtkWidget* _tmp1_;
				GtkWidget* _tmp2_;
				_tmp1_ = item;
				_vala_hexpand_p = _vala_hexpand_p | gtk_widget_compute_expand (_tmp1_, GTK_ORIENTATION_HORIZONTAL);
				_tmp2_ = item;
				_vala_vexpand_p = _vala_vexpand_p | gtk_widget_compute_expand (_tmp2_, GTK_ORIENTATION_VERTICAL);
			}
		}
	}
	if (hexpand_p) {
		*hexpand_p = _vala_hexpand_p;
	}
	if (vexpand_p) {
		*vexpand_p = _vala_vexpand_p;
	}
}

void
sway_notification_center_expandable_group_set_expanded (SwayNotificationCenterExpandableGroup* self,
                                                        gboolean value)
{
	gboolean _tmp0_;
	gint _tmp1_ = 0;
	gboolean _tmp2_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	_tmp0_ = self->priv->_is_expanded;
	if (_tmp0_ == value) {
		return;
	}
	sway_notification_center_expandable_group_set_is_expanded (self, value);
	_tmp2_ = self->priv->_is_expanded;
	if (_tmp2_) {
		_tmp1_ = 1;
	} else {
		_tmp1_ = 0;
	}
	sway_notification_center_expandable_group_animate (self, (gdouble) _tmp1_);
	gtk_widget_queue_resize (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

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

void
sway_notification_center_expandable_group_add (SwayNotificationCenterExpandableGroup* self,
                                               GtkWidget* widget)
{
	GtkWidget* _tmp0_;
	guint _tmp1_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (widget, gtk_widget_get_type ()));
	gtk_widget_set_parent (widget, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp0_ = _g_object_ref0 (widget);
	self->priv->widgets = g_list_prepend (self->priv->widgets, _tmp0_);
	_tmp1_ = self->priv->_n_children;
	sway_notification_center_expandable_group_set_n_children (self, _tmp1_ + 1);
}

static GList*
vala_g_list_remove_full (GList* self,
                         gconstpointer data,
                         GFreeFunc func)
{
	GList* l = NULL;
	GList* result;
	l = self;
	while (TRUE) {
		GList* _tmp0_;
		GList* _tmp1_;
		gconstpointer _tmp2_;
		_tmp0_ = l;
		if (!(_tmp0_ != NULL)) {
			break;
		}
		_tmp1_ = l;
		_tmp2_ = ((GList*) _tmp1_)->data;
		if (_tmp2_ != data) {
			GList* _tmp3_;
			GList* _tmp4_;
			_tmp3_ = l;
			_tmp4_ = ((GList*) _tmp3_)->next;
			l = _tmp4_;
		} else {
			GList* _tmp5_;
			gconstpointer _tmp6_;
			GList* _tmp7_;
			_tmp5_ = l;
			_tmp6_ = ((GList*) _tmp5_)->data;
			func (_tmp6_);
			_tmp7_ = l;
			self = g_list_delete_link (self, (GList*) _tmp7_);
			break;
		}
	}
	result = self;
	return result;
}

void
sway_notification_center_expandable_group_remove (SwayNotificationCenterExpandableGroup* self,
                                                  GtkWidget* widget)
{
	gboolean widget_visible = FALSE;
	guint _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (widget, gtk_widget_get_type ()));
	widget_visible = gtk_widget_get_visible (widget);
	gtk_widget_unparent (widget);
	self->priv->widgets = vala_g_list_remove_full (self->priv->widgets, widget, _g_object_unref0_);
	if (widget_visible) {
		gtk_widget_queue_resize (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	}
	_tmp0_ = self->priv->_n_children;
	sway_notification_center_expandable_group_set_n_children (self, _tmp0_ - 1);
}

void
sway_notification_center_expandable_group_remove_all (SwayNotificationCenterExpandableGroup* self)
{
	GList* _tmp11_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	while (TRUE) {
		GList* _tmp0_;
		GList* link = NULL;
		GList* _tmp1_;
		GList* _tmp2_;
		gboolean _tmp3_ = FALSE;
		GList* _tmp4_;
		gconstpointer _tmp5_;
		_tmp0_ = self->priv->widgets;
		if (!(!vala_g_list_is_empty (_tmp0_))) {
			break;
		}
		_tmp1_ = self->priv->widgets;
		_tmp2_ = g_list_nth (_tmp1_, (guint) 0);
		link = _tmp2_;
		_tmp4_ = link;
		_tmp5_ = _tmp4_->data;
		if (((GtkWidget*) _tmp5_) != NULL) {
			GList* _tmp6_;
			gconstpointer _tmp7_;
			_tmp6_ = link;
			_tmp7_ = _tmp6_->data;
			_tmp3_ = G_TYPE_CHECK_INSTANCE_TYPE ((GtkWidget*) _tmp7_, gtk_widget_get_type ());
		} else {
			_tmp3_ = FALSE;
		}
		if (_tmp3_) {
			GList* _tmp8_;
			gconstpointer _tmp9_;
			_tmp8_ = link;
			_tmp9_ = _tmp8_->data;
			sway_notification_center_expandable_group_remove (self, (GtkWidget*) _tmp9_);
		} else {
			GList* _tmp10_;
			_tmp10_ = link;
			self->priv->widgets = g_list_delete_link (self->priv->widgets, _tmp10_);
		}
	}
	_tmp11_ = self->priv->widgets;
	g_warn_if_fail (vala_g_list_is_empty (_tmp11_));
	sway_notification_center_expandable_group_set_n_children (self, (guint) 0);
}

GtkWidget*
sway_notification_center_expandable_group_get_first_widget (SwayNotificationCenterExpandableGroup* self,
                                                            SwayNotificationCenterExpandableGroupWidgetFilterDelegate filter,
                                                            gpointer filter_target)
{
	GtkWidget* result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self), NULL);
	{
		GList* link = NULL;
		GList* _tmp0_;
		GList* _tmp1_;
		_tmp0_ = self->priv->widgets;
		_tmp1_ = g_list_first (_tmp0_);
		link = _tmp1_;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GList* _tmp5_;
				gboolean _tmp6_ = FALSE;
				GList* _tmp7_;
				gconstpointer _tmp8_;
				if (!_tmp2_) {
					GList* _tmp3_;
					GList* _tmp4_;
					_tmp3_ = link;
					_tmp4_ = _tmp3_->next;
					link = _tmp4_;
				}
				_tmp2_ = FALSE;
				_tmp5_ = link;
				if (!(_tmp5_ != NULL)) {
					break;
				}
				_tmp7_ = link;
				_tmp8_ = _tmp7_->data;
				if (((GtkWidget*) _tmp8_) != NULL) {
					gboolean _tmp9_ = FALSE;
					if (filter == NULL) {
						_tmp9_ = TRUE;
					} else {
						GList* _tmp10_;
						gconstpointer _tmp11_;
						_tmp10_ = link;
						_tmp11_ = _tmp10_->data;
						_tmp9_ = filter ((GtkWidget*) _tmp11_, filter_target);
					}
					_tmp6_ = _tmp9_;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					GList* _tmp12_;
					gconstpointer _tmp13_;
					_tmp12_ = link;
					_tmp13_ = _tmp12_->data;
					result = (GtkWidget*) _tmp13_;
					return result;
				}
			}
		}
	}
	result = NULL;
	return result;
}

inline gboolean
sway_notification_center_expandable_group_is_empty (SwayNotificationCenterExpandableGroup* self)
{
	GList* _tmp0_;
	gboolean result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self), FALSE);
	_tmp0_ = self->priv->widgets;
	result = vala_g_list_is_empty (_tmp0_);
	return result;
}

static void
sway_notification_center_expandable_group_compute_height (SwayNotificationCenterExpandableGroup* self,
                                                          gint width,
                                                          gint height,
                                                          SwayNotificationCenterExpandableGroupcompute_height_iter_cb iter_callback,
                                                          gpointer iter_callback_target)
{
	gint num_vexpand_children = 0;
	WidgetHeights measured_height = {0};
	WidgetHeights* heights = NULL;
	guint _tmp0_;
	WidgetHeights* _tmp1_;
	gint heights_length1;
	gint _heights_size_;
	gint total_min = 0;
	gint total_nat = 0;
	gint i = 0;
	GList* _tmp2_;
	gboolean allocate_nat = FALSE;
	gint extra_height = 0;
	WidgetHeights _tmp17_;
	WidgetAlloc first_allocation = {0};
	gint y = 0;
	GList* _tmp19_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	num_vexpand_children = 0;
	memset (&measured_height, 0, sizeof (WidgetHeights));
	_tmp0_ = self->priv->_n_children;
	_tmp1_ = g_new0 (WidgetHeights, _tmp0_);
	heights = _tmp1_;
	heights_length1 = _tmp0_;
	_heights_size_ = heights_length1;
	total_min = 0;
	total_nat = 0;
	i = 0;
	_tmp2_ = self->priv->widgets;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp2_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GtkWidget* _tmp3_;
				gint nat_width = 0;
				GtkWidget* _tmp4_;
				gint _tmp5_ = 0;
				gint min_height = 0;
				gint nat_height = 0;
				GtkWidget* _tmp6_;
				gint _tmp7_ = 0;
				gint _tmp8_ = 0;
				gint min = 0;
				gint nat = 0;
				GtkWidget* _tmp9_;
				gint _tmp10_ = 0;
				gint _tmp11_ = 0;
				WidgetHeights* _tmp12_;
				gint _tmp12__length1;
				WidgetHeights _tmp13_ = {0};
				GtkWidget* _tmp14_;
				gint _tmp16_;
				_tmp3_ = child;
				if (!gtk_widget_should_layout (_tmp3_)) {
					continue;
				}
				_tmp4_ = child;
				gtk_widget_measure (_tmp4_, GTK_ORIENTATION_HORIZONTAL, -1, NULL, &_tmp5_, NULL, NULL);
				nat_width = _tmp5_;
				_tmp6_ = child;
				gtk_widget_measure (_tmp6_, GTK_ORIENTATION_VERTICAL, nat_width, &_tmp7_, &_tmp8_, NULL, NULL);
				min_height = _tmp7_;
				nat_height = _tmp8_;
				_tmp9_ = child;
				gtk_widget_measure (_tmp9_, GTK_ORIENTATION_VERTICAL, width, &_tmp10_, &_tmp11_, NULL, NULL);
				min = _tmp10_;
				nat = _tmp11_;
				_tmp12_ = heights;
				_tmp12__length1 = heights_length1;
				memset (&_tmp13_, 0, sizeof (WidgetHeights));
				_tmp13_.min_height = min;
				_tmp13_.nat_height = nat;
				_tmp12_[i] = _tmp13_;
				total_min += min;
				total_nat += nat;
				_tmp14_ = child;
				if (gtk_widget_compute_expand (_tmp14_, GTK_ORIENTATION_VERTICAL)) {
					gint _tmp15_;
					_tmp15_ = num_vexpand_children;
					num_vexpand_children = _tmp15_ + 1;
				}
				_tmp16_ = i;
				i = _tmp16_ + 1;
			}
		}
	}
	allocate_nat = FALSE;
	extra_height = 0;
	_tmp17_ = measured_height;
	if (height >= _tmp17_.nat_height) {
		WidgetHeights _tmp18_;
		allocate_nat = TRUE;
		_tmp18_ = measured_height;
		extra_height = height - _tmp18_.nat_height;
	} else {
		g_warn_if_reached ();
	}
	widget_alloc_init (&first_allocation);
	y = 0;
	i = 0;
	_tmp19_ = self->priv->widgets;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp19_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				WidgetHeights computed_height = {0};
				WidgetHeights* _tmp20_;
				gint _tmp20__length1;
				WidgetHeights _tmp21_;
				WidgetAlloc child_allocation = {0};
				WidgetHeights _tmp22_;
				WidgetAlloc _tmp23_ = {0};
				GtkWidget* _tmp25_;
				GtkWidget* _tmp27_;
				WidgetAlloc _tmp28_;
				WidgetAlloc _tmp29_;
				WidgetAlloc _tmp30_;
				gint _tmp31_;
				_tmp20_ = heights;
				_tmp20__length1 = heights_length1;
				_tmp21_ = _tmp20_[i];
				computed_height = _tmp21_;
				_tmp22_ = computed_height;
				widget_alloc_init (&_tmp23_);
				_tmp23_.y = (gfloat) 0;
				_tmp23_.height = _tmp22_.min_height;
				child_allocation = _tmp23_;
				if (allocate_nat) {
					WidgetHeights _tmp24_;
					_tmp24_ = computed_height;
					child_allocation.height = _tmp24_.nat_height;
				}
				_tmp25_ = child;
				if (gtk_widget_compute_expand (_tmp25_, GTK_ORIENTATION_VERTICAL)) {
					child_allocation.height = child_allocation.height + (extra_height / num_vexpand_children);
				}
				child_allocation.y = (gfloat) y;
				if (i == 0) {
					WidgetAlloc _tmp26_;
					_tmp26_ = child_allocation;
					first_allocation = _tmp26_;
				}
				_tmp27_ = child;
				_tmp28_ = child_allocation;
				_tmp29_ = first_allocation;
				iter_callback (_tmp27_, &_tmp28_, i, &_tmp29_, iter_callback_target);
				_tmp30_ = child_allocation;
				y += _tmp30_.height;
				_tmp31_ = i;
				i = _tmp31_ + 1;
			}
		}
	}
	heights = (g_free (heights), NULL);
}

static inline gboolean
sway_notification_center_expandable_group_is_outside_bounds (SwayNotificationCenterExpandableGroup* self,
                                                             gfloat y,
                                                             gint height,
                                                             gfloat max_height)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self), FALSE);
	if ((y + height) < ((gfloat) 0)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = y > max_height;
	}
	result = _tmp0_;
	return result;
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		SwayNotificationCenterExpandableGroup* self;
		self = _data13_->self;
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static gpointer
_gsk_transform_ref0 (gpointer self)
{
	return self ? gsk_transform_ref (self) : NULL;
}

static void
__lambda20_ (Block13Data* _data13_,
             GtkWidget* child,
             WidgetAlloc* child_allocation,
             gint index,
             WidgetAlloc* target_alloc)
{
	SwayNotificationCenterExpandableGroup* self;
	gint child_height = 0;
	WidgetAlloc _tmp0_;
	WidgetAlloc _tmp1_;
	graphene_point_t viewport_relative_coords = {0};
	GtkViewport* _tmp2_;
	graphene_point_t _tmp3_ = {0};
	WidgetAlloc _tmp4_;
	graphene_point_t _tmp5_;
	graphene_point_t _tmp6_ = {0};
	gboolean skip_child = FALSE;
	gboolean outside_bounds = FALSE;
	graphene_point_t _tmp7_;
	gboolean _tmp8_ = FALSE;
	gfloat scale = 0.0F;
	gfloat opacity = 0.0F;
	gfloat x = 0.0F;
	gfloat y = 0.0F;
	WidgetAlloc _tmp11_;
	GskTransform* transform = NULL;
	GskTransform* _tmp12_;
	graphene_point_t _tmp13_ = {0};
	graphene_point_t _tmp14_;
	GskTransform* _tmp15_;
	GskTransform* _tmp16_;
	GskTransform* _tmp17_;
	GskTransform* _tmp18_;
	self = _data13_->self;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()));
	g_return_if_fail (child_allocation != NULL);
	g_return_if_fail (target_alloc != NULL);
	if (!gtk_widget_should_layout (child)) {
		return;
	}
	_tmp0_ = *target_alloc;
	_tmp1_ = *child_allocation;
	child_height = (gint) adw_lerp ((gdouble) _tmp0_.height, (gdouble) _tmp1_.height, self->priv->animation_progress);
	_tmp2_ = self->priv->viewport;
	memset (&_tmp3_, 0, sizeof (graphene_point_t));
	_tmp4_ = *child_allocation;
	_tmp5_ = *graphene_point_init (&_tmp3_, (gfloat) 0, _tmp4_.y);
	gtk_widget_compute_point (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), &_tmp5_, &_tmp6_);
	viewport_relative_coords = _tmp6_;
	skip_child = FALSE;
	_tmp7_ = viewport_relative_coords;
	outside_bounds = sway_notification_center_expandable_group_is_outside_bounds (self, _tmp7_.y, child_height, _data13_->max_height);
	if (self->priv->animation_progress > ((gdouble) 0)) {
		_tmp8_ = self->priv->animation_progress < ((gdouble) 1);
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		gboolean _tmp9_ = FALSE;
		if (index >= SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_NUM_STACKED_NOTIFICATIONS) {
			_tmp9_ = outside_bounds;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			skip_child = TRUE;
		}
	} else {
		gboolean _tmp10_;
		_tmp10_ = self->priv->_is_expanded;
		if (!_tmp10_) {
			if (index >= SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_NUM_STACKED_NOTIFICATIONS) {
				skip_child = TRUE;
			}
		} else {
			if (outside_bounds) {
				skip_child = TRUE;
			}
		}
	}
	if (skip_child) {
		return;
	}
	self->visible_widgets = g_list_prepend (self->visible_widgets, child);
	scale = 1.0f;
	opacity = 1.0f;
	x = (gfloat) 0;
	_tmp11_ = *child_allocation;
	y = (gfloat) adw_lerp ((gdouble) 0, (gdouble) _tmp11_.y, self->priv->animation_progress);
	if (index < SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_NUM_STACKED_NOTIFICATIONS) {
		scale = (gfloat) MIN (self->priv->animation_progress + pow (0.95, (gdouble) index), (gdouble) 1);
		x = (_data13_->width - (_data13_->width * scale)) * 0.5f;
		y += child_height * (1 - scale);
		y += (gfloat) (((gint) adw_lerp ((gdouble) SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_COLLAPSED_NOTIFICATION_OFFSET, (gdouble) 0, self->priv->animation_progress)) * index);
	} else {
		opacity = (gfloat) (1.5f * self->priv->animation_progress);
	}
	_tmp12_ = gsk_transform_new ();
	memset (&_tmp13_, 0, sizeof (graphene_point_t));
	_tmp14_ = *graphene_point_init (&_tmp13_, x, y);
	_tmp15_ = gsk_transform_translate (_tmp12_, &_tmp14_);
	_tmp16_ = gsk_transform_scale (_tmp15_, scale, scale);
	transform = _tmp16_;
	_tmp17_ = transform;
	_tmp18_ = _gsk_transform_ref0 (_tmp17_);
	gtk_widget_allocate (child, _data13_->width, child_height, _data13_->baseline, _tmp18_);
	gtk_widget_set_opacity (child, (gdouble) opacity);
	_gsk_transform_unref0 (transform);
}

static void
___lambda20__swaynotificationcenterexpandablegroupcompute_height_iter_cb (GtkWidget* child,
                                                                          WidgetAlloc* widget_alloc,
                                                                          gint index,
                                                                          WidgetAlloc* first_alloc,
                                                                          gpointer self)
{
	__lambda20_ (self, child, widget_alloc, index, first_alloc);
}

static void
sway_notification_center_expandable_group_real_size_allocate (GtkWidget* base,
                                                              gint width,
                                                              gint height,
                                                              gint baseline)
{
	SwayNotificationCenterExpandableGroup * self;
	Block13Data* _data13_;
	GList* _tmp3_;
	guint _tmp4_;
	graphene_rect_t bounds = {0};
	GtkViewport* _tmp5_;
	graphene_rect_t _tmp6_ = {0};
	GtkViewport* _tmp7_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_data13_->self = g_object_ref (self);
	_data13_->width = width;
	_data13_->baseline = baseline;
	GTK_WIDGET_CLASS (sway_notification_center_expandable_group_parent_class)->size_allocate (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _data13_->width, height, _data13_->baseline);
	while (TRUE) {
		GList* _tmp0_;
		GList* _tmp1_;
		GList* _tmp2_;
		_tmp0_ = self->visible_widgets;
		if (!(!vala_g_list_is_empty (_tmp0_))) {
			break;
		}
		_tmp1_ = self->visible_widgets;
		_tmp2_ = g_list_nth (_tmp1_, (guint) 0);
		self->visible_widgets = g_list_delete_link (self->visible_widgets, _tmp2_);
	}
	_tmp3_ = self->visible_widgets;
	g_warn_if_fail (vala_g_list_is_empty (_tmp3_));
	_tmp4_ = self->priv->_n_children;
	if (_tmp4_ == ((guint) 0)) {
		block13_data_unref (_data13_);
		_data13_ = NULL;
		return;
	}
	_tmp5_ = self->priv->viewport;
	gtk_widget_compute_bounds (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), &_tmp6_);
	bounds = _tmp6_;
	_tmp7_ = self->priv->viewport;
	_data13_->max_height = (gfloat) gtk_widget_get_height (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget));
	sway_notification_center_expandable_group_compute_height (self, _data13_->width, height, ___lambda20__swaynotificationcenterexpandablegroupcompute_height_iter_cb, _data13_);
	block13_data_unref (_data13_);
	_data13_ = NULL;
}

static void
sway_notification_center_expandable_group_real_measure (GtkWidget* base,
                                                        GtkOrientation orientation,
                                                        gint for_size,
                                                        gint* minimum,
                                                        gint* natural,
                                                        gint* minimum_baseline,
                                                        gint* natural_baseline)
{
	SwayNotificationCenterExpandableGroup * self;
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	gboolean _tmp0_ = FALSE;
	GList* _tmp2_;
	gint target_nat_height = 0;
	gint target_min_height = 0;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	gdouble _tmp9_;
	gdouble _tmp10_;
	gdouble _tmp11_;
	gdouble _tmp12_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	_vala_minimum = 0;
	_vala_natural = 0;
	_vala_minimum_baseline = -1;
	_vala_natural_baseline = -1;
	if (orientation == GTK_ORIENTATION_HORIZONTAL) {
		_tmp0_ = TRUE;
	} else {
		guint _tmp1_;
		_tmp1_ = self->priv->_n_children;
		_tmp0_ = _tmp1_ == ((guint) 0);
	}
	if (_tmp0_) {
		if (minimum) {
			*minimum = _vala_minimum;
		}
		if (natural) {
			*natural = _vala_natural;
		}
		if (minimum_baseline) {
			*minimum_baseline = _vala_minimum_baseline;
		}
		if (natural_baseline) {
			*natural_baseline = _vala_natural_baseline;
		}
		return;
	}
	_tmp2_ = self->priv->widgets;
	{
		GList* widget_collection = NULL;
		GList* widget_it = NULL;
		widget_collection = _tmp2_;
		for (widget_it = widget_collection; widget_it != NULL; widget_it = widget_it->next) {
			GtkWidget* widget = NULL;
			widget = (GtkWidget*) widget_it->data;
			{
				GtkWidget* _tmp3_;
				gint min_height = 0;
				gint nat_height = 0;
				GtkWidget* _tmp4_;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				_tmp3_ = widget;
				if (!gtk_widget_should_layout (_tmp3_)) {
					continue;
				}
				min_height = 0;
				nat_height = 0;
				_tmp4_ = widget;
				gtk_widget_measure (_tmp4_, orientation, for_size, &_tmp5_, &_tmp6_, NULL, NULL);
				min_height = _tmp5_;
				nat_height = _tmp6_;
				_vala_minimum = _vala_minimum + min_height;
				_vala_natural = _vala_natural + nat_height;
			}
		}
	}
	sway_notification_center_expandable_group_get_height_for_latest_notifications (self, for_size, &_tmp7_, &_tmp8_);
	target_min_height = _tmp7_;
	target_nat_height = _tmp8_;
	_tmp9_ = sway_notification_center_expandable_group_get_animation_progress_inv (self);
	_tmp10_ = _tmp9_;
	_vala_minimum = (gint) sway_notification_center_functions_lerp ((gdouble) _vala_minimum, (gdouble) target_nat_height, _tmp10_);
	_tmp11_ = sway_notification_center_expandable_group_get_animation_progress_inv (self);
	_tmp12_ = _tmp11_;
	_vala_natural = (gint) sway_notification_center_functions_lerp ((gdouble) _vala_natural, (gdouble) target_nat_height, _tmp12_);
	if (minimum) {
		*minimum = _vala_minimum;
	}
	if (natural) {
		*natural = _vala_natural;
	}
	if (minimum_baseline) {
		*minimum_baseline = _vala_minimum_baseline;
	}
	if (natural_baseline) {
		*natural_baseline = _vala_natural_baseline;
	}
}

static void
sway_notification_center_expandable_group_real_snapshot (GtkWidget* base,
                                                         GtkSnapshot* snapshot)
{
	SwayNotificationCenterExpandableGroup * self;
	GList* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (snapshot, gtk_snapshot_get_type ()));
	_tmp0_ = self->visible_widgets;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp0_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GtkWidget* _tmp1_;
				GtkWidget* _tmp2_;
				_tmp1_ = child;
				if (!gtk_widget_should_layout (_tmp1_)) {
					continue;
				}
				_tmp2_ = child;
				gtk_widget_snapshot_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp2_, snapshot);
			}
		}
	}
}

/** Gets the collapsed height (first notification + stacked) */
static void
sway_notification_center_expandable_group_get_height_for_latest_notifications (SwayNotificationCenterExpandableGroup* self,
                                                                               gint for_size,
                                                                               gint* minimum,
                                                                               gint* natural)
{
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	guint _tmp0_;
	GList* first = NULL;
	GList* _tmp1_;
	GList* _tmp2_;
	GList* _tmp3_;
	gint offset = 0;
	guint _tmp9_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	_vala_minimum = 0;
	_vala_natural = 0;
	_tmp0_ = self->priv->_n_children;
	if (_tmp0_ == ((guint) 0)) {
		if (minimum) {
			*minimum = _vala_minimum;
		}
		if (natural) {
			*natural = _vala_natural;
		}
		return;
	}
	_tmp1_ = self->priv->widgets;
	_tmp2_ = g_list_first (_tmp1_);
	first = _tmp2_;
	_tmp3_ = first;
	if (_tmp3_ != NULL) {
		GtkWidget* last_widget = NULL;
		GList* _tmp4_;
		gconstpointer _tmp5_;
		GtkWidget* _tmp6_;
		gint _tmp7_ = 0;
		gint _tmp8_ = 0;
		_tmp4_ = first;
		_tmp5_ = _tmp4_->data;
		last_widget = (GtkWidget*) _tmp5_;
		_tmp6_ = last_widget;
		gtk_widget_measure (_tmp6_, GTK_ORIENTATION_VERTICAL, for_size, &_tmp7_, &_tmp8_, NULL, NULL);
		_vala_minimum = _tmp7_;
		_vala_natural = _tmp8_;
	}
	_tmp9_ = self->priv->_n_children;
	offset = ((gint) CLAMP (_tmp9_ - 1, (guint) 0, (guint) (SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_NUM_STACKED_NOTIFICATIONS - 1))) * SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_COLLAPSED_NOTIFICATION_OFFSET;
	_vala_natural = _vala_natural + offset;
	if (minimum) {
		*minimum = _vala_minimum;
	}
	if (natural) {
		*natural = _vala_natural;
	}
}

static void
sway_notification_center_expandable_group_animation_value_cb (SwayNotificationCenterExpandableGroup* self,
                                                              gdouble progress)
{
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	self->priv->animation_progress = progress;
	gtk_widget_queue_resize (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

static void
sway_notification_center_expandable_group_animation_done_cb (SwayNotificationCenterExpandableGroup* self)
{
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	gtk_widget_queue_allocate (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

static void
sway_notification_center_expandable_group_animate (SwayNotificationCenterExpandableGroup* self,
                                                   gdouble to)
{
	AdwTimedAnimation* _tmp0_;
	AdwTimedAnimation* _tmp1_;
	AdwTimedAnimation* _tmp2_;
	AdwTimedAnimation* _tmp3_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	_tmp0_ = self->priv->animation;
	adw_timed_animation_set_value_from (_tmp0_, self->priv->animation_progress);
	_tmp1_ = self->priv->animation;
	adw_timed_animation_set_value_to (_tmp1_, to);
	_tmp2_ = self->priv->animation;
	adw_animation_reset (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, adw_animation_get_type (), AdwAnimation));
	_tmp3_ = self->priv->animation;
	adw_animation_play (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, adw_animation_get_type (), AdwAnimation));
}

gboolean
sway_notification_center_expandable_group_get_is_expanded (SwayNotificationCenterExpandableGroup* self)
{
	gboolean result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self), FALSE);
	result = self->priv->_is_expanded;
	return result;
}

static void
sway_notification_center_expandable_group_set_is_expanded (SwayNotificationCenterExpandableGroup* self,
                                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	old_value = sway_notification_center_expandable_group_get_is_expanded (self);
	if (old_value != value) {
		self->priv->_is_expanded = value;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_expandable_group_properties[SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_IS_EXPANDED_PROPERTY]);
	}
}

static gdouble
sway_notification_center_expandable_group_get_animation_progress_inv (SwayNotificationCenterExpandableGroup* self)
{
	gdouble result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self), 0.0);
	result = 1 - self->priv->animation_progress;
	return result;
}

guint
sway_notification_center_expandable_group_get_n_children (SwayNotificationCenterExpandableGroup* self)
{
	guint result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self), 0U);
	result = self->priv->_n_children;
	return result;
}

static void
sway_notification_center_expandable_group_set_n_children (SwayNotificationCenterExpandableGroup* self,
                                                          guint value)
{
	guint old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_EXPANDABLE_GROUP (self));
	old_value = sway_notification_center_expandable_group_get_n_children (self);
	if (old_value != value) {
		self->priv->_n_children = value;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_expandable_group_properties[SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_N_CHILDREN_PROPERTY]);
	}
}

static void
sway_notification_center_expandable_group_class_init (SwayNotificationCenterExpandableGroupClass * klass,
                                                      gpointer klass_data)
{
	sway_notification_center_expandable_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterExpandableGroup_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) sway_notification_center_expandable_group_real_dispose;
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget*)) sway_notification_center_expandable_group_real_get_request_mode;
	((GtkWidgetClass *) klass)->compute_expand = (void (*) (GtkWidget*, gboolean*, gboolean*)) sway_notification_center_expandable_group_real_compute_expand_internal;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) sway_notification_center_expandable_group_real_size_allocate;
	((GtkWidgetClass *) klass)->measure = (void (*) (GtkWidget*, GtkOrientation, gint, gint*, gint*, gint*, gint*)) sway_notification_center_expandable_group_real_measure;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) sway_notification_center_expandable_group_real_snapshot;
	G_OBJECT_CLASS (klass)->get_property = _vala_sway_notification_center_expandable_group_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sway_notification_center_expandable_group_set_property;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_expandable_group_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_IS_EXPANDED_PROPERTY, sway_notification_center_expandable_group_properties[SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_IS_EXPANDED_PROPERTY] = g_param_spec_boolean ("is-expanded", "is-expanded", "is-expanded", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_N_CHILDREN_PROPERTY, sway_notification_center_expandable_group_properties[SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_N_CHILDREN_PROPERTY] = g_param_spec_uint ("n-children", "n-children", "n-children", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
sway_notification_center_expandable_group_instance_init (SwayNotificationCenterExpandableGroup * self,
                                                         gpointer klass)
{
	self->priv = sway_notification_center_expandable_group_get_instance_private (self);
	self->priv->_is_expanded = TRUE;
	self->priv->animation_progress = 1.0;
	self->visible_widgets = NULL;
	self->priv->widgets = NULL;
}

static void
sway_notification_center_expandable_group_finalize (GObject * obj)
{
	SwayNotificationCenterExpandableGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	_g_object_unref0 (self->priv->animation_target);
	_g_object_unref0 (self->priv->animation);
	(self->visible_widgets == NULL) ? NULL : (self->visible_widgets = (g_list_free (self->visible_widgets), NULL));
	(self->priv->widgets == NULL) ? NULL : (self->priv->widgets = (_g_list_free__g_object_unref0_ (self->priv->widgets), NULL));
	G_OBJECT_CLASS (sway_notification_center_expandable_group_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_expandable_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterExpandableGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_expandable_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterExpandableGroup), 0, (GInstanceInitFunc) sway_notification_center_expandable_group_instance_init, NULL };
	GType sway_notification_center_expandable_group_type_id;
	sway_notification_center_expandable_group_type_id = g_type_register_static (gtk_widget_get_type (), "SwayNotificationCenterExpandableGroup", &g_define_type_info, 0);
	SwayNotificationCenterExpandableGroup_private_offset = g_type_add_instance_private (sway_notification_center_expandable_group_type_id, sizeof (SwayNotificationCenterExpandableGroupPrivate));
	return sway_notification_center_expandable_group_type_id;
}

GType
sway_notification_center_expandable_group_get_type (void)
{
	static gsize sway_notification_center_expandable_group_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_expandable_group_type_id__once)) {
		GType sway_notification_center_expandable_group_type_id;
		sway_notification_center_expandable_group_type_id = sway_notification_center_expandable_group_get_type_once ();
		g_once_init_leave (&sway_notification_center_expandable_group_type_id__once, sway_notification_center_expandable_group_type_id);
	}
	return sway_notification_center_expandable_group_type_id__once;
}

static void
_vala_sway_notification_center_expandable_group_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	SwayNotificationCenterExpandableGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_IS_EXPANDED_PROPERTY:
		g_value_set_boolean (value, sway_notification_center_expandable_group_get_is_expanded (self));
		break;
		case SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_N_CHILDREN_PROPERTY:
		g_value_set_uint (value, sway_notification_center_expandable_group_get_n_children (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_sway_notification_center_expandable_group_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec)
{
	SwayNotificationCenterExpandableGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_TYPE_EXPANDABLE_GROUP, SwayNotificationCenterExpandableGroup);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_IS_EXPANDED_PROPERTY:
		sway_notification_center_expandable_group_set_is_expanded (self, g_value_get_boolean (value));
		break;
		case SWAY_NOTIFICATION_CENTER_EXPANDABLE_GROUP_N_CHILDREN_PROPERTY:
		sway_notification_center_expandable_group_set_n_children (self, g_value_get_uint (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

