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

/* -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-*/
/*-
 * Copyright (c) 2018 elementary LLC. (https://elementary.io)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Authored by: David Hewitt <davidmhewitt@gmail.com>
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <gee.h>
#include <string.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 TYPE_VIRTUALIZING_LIST_BOX_MODEL (virtualizing_list_box_model_get_type ())
#define VIRTUALIZING_LIST_BOX_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIRTUALIZING_LIST_BOX_MODEL, VirtualizingListBoxModel))
#define VIRTUALIZING_LIST_BOX_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIRTUALIZING_LIST_BOX_MODEL, VirtualizingListBoxModelClass))
#define IS_VIRTUALIZING_LIST_BOX_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIRTUALIZING_LIST_BOX_MODEL))
#define IS_VIRTUALIZING_LIST_BOX_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIRTUALIZING_LIST_BOX_MODEL))
#define VIRTUALIZING_LIST_BOX_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIRTUALIZING_LIST_BOX_MODEL, VirtualizingListBoxModelClass))

typedef struct _VirtualizingListBoxModel VirtualizingListBoxModel;
typedef struct _VirtualizingListBoxModelClass VirtualizingListBoxModelClass;
typedef struct _VirtualizingListBoxModelPrivate VirtualizingListBoxModelPrivate;
enum  {
	VIRTUALIZING_LIST_BOX_MODEL_0_PROPERTY,
	VIRTUALIZING_LIST_BOX_MODEL_NUM_PROPERTIES
};
static GParamSpec* virtualizing_list_box_model_properties[VIRTUALIZING_LIST_BOX_MODEL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _VirtualizingListBoxModel {
	GObject parent_instance;
	VirtualizingListBoxModelPrivate * priv;
};

struct _VirtualizingListBoxModelClass {
	GObjectClass parent_class;
	guint (*get_n_items) (VirtualizingListBoxModel* self);
	GObject* (*get_item) (VirtualizingListBoxModel* self, guint index);
	GObject* (*get_item_unfiltered) (VirtualizingListBoxModel* self, guint index);
};

struct _VirtualizingListBoxModelPrivate {
	GeeHashSet* selected_rows;
};

static gint VirtualizingListBoxModel_private_offset;
static gpointer virtualizing_list_box_model_parent_class = NULL;
static GListModelInterface * virtualizing_list_box_model_g_list_model_parent_iface = NULL;

VALA_EXTERN GType virtualizing_list_box_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VirtualizingListBoxModel, g_object_unref)
VALA_EXTERN guint virtualizing_list_box_model_get_n_items (VirtualizingListBoxModel* self);
VALA_EXTERN GObject* virtualizing_list_box_model_get_item (VirtualizingListBoxModel* self,
                                               guint index);
VALA_EXTERN GObject* virtualizing_list_box_model_get_item_unfiltered (VirtualizingListBoxModel* self,
                                                          guint index);
static GType virtualizing_list_box_model_real_get_item_type (GListModel* base);
static guint virtualizing_list_box_model_real_get_n_items (VirtualizingListBoxModel* self);
static GObject* virtualizing_list_box_model_real_get_item (VirtualizingListBoxModel* self,
                                                    guint index);
static GObject* virtualizing_list_box_model_real_get_item_unfiltered (VirtualizingListBoxModel* self,
                                                               guint index);
VALA_EXTERN void virtualizing_list_box_model_unselect_all (VirtualizingListBoxModel* self);
VALA_EXTERN void virtualizing_list_box_model_set_item_selected (VirtualizingListBoxModel* self,
                                                    GObject* item,
                                                    gboolean selected);
VALA_EXTERN gboolean virtualizing_list_box_model_get_item_selected (VirtualizingListBoxModel* self,
                                                        GObject* item);
VALA_EXTERN GeeArrayList* virtualizing_list_box_model_get_items_between (VirtualizingListBoxModel* self,
                                                             GObject* from,
                                                             GObject* to);
VALA_EXTERN gint virtualizing_list_box_model_get_index_of (VirtualizingListBoxModel* self,
                                               GObject* item);
VALA_EXTERN gint virtualizing_list_box_model_get_index_of_unfiltered (VirtualizingListBoxModel* self,
                                                          GObject* item);
VALA_EXTERN gint virtualizing_list_box_model_get_index_of_item_before (VirtualizingListBoxModel* self,
                                                           GObject* item);
VALA_EXTERN gint virtualizing_list_box_model_get_index_of_item_after (VirtualizingListBoxModel* self,
                                                          GObject* item);
VALA_EXTERN GeeHashSet* virtualizing_list_box_model_get_selected_rows (VirtualizingListBoxModel* self);
VALA_EXTERN VirtualizingListBoxModel* virtualizing_list_box_model_construct (GType object_type);
static void virtualizing_list_box_model_finalize (GObject * obj);
static GType virtualizing_list_box_model_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
virtualizing_list_box_model_get_instance_private (VirtualizingListBoxModel* self)
{
	return G_STRUCT_MEMBER_P (self, VirtualizingListBoxModel_private_offset);
}

static GType
virtualizing_list_box_model_real_get_item_type (GListModel* base)
{
	VirtualizingListBoxModel * self;
	GType result;
	self = (VirtualizingListBoxModel*) base;
	result = G_TYPE_OBJECT;
	return result;
}

static guint
virtualizing_list_box_model_real_get_n_items (VirtualizingListBoxModel* self)
{
	guint _tmp0_ = 0U;
	g_critical ("Type `%s' does not implement abstract method `virtualizing_list_box_model_get_n_items'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

guint
virtualizing_list_box_model_get_n_items (VirtualizingListBoxModel* self)
{
	VirtualizingListBoxModelClass* _klass_;
	g_return_val_if_fail (self != NULL, 0U);
	_klass_ = VIRTUALIZING_LIST_BOX_MODEL_GET_CLASS (self);
	if (_klass_->get_n_items) {
		return _klass_->get_n_items (self);
	}
	return 0U;
}

static GObject*
virtualizing_list_box_model_real_get_item (VirtualizingListBoxModel* self,
                                           guint index)
{
	g_critical ("Type `%s' does not implement abstract method `virtualizing_list_box_model_get_item'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

GObject*
virtualizing_list_box_model_get_item (VirtualizingListBoxModel* self,
                                      guint index)
{
	VirtualizingListBoxModelClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = VIRTUALIZING_LIST_BOX_MODEL_GET_CLASS (self);
	if (_klass_->get_item) {
		return _klass_->get_item (self, index);
	}
	return NULL;
}

static GObject*
virtualizing_list_box_model_real_get_item_unfiltered (VirtualizingListBoxModel* self,
                                                      guint index)
{
	g_critical ("Type `%s' does not implement abstract method `virtualizing_list_box_model_get_item_unfiltered'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

GObject*
virtualizing_list_box_model_get_item_unfiltered (VirtualizingListBoxModel* self,
                                                 guint index)
{
	VirtualizingListBoxModelClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = VIRTUALIZING_LIST_BOX_MODEL_GET_CLASS (self);
	if (_klass_->get_item_unfiltered) {
		return _klass_->get_item_unfiltered (self, index);
	}
	return NULL;
}

void
virtualizing_list_box_model_unselect_all (VirtualizingListBoxModel* self)
{
	GeeHashSet* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->selected_rows;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp0_);
}

void
virtualizing_list_box_model_set_item_selected (VirtualizingListBoxModel* self,
                                               GObject* item,
                                               gboolean selected)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	if (!selected) {
		GeeHashSet* _tmp0_;
		_tmp0_ = self->priv->selected_rows;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp0_, item);
	} else {
		GeeHashSet* _tmp1_;
		_tmp1_ = self->priv->selected_rows;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, item);
	}
}

gboolean
virtualizing_list_box_model_get_item_selected (VirtualizingListBoxModel* self,
                                               GObject* item)
{
	GeeHashSet* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->selected_rows;
	result = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp0_, item);
	return result;
}

GeeArrayList*
virtualizing_list_box_model_get_items_between (VirtualizingListBoxModel* self,
                                               GObject* from,
                                               GObject* to)
{
	GeeArrayList* items = NULL;
	GeeArrayList* _tmp0_;
	gboolean start_found = FALSE;
	gboolean ignore_next_break = FALSE;
	guint length = 0U;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (from != NULL, NULL);
	g_return_val_if_fail (to != NULL, NULL);
	_tmp0_ = gee_array_list_new (G_TYPE_OBJECT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	items = _tmp0_;
	start_found = FALSE;
	ignore_next_break = FALSE;
	length = virtualizing_list_box_model_get_n_items (self);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GObject* item = NULL;
				GObject* _tmp3_;
				gboolean _tmp4_ = FALSE;
				gboolean _tmp5_ = FALSE;
				GObject* _tmp6_;
				GObject* _tmp8_;
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				GObject* _tmp13_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(((guint) i) < length)) {
					break;
				}
				_tmp3_ = virtualizing_list_box_model_get_item (self, (guint) i);
				item = _tmp3_;
				_tmp6_ = item;
				if (_tmp6_ == from) {
					_tmp5_ = TRUE;
				} else {
					GObject* _tmp7_;
					_tmp7_ = item;
					_tmp5_ = _tmp7_ == to;
				}
				if (_tmp5_) {
					_tmp4_ = !start_found;
				} else {
					_tmp4_ = FALSE;
				}
				if (_tmp4_) {
					start_found = TRUE;
					ignore_next_break = TRUE;
				} else {
					if (!start_found) {
						_g_object_unref0 (item);
						continue;
					}
				}
				_tmp8_ = item;
				if (_tmp8_ != NULL) {
					GeeArrayList* _tmp9_;
					GObject* _tmp10_;
					_tmp9_ = items;
					_tmp10_ = item;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
				}
				_tmp13_ = item;
				if (_tmp13_ == to) {
					_tmp12_ = TRUE;
				} else {
					GObject* _tmp14_;
					_tmp14_ = item;
					_tmp12_ = _tmp14_ == from;
				}
				if (_tmp12_) {
					_tmp11_ = !ignore_next_break;
				} else {
					_tmp11_ = FALSE;
				}
				if (_tmp11_) {
					_g_object_unref0 (item);
					break;
				}
				ignore_next_break = FALSE;
				_g_object_unref0 (item);
			}
		}
	}
	result = items;
	return result;
}

gint
virtualizing_list_box_model_get_index_of (VirtualizingListBoxModel* self,
                                          GObject* item)
{
	guint length = 0U;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	if (item == NULL) {
		result = -1;
		return result;
	}
	length = virtualizing_list_box_model_get_n_items (self);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GObject* _tmp2_;
				GObject* _tmp3_;
				gboolean _tmp4_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(((guint) i) < length)) {
					break;
				}
				_tmp2_ = virtualizing_list_box_model_get_item (self, (guint) i);
				_tmp3_ = _tmp2_;
				_tmp4_ = item == _tmp3_;
				_g_object_unref0 (_tmp3_);
				if (_tmp4_) {
					result = i;
					return result;
				}
			}
		}
	}
	result = -1;
	return result;
}

gint
virtualizing_list_box_model_get_index_of_unfiltered (VirtualizingListBoxModel* self,
                                                     GObject* item)
{
	guint length = 0U;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	if (item == NULL) {
		result = -1;
		return result;
	}
	length = virtualizing_list_box_model_get_n_items (self);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GObject* _tmp2_;
				GObject* _tmp3_;
				gboolean _tmp4_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(((guint) i) < length)) {
					break;
				}
				_tmp2_ = virtualizing_list_box_model_get_item_unfiltered (self, (guint) i);
				_tmp3_ = _tmp2_;
				_tmp4_ = item == _tmp3_;
				_g_object_unref0 (_tmp3_);
				if (_tmp4_) {
					result = i;
					return result;
				}
			}
		}
	}
	result = -1;
	return result;
}

gint
virtualizing_list_box_model_get_index_of_item_before (VirtualizingListBoxModel* self,
                                                      GObject* item)
{
	GObject* _tmp0_;
	GObject* _tmp1_;
	gboolean _tmp2_;
	guint length = 0U;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (item != NULL, -1);
	_tmp0_ = virtualizing_list_box_model_get_item (self, (guint) 0);
	_tmp1_ = _tmp0_;
	_tmp2_ = item == _tmp1_;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		result = -1;
		return result;
	}
	length = virtualizing_list_box_model_get_n_items (self);
	{
		gint i = 0;
		i = 1;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GObject* _tmp5_;
				GObject* _tmp6_;
				gboolean _tmp7_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				if (!(((guint) i) < length)) {
					break;
				}
				_tmp5_ = virtualizing_list_box_model_get_item (self, (guint) i);
				_tmp6_ = _tmp5_;
				_tmp7_ = _tmp6_ == item;
				_g_object_unref0 (_tmp6_);
				if (_tmp7_) {
					GObject* _tmp8_;
					GObject* _tmp9_;
					gboolean _tmp10_;
					_tmp8_ = virtualizing_list_box_model_get_item (self, (guint) (i - 1));
					_tmp9_ = _tmp8_;
					_tmp10_ = _tmp9_ != NULL;
					_g_object_unref0 (_tmp9_);
					if (_tmp10_) {
						result = i - 1;
						return result;
					}
				}
			}
		}
	}
	result = -1;
	return result;
}

gint
virtualizing_list_box_model_get_index_of_item_after (VirtualizingListBoxModel* self,
                                                     GObject* item)
{
	GObject* _tmp0_;
	GObject* _tmp1_;
	gboolean _tmp2_;
	guint length = 0U;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (item != NULL, -1);
	_tmp0_ = virtualizing_list_box_model_get_item (self, virtualizing_list_box_model_get_n_items (self) - 1);
	_tmp1_ = _tmp0_;
	_tmp2_ = item == _tmp1_;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		result = -1;
		return result;
	}
	length = virtualizing_list_box_model_get_n_items (self);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GObject* _tmp5_;
				GObject* _tmp6_;
				gboolean _tmp7_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				if (!(((guint) i) < (length - 1))) {
					break;
				}
				_tmp5_ = virtualizing_list_box_model_get_item (self, (guint) i);
				_tmp6_ = _tmp5_;
				_tmp7_ = _tmp6_ == item;
				_g_object_unref0 (_tmp6_);
				if (_tmp7_) {
					GObject* _tmp8_;
					GObject* _tmp9_;
					gboolean _tmp10_;
					_tmp8_ = virtualizing_list_box_model_get_item (self, (guint) (i + 1));
					_tmp9_ = _tmp8_;
					_tmp10_ = _tmp9_ != NULL;
					_g_object_unref0 (_tmp9_);
					if (_tmp10_) {
						result = i + 1;
						return result;
					}
				}
			}
		}
	}
	result = -1;
	return result;
}

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

GeeHashSet*
virtualizing_list_box_model_get_selected_rows (VirtualizingListBoxModel* self)
{
	GeeHashSet* _tmp0_;
	GeeHashSet* _tmp1_;
	GeeHashSet* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->selected_rows;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

VirtualizingListBoxModel*
virtualizing_list_box_model_construct (GType object_type)
{
	VirtualizingListBoxModel * self = NULL;
	self = (VirtualizingListBoxModel*) g_object_new (object_type, NULL);
	return self;
}

static void
virtualizing_list_box_model_class_init (VirtualizingListBoxModelClass * klass,
                                        gpointer klass_data)
{
	virtualizing_list_box_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &VirtualizingListBoxModel_private_offset);
	((VirtualizingListBoxModelClass *) klass)->get_n_items = (guint (*) (VirtualizingListBoxModel*)) virtualizing_list_box_model_real_get_n_items;
	((VirtualizingListBoxModelClass *) klass)->get_item = (GObject* (*) (VirtualizingListBoxModel*, guint)) virtualizing_list_box_model_real_get_item;
	((VirtualizingListBoxModelClass *) klass)->get_item_unfiltered = (GObject* (*) (VirtualizingListBoxModel*, guint)) virtualizing_list_box_model_real_get_item_unfiltered;
	G_OBJECT_CLASS (klass)->finalize = virtualizing_list_box_model_finalize;
}

static void
virtualizing_list_box_model_g_list_model_interface_init (GListModelInterface * iface,
                                                         gpointer iface_data)
{
	virtualizing_list_box_model_g_list_model_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_item_type = (GType (*) (GListModel*)) virtualizing_list_box_model_real_get_item_type;
	iface->get_n_items = (guint (*) (GListModel*)) virtualizing_list_box_model_get_n_items;
	iface->get_item = (GObject* (*) (GListModel*, guint)) virtualizing_list_box_model_get_item;
}

static void
virtualizing_list_box_model_instance_init (VirtualizingListBoxModel * self,
                                           gpointer klass)
{
	GeeHashSet* _tmp0_;
	self->priv = virtualizing_list_box_model_get_instance_private (self);
	_tmp0_ = gee_hash_set_new (G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->selected_rows = _tmp0_;
}

static void
virtualizing_list_box_model_finalize (GObject * obj)
{
	VirtualizingListBoxModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_VIRTUALIZING_LIST_BOX_MODEL, VirtualizingListBoxModel);
	_g_object_unref0 (self->priv->selected_rows);
	G_OBJECT_CLASS (virtualizing_list_box_model_parent_class)->finalize (obj);
}

static GType
virtualizing_list_box_model_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (VirtualizingListBoxModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) virtualizing_list_box_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VirtualizingListBoxModel), 0, (GInstanceInitFunc) virtualizing_list_box_model_instance_init, NULL };
	static const GInterfaceInfo g_list_model_info = { (GInterfaceInitFunc) virtualizing_list_box_model_g_list_model_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType virtualizing_list_box_model_type_id;
	virtualizing_list_box_model_type_id = g_type_register_static (G_TYPE_OBJECT, "VirtualizingListBoxModel", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (virtualizing_list_box_model_type_id, g_list_model_get_type (), &g_list_model_info);
	VirtualizingListBoxModel_private_offset = g_type_add_instance_private (virtualizing_list_box_model_type_id, sizeof (VirtualizingListBoxModelPrivate));
	return virtualizing_list_box_model_type_id;
}

GType
virtualizing_list_box_model_get_type (void)
{
	static volatile gsize virtualizing_list_box_model_type_id__once = 0;
	if (g_once_init_enter (&virtualizing_list_box_model_type_id__once)) {
		GType virtualizing_list_box_model_type_id;
		virtualizing_list_box_model_type_id = virtualizing_list_box_model_get_type_once ();
		g_once_init_leave (&virtualizing_list_box_model_type_id__once, virtualizing_list_box_model_type_id);
	}
	return virtualizing_list_box_model_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

