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

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gio/gio.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 TUBA_VIEWS_TYPE_BASE (tuba_views_base_get_type ())
#define TUBA_VIEWS_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBase))
#define TUBA_VIEWS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))
#define TUBA_VIEWS_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))

typedef struct _TubaViewsBase TubaViewsBase;
typedef struct _TubaViewsBaseClass TubaViewsBaseClass;
typedef struct _TubaViewsBasePrivate TubaViewsBasePrivate;

#define TUBA_VIEWS_TYPE_CONTENT_BASE (tuba_views_content_base_get_type ())
#define TUBA_VIEWS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase))
#define TUBA_VIEWS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))
#define TUBA_VIEWS_IS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_IS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_CONTENT_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))

typedef struct _TubaViewsContentBase TubaViewsContentBase;
typedef struct _TubaViewsContentBaseClass TubaViewsContentBaseClass;
typedef struct _TubaViewsContentBasePrivate TubaViewsContentBasePrivate;
enum  {
	TUBA_VIEWS_CONTENT_BASE_0_PROPERTY,
	TUBA_VIEWS_CONTENT_BASE_EMPTY_PROPERTY,
	TUBA_VIEWS_CONTENT_BASE_NUM_PROPERTIES
};
static GParamSpec* tuba_views_content_base_properties[TUBA_VIEWS_CONTENT_BASE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE (tuba_views_base_status_message_get_type ())
#define TUBA_VIEWS_BASE_STATUS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE, TubaViewsBaseStatusMessage))
#define TUBA_VIEWS_BASE_STATUS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE, TubaViewsBaseStatusMessageClass))
#define TUBA_VIEWS_BASE_IS_STATUS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE))
#define TUBA_VIEWS_BASE_IS_STATUS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE))
#define TUBA_VIEWS_BASE_STATUS_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE, TubaViewsBaseStatusMessageClass))

typedef struct _TubaViewsBaseStatusMessage TubaViewsBaseStatusMessage;
typedef struct _TubaViewsBaseStatusMessageClass TubaViewsBaseStatusMessageClass;

#define TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;
typedef struct _Block63Data Block63Data;
enum  {
	TUBA_VIEWS_CONTENT_BASE_REACHED_CLOSE_TO_TOP_SIGNAL,
	TUBA_VIEWS_CONTENT_BASE_NUM_SIGNALS
};
static guint tuba_views_content_base_signals[TUBA_VIEWS_CONTENT_BASE_NUM_SIGNALS] = {0};

struct _TubaViewsBase {
	AdwBreakpointBin parent_instance;
	TubaViewsBasePrivate * priv;
	AdwHeaderBar* header;
	AdwToolbarView* toolbar_view;
	GtkScrolledWindow* scrolled;
	GtkOverlay* scrolled_overlay;
	GtkRevealer* scroll_to_top_rev;
	GtkButton* scroll_to_top;
	GtkStack* states;
	AdwClamp* content_box;
	GtkButton* status_button;
};

struct _TubaViewsBaseClass {
	AdwBreakpointBinClass parent_class;
	void (*scroll_page) (TubaViewsBase* self, gboolean up);
	void (*unbind_listboxes) (TubaViewsBase* self);
	void (*build_actions) (TubaViewsBase* self);
	void (*build_header) (TubaViewsBase* self);
	void (*clear) (TubaViewsBase* self);
	void (*on_shown) (TubaViewsBase* self);
	void (*on_hidden) (TubaViewsBase* self);
	void (*on_content_changed) (TubaViewsBase* self);
	void (*on_error) (TubaViewsBase* self, gint32 code, const gchar* reason);
};

struct _TubaViewsContentBase {
	TubaViewsBase parent_instance;
	TubaViewsContentBasePrivate * priv;
	GtkListBox* content;
	GListStore* model;
};

struct _TubaViewsContentBaseClass {
	TubaViewsBaseClass parent_class;
	void (*on_scrolled_vadjustment_value_change) (TubaViewsContentBase* self);
	void (*clear_all_but_first) (TubaViewsContentBase* self, gint i);
	void (*attempt_focus_grab) (TubaViewsContentBase* self);
	GtkWidget* (*on_create_model_widget) (TubaViewsContentBase* self, GObject* obj);
	void (*on_bottom_reached) (TubaViewsContentBase* self);
	void (*on_content_item_activated) (TubaViewsContentBase* self, GtkListBoxRow* row);
	gboolean (*get_empty) (TubaViewsContentBase* self);
};

struct _TubaViewsContentBasePrivate {
	gboolean bottom_reached_locked;
};

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

struct _Block63Data {
	int _ref_count_;
	TubaViewsContentBase* self;
	guint timeout;
};

static gint TubaViewsContentBase_private_offset;
static gpointer tuba_views_content_base_parent_class = NULL;

VALA_EXTERN GType tuba_views_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBase, g_object_unref)
VALA_EXTERN GType tuba_views_content_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsContentBase, g_object_unref)
VALA_EXTERN void tuba_views_content_base_on_scrolled_vadjustment_value_change (TubaViewsContentBase* self);
VALA_EXTERN void tuba_views_base_clear (TubaViewsBase* self);
VALA_EXTERN void tuba_views_content_base_clear_all_but_first (TubaViewsContentBase* self,
                                                  gint i);
VALA_EXTERN void tuba_views_base_on_content_changed (TubaViewsBase* self);
VALA_EXTERN void tuba_views_content_base_attempt_focus_grab (TubaViewsContentBase* self);
VALA_EXTERN void tuba_views_base_unbind_listboxes (TubaViewsBase* self);
VALA_EXTERN GtkWidget* tuba_views_content_base_on_create_model_widget (TubaViewsContentBase* self,
                                                           GObject* obj);
VALA_EXTERN void tuba_views_content_base_on_bottom_reached (TubaViewsContentBase* self);
VALA_EXTERN void tuba_views_content_base_on_content_item_activated (TubaViewsContentBase* self,
                                                        GtkListBoxRow* row);
VALA_EXTERN gboolean tuba_views_content_base_get_empty (TubaViewsContentBase* self);
static void tuba_views_content_base_real_on_scrolled_vadjustment_value_change (TubaViewsContentBase* self);
VALA_EXTERN void tuba_views_content_base_set_scroll_to_top_reveal_child (TubaViewsContentBase* self,
                                                             gboolean reveal);
static void tuba_views_content_base_real_dispose (GObject* base);
static void tuba_views_content_base_real_clear (TubaViewsBase* base);
static void tuba_views_content_base_real_clear_all_but_first (TubaViewsContentBase* self,
                                                       gint i);
static void tuba_views_content_base_real_on_content_changed (TubaViewsBase* base);
VALA_EXTERN TubaViewsBaseStatusMessage* tuba_views_base_status_message_new (void);
VALA_EXTERN TubaViewsBaseStatusMessage* tuba_views_base_status_message_construct (GType object_type);
VALA_EXTERN GType tuba_views_base_status_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBaseStatusMessage, g_object_unref)
VALA_EXTERN void tuba_views_base_set_base_status (TubaViewsBase* self,
                                      TubaViewsBaseStatusMessage* value);
VALA_EXTERN TubaViewsBaseStatusMessage* tuba_views_base_get_base_status (TubaViewsBase* self);
static void tuba_views_content_base_real_attempt_focus_grab (TubaViewsContentBase* self);
static gboolean tuba_views_content_base_attempt_focus_grab_real (TubaViewsContentBase* self);
static gboolean _tuba_views_content_base_attempt_focus_grab_real_gsource_func (gpointer self);
static void tuba_views_content_base_real_unbind_listboxes (TubaViewsBase* base);
static GtkWidget* tuba_views_content_base_real_on_create_model_widget (TubaViewsContentBase* self,
                                                                GObject* obj);
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GtkWidget* tuba_widgetizable_to_widget (TubaWidgetizable* self);
static void tuba_views_content_base_real_on_bottom_reached (TubaViewsContentBase* self);
static Block63Data* block63_data_ref (Block63Data* _data63_);
static void block63_data_unref (void * _userdata_);
static gboolean __lambda27_ (Block63Data* _data63_);
static gboolean ___lambda27__gsource_func (gpointer self);
static void tuba_views_content_base_real_on_content_item_activated (TubaViewsContentBase* self,
                                                             GtkListBoxRow* row);
VALA_EXTERN TubaViewsContentBase* tuba_views_content_base_new (void);
VALA_EXTERN TubaViewsContentBase* tuba_views_content_base_construct (GType object_type);
VALA_EXTERN TubaViewsBase* tuba_views_base_new (void);
VALA_EXTERN TubaViewsBase* tuba_views_base_construct (GType object_type);
static GObject * tuba_views_content_base_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void _tuba_views_base_on_content_changed_g_list_model_items_changed (GListModel* _sender,
                                                                     guint position,
                                                                     guint removed,
                                                                     guint added,
                                                                     gpointer self);
static void _tuba_views_content_base_on_content_item_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                    GtkListBoxRow* row,
                                                                                    gpointer self);
static GtkWidget* _tuba_views_content_base_on_create_model_widget_gtk_list_box_create_widget_func (GObject* item,
                                                                                            gpointer self);
static void _tuba_views_content_base_on_scrolled_vadjustment_value_change_gtk_adjustment_value_changed (GtkAdjustment* _sender,
                                                                                                 gpointer self);
static void tuba_views_content_base_finalize (GObject * obj);
static GType tuba_views_content_base_get_type_once (void);
static void _vala_tuba_views_content_base_get_property (GObject * object,
                                                 guint property_id,
                                                 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 inline gpointer
tuba_views_content_base_get_instance_private (TubaViewsContentBase* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsContentBase_private_offset);
}

static void
tuba_views_content_base_real_on_scrolled_vadjustment_value_change (TubaViewsContentBase* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean is_close_to_top = FALSE;
	GtkScrolledWindow* _tmp16_;
	GtkAdjustment* _tmp17_;
	GtkAdjustment* _tmp18_;
	gdouble _tmp19_;
	gdouble _tmp20_;
	gboolean _tmp21_ = FALSE;
	if (!self->priv->bottom_reached_locked) {
		GtkScrolledWindow* _tmp1_;
		GtkAdjustment* _tmp2_;
		GtkAdjustment* _tmp3_;
		gdouble _tmp4_;
		gdouble _tmp5_;
		GtkScrolledWindow* _tmp6_;
		GtkAdjustment* _tmp7_;
		GtkAdjustment* _tmp8_;
		gdouble _tmp9_;
		gdouble _tmp10_;
		GtkScrolledWindow* _tmp11_;
		GtkAdjustment* _tmp12_;
		GtkAdjustment* _tmp13_;
		gdouble _tmp14_;
		gdouble _tmp15_;
		_tmp1_ = ((TubaViewsBase*) self)->scrolled;
		_tmp2_ = gtk_scrolled_window_get_vadjustment (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = gtk_adjustment_get_value (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = ((TubaViewsBase*) self)->scrolled;
		_tmp7_ = gtk_scrolled_window_get_vadjustment (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gtk_adjustment_get_upper (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = ((TubaViewsBase*) self)->scrolled;
		_tmp12_ = gtk_scrolled_window_get_vadjustment (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = gtk_adjustment_get_page_size (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp0_ = _tmp5_ > (_tmp10_ - (_tmp15_ * 2));
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		self->priv->bottom_reached_locked = TRUE;
		tuba_views_content_base_on_bottom_reached (self);
	}
	_tmp16_ = ((TubaViewsBase*) self)->scrolled;
	_tmp17_ = gtk_scrolled_window_get_vadjustment (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = gtk_adjustment_get_value (_tmp18_);
	_tmp20_ = _tmp19_;
	is_close_to_top = _tmp20_ <= ((gdouble) 100);
	if (!is_close_to_top) {
		GtkScrolledWindow* _tmp22_;
		GtkAdjustment* _tmp23_;
		GtkAdjustment* _tmp24_;
		gdouble _tmp25_;
		gdouble _tmp26_;
		GtkScrolledWindow* _tmp27_;
		GtkAdjustment* _tmp28_;
		GtkAdjustment* _tmp29_;
		gdouble _tmp30_;
		gdouble _tmp31_;
		GtkScrolledWindow* _tmp32_;
		GtkAdjustment* _tmp33_;
		GtkAdjustment* _tmp34_;
		gdouble _tmp35_;
		gdouble _tmp36_;
		_tmp22_ = ((TubaViewsBase*) self)->scrolled;
		_tmp23_ = gtk_scrolled_window_get_vadjustment (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = gtk_adjustment_get_value (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = ((TubaViewsBase*) self)->scrolled;
		_tmp28_ = gtk_scrolled_window_get_vadjustment (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp30_ = gtk_adjustment_get_page_size (_tmp29_);
		_tmp31_ = _tmp30_;
		_tmp32_ = ((TubaViewsBase*) self)->scrolled;
		_tmp33_ = gtk_scrolled_window_get_vadjustment (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = gtk_adjustment_get_upper (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp21_ = ((_tmp26_ + _tmp31_) + 100) < _tmp36_;
	} else {
		_tmp21_ = FALSE;
	}
	tuba_views_content_base_set_scroll_to_top_reveal_child (self, _tmp21_);
	if (is_close_to_top) {
		g_signal_emit (self, tuba_views_content_base_signals[TUBA_VIEWS_CONTENT_BASE_REACHED_CLOSE_TO_TOP_SIGNAL], 0);
	}
}

void
tuba_views_content_base_on_scrolled_vadjustment_value_change (TubaViewsContentBase* self)
{
	TubaViewsContentBaseClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TUBA_VIEWS_CONTENT_BASE_GET_CLASS (self);
	if (_klass_->on_scrolled_vadjustment_value_change) {
		_klass_->on_scrolled_vadjustment_value_change (self);
	}
}

void
tuba_views_content_base_set_scroll_to_top_reveal_child (TubaViewsContentBase* self,
                                                        gboolean reveal)
{
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkRevealer* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	if (reveal == _tmp2_) {
		return;
	}
	if (reveal) {
		GtkRevealer* _tmp3_;
		_tmp3_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
		gtk_widget_set_visible ((GtkWidget*) _tmp3_, TRUE);
	}
	_tmp4_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	gtk_revealer_set_reveal_child (_tmp4_, reveal);
}

static void
tuba_views_content_base_real_dispose (GObject* base)
{
	TubaViewsContentBase * self;
	self = (TubaViewsContentBase*) base;
	tuba_views_base_unbind_listboxes ((TubaViewsBase*) self);
	G_OBJECT_CLASS (tuba_views_content_base_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_BASE, TubaViewsBase));
}

static void
tuba_views_content_base_real_clear (TubaViewsBase* base)
{
	TubaViewsContentBase * self;
	GListStore* _tmp0_;
	self = (TubaViewsContentBase*) base;
	TUBA_VIEWS_BASE_CLASS (tuba_views_content_base_parent_class)->clear (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_BASE, TubaViewsBase));
	_tmp0_ = self->model;
	g_list_store_remove_all (_tmp0_);
}

static void
tuba_views_content_base_real_clear_all_but_first (TubaViewsContentBase* self,
                                                  gint i)
{
	GListStore* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	TUBA_VIEWS_BASE_CLASS (tuba_views_content_base_parent_class)->clear (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_BASE, TubaViewsBase));
	_tmp0_ = self->model;
	g_object_get (_tmp0_, "n-items", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > ((guint) i)) {
		GListStore* _tmp3_;
		GListStore* _tmp4_;
		guint _tmp5_;
		guint _tmp6_;
		GObject** _tmp7_;
		GObject** _tmp8_;
		gint _tmp8__length1;
		_tmp3_ = self->model;
		_tmp4_ = self->model;
		g_object_get (_tmp4_, "n-items", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_new0 (GObject*, 0 + 1);
		_tmp8_ = _tmp7_;
		_tmp8__length1 = 0;
		g_list_store_splice (_tmp3_, (guint) i, _tmp6_ - i, _tmp8_, (guint) 0);
		_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_object_unref), NULL);
	}
}

void
tuba_views_content_base_clear_all_but_first (TubaViewsContentBase* self,
                                             gint i)
{
	TubaViewsContentBaseClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TUBA_VIEWS_CONTENT_BASE_GET_CLASS (self);
	if (_klass_->clear_all_but_first) {
		_klass_->clear_all_but_first (self, i);
	}
}

static void
tuba_views_content_base_real_on_content_changed (TubaViewsBase* base)
{
	TubaViewsContentBase * self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = (TubaViewsContentBase*) base;
	_tmp0_ = tuba_views_content_base_get_empty (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		TubaViewsBaseStatusMessage* _tmp2_;
		TubaViewsBaseStatusMessage* _tmp3_;
		_tmp2_ = tuba_views_base_status_message_new ();
		_tmp3_ = _tmp2_;
		tuba_views_base_set_base_status ((TubaViewsBase*) self, _tmp3_);
		_g_object_unref0 (_tmp3_);
	} else {
		TubaViewsBaseStatusMessage* _tmp4_;
		TubaViewsBaseStatusMessage* _tmp5_;
		_tmp4_ = tuba_views_base_get_base_status ((TubaViewsBase*) self);
		_tmp5_ = _tmp4_;
		if (_tmp5_ != NULL) {
			tuba_views_content_base_attempt_focus_grab (self);
		}
		tuba_views_base_set_base_status ((TubaViewsBase*) self, NULL);
	}
}

static gboolean
_tuba_views_content_base_attempt_focus_grab_real_gsource_func (gpointer self)
{
	gboolean result;
	result = tuba_views_content_base_attempt_focus_grab_real ((TubaViewsContentBase*) self);
	return result;
}

static void
tuba_views_content_base_real_attempt_focus_grab (TubaViewsContentBase* self)
{
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, _tuba_views_content_base_attempt_focus_grab_real_gsource_func, g_object_ref (self), g_object_unref);
}

void
tuba_views_content_base_attempt_focus_grab (TubaViewsContentBase* self)
{
	TubaViewsContentBaseClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TUBA_VIEWS_CONTENT_BASE_GET_CLASS (self);
	if (_klass_->attempt_focus_grab) {
		_klass_->attempt_focus_grab (self);
	}
}

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

static gboolean
tuba_views_content_base_attempt_focus_grab_real (TubaViewsContentBase* self)
{
	GtkListBoxRow* w = NULL;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	GtkListBoxRow* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GtkListBoxRow* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->content;
	_tmp1_ = gtk_list_box_get_row_at_index (_tmp0_, 0);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	w = _tmp2_;
	_tmp4_ = w;
	if (_tmp4_ != NULL) {
		GtkListBoxRow* _tmp5_;
		_tmp5_ = w;
		_tmp3_ = gtk_widget_get_mapped ((GtkWidget*) _tmp5_);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		GtkListBoxRow* _tmp6_;
		_tmp6_ = w;
		gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
	}
	result = G_SOURCE_REMOVE;
	_g_object_unref0 (w);
	return result;
}

static void
tuba_views_content_base_real_unbind_listboxes (TubaViewsBase* base)
{
	TubaViewsContentBase * self;
	GtkListBox* _tmp0_;
	self = (TubaViewsContentBase*) base;
	_tmp0_ = self->content;
	if (_tmp0_ != NULL) {
		GtkListBox* _tmp1_;
		_tmp1_ = self->content;
		gtk_list_box_bind_model (_tmp1_, NULL, NULL, NULL, NULL);
	}
	TUBA_VIEWS_BASE_CLASS (tuba_views_content_base_parent_class)->unbind_listboxes (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_BASE, TubaViewsBase));
}

static GtkWidget*
tuba_views_content_base_real_on_create_model_widget (TubaViewsContentBase* self,
                                                     GObject* obj)
{
	TubaWidgetizable* obj_widgetable = NULL;
	TubaWidgetizable* _tmp0_;
	GtkWidget* widget = NULL;
	GtkWidget* _tmp1_;
	GtkWidget* result;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = _g_object_ref0 (TUBA_IS_WIDGETIZABLE (obj) ? ((TubaWidgetizable*) obj) : NULL);
	obj_widgetable = _tmp0_;
	if (obj_widgetable == NULL) {
		exit (0);
	}
	_tmp1_ = tuba_widgetizable_to_widget (obj_widgetable);
	widget = _tmp1_;
	gtk_widget_add_css_class (widget, "card");
	gtk_widget_add_css_class (widget, "card-spacing");
	gtk_widget_set_focusable (widget, TRUE);
	gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
	result = widget;
	_g_object_unref0 (obj_widgetable);
	return result;
}

GtkWidget*
tuba_views_content_base_on_create_model_widget (TubaViewsContentBase* self,
                                                GObject* obj)
{
	TubaViewsContentBaseClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = TUBA_VIEWS_CONTENT_BASE_GET_CLASS (self);
	if (_klass_->on_create_model_widget) {
		return _klass_->on_create_model_widget (self, obj);
	}
	return NULL;
}

static Block63Data*
block63_data_ref (Block63Data* _data63_)
{
	g_atomic_int_inc (&_data63_->_ref_count_);
	return _data63_;
}

static void
block63_data_unref (void * _userdata_)
{
	Block63Data* _data63_;
	_data63_ = (Block63Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data63_->_ref_count_)) {
		TubaViewsContentBase* self;
		self = _data63_->self;
		_g_object_unref0 (self);
		g_slice_free (Block63Data, _data63_);
	}
}

static gboolean
__lambda27_ (Block63Data* _data63_)
{
	TubaViewsContentBase* self;
	gboolean result;
	self = _data63_->self;
	self->priv->bottom_reached_locked = FALSE;
	g_source_remove (_data63_->timeout);
	result = TRUE;
	return result;
}

static gboolean
___lambda27__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda27_ (self);
	return result;
}

static void
tuba_views_content_base_real_on_bottom_reached (TubaViewsContentBase* self)
{
	Block63Data* _data63_;
	_data63_ = g_slice_new0 (Block63Data);
	_data63_->_ref_count_ = 1;
	_data63_->self = g_object_ref (self);
	_data63_->timeout = (guint) 0;
	_data63_->timeout = g_timeout_add_full (G_PRIORITY_LOW, (guint) 1000, ___lambda27__gsource_func, block63_data_ref (_data63_), block63_data_unref);
	block63_data_unref (_data63_);
	_data63_ = NULL;
}

void
tuba_views_content_base_on_bottom_reached (TubaViewsContentBase* self)
{
	TubaViewsContentBaseClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TUBA_VIEWS_CONTENT_BASE_GET_CLASS (self);
	if (_klass_->on_bottom_reached) {
		_klass_->on_bottom_reached (self);
	}
}

static void
tuba_views_content_base_real_on_content_item_activated (TubaViewsContentBase* self,
                                                        GtkListBoxRow* row)
{
	g_return_if_fail (row != NULL);
	g_signal_emit_by_name (row, "open", NULL);
}

void
tuba_views_content_base_on_content_item_activated (TubaViewsContentBase* self,
                                                   GtkListBoxRow* row)
{
	TubaViewsContentBaseClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TUBA_VIEWS_CONTENT_BASE_GET_CLASS (self);
	if (_klass_->on_content_item_activated) {
		_klass_->on_content_item_activated (self, row);
	}
}

TubaViewsContentBase*
tuba_views_content_base_construct (GType object_type)
{
	TubaViewsContentBase * self = NULL;
	self = (TubaViewsContentBase*) tuba_views_base_construct (object_type);
	return self;
}

TubaViewsContentBase*
tuba_views_content_base_new (void)
{
	return tuba_views_content_base_construct (TUBA_VIEWS_TYPE_CONTENT_BASE);
}

gboolean
tuba_views_content_base_get_empty (TubaViewsContentBase* self)
{
	TubaViewsContentBaseClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = TUBA_VIEWS_CONTENT_BASE_GET_CLASS (self);
	if (_klass_->get_empty) {
		return _klass_->get_empty (self);
	}
	return FALSE;
}

static gboolean
tuba_views_content_base_real_get_empty (TubaViewsContentBase* base)
{
	gboolean result;
	TubaViewsContentBase* self;
	GListStore* _tmp0_;
	self = base;
	_tmp0_ = self->model;
	result = g_list_model_get_n_items ((GListModel*) _tmp0_) <= ((guint) 0);
	return result;
}

static void
_tuba_views_base_on_content_changed_g_list_model_items_changed (GListModel* _sender,
                                                                guint position,
                                                                guint removed,
                                                                guint added,
                                                                gpointer self)
{
	tuba_views_base_on_content_changed ((TubaViewsBase*) self);
}

static void
_tuba_views_content_base_on_content_item_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                               GtkListBoxRow* row,
                                                                               gpointer self)
{
	tuba_views_content_base_on_content_item_activated ((TubaViewsContentBase*) self, row);
}

static GtkWidget*
_tuba_views_content_base_on_create_model_widget_gtk_list_box_create_widget_func (GObject* item,
                                                                                 gpointer self)
{
	GtkWidget* result;
	result = tuba_views_content_base_on_create_model_widget ((TubaViewsContentBase*) self, item);
	return result;
}

static void
_tuba_views_content_base_on_scrolled_vadjustment_value_change_gtk_adjustment_value_changed (GtkAdjustment* _sender,
                                                                                            gpointer self)
{
	tuba_views_content_base_on_scrolled_vadjustment_value_change ((TubaViewsContentBase*) self);
}

static GObject *
tuba_views_content_base_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaViewsContentBase * self;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	GtkListBox* _tmp5_ = NULL;
	GtkListBox* _tmp6_;
	GtkListBox* _tmp7_;
	GListStore* _tmp8_;
	AdwClamp* _tmp9_;
	GtkListBox* _tmp10_;
	GtkScrolledWindow* _tmp11_;
	GtkAdjustment* _tmp12_;
	GtkAdjustment* _tmp13_;
	GtkRevealer* _tmp14_;
	GtkRevealer* _tmp15_;
	parent_class = G_OBJECT_CLASS (tuba_views_content_base_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase);
	_tmp0_ = g_list_store_new (TUBA_TYPE_WIDGETIZABLE);
	_g_object_unref0 (self->model);
	self->model = _tmp0_;
	_tmp1_ = self->model;
	g_signal_connect_object ((GListModel*) _tmp1_, "items-changed", (GCallback) _tuba_views_base_on_content_changed_g_list_model_items_changed, (TubaViewsBase*) self, 0);
	_tmp2_ = g_strdup ("fake-content");
	_tmp3_ = g_strdup ("background");
	_tmp4_ = g_new0 (gchar*, 2 + 1);
	_tmp4_[0] = _tmp2_;
	_tmp4_[1] = _tmp3_;
	_tmp5_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp5_, GTK_SELECTION_NONE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp5_, _tmp4_);
	_tmp4_ = (_vala_array_free (_tmp4_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->content);
	self->content = _tmp5_;
	_tmp6_ = self->content;
	g_signal_connect_object (_tmp6_, "row-activated", (GCallback) _tuba_views_content_base_on_content_item_activated_gtk_list_box_row_activated, self, 0);
	_tmp7_ = self->content;
	_tmp8_ = self->model;
	gtk_list_box_bind_model (_tmp7_, (GListModel*) _tmp8_, _tuba_views_content_base_on_create_model_widget_gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_tmp9_ = ((TubaViewsBase*) self)->content_box;
	_tmp10_ = self->content;
	adw_clamp_set_child (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = ((TubaViewsBase*) self)->scrolled;
	_tmp12_ = gtk_scrolled_window_get_vadjustment (_tmp11_);
	_tmp13_ = _tmp12_;
	g_signal_connect_object (_tmp13_, "value-changed", (GCallback) _tuba_views_content_base_on_scrolled_vadjustment_value_change_gtk_adjustment_value_changed, self, 0);
	_tmp14_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	_tmp15_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	g_object_bind_property_with_closures ((GObject*) _tmp14_, "child-revealed", (GObject*) _tmp15_, "visible", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	return obj;
}

static void
tuba_views_content_base_class_init (TubaViewsContentBaseClass * klass,
                                    gpointer klass_data)
{
	tuba_views_content_base_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsContentBase_private_offset);
	((TubaViewsContentBaseClass *) klass)->on_scrolled_vadjustment_value_change = (void (*) (TubaViewsContentBase*)) tuba_views_content_base_real_on_scrolled_vadjustment_value_change;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) tuba_views_content_base_real_dispose;
	((TubaViewsBaseClass *) klass)->clear = (void (*) (TubaViewsBase*)) tuba_views_content_base_real_clear;
	((TubaViewsContentBaseClass *) klass)->clear_all_but_first = (void (*) (TubaViewsContentBase*, gint)) tuba_views_content_base_real_clear_all_but_first;
	((TubaViewsBaseClass *) klass)->on_content_changed = (void (*) (TubaViewsBase*)) tuba_views_content_base_real_on_content_changed;
	((TubaViewsContentBaseClass *) klass)->attempt_focus_grab = (void (*) (TubaViewsContentBase*)) tuba_views_content_base_real_attempt_focus_grab;
	((TubaViewsBaseClass *) klass)->unbind_listboxes = (void (*) (TubaViewsBase*)) tuba_views_content_base_real_unbind_listboxes;
	((TubaViewsContentBaseClass *) klass)->on_create_model_widget = (GtkWidget* (*) (TubaViewsContentBase*, GObject*)) tuba_views_content_base_real_on_create_model_widget;
	((TubaViewsContentBaseClass *) klass)->on_bottom_reached = (void (*) (TubaViewsContentBase*)) tuba_views_content_base_real_on_bottom_reached;
	((TubaViewsContentBaseClass *) klass)->on_content_item_activated = (void (*) (TubaViewsContentBase*, GtkListBoxRow*)) tuba_views_content_base_real_on_content_item_activated;
	TUBA_VIEWS_CONTENT_BASE_CLASS (klass)->get_empty = (gboolean (*) (TubaViewsContentBase*)) tuba_views_content_base_real_get_empty;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_views_content_base_get_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_views_content_base_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_views_content_base_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_CONTENT_BASE_EMPTY_PROPERTY, tuba_views_content_base_properties[TUBA_VIEWS_CONTENT_BASE_EMPTY_PROPERTY] = g_param_spec_boolean ("empty", "empty", "empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	tuba_views_content_base_signals[TUBA_VIEWS_CONTENT_BASE_REACHED_CLOSE_TO_TOP_SIGNAL] = g_signal_new ("reached-close-to-top", TUBA_VIEWS_TYPE_CONTENT_BASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
tuba_views_content_base_instance_init (TubaViewsContentBase * self,
                                       gpointer klass)
{
	self->priv = tuba_views_content_base_get_instance_private (self);
	self->priv->bottom_reached_locked = FALSE;
}

static void
tuba_views_content_base_finalize (GObject * obj)
{
	TubaViewsContentBase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase);
	g_debug ("ContentBase.vala:46: Destroying ContentBase");
	_g_object_unref0 (self->content);
	_g_object_unref0 (self->model);
	G_OBJECT_CLASS (tuba_views_content_base_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_content_base_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsContentBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_content_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsContentBase), 0, (GInstanceInitFunc) tuba_views_content_base_instance_init, NULL };
	GType tuba_views_content_base_type_id;
	tuba_views_content_base_type_id = g_type_register_static (TUBA_VIEWS_TYPE_BASE, "TubaViewsContentBase", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaViewsContentBase_private_offset = g_type_add_instance_private (tuba_views_content_base_type_id, sizeof (TubaViewsContentBasePrivate));
	return tuba_views_content_base_type_id;
}

GType
tuba_views_content_base_get_type (void)
{
	static GType tuba_views_content_base_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_content_base_type_id__once)) {
		GType tuba_views_content_base_type_id;
		tuba_views_content_base_type_id = tuba_views_content_base_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_content_base_type_id__once, tuba_views_content_base_type_id);
	}
	return tuba_views_content_base_type_id__once;
}

static void
_vala_tuba_views_content_base_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	TubaViewsContentBase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase);
	switch (property_id) {
		case TUBA_VIEWS_CONTENT_BASE_EMPTY_PROPERTY:
		g_value_set_boolean (value, tuba_views_content_base_get_empty (self));
		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);
}

