/* contacts-row.c generated by valac 0.22.1, the Vala compiler
 * generated from contacts-row.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <gtk/gtk.h>
#include <string.h>
#include <gdk/gdk.h>


#define CONTACTS_TYPE_ROW_GROUP (contacts_row_group_get_type ())
#define CONTACTS_ROW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_ROW_GROUP, ContactsRowGroup))
#define CONTACTS_ROW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_ROW_GROUP, ContactsRowGroupClass))
#define CONTACTS_IS_ROW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_ROW_GROUP))
#define CONTACTS_IS_ROW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_ROW_GROUP))
#define CONTACTS_ROW_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_ROW_GROUP, ContactsRowGroupClass))

typedef struct _ContactsRowGroup ContactsRowGroup;
typedef struct _ContactsRowGroupClass ContactsRowGroupClass;
typedef struct _ContactsRowGroupPrivate ContactsRowGroupPrivate;

#define CONTACTS_ROW_GROUP_TYPE_COLUMN_INFO (contacts_row_group_column_info_get_type ())
typedef struct _ContactsRowGroupColumnInfo ContactsRowGroupColumnInfo;

#define CONTACTS_TYPE_ROW (contacts_row_get_type ())
#define CONTACTS_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_ROW, ContactsRow))
#define CONTACTS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_ROW, ContactsRowClass))
#define CONTACTS_IS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_ROW))
#define CONTACTS_IS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_ROW))
#define CONTACTS_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_ROW, ContactsRowClass))

typedef struct _ContactsRow ContactsRow;
typedef struct _ContactsRowClass ContactsRowClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block33Data Block33Data;
typedef struct _ContactsRowPrivate ContactsRowPrivate;

#define CONTACTS_ROW_TYPE_CHILD (contacts_row_child_get_type ())
typedef struct _ContactsRowChild ContactsRowChild;

#define CONTACTS_ROW_TYPE_ROW_INFO (contacts_row_row_info_get_type ())
typedef struct _ContactsRowRowInfo ContactsRowRowInfo;

struct _ContactsRowGroup {
	GObject parent_instance;
	ContactsRowGroupPrivate * priv;
	gint n_columns;
};

struct _ContactsRowGroupClass {
	GObjectClass parent_class;
};

struct _ContactsRowGroupColumnInfo {
	gint min_width;
	gint nat_width;
	gint max_width;
	gint prio;
	gint spacing;
};

struct _ContactsRowGroupPrivate {
	ContactsRowGroupColumnInfo* column_info;
	gint column_info_length1;
	gint _column_info_size_;
	gint* cached_widths;
	gint cached_widths_length1;
	gint _cached_widths_size_;
	gint cached_widths_for_width;
	GeeArrayList* rows;
};

struct _Block33Data {
	int _ref_count_;
	ContactsRowGroup * self;
	ContactsRow* row;
};

struct _ContactsRow {
	GtkContainer parent_instance;
	ContactsRowPrivate * priv;
	GdkWindow* event_window;
};

struct _ContactsRowClass {
	GtkContainerClass parent_class;
};

struct _ContactsRowChild {
	GtkWidget** widgets;
	gint widgets_length1;
	gint _widgets_size_;
};

struct _ContactsRowPrivate {
	ContactsRowGroup* group;
	gint n_rows;
	ContactsRowChild* row_children;
	gint row_children_length1;
	gint row_children_length2;
};

struct _ContactsRowRowInfo {
	gint min_height;
	gint nat_height;
	gboolean expand;
};


static gpointer contacts_row_group_parent_class = NULL;
static gpointer contacts_row_parent_class = NULL;

GType contacts_row_group_get_type (void) G_GNUC_CONST;
GType contacts_row_group_column_info_get_type (void) G_GNUC_CONST;
ContactsRowGroupColumnInfo* contacts_row_group_column_info_dup (const ContactsRowGroupColumnInfo* self);
void contacts_row_group_column_info_free (ContactsRowGroupColumnInfo* self);
GType contacts_row_get_type (void) G_GNUC_CONST;
#define CONTACTS_ROW_GROUP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_ROW_GROUP, ContactsRowGroupPrivate))
enum  {
	CONTACTS_ROW_GROUP_DUMMY_PROPERTY
};
ContactsRowGroup* contacts_row_group_new (gint n_columns);
ContactsRowGroup* contacts_row_group_construct (GType object_type, gint n_columns);
ContactsRowGroup* contacts_row_group_copy (ContactsRowGroup* self);
ContactsRowGroupColumnInfo* contacts_row_group_get_column_info (ContactsRowGroup* self, gint col);
void contacts_row_group_add (ContactsRowGroup* self, ContactsRow* row);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void __lambda138_ (Block33Data* _data33_, GtkWidget* widget);
static void ___lambda138__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void contacts_row_group_queue_resize (ContactsRowGroup* self);
void contacts_row_group_set_column_priority (ContactsRowGroup* self, gint column, gint priority);
void contacts_row_group_set_column_min_width (ContactsRowGroup* self, gint column, gint min_width);
void contacts_row_group_set_column_max_width (ContactsRowGroup* self, gint column, gint max_width);
void contacts_row_group_set_column_spacing (ContactsRowGroup* self, gint column, gint spacing);
gint* contacts_row_group_distribute_widths (ContactsRowGroup* self, gint width, int* result_length1);
static gint* _vala_array_dup1 (gint* self, int length);
static gint* _vala_array_dup2 (gint* self, int length);
void contacts_row_group_get_width (ContactsRowGroup* self, gint* minimum_width, gint* natural_width);
gboolean contacts_row_group_is_expanding (ContactsRowGroup* self);
static void contacts_row_group_finalize (GObject* obj);
static GType contacts_row_child_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static ContactsRowChild* contacts_row_child_dup (const ContactsRowChild* self);
static void contacts_row_child_free (ContactsRowChild* self);
static void contacts_row_child_copy (const ContactsRowChild* self, ContactsRowChild* dest);
static void contacts_row_child_destroy (ContactsRowChild* self);
#define CONTACTS_ROW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_ROW, ContactsRowPrivate))
enum  {
	CONTACTS_ROW_DUMMY_PROPERTY
};
static void _vala_ContactsRowChild_array_free (ContactsRowChild* array, gint array_length);
ContactsRow* contacts_row_new (ContactsRowGroup* group);
ContactsRow* contacts_row_construct (GType object_type, ContactsRowGroup* group);
static void contacts_row_real_realize (GtkWidget* base);
static void contacts_row_real_unrealize (GtkWidget* base);
static void contacts_row_real_map (GtkWidget* base);
static void contacts_row_real_unmap (GtkWidget* base);
void contacts_row_attach (ContactsRow* self, GtkWidget* widget, gint attach_col, gint attach_row);
static void contacts_row_real_add (GtkContainer* base, GtkWidget* widget);
static void contacts_row_real_remove (GtkContainer* base, GtkWidget* widget);
GeeList* contacts_row_get_children_at (ContactsRow* self, gint col, gint row);
static void contacts_row_real_forall_internal (GtkContainer* base, gboolean include_internals, GtkCallback callback, void* callback_target);
static void contacts_row_real_compute_expand_internal (GtkWidget* base, gboolean* hexpand, gboolean* vexpand);
static GType contacts_row_real_child_type (GtkContainer* base);
static GtkSizeRequestMode contacts_row_real_get_request_mode (GtkWidget* base);
static void contacts_row_real_get_preferred_height (GtkWidget* base, gint* minimum_height, gint* natural_height);
static GType contacts_row_row_info_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static ContactsRowRowInfo* contacts_row_row_info_dup (const ContactsRowRowInfo* self);
static void contacts_row_row_info_free (ContactsRowRowInfo* self);
static gint* contacts_row_distribute_heights (ContactsRow* self, gint height, ContactsRowRowInfo* row_info, int row_info_length1, int* result_length1);
static ContactsRowRowInfo* contacts_row_get_row_heights_for_widths (ContactsRow* self, gint* widths, int widths_length1, int* result_length1);
static void contacts_row_real_get_preferred_height_for_width (GtkWidget* base, gint width, gint* minimum_height, gint* natural_height);
static void contacts_row_real_get_preferred_width (GtkWidget* base, gint* minimum_width, gint* natural_width);
static void contacts_row_real_get_preferred_width_for_height (GtkWidget* base, gint height, gint* minimum_width, gint* natural_width);
static void contacts_row_real_size_allocate (GtkWidget* base, GtkAllocation* allocation);
static GtkWidget** _vala_array_dup3 (GtkWidget** self, int length);
static void contacts_row_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


ContactsRowGroup* contacts_row_group_construct (GType object_type, gint n_columns) {
	ContactsRowGroup * self = NULL;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	ContactsRowGroupColumnInfo* _tmp2_ = NULL;
	GeeArrayList* _tmp18_ = NULL;
	self = (ContactsRowGroup*) g_object_new (object_type, NULL);
	_tmp0_ = n_columns;
	self->n_columns = _tmp0_;
	_tmp1_ = n_columns;
	_tmp2_ = g_new0 (ContactsRowGroupColumnInfo, _tmp1_);
	self->priv->column_info = (g_free (self->priv->column_info), NULL);
	self->priv->column_info = _tmp2_;
	self->priv->column_info_length1 = _tmp1_;
	self->priv->_column_info_size_ = self->priv->column_info_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				gboolean _tmp4_ = FALSE;
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				ContactsRowGroupColumnInfo* _tmp8_ = NULL;
				gint _tmp8__length1 = 0;
				gint _tmp9_ = 0;
				ContactsRowGroupColumnInfo* _tmp10_ = NULL;
				gint _tmp10__length1 = 0;
				gint _tmp11_ = 0;
				ContactsRowGroupColumnInfo* _tmp12_ = NULL;
				gint _tmp12__length1 = 0;
				gint _tmp13_ = 0;
				ContactsRowGroupColumnInfo* _tmp14_ = NULL;
				gint _tmp14__length1 = 0;
				gint _tmp15_ = 0;
				ContactsRowGroupColumnInfo* _tmp16_ = NULL;
				gint _tmp16__length1 = 0;
				gint _tmp17_ = 0;
				_tmp4_ = _tmp3_;
				if (!_tmp4_) {
					gint _tmp5_ = 0;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp6_ = i;
				_tmp7_ = n_columns;
				if (!(_tmp6_ < _tmp7_)) {
					break;
				}
				_tmp8_ = self->priv->column_info;
				_tmp8__length1 = self->priv->column_info_length1;
				_tmp9_ = i;
				_tmp8_[_tmp9_].min_width = 0;
				_tmp10_ = self->priv->column_info;
				_tmp10__length1 = self->priv->column_info_length1;
				_tmp11_ = i;
				_tmp10_[_tmp11_].nat_width = -1;
				_tmp12_ = self->priv->column_info;
				_tmp12__length1 = self->priv->column_info_length1;
				_tmp13_ = i;
				_tmp12_[_tmp13_].max_width = -1;
				_tmp14_ = self->priv->column_info;
				_tmp14__length1 = self->priv->column_info_length1;
				_tmp15_ = i;
				_tmp14_[_tmp15_].prio = 0;
				_tmp16_ = self->priv->column_info;
				_tmp16__length1 = self->priv->column_info_length1;
				_tmp17_ = i;
				_tmp16_[_tmp17_].spacing = 0;
			}
		}
	}
	_tmp18_ = gee_array_list_new (CONTACTS_TYPE_ROW, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->rows);
	self->priv->rows = _tmp18_;
	return self;
}


ContactsRowGroup* contacts_row_group_new (gint n_columns) {
	return contacts_row_group_construct (CONTACTS_TYPE_ROW_GROUP, n_columns);
}


ContactsRowGroup* contacts_row_group_copy (ContactsRowGroup* self) {
	ContactsRowGroup* result = NULL;
	ContactsRowGroup* n = NULL;
	gint _tmp0_ = 0;
	ContactsRowGroup* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->n_columns;
	_tmp1_ = contacts_row_group_new (_tmp0_);
	n = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gboolean _tmp3_ = FALSE;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				ContactsRowGroup* _tmp7_ = NULL;
				ContactsRowGroupColumnInfo* _tmp8_ = NULL;
				gint _tmp8__length1 = 0;
				gint _tmp9_ = 0;
				ContactsRowGroupColumnInfo* _tmp10_ = NULL;
				gint _tmp10__length1 = 0;
				gint _tmp11_ = 0;
				ContactsRowGroupColumnInfo _tmp12_ = {0};
				ContactsRowGroupColumnInfo _tmp13_ = {0};
				_tmp3_ = _tmp2_;
				if (!_tmp3_) {
					gint _tmp4_ = 0;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp5_ = i;
				_tmp6_ = self->n_columns;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = n;
				_tmp8_ = _tmp7_->priv->column_info;
				_tmp8__length1 = _tmp7_->priv->column_info_length1;
				_tmp9_ = i;
				_tmp10_ = self->priv->column_info;
				_tmp10__length1 = self->priv->column_info_length1;
				_tmp11_ = i;
				_tmp12_ = _tmp10_[_tmp11_];
				_tmp8_[_tmp9_] = _tmp12_;
				_tmp13_ = _tmp8_[_tmp9_];
			}
		}
	}
	result = n;
	return result;
}


ContactsRowGroupColumnInfo* contacts_row_group_get_column_info (ContactsRowGroup* self, gint col) {
	ContactsRowGroupColumnInfo* result = NULL;
	ContactsRowGroupColumnInfo* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp1_ = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->column_info;
	_tmp0__length1 = self->priv->column_info_length1;
	_tmp1_ = col;
	result = &_tmp0_[_tmp1_];
	return result;
}


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


static Block33Data* block33_data_ref (Block33Data* _data33_) {
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}


static void block33_data_unref (void * _userdata_) {
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		ContactsRowGroup * self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->row);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}


static void __lambda138_ (Block33Data* _data33_, GtkWidget* widget) {
	ContactsRowGroup * self;
	GeeArrayList* _tmp0_ = NULL;
	ContactsRow* _tmp1_ = NULL;
	self = _data33_->self;
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->priv->rows;
	_tmp1_ = _data33_->row;
	gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp0_, _tmp1_);
}


static void ___lambda138__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda138_ (self, _sender);
}


void contacts_row_group_add (ContactsRowGroup* self, ContactsRow* row) {
	Block33Data* _data33_;
	ContactsRow* _tmp0_ = NULL;
	ContactsRow* _tmp1_ = NULL;
	GeeArrayList* _tmp2_ = NULL;
	ContactsRow* _tmp3_ = NULL;
	ContactsRow* _tmp4_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_data33_ = g_slice_new0 (Block33Data);
	_data33_->_ref_count_ = 1;
	_data33_->self = g_object_ref (self);
	_tmp0_ = row;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data33_->row);
	_data33_->row = _tmp1_;
	_tmp2_ = self->priv->rows;
	_tmp3_ = _data33_->row;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp2_, _tmp3_);
	_tmp4_ = _data33_->row;
	g_signal_connect_data ((GtkWidget*) _tmp4_, "destroy", (GCallback) ___lambda138__gtk_widget_destroy, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
	block33_data_unref (_data33_);
	_data33_ = NULL;
}


static void contacts_row_group_queue_resize (ContactsRowGroup* self) {
	g_return_if_fail (self != NULL);
	{
		GeeArrayList* _row_list = NULL;
		GeeArrayList* _tmp0_ = NULL;
		GeeArrayList* _tmp1_ = NULL;
		gint _row_size = 0;
		GeeArrayList* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		gint _tmp4_ = 0;
		gint _row_index = 0;
		_tmp0_ = self->priv->rows;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_row_list = _tmp1_;
		_tmp2_ = _row_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_row_size = _tmp4_;
		_row_index = -1;
		while (TRUE) {
			gint _tmp5_ = 0;
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			ContactsRow* row = NULL;
			GeeArrayList* _tmp8_ = NULL;
			gint _tmp9_ = 0;
			gpointer _tmp10_ = NULL;
			ContactsRow* _tmp11_ = NULL;
			gboolean _tmp12_ = FALSE;
			_tmp5_ = _row_index;
			_row_index = _tmp5_ + 1;
			_tmp6_ = _row_index;
			_tmp7_ = _row_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _row_list;
			_tmp9_ = _row_index;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
			row = (ContactsRow*) _tmp10_;
			_tmp11_ = row;
			_tmp12_ = gtk_widget_get_visible ((GtkWidget*) _tmp11_);
			if (_tmp12_) {
				ContactsRow* _tmp13_ = NULL;
				_tmp13_ = row;
				gtk_widget_queue_resize ((GtkWidget*) _tmp13_);
			}
		}
		_g_object_unref0 (_row_list);
	}
}


void contacts_row_group_set_column_priority (ContactsRowGroup* self, gint column, gint priority) {
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	ContactsRowGroupColumnInfo* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = column;
	_tmp1_ = self->n_columns;
	if (_tmp0_ >= _tmp1_) {
		return;
	}
	_tmp2_ = self->priv->column_info;
	_tmp2__length1 = self->priv->column_info_length1;
	_tmp3_ = column;
	_tmp4_ = priority;
	_tmp2_[_tmp3_].prio = _tmp4_;
	self->priv->cached_widths = (g_free (self->priv->cached_widths), NULL);
	self->priv->cached_widths = NULL;
	self->priv->cached_widths_length1 = 0;
	self->priv->_cached_widths_size_ = self->priv->cached_widths_length1;
	contacts_row_group_queue_resize (self);
}


void contacts_row_group_set_column_min_width (ContactsRowGroup* self, gint column, gint min_width) {
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	ContactsRowGroupColumnInfo* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = column;
	_tmp1_ = self->n_columns;
	if (_tmp0_ >= _tmp1_) {
		return;
	}
	_tmp2_ = self->priv->column_info;
	_tmp2__length1 = self->priv->column_info_length1;
	_tmp3_ = column;
	_tmp4_ = min_width;
	_tmp2_[_tmp3_].min_width = _tmp4_;
	self->priv->cached_widths = (g_free (self->priv->cached_widths), NULL);
	self->priv->cached_widths = NULL;
	self->priv->cached_widths_length1 = 0;
	self->priv->_cached_widths_size_ = self->priv->cached_widths_length1;
	contacts_row_group_queue_resize (self);
}


void contacts_row_group_set_column_max_width (ContactsRowGroup* self, gint column, gint max_width) {
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	ContactsRowGroupColumnInfo* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = column;
	_tmp1_ = self->n_columns;
	if (_tmp0_ >= _tmp1_) {
		return;
	}
	_tmp2_ = self->priv->column_info;
	_tmp2__length1 = self->priv->column_info_length1;
	_tmp3_ = column;
	_tmp4_ = max_width;
	_tmp2_[_tmp3_].max_width = _tmp4_;
	self->priv->cached_widths = (g_free (self->priv->cached_widths), NULL);
	self->priv->cached_widths = NULL;
	self->priv->cached_widths_length1 = 0;
	self->priv->_cached_widths_size_ = self->priv->cached_widths_length1;
	contacts_row_group_queue_resize (self);
}


void contacts_row_group_set_column_spacing (ContactsRowGroup* self, gint column, gint spacing) {
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	ContactsRowGroupColumnInfo* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = column;
	_tmp1_ = self->n_columns;
	if (_tmp0_ >= _tmp1_) {
		return;
	}
	_tmp2_ = self->priv->column_info;
	_tmp2__length1 = self->priv->column_info_length1;
	_tmp3_ = column;
	_tmp4_ = spacing;
	_tmp2_[_tmp3_].spacing = _tmp4_;
	self->priv->cached_widths = (g_free (self->priv->cached_widths), NULL);
	self->priv->cached_widths = NULL;
	self->priv->cached_widths_length1 = 0;
	self->priv->_cached_widths_size_ = self->priv->cached_widths_length1;
	contacts_row_group_queue_resize (self);
}


static gint* _vala_array_dup1 (gint* self, int length) {
	return g_memdup (self, length * sizeof (gint));
}


static gint* _vala_array_dup2 (gint* self, int length) {
	return g_memdup (self, length * sizeof (gint));
}


gint* contacts_row_group_distribute_widths (ContactsRowGroup* self, gint width, int* result_length1) {
	gint* result = NULL;
	gboolean _tmp0_ = FALSE;
	gint* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gboolean _tmp4_ = FALSE;
	gint max_prio = 0;
	gint* widths = NULL;
	gint _tmp8_ = 0;
	gint* _tmp9_ = NULL;
	gint widths_length1 = 0;
	gint _widths_size_ = 0;
	gint* _tmp136_ = NULL;
	gint _tmp136__length1 = 0;
	gint* _tmp137_ = NULL;
	gint _tmp137__length1 = 0;
	gint _tmp138_ = 0;
	gint* _tmp139_ = NULL;
	gint _tmp139__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->cached_widths;
	_tmp1__length1 = self->priv->cached_widths_length1;
	if (_tmp1_ != NULL) {
		gint _tmp2_ = 0;
		gint _tmp3_ = 0;
		_tmp2_ = self->priv->cached_widths_for_width;
		_tmp3_ = width;
		_tmp0_ = _tmp2_ == _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		gint* _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		gint* _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		gint* _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
		_tmp5_ = self->priv->cached_widths;
		_tmp5__length1 = self->priv->cached_widths_length1;
		_tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup1 (_tmp5_, _tmp5__length1) : ((gpointer) _tmp5_);
		_tmp6__length1 = _tmp5__length1;
		_tmp7_ = _tmp6_;
		_tmp7__length1 = _tmp6__length1;
		if (result_length1) {
			*result_length1 = _tmp7__length1;
		}
		result = _tmp7_;
		return result;
	}
	max_prio = 0;
	_tmp8_ = self->n_columns;
	_tmp9_ = g_new0 (gint, _tmp8_);
	widths = _tmp9_;
	widths_length1 = _tmp8_;
	_widths_size_ = widths_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp10_ = FALSE;
			_tmp10_ = TRUE;
			while (TRUE) {
				gboolean _tmp11_ = FALSE;
				gint _tmp13_ = 0;
				gint _tmp14_ = 0;
				ContactsRowGroupColumnInfo* info = NULL;
				ContactsRowGroupColumnInfo* _tmp15_ = NULL;
				gint _tmp15__length1 = 0;
				gint _tmp16_ = 0;
				ContactsRowGroupColumnInfo* _tmp17_ = NULL;
				gint _tmp18_ = 0;
				gint _tmp19_ = 0;
				gint _tmp22_ = 0;
				ContactsRowGroupColumnInfo* _tmp23_ = NULL;
				gint _tmp24_ = 0;
				gint _tmp41_ = 0;
				ContactsRowGroupColumnInfo* _tmp42_ = NULL;
				gint _tmp43_ = 0;
				_tmp11_ = _tmp10_;
				if (!_tmp11_) {
					gint _tmp12_ = 0;
					_tmp12_ = i;
					i = _tmp12_ + 1;
				}
				_tmp10_ = FALSE;
				_tmp13_ = i;
				_tmp14_ = self->n_columns;
				if (!(_tmp13_ < _tmp14_)) {
					break;
				}
				_tmp15_ = self->priv->column_info;
				_tmp15__length1 = self->priv->column_info_length1;
				_tmp16_ = i;
				info = &_tmp15_[_tmp16_];
				_tmp17_ = info;
				_tmp18_ = (*_tmp17_).prio;
				_tmp19_ = max_prio;
				if (_tmp18_ > _tmp19_) {
					ContactsRowGroupColumnInfo* _tmp20_ = NULL;
					gint _tmp21_ = 0;
					_tmp20_ = info;
					_tmp21_ = (*_tmp20_).prio;
					max_prio = _tmp21_;
				}
				_tmp22_ = width;
				_tmp23_ = info;
				_tmp24_ = (*_tmp23_).min_width;
				if (_tmp22_ > _tmp24_) {
					gint* _tmp25_ = NULL;
					gint _tmp25__length1 = 0;
					gint _tmp26_ = 0;
					ContactsRowGroupColumnInfo* _tmp27_ = NULL;
					gint _tmp28_ = 0;
					gint _tmp29_ = 0;
					gint _tmp30_ = 0;
					ContactsRowGroupColumnInfo* _tmp31_ = NULL;
					gint _tmp32_ = 0;
					_tmp25_ = widths;
					_tmp25__length1 = widths_length1;
					_tmp26_ = i;
					_tmp27_ = info;
					_tmp28_ = (*_tmp27_).min_width;
					_tmp25_[_tmp26_] = _tmp28_;
					_tmp29_ = _tmp25_[_tmp26_];
					_tmp30_ = width;
					_tmp31_ = info;
					_tmp32_ = (*_tmp31_).min_width;
					width = _tmp30_ - _tmp32_;
				} else {
					gint _tmp33_ = 0;
					_tmp33_ = width;
					if (_tmp33_ > 0) {
						gint* _tmp34_ = NULL;
						gint _tmp34__length1 = 0;
						gint _tmp35_ = 0;
						gint _tmp36_ = 0;
						gint _tmp37_ = 0;
						_tmp34_ = widths;
						_tmp34__length1 = widths_length1;
						_tmp35_ = i;
						_tmp36_ = width;
						_tmp34_[_tmp35_] = _tmp36_;
						_tmp37_ = _tmp34_[_tmp35_];
						width = 0;
					} else {
						gint* _tmp38_ = NULL;
						gint _tmp38__length1 = 0;
						gint _tmp39_ = 0;
						gint _tmp40_ = 0;
						_tmp38_ = widths;
						_tmp38__length1 = widths_length1;
						_tmp39_ = i;
						_tmp38_[_tmp39_] = 0;
						_tmp40_ = _tmp38_[_tmp39_];
					}
				}
				_tmp41_ = width;
				_tmp42_ = info;
				_tmp43_ = (*_tmp42_).spacing;
				width = _tmp41_ - _tmp43_;
			}
		}
	}
	{
		gint prio = 0;
		gint _tmp44_ = 0;
		_tmp44_ = max_prio;
		prio = _tmp44_;
		{
			gboolean _tmp45_ = FALSE;
			_tmp45_ = TRUE;
			while (TRUE) {
				gboolean _tmp46_ = FALSE;
				gboolean _tmp48_ = FALSE;
				gint _tmp49_ = 0;
				gboolean _tmp51_ = FALSE;
				gint n_children = 0;
				_tmp46_ = _tmp45_;
				if (!_tmp46_) {
					gint _tmp47_ = 0;
					_tmp47_ = prio;
					prio = _tmp47_ - 1;
				}
				_tmp45_ = FALSE;
				_tmp49_ = width;
				if (_tmp49_ > 0) {
					gint _tmp50_ = 0;
					_tmp50_ = prio;
					_tmp48_ = _tmp50_ >= 0;
				} else {
					_tmp48_ = FALSE;
				}
				_tmp51_ = _tmp48_;
				if (!_tmp51_) {
					break;
				}
				while (TRUE) {
					gint _tmp52_ = 0;
					gint max_extra = 0;
					gint _tmp53_ = 0;
					gint _tmp91_ = 0;
					gint distribute = 0;
					gint _tmp92_ = 0;
					gint _tmp93_ = 0;
					gint _tmp94_ = 0;
					gint _tmp95_ = 0;
					gint _tmp96_ = 0;
					gint _tmp97_ = 0;
					gint per_child = 0;
					gint _tmp98_ = 0;
					gint _tmp99_ = 0;
					gint per_child_extra = 0;
					gint _tmp100_ = 0;
					gint _tmp101_ = 0;
					gint per_child_extra_sum = 0;
					_tmp52_ = width;
					if (!(_tmp52_ > 0)) {
						break;
					}
					n_children = 0;
					_tmp53_ = width;
					max_extra = _tmp53_;
					{
						gint i = 0;
						i = 0;
						{
							gboolean _tmp54_ = FALSE;
							_tmp54_ = TRUE;
							while (TRUE) {
								gboolean _tmp55_ = FALSE;
								gint _tmp57_ = 0;
								gint _tmp58_ = 0;
								ContactsRowGroupColumnInfo* info = NULL;
								ContactsRowGroupColumnInfo* _tmp59_ = NULL;
								gint _tmp59__length1 = 0;
								gint _tmp60_ = 0;
								gboolean _tmp61_ = FALSE;
								ContactsRowGroupColumnInfo* _tmp62_ = NULL;
								gint _tmp63_ = 0;
								gint _tmp64_ = 0;
								gboolean _tmp74_ = FALSE;
								_tmp55_ = _tmp54_;
								if (!_tmp55_) {
									gint _tmp56_ = 0;
									_tmp56_ = i;
									i = _tmp56_ + 1;
								}
								_tmp54_ = FALSE;
								_tmp57_ = i;
								_tmp58_ = self->n_columns;
								if (!(_tmp57_ < _tmp58_)) {
									break;
								}
								_tmp59_ = self->priv->column_info;
								_tmp59__length1 = self->priv->column_info_length1;
								_tmp60_ = i;
								info = &_tmp59_[_tmp60_];
								_tmp62_ = info;
								_tmp63_ = (*_tmp62_).prio;
								_tmp64_ = prio;
								if (_tmp63_ == _tmp64_) {
									gboolean _tmp65_ = FALSE;
									ContactsRowGroupColumnInfo* _tmp66_ = NULL;
									gint _tmp67_ = 0;
									gboolean _tmp73_ = FALSE;
									_tmp66_ = info;
									_tmp67_ = (*_tmp66_).max_width;
									if (_tmp67_ < 0) {
										_tmp65_ = TRUE;
									} else {
										gint* _tmp68_ = NULL;
										gint _tmp68__length1 = 0;
										gint _tmp69_ = 0;
										gint _tmp70_ = 0;
										ContactsRowGroupColumnInfo* _tmp71_ = NULL;
										gint _tmp72_ = 0;
										_tmp68_ = widths;
										_tmp68__length1 = widths_length1;
										_tmp69_ = i;
										_tmp70_ = _tmp68_[_tmp69_];
										_tmp71_ = info;
										_tmp72_ = (*_tmp71_).max_width;
										_tmp65_ = _tmp70_ < _tmp72_;
									}
									_tmp73_ = _tmp65_;
									_tmp61_ = _tmp73_;
								} else {
									_tmp61_ = FALSE;
								}
								_tmp74_ = _tmp61_;
								if (_tmp74_) {
									gint _tmp75_ = 0;
									gboolean _tmp76_ = FALSE;
									ContactsRowGroupColumnInfo* _tmp77_ = NULL;
									gint _tmp78_ = 0;
									gboolean _tmp85_ = FALSE;
									_tmp75_ = n_children;
									n_children = _tmp75_ + 1;
									_tmp77_ = info;
									_tmp78_ = (*_tmp77_).max_width;
									if (_tmp78_ >= 0) {
										ContactsRowGroupColumnInfo* _tmp79_ = NULL;
										gint _tmp80_ = 0;
										gint* _tmp81_ = NULL;
										gint _tmp81__length1 = 0;
										gint _tmp82_ = 0;
										gint _tmp83_ = 0;
										gint _tmp84_ = 0;
										_tmp79_ = info;
										_tmp80_ = (*_tmp79_).max_width;
										_tmp81_ = widths;
										_tmp81__length1 = widths_length1;
										_tmp82_ = i;
										_tmp83_ = _tmp81_[_tmp82_];
										_tmp84_ = max_extra;
										_tmp76_ = (_tmp80_ - _tmp83_) < _tmp84_;
									} else {
										_tmp76_ = FALSE;
									}
									_tmp85_ = _tmp76_;
									if (_tmp85_) {
										ContactsRowGroupColumnInfo* _tmp86_ = NULL;
										gint _tmp87_ = 0;
										gint* _tmp88_ = NULL;
										gint _tmp88__length1 = 0;
										gint _tmp89_ = 0;
										gint _tmp90_ = 0;
										_tmp86_ = info;
										_tmp87_ = (*_tmp86_).max_width;
										_tmp88_ = widths;
										_tmp88__length1 = widths_length1;
										_tmp89_ = i;
										_tmp90_ = _tmp88_[_tmp89_];
										max_extra = _tmp87_ - _tmp90_;
									}
								}
							}
						}
					}
					_tmp91_ = n_children;
					if (_tmp91_ == 0) {
						break;
					}
					_tmp92_ = width;
					_tmp93_ = max_extra;
					_tmp94_ = n_children;
					_tmp95_ = MIN (_tmp92_, _tmp93_ * _tmp94_);
					distribute = _tmp95_;
					_tmp96_ = width;
					_tmp97_ = distribute;
					width = _tmp96_ - _tmp97_;
					_tmp98_ = distribute;
					_tmp99_ = n_children;
					per_child = _tmp98_ / _tmp99_;
					_tmp100_ = distribute;
					_tmp101_ = n_children;
					per_child_extra = _tmp100_ % _tmp101_;
					per_child_extra_sum = 0;
					{
						gint i = 0;
						i = 0;
						{
							gboolean _tmp102_ = FALSE;
							_tmp102_ = TRUE;
							while (TRUE) {
								gboolean _tmp103_ = FALSE;
								gint _tmp105_ = 0;
								gint _tmp106_ = 0;
								ContactsRowGroupColumnInfo* info = NULL;
								ContactsRowGroupColumnInfo* _tmp107_ = NULL;
								gint _tmp107__length1 = 0;
								gint _tmp108_ = 0;
								gboolean _tmp109_ = FALSE;
								ContactsRowGroupColumnInfo* _tmp110_ = NULL;
								gint _tmp111_ = 0;
								gint _tmp112_ = 0;
								gboolean _tmp122_ = FALSE;
								_tmp103_ = _tmp102_;
								if (!_tmp103_) {
									gint _tmp104_ = 0;
									_tmp104_ = i;
									i = _tmp104_ + 1;
								}
								_tmp102_ = FALSE;
								_tmp105_ = i;
								_tmp106_ = self->n_columns;
								if (!(_tmp105_ < _tmp106_)) {
									break;
								}
								_tmp107_ = self->priv->column_info;
								_tmp107__length1 = self->priv->column_info_length1;
								_tmp108_ = i;
								info = &_tmp107_[_tmp108_];
								_tmp110_ = info;
								_tmp111_ = (*_tmp110_).prio;
								_tmp112_ = prio;
								if (_tmp111_ == _tmp112_) {
									gboolean _tmp113_ = FALSE;
									ContactsRowGroupColumnInfo* _tmp114_ = NULL;
									gint _tmp115_ = 0;
									gboolean _tmp121_ = FALSE;
									_tmp114_ = info;
									_tmp115_ = (*_tmp114_).max_width;
									if (_tmp115_ < 0) {
										_tmp113_ = TRUE;
									} else {
										gint* _tmp116_ = NULL;
										gint _tmp116__length1 = 0;
										gint _tmp117_ = 0;
										gint _tmp118_ = 0;
										ContactsRowGroupColumnInfo* _tmp119_ = NULL;
										gint _tmp120_ = 0;
										_tmp116_ = widths;
										_tmp116__length1 = widths_length1;
										_tmp117_ = i;
										_tmp118_ = _tmp116_[_tmp117_];
										_tmp119_ = info;
										_tmp120_ = (*_tmp119_).max_width;
										_tmp113_ = _tmp118_ < _tmp120_;
									}
									_tmp121_ = _tmp113_;
									_tmp109_ = _tmp121_;
								} else {
									_tmp109_ = FALSE;
								}
								_tmp122_ = _tmp109_;
								if (_tmp122_) {
									gint* _tmp123_ = NULL;
									gint _tmp123__length1 = 0;
									gint _tmp124_ = 0;
									gint _tmp125_ = 0;
									gint _tmp126_ = 0;
									gint _tmp127_ = 0;
									gint _tmp128_ = 0;
									gint _tmp129_ = 0;
									gint _tmp130_ = 0;
									_tmp123_ = widths;
									_tmp123__length1 = widths_length1;
									_tmp124_ = i;
									_tmp125_ = per_child;
									_tmp123_[_tmp124_] += _tmp125_;
									_tmp126_ = _tmp123_[_tmp124_];
									_tmp127_ = per_child_extra_sum;
									_tmp128_ = per_child_extra;
									per_child_extra_sum = _tmp127_ + _tmp128_;
									_tmp129_ = per_child_extra_sum;
									_tmp130_ = distribute;
									if (_tmp129_ > _tmp130_) {
										gint* _tmp131_ = NULL;
										gint _tmp131__length1 = 0;
										gint _tmp132_ = 0;
										gint _tmp133_ = 0;
										gint _tmp134_ = 0;
										gint _tmp135_ = 0;
										_tmp131_ = widths;
										_tmp131__length1 = widths_length1;
										_tmp132_ = i;
										_tmp131_[_tmp132_] += 1;
										_tmp133_ = _tmp131_[_tmp132_];
										_tmp134_ = per_child_extra_sum;
										_tmp135_ = distribute;
										per_child_extra_sum = _tmp134_ - _tmp135_;
									}
								}
							}
						}
					}
				}
			}
		}
	}
	_tmp136_ = widths;
	_tmp136__length1 = widths_length1;
	_tmp137_ = (_tmp136_ != NULL) ? _vala_array_dup2 (_tmp136_, _tmp136__length1) : ((gpointer) _tmp136_);
	_tmp137__length1 = _tmp136__length1;
	self->priv->cached_widths = (g_free (self->priv->cached_widths), NULL);
	self->priv->cached_widths = _tmp137_;
	self->priv->cached_widths_length1 = _tmp137__length1;
	self->priv->_cached_widths_size_ = self->priv->cached_widths_length1;
	_tmp138_ = width;
	self->priv->cached_widths_for_width = _tmp138_;
	_tmp139_ = widths;
	_tmp139__length1 = widths_length1;
	if (result_length1) {
		*result_length1 = _tmp139__length1;
	}
	result = _tmp139_;
	return result;
}


void contacts_row_group_get_width (ContactsRowGroup* self, gint* minimum_width, gint* natural_width) {
	gint _vala_minimum_width = 0;
	gint _vala_natural_width = 0;
	g_return_if_fail (self != NULL);
	_vala_minimum_width = 0;
	_vala_natural_width = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp1_ = FALSE;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
				gint _tmp5_ = 0;
				ContactsRowGroupColumnInfo* _tmp6_ = NULL;
				gint _tmp6__length1 = 0;
				gint _tmp7_ = 0;
				ContactsRowGroupColumnInfo _tmp8_ = {0};
				gint _tmp9_ = 0;
				ContactsRowGroupColumnInfo* _tmp10_ = NULL;
				gint _tmp10__length1 = 0;
				gint _tmp11_ = 0;
				ContactsRowGroupColumnInfo _tmp12_ = {0};
				gint _tmp13_ = 0;
				gint _tmp33_ = 0;
				ContactsRowGroupColumnInfo* _tmp34_ = NULL;
				gint _tmp34__length1 = 0;
				gint _tmp35_ = 0;
				ContactsRowGroupColumnInfo _tmp36_ = {0};
				gint _tmp37_ = 0;
				gint _tmp38_ = 0;
				ContactsRowGroupColumnInfo* _tmp39_ = NULL;
				gint _tmp39__length1 = 0;
				gint _tmp40_ = 0;
				ContactsRowGroupColumnInfo _tmp41_ = {0};
				gint _tmp42_ = 0;
				_tmp1_ = _tmp0_;
				if (!_tmp1_) {
					gint _tmp2_ = 0;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp3_ = i;
				_tmp4_ = self->n_columns;
				if (!(_tmp3_ < _tmp4_)) {
					break;
				}
				_tmp5_ = _vala_minimum_width;
				_tmp6_ = self->priv->column_info;
				_tmp6__length1 = self->priv->column_info_length1;
				_tmp7_ = i;
				_tmp8_ = _tmp6_[_tmp7_];
				_tmp9_ = _tmp8_.min_width;
				_vala_minimum_width = _tmp5_ + _tmp9_;
				_tmp10_ = self->priv->column_info;
				_tmp10__length1 = self->priv->column_info_length1;
				_tmp11_ = i;
				_tmp12_ = _tmp10_[_tmp11_];
				_tmp13_ = _tmp12_.nat_width;
				if (_tmp13_ >= 0) {
					gint _tmp14_ = 0;
					ContactsRowGroupColumnInfo* _tmp15_ = NULL;
					gint _tmp15__length1 = 0;
					gint _tmp16_ = 0;
					ContactsRowGroupColumnInfo _tmp17_ = {0};
					gint _tmp18_ = 0;
					_tmp14_ = _vala_natural_width;
					_tmp15_ = self->priv->column_info;
					_tmp15__length1 = self->priv->column_info_length1;
					_tmp16_ = i;
					_tmp17_ = _tmp15_[_tmp16_];
					_tmp18_ = _tmp17_.nat_width;
					_vala_natural_width = _tmp14_ + _tmp18_;
				} else {
					ContactsRowGroupColumnInfo* _tmp19_ = NULL;
					gint _tmp19__length1 = 0;
					gint _tmp20_ = 0;
					ContactsRowGroupColumnInfo _tmp21_ = {0};
					gint _tmp22_ = 0;
					_tmp19_ = self->priv->column_info;
					_tmp19__length1 = self->priv->column_info_length1;
					_tmp20_ = i;
					_tmp21_ = _tmp19_[_tmp20_];
					_tmp22_ = _tmp21_.max_width;
					if (_tmp22_ >= 0) {
						gint _tmp23_ = 0;
						ContactsRowGroupColumnInfo* _tmp24_ = NULL;
						gint _tmp24__length1 = 0;
						gint _tmp25_ = 0;
						ContactsRowGroupColumnInfo _tmp26_ = {0};
						gint _tmp27_ = 0;
						_tmp23_ = _vala_natural_width;
						_tmp24_ = self->priv->column_info;
						_tmp24__length1 = self->priv->column_info_length1;
						_tmp25_ = i;
						_tmp26_ = _tmp24_[_tmp25_];
						_tmp27_ = _tmp26_.max_width;
						_vala_natural_width = _tmp23_ + _tmp27_;
					} else {
						gint _tmp28_ = 0;
						ContactsRowGroupColumnInfo* _tmp29_ = NULL;
						gint _tmp29__length1 = 0;
						gint _tmp30_ = 0;
						ContactsRowGroupColumnInfo _tmp31_ = {0};
						gint _tmp32_ = 0;
						_tmp28_ = _vala_natural_width;
						_tmp29_ = self->priv->column_info;
						_tmp29__length1 = self->priv->column_info_length1;
						_tmp30_ = i;
						_tmp31_ = _tmp29_[_tmp30_];
						_tmp32_ = _tmp31_.min_width;
						_vala_natural_width = _tmp28_ + _tmp32_;
					}
				}
				_tmp33_ = _vala_minimum_width;
				_tmp34_ = self->priv->column_info;
				_tmp34__length1 = self->priv->column_info_length1;
				_tmp35_ = i;
				_tmp36_ = _tmp34_[_tmp35_];
				_tmp37_ = _tmp36_.spacing;
				_vala_minimum_width = _tmp33_ + _tmp37_;
				_tmp38_ = _vala_natural_width;
				_tmp39_ = self->priv->column_info;
				_tmp39__length1 = self->priv->column_info_length1;
				_tmp40_ = i;
				_tmp41_ = _tmp39_[_tmp40_];
				_tmp42_ = _tmp41_.spacing;
				_vala_natural_width = _tmp38_ + _tmp42_;
			}
		}
	}
	if (minimum_width) {
		*minimum_width = _vala_minimum_width;
	}
	if (natural_width) {
		*natural_width = _vala_natural_width;
	}
}


gboolean contacts_row_group_is_expanding (ContactsRowGroup* self) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp1_ = FALSE;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
				ContactsRowGroupColumnInfo* info = NULL;
				ContactsRowGroupColumnInfo* _tmp5_ = NULL;
				gint _tmp5__length1 = 0;
				gint _tmp6_ = 0;
				gboolean _tmp7_ = FALSE;
				ContactsRowGroupColumnInfo* _tmp8_ = NULL;
				gint _tmp9_ = 0;
				gboolean _tmp14_ = FALSE;
				_tmp1_ = _tmp0_;
				if (!_tmp1_) {
					gint _tmp2_ = 0;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp3_ = i;
				_tmp4_ = self->n_columns;
				if (!(_tmp3_ < _tmp4_)) {
					break;
				}
				_tmp5_ = self->priv->column_info;
				_tmp5__length1 = self->priv->column_info_length1;
				_tmp6_ = i;
				info = &_tmp5_[_tmp6_];
				_tmp8_ = info;
				_tmp9_ = (*_tmp8_).max_width;
				if (_tmp9_ == (-1)) {
					ContactsRowGroupColumnInfo* _tmp10_ = NULL;
					gint _tmp11_ = 0;
					ContactsRowGroupColumnInfo* _tmp12_ = NULL;
					gint _tmp13_ = 0;
					_tmp10_ = info;
					_tmp11_ = (*_tmp10_).max_width;
					_tmp12_ = info;
					_tmp13_ = (*_tmp12_).min_width;
					_tmp7_ = _tmp11_ != _tmp13_;
				} else {
					_tmp7_ = FALSE;
				}
				_tmp14_ = _tmp7_;
				if (_tmp14_) {
					result = TRUE;
					return result;
				}
			}
		}
	}
	result = FALSE;
	return result;
}


ContactsRowGroupColumnInfo* contacts_row_group_column_info_dup (const ContactsRowGroupColumnInfo* self) {
	ContactsRowGroupColumnInfo* dup;
	dup = g_new0 (ContactsRowGroupColumnInfo, 1);
	memcpy (dup, self, sizeof (ContactsRowGroupColumnInfo));
	return dup;
}


void contacts_row_group_column_info_free (ContactsRowGroupColumnInfo* self) {
	g_free (self);
}


GType contacts_row_group_column_info_get_type (void) {
	static volatile gsize contacts_row_group_column_info_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_row_group_column_info_type_id__volatile)) {
		GType contacts_row_group_column_info_type_id;
		contacts_row_group_column_info_type_id = g_boxed_type_register_static ("ContactsRowGroupColumnInfo", (GBoxedCopyFunc) contacts_row_group_column_info_dup, (GBoxedFreeFunc) contacts_row_group_column_info_free);
		g_once_init_leave (&contacts_row_group_column_info_type_id__volatile, contacts_row_group_column_info_type_id);
	}
	return contacts_row_group_column_info_type_id__volatile;
}


static void contacts_row_group_class_init (ContactsRowGroupClass * klass) {
	contacts_row_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsRowGroupPrivate));
	G_OBJECT_CLASS (klass)->finalize = contacts_row_group_finalize;
}


static void contacts_row_group_instance_init (ContactsRowGroup * self) {
	self->priv = CONTACTS_ROW_GROUP_GET_PRIVATE (self);
}


static void contacts_row_group_finalize (GObject* obj) {
	ContactsRowGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_ROW_GROUP, ContactsRowGroup);
	self->priv->column_info = (g_free (self->priv->column_info), NULL);
	self->priv->cached_widths = (g_free (self->priv->cached_widths), NULL);
	_g_object_unref0 (self->priv->rows);
	G_OBJECT_CLASS (contacts_row_group_parent_class)->finalize (obj);
}


GType contacts_row_group_get_type (void) {
	static volatile gsize contacts_row_group_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_row_group_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsRowGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_row_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsRowGroup), 0, (GInstanceInitFunc) contacts_row_group_instance_init, NULL };
		GType contacts_row_group_type_id;
		contacts_row_group_type_id = g_type_register_static (G_TYPE_OBJECT, "ContactsRowGroup", &g_define_type_info, 0);
		g_once_init_leave (&contacts_row_group_type_id__volatile, contacts_row_group_type_id);
	}
	return contacts_row_group_type_id__volatile;
}


static void _vala_ContactsRowChild_array_free (ContactsRowChild* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			contacts_row_child_destroy (&array[i]);
		}
	}
	g_free (array);
}


ContactsRow* contacts_row_construct (GType object_type, ContactsRowGroup* group) {
	ContactsRow * self = NULL;
	ContactsRowGroup* _tmp0_ = NULL;
	ContactsRowGroup* _tmp1_ = NULL;
	ContactsRowGroup* _tmp2_ = NULL;
	ContactsRowGroup* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	ContactsRowChild* _tmp6_ = NULL;
	g_return_val_if_fail (group != NULL, NULL);
	self = (ContactsRow*) g_object_new (object_type, NULL);
	_tmp0_ = group;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->group);
	self->priv->group = _tmp1_;
	_tmp2_ = group;
	contacts_row_group_add (_tmp2_, self);
	gtk_widget_set_has_window ((GtkWidget*) self, FALSE);
	gtk_widget_set_redraw_on_allocate ((GtkWidget*) self, FALSE);
	gtk_widget_set_hexpand ((GtkWidget*) self, TRUE);
	self->priv->n_rows = 1;
	_tmp3_ = group;
	_tmp4_ = _tmp3_->n_columns;
	_tmp5_ = self->priv->n_rows;
	_tmp6_ = g_new0 (ContactsRowChild, _tmp4_ * _tmp5_);
	self->priv->row_children = (_vala_ContactsRowChild_array_free (self->priv->row_children, self->priv->row_children_length1 * self->priv->row_children_length2), NULL);
	self->priv->row_children = _tmp6_;
	self->priv->row_children_length1 = _tmp4_;
	self->priv->row_children_length2 = _tmp5_;
	return self;
}


ContactsRow* contacts_row_new (ContactsRowGroup* group) {
	return contacts_row_construct (CONTACTS_TYPE_ROW, group);
}


static void contacts_row_real_realize (GtkWidget* base) {
	ContactsRow * self;
	GtkAllocation allocation = {0};
	GtkAllocation _tmp0_ = {0};
	GdkWindowAttr attributes = {0};
	GdkWindowAttr _tmp1_ = {0};
	GtkAllocation _tmp2_ = {0};
	gint _tmp3_ = 0;
	GtkAllocation _tmp4_ = {0};
	gint _tmp5_ = 0;
	GtkAllocation _tmp6_ = {0};
	gint _tmp7_ = 0;
	GtkAllocation _tmp8_ = {0};
	gint _tmp9_ = 0;
	gint _tmp10_ = 0;
	GdkWindow* window = NULL;
	GdkWindow* _tmp11_ = NULL;
	GdkWindow* _tmp12_ = NULL;
	GdkWindow* _tmp13_ = NULL;
	GdkWindowAttr _tmp14_ = {0};
	GdkWindow* _tmp15_ = NULL;
	GdkWindow* _tmp16_ = NULL;
	self = (ContactsRow*) base;
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp0_);
	allocation = _tmp0_;
	gtk_widget_set_realized ((GtkWidget*) self, TRUE);
	attributes = _tmp1_;
	_tmp2_ = allocation;
	_tmp3_ = _tmp2_.x;
	attributes.x = _tmp3_;
	_tmp4_ = allocation;
	_tmp5_ = _tmp4_.y;
	attributes.y = _tmp5_;
	_tmp6_ = allocation;
	_tmp7_ = _tmp6_.width;
	attributes.width = _tmp7_;
	_tmp8_ = allocation;
	_tmp9_ = _tmp8_.height;
	attributes.height = _tmp9_;
	attributes.window_type = GDK_WINDOW_CHILD;
	_tmp10_ = gtk_widget_get_events ((GtkWidget*) self);
	attributes.event_mask = ((_tmp10_ | GDK_EXPOSURE_MASK) | GDK_ENTER_NOTIFY_MASK) | GDK_LEAVE_NOTIFY_MASK;
	_tmp11_ = gtk_widget_get_parent_window ((GtkWidget*) self);
	_tmp12_ = _g_object_ref0 (_tmp11_);
	window = _tmp12_;
	_tmp13_ = _g_object_ref0 (window);
	gtk_widget_set_window ((GtkWidget*) self, _tmp13_);
	attributes.wclass = GDK_INPUT_ONLY;
	_tmp14_ = attributes;
	_tmp15_ = gdk_window_new (window, &_tmp14_, GDK_WA_X | GDK_WA_Y);
	_g_object_unref0 (self->event_window);
	self->event_window = _tmp15_;
	_tmp16_ = self->event_window;
	gdk_window_set_user_data (_tmp16_, (GObject*) self);
	_g_object_unref0 (window);
}


static void contacts_row_real_unrealize (GtkWidget* base) {
	ContactsRow * self;
	GdkWindow* _tmp0_ = NULL;
	GdkWindow* _tmp1_ = NULL;
	GdkWindow* _tmp2_ = NULL;
	self = (ContactsRow*) base;
	_tmp0_ = self->event_window;
	gdk_window_set_user_data (_tmp0_, NULL);
	_tmp1_ = self->event_window;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	gdk_window_destroy (_tmp2_);
	_g_object_unref0 (self->event_window);
	self->event_window = NULL;
	GTK_WIDGET_CLASS (contacts_row_parent_class)->unrealize ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_CONTAINER, GtkContainer));
}


static void contacts_row_real_map (GtkWidget* base) {
	ContactsRow * self;
	GdkWindow* _tmp0_ = NULL;
	self = (ContactsRow*) base;
	_tmp0_ = self->event_window;
	gdk_window_show (_tmp0_);
	GTK_WIDGET_CLASS (contacts_row_parent_class)->map ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_CONTAINER, GtkContainer));
}


static void contacts_row_real_unmap (GtkWidget* base) {
	ContactsRow * self;
	GdkWindow* _tmp0_ = NULL;
	self = (ContactsRow*) base;
	_tmp0_ = self->event_window;
	gdk_window_hide (_tmp0_);
	GTK_WIDGET_CLASS (contacts_row_parent_class)->unmap ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_CONTAINER, GtkContainer));
}


void contacts_row_attach (ContactsRow* self, GtkWidget* widget, gint attach_col, gint attach_row) {
	gint _tmp0_ = 0;
	ContactsRowGroup* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	ContactsRowChild* child_info = NULL;
	ContactsRowChild* _tmp38_ = NULL;
	gint _tmp38__length1 = 0;
	gint _tmp38__length2 = 0;
	gint _tmp39_ = 0;
	gint _tmp40_ = 0;
	ContactsRowChild* _tmp41_ = NULL;
	GtkWidget** _tmp42_ = NULL;
	gint _tmp42__length1 = 0;
	ContactsRowChild* _tmp49_ = NULL;
	GtkWidget** _tmp50_ = NULL;
	gint _tmp50__length1 = 0;
	ContactsRowChild* _tmp51_ = NULL;
	GtkWidget** _tmp52_ = NULL;
	gint _tmp52__length1 = 0;
	GtkWidget* _tmp53_ = NULL;
	GtkWidget* _tmp54_ = NULL;
	GtkWidget* _tmp55_ = NULL;
	GtkWidget* _tmp56_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = attach_col;
	_tmp1_ = self->priv->group;
	_tmp2_ = _tmp1_->n_columns;
	if (_tmp0_ >= _tmp2_) {
		g_warning ("contacts-row.vala:297: Tryint to attach widget to non-existing column");
		return;
	}
	_tmp3_ = attach_row;
	_tmp4_ = self->priv->n_rows;
	if (_tmp3_ >= _tmp4_) {
		gint old_n_rows = 0;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		ContactsRowChild* old_row_children = NULL;
		ContactsRowChild* _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
		gint _tmp7__length2 = 0;
		gint old_row_children_length1 = 0;
		gint old_row_children_length2 = 0;
		ContactsRowGroup* _tmp8_ = NULL;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
		ContactsRowChild* _tmp11_ = NULL;
		_tmp5_ = self->priv->n_rows;
		old_n_rows = _tmp5_;
		_tmp6_ = attach_row;
		self->priv->n_rows = _tmp6_ + 1;
		_tmp7_ = self->priv->row_children;
		_tmp7__length1 = self->priv->row_children_length1;
		_tmp7__length2 = self->priv->row_children_length2;
		self->priv->row_children = NULL;
		old_row_children = _tmp7_;
		old_row_children_length1 = _tmp7__length1;
		old_row_children_length2 = _tmp7__length2;
		_tmp8_ = self->priv->group;
		_tmp9_ = _tmp8_->n_columns;
		_tmp10_ = self->priv->n_rows;
		_tmp11_ = g_new0 (ContactsRowChild, _tmp9_ * _tmp10_);
		self->priv->row_children = (_vala_ContactsRowChild_array_free (self->priv->row_children, self->priv->row_children_length1 * self->priv->row_children_length2), NULL);
		self->priv->row_children = _tmp11_;
		self->priv->row_children_length1 = _tmp9_;
		self->priv->row_children_length2 = _tmp10_;
		{
			gint row = 0;
			row = 0;
			{
				gboolean _tmp12_ = FALSE;
				_tmp12_ = TRUE;
				while (TRUE) {
					gboolean _tmp13_ = FALSE;
					gint _tmp15_ = 0;
					gint _tmp16_ = 0;
					_tmp13_ = _tmp12_;
					if (!_tmp13_) {
						gint _tmp14_ = 0;
						_tmp14_ = row;
						row = _tmp14_ + 1;
					}
					_tmp12_ = FALSE;
					_tmp15_ = row;
					_tmp16_ = self->priv->n_rows;
					if (!(_tmp15_ < _tmp16_)) {
						break;
					}
					{
						gint col = 0;
						col = 0;
						{
							gboolean _tmp17_ = FALSE;
							_tmp17_ = TRUE;
							while (TRUE) {
								gboolean _tmp18_ = FALSE;
								gint _tmp20_ = 0;
								ContactsRowGroup* _tmp21_ = NULL;
								gint _tmp22_ = 0;
								gboolean _tmp23_ = FALSE;
								gint _tmp24_ = 0;
								gint _tmp25_ = 0;
								gboolean _tmp29_ = FALSE;
								_tmp18_ = _tmp17_;
								if (!_tmp18_) {
									gint _tmp19_ = 0;
									_tmp19_ = col;
									col = _tmp19_ + 1;
								}
								_tmp17_ = FALSE;
								_tmp20_ = col;
								_tmp21_ = self->priv->group;
								_tmp22_ = _tmp21_->n_columns;
								if (!(_tmp20_ < _tmp22_)) {
									break;
								}
								_tmp24_ = row;
								_tmp25_ = old_n_rows;
								if (_tmp24_ < _tmp25_) {
									gint _tmp26_ = 0;
									ContactsRowGroup* _tmp27_ = NULL;
									gint _tmp28_ = 0;
									_tmp26_ = col;
									_tmp27_ = self->priv->group;
									_tmp28_ = _tmp27_->n_columns;
									_tmp23_ = _tmp26_ < _tmp28_;
								} else {
									_tmp23_ = FALSE;
								}
								_tmp29_ = _tmp23_;
								if (_tmp29_) {
									ContactsRowChild* _tmp30_ = NULL;
									gint _tmp30__length1 = 0;
									gint _tmp30__length2 = 0;
									gint _tmp31_ = 0;
									gint _tmp32_ = 0;
									ContactsRowChild* _tmp33_ = NULL;
									gint _tmp33__length1 = 0;
									gint _tmp33__length2 = 0;
									gint _tmp34_ = 0;
									gint _tmp35_ = 0;
									ContactsRowChild _tmp36_ = {0};
									ContactsRowChild _tmp37_ = {0};
									_tmp30_ = self->priv->row_children;
									_tmp30__length1 = self->priv->row_children_length1;
									_tmp30__length2 = self->priv->row_children_length2;
									_tmp31_ = col;
									_tmp32_ = row;
									_tmp33_ = old_row_children;
									_tmp33__length1 = old_row_children_length1;
									_tmp33__length2 = old_row_children_length2;
									_tmp34_ = col;
									_tmp35_ = row;
									_tmp36_ = _tmp33_[(_tmp34_ * _tmp33__length2) + _tmp35_];
									memset (&_tmp33_[(_tmp34_ * _tmp33__length2) + _tmp35_], 0, sizeof (ContactsRowChild));
									contacts_row_child_destroy (&_tmp30_[(_tmp31_ * _tmp30__length2) + _tmp32_]);
									_tmp30_[(_tmp31_ * _tmp30__length2) + _tmp32_] = _tmp36_;
									_tmp37_ = _tmp30_[(_tmp31_ * _tmp30__length2) + _tmp32_];
								}
							}
						}
					}
				}
			}
		}
		old_row_children = (_vala_ContactsRowChild_array_free (old_row_children, old_row_children_length1 * old_row_children_length2), NULL);
	}
	_tmp38_ = self->priv->row_children;
	_tmp38__length1 = self->priv->row_children_length1;
	_tmp38__length2 = self->priv->row_children_length2;
	_tmp39_ = attach_col;
	_tmp40_ = attach_row;
	child_info = &_tmp38_[(_tmp39_ * _tmp38__length2) + _tmp40_];
	_tmp41_ = child_info;
	_tmp42_ = (*_tmp41_).widgets;
	_tmp42__length1 = (*_tmp41_).widgets_length1;
	if (_tmp42_ == NULL) {
		ContactsRowChild* _tmp43_ = NULL;
		GtkWidget** _tmp44_ = NULL;
		_tmp43_ = child_info;
		_tmp44_ = g_new0 (GtkWidget*, 1 + 1);
		(*_tmp43_).widgets = (_vala_array_free ((*_tmp43_).widgets, (*_tmp43_).widgets_length1, (GDestroyNotify) g_object_unref), NULL);
		(*_tmp43_).widgets = _tmp44_;
		(*_tmp43_).widgets_length1 = 1;
		(*_tmp43_)._widgets_size_ = (*_tmp43_).widgets_length1;
	} else {
		ContactsRowChild* _tmp45_ = NULL;
		ContactsRowChild* _tmp46_ = NULL;
		GtkWidget** _tmp47_ = NULL;
		gint _tmp47__length1 = 0;
		gint _tmp48_ = 0;
		_tmp45_ = child_info;
		_tmp46_ = child_info;
		_tmp47_ = (*_tmp46_).widgets;
		_tmp47__length1 = (*_tmp46_).widgets_length1;
		_tmp48_ = _tmp47__length1 + 1;
		(*_tmp45_).widgets = g_renew (GtkWidget*, (*_tmp45_).widgets, _tmp47__length1 + 1);
		(_tmp48_ > (*_tmp45_).widgets_length1) ? memset ((*_tmp45_).widgets + (*_tmp45_).widgets_length1, 0, sizeof (GtkWidget*) * (_tmp48_ - (*_tmp45_).widgets_length1)) : NULL;
		(*_tmp45_).widgets_length1 = _tmp48_;
		(*_tmp45_)._widgets_size_ = _tmp48_;
	}
	_tmp49_ = child_info;
	_tmp50_ = (*_tmp49_).widgets;
	_tmp50__length1 = (*_tmp49_).widgets_length1;
	_tmp51_ = child_info;
	_tmp52_ = (*_tmp51_).widgets;
	_tmp52__length1 = (*_tmp51_).widgets_length1;
	_tmp53_ = widget;
	_tmp54_ = _g_object_ref0 (_tmp53_);
	_g_object_unref0 (_tmp50_[_tmp52__length1 - 1]);
	_tmp50_[_tmp52__length1 - 1] = _tmp54_;
	_tmp55_ = _tmp50_[_tmp52__length1 - 1];
	_tmp56_ = widget;
	gtk_widget_set_parent (_tmp56_, (GtkWidget*) self);
}


static void contacts_row_real_add (GtkContainer* base, GtkWidget* widget) {
	ContactsRow * self;
	GtkWidget* _tmp23_ = NULL;
	gint _tmp24_ = 0;
	self = (ContactsRow*) base;
	g_return_if_fail (widget != NULL);
	{
		gint row = 0;
		row = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp1_ = FALSE;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
				_tmp1_ = _tmp0_;
				if (!_tmp1_) {
					gint _tmp2_ = 0;
					_tmp2_ = row;
					row = _tmp2_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp3_ = row;
				_tmp4_ = self->priv->n_rows;
				if (!(_tmp3_ < _tmp4_)) {
					break;
				}
				{
					gint col = 0;
					col = 0;
					{
						gboolean _tmp5_ = FALSE;
						_tmp5_ = TRUE;
						while (TRUE) {
							gboolean _tmp6_ = FALSE;
							gint _tmp8_ = 0;
							ContactsRowGroup* _tmp9_ = NULL;
							gint _tmp10_ = 0;
							ContactsRowChild* child_info = NULL;
							ContactsRowChild* _tmp11_ = NULL;
							gint _tmp11__length1 = 0;
							gint _tmp11__length2 = 0;
							gint _tmp12_ = 0;
							gint _tmp13_ = 0;
							gboolean _tmp14_ = FALSE;
							ContactsRowChild* _tmp15_ = NULL;
							GtkWidget** _tmp16_ = NULL;
							gint _tmp16__length1 = 0;
							gboolean _tmp19_ = FALSE;
							_tmp6_ = _tmp5_;
							if (!_tmp6_) {
								gint _tmp7_ = 0;
								_tmp7_ = col;
								col = _tmp7_ + 1;
							}
							_tmp5_ = FALSE;
							_tmp8_ = col;
							_tmp9_ = self->priv->group;
							_tmp10_ = _tmp9_->n_columns;
							if (!(_tmp8_ < _tmp10_)) {
								break;
							}
							_tmp11_ = self->priv->row_children;
							_tmp11__length1 = self->priv->row_children_length1;
							_tmp11__length2 = self->priv->row_children_length2;
							_tmp12_ = col;
							_tmp13_ = row;
							child_info = &_tmp11_[(_tmp12_ * _tmp11__length2) + _tmp13_];
							_tmp15_ = child_info;
							_tmp16_ = (*_tmp15_).widgets;
							_tmp16__length1 = (*_tmp15_).widgets_length1;
							if (_tmp16_ == NULL) {
								_tmp14_ = TRUE;
							} else {
								ContactsRowChild* _tmp17_ = NULL;
								GtkWidget** _tmp18_ = NULL;
								gint _tmp18__length1 = 0;
								_tmp17_ = child_info;
								_tmp18_ = (*_tmp17_).widgets;
								_tmp18__length1 = (*_tmp17_).widgets_length1;
								_tmp14_ = _tmp18__length1 == 0;
							}
							_tmp19_ = _tmp14_;
							if (_tmp19_) {
								GtkWidget* _tmp20_ = NULL;
								gint _tmp21_ = 0;
								gint _tmp22_ = 0;
								_tmp20_ = widget;
								_tmp21_ = col;
								_tmp22_ = row;
								contacts_row_attach (self, _tmp20_, _tmp21_, _tmp22_);
								return;
							}
						}
					}
				}
			}
		}
	}
	_tmp23_ = widget;
	_tmp24_ = self->priv->n_rows;
	contacts_row_attach (self, _tmp23_, 0, _tmp24_);
}


static void contacts_row_real_remove (GtkContainer* base, GtkWidget* widget) {
	ContactsRow * self;
	self = (ContactsRow*) base;
	g_return_if_fail (widget != NULL);
	{
		gint row = 0;
		row = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp1_ = FALSE;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
				_tmp1_ = _tmp0_;
				if (!_tmp1_) {
					gint _tmp2_ = 0;
					_tmp2_ = row;
					row = _tmp2_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp3_ = row;
				_tmp4_ = self->priv->n_rows;
				if (!(_tmp3_ < _tmp4_)) {
					break;
				}
				{
					gint col = 0;
					col = 0;
					{
						gboolean _tmp5_ = FALSE;
						_tmp5_ = TRUE;
						while (TRUE) {
							gboolean _tmp6_ = FALSE;
							gint _tmp8_ = 0;
							ContactsRowGroup* _tmp9_ = NULL;
							gint _tmp10_ = 0;
							ContactsRowChild* child_info = NULL;
							ContactsRowChild* _tmp11_ = NULL;
							gint _tmp11__length1 = 0;
							gint _tmp11__length2 = 0;
							gint _tmp12_ = 0;
							gint _tmp13_ = 0;
							_tmp6_ = _tmp5_;
							if (!_tmp6_) {
								gint _tmp7_ = 0;
								_tmp7_ = col;
								col = _tmp7_ + 1;
							}
							_tmp5_ = FALSE;
							_tmp8_ = col;
							_tmp9_ = self->priv->group;
							_tmp10_ = _tmp9_->n_columns;
							if (!(_tmp8_ < _tmp10_)) {
								break;
							}
							_tmp11_ = self->priv->row_children;
							_tmp11__length1 = self->priv->row_children_length1;
							_tmp11__length2 = self->priv->row_children_length2;
							_tmp12_ = col;
							_tmp13_ = row;
							child_info = &_tmp11_[(_tmp12_ * _tmp11__length2) + _tmp13_];
							{
								gint i = 0;
								i = 0;
								{
									gboolean _tmp14_ = FALSE;
									_tmp14_ = TRUE;
									while (TRUE) {
										gboolean _tmp15_ = FALSE;
										gboolean _tmp17_ = FALSE;
										ContactsRowChild* _tmp18_ = NULL;
										GtkWidget** _tmp19_ = NULL;
										gint _tmp19__length1 = 0;
										gboolean _tmp23_ = FALSE;
										ContactsRowChild* _tmp24_ = NULL;
										GtkWidget** _tmp25_ = NULL;
										gint _tmp25__length1 = 0;
										gint _tmp26_ = 0;
										GtkWidget* _tmp27_ = NULL;
										GtkWidget* _tmp28_ = NULL;
										_tmp15_ = _tmp14_;
										if (!_tmp15_) {
											gint _tmp16_ = 0;
											_tmp16_ = i;
											i = _tmp16_ + 1;
										}
										_tmp14_ = FALSE;
										_tmp18_ = child_info;
										_tmp19_ = (*_tmp18_).widgets;
										_tmp19__length1 = (*_tmp18_).widgets_length1;
										if (_tmp19_ != NULL) {
											gint _tmp20_ = 0;
											ContactsRowChild* _tmp21_ = NULL;
											GtkWidget** _tmp22_ = NULL;
											gint _tmp22__length1 = 0;
											_tmp20_ = i;
											_tmp21_ = child_info;
											_tmp22_ = (*_tmp21_).widgets;
											_tmp22__length1 = (*_tmp21_).widgets_length1;
											_tmp17_ = _tmp20_ < _tmp22__length1;
										} else {
											_tmp17_ = FALSE;
										}
										_tmp23_ = _tmp17_;
										if (!_tmp23_) {
											break;
										}
										_tmp24_ = child_info;
										_tmp25_ = (*_tmp24_).widgets;
										_tmp25__length1 = (*_tmp24_).widgets_length1;
										_tmp26_ = i;
										_tmp27_ = _tmp25_[_tmp26_];
										_tmp28_ = widget;
										if (_tmp27_ == _tmp28_) {
											gboolean was_visible = FALSE;
											GtkWidget* _tmp29_ = NULL;
											gboolean _tmp30_ = FALSE;
											GtkWidget* _tmp31_ = NULL;
											gint j = 0;
											ContactsRowChild* _tmp48_ = NULL;
											GtkWidget** _tmp49_ = NULL;
											gint _tmp49__length1 = 0;
											gint _tmp50_ = 0;
											GtkWidget* _tmp51_ = NULL;
											ContactsRowChild* _tmp52_ = NULL;
											ContactsRowChild* _tmp53_ = NULL;
											GtkWidget** _tmp54_ = NULL;
											gint _tmp54__length1 = 0;
											gint _tmp55_ = 0;
											gboolean _tmp56_ = FALSE;
											gboolean _tmp57_ = FALSE;
											gboolean _tmp59_ = FALSE;
											_tmp29_ = widget;
											_tmp30_ = gtk_widget_get_visible (_tmp29_);
											was_visible = _tmp30_;
											_tmp31_ = widget;
											gtk_widget_unparent (_tmp31_);
											{
												gint _tmp32_ = 0;
												gboolean _tmp33_ = FALSE;
												_tmp32_ = i;
												j = _tmp32_;
												_tmp33_ = TRUE;
												while (TRUE) {
													gboolean _tmp34_ = FALSE;
													gint _tmp36_ = 0;
													ContactsRowChild* _tmp37_ = NULL;
													GtkWidget** _tmp38_ = NULL;
													gint _tmp38__length1 = 0;
													ContactsRowChild* _tmp39_ = NULL;
													GtkWidget** _tmp40_ = NULL;
													gint _tmp40__length1 = 0;
													gint _tmp41_ = 0;
													ContactsRowChild* _tmp42_ = NULL;
													GtkWidget** _tmp43_ = NULL;
													gint _tmp43__length1 = 0;
													gint _tmp44_ = 0;
													GtkWidget* _tmp45_ = NULL;
													GtkWidget* _tmp46_ = NULL;
													GtkWidget* _tmp47_ = NULL;
													_tmp34_ = _tmp33_;
													if (!_tmp34_) {
														gint _tmp35_ = 0;
														_tmp35_ = j;
														j = _tmp35_ + 1;
													}
													_tmp33_ = FALSE;
													_tmp36_ = j;
													_tmp37_ = child_info;
													_tmp38_ = (*_tmp37_).widgets;
													_tmp38__length1 = (*_tmp37_).widgets_length1;
													if (!(_tmp36_ < (_tmp38__length1 - 1))) {
														break;
													}
													_tmp39_ = child_info;
													_tmp40_ = (*_tmp39_).widgets;
													_tmp40__length1 = (*_tmp39_).widgets_length1;
													_tmp41_ = j;
													_tmp42_ = child_info;
													_tmp43_ = (*_tmp42_).widgets;
													_tmp43__length1 = (*_tmp42_).widgets_length1;
													_tmp44_ = j;
													_tmp45_ = _tmp43_[_tmp44_ + 1];
													_tmp46_ = _g_object_ref0 (_tmp45_);
													_g_object_unref0 (_tmp40_[_tmp41_]);
													_tmp40_[_tmp41_] = _tmp46_;
													_tmp47_ = _tmp40_[_tmp41_];
												}
											}
											_tmp48_ = child_info;
											_tmp49_ = (*_tmp48_).widgets;
											_tmp49__length1 = (*_tmp48_).widgets_length1;
											_tmp50_ = j;
											_g_object_unref0 (_tmp49_[_tmp50_]);
											_tmp49_[_tmp50_] = NULL;
											_tmp51_ = _tmp49_[_tmp50_];
											_tmp52_ = child_info;
											_tmp53_ = child_info;
											_tmp54_ = (*_tmp53_).widgets;
											_tmp54__length1 = (*_tmp53_).widgets_length1;
											_tmp55_ = _tmp54__length1 - 1;
											(*_tmp52_).widgets = g_renew (GtkWidget*, (*_tmp52_).widgets, _tmp54__length1 - 1);
											(_tmp55_ > (*_tmp52_).widgets_length1) ? memset ((*_tmp52_).widgets + (*_tmp52_).widgets_length1, 0, sizeof (GtkWidget*) * (_tmp55_ - (*_tmp52_).widgets_length1)) : NULL;
											(*_tmp52_).widgets_length1 = _tmp55_;
											(*_tmp52_)._widgets_size_ = _tmp55_;
											_tmp57_ = was_visible;
											if (_tmp57_) {
												gboolean _tmp58_ = FALSE;
												_tmp58_ = gtk_widget_get_visible ((GtkWidget*) self);
												_tmp56_ = _tmp58_;
											} else {
												_tmp56_ = FALSE;
											}
											_tmp59_ = _tmp56_;
											if (_tmp59_) {
												gtk_widget_queue_resize ((GtkWidget*) self);
											}
											return;
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}


GeeList* contacts_row_get_children_at (ContactsRow* self, gint col, gint row) {
	GeeList* result = NULL;
	GeeArrayList* l = NULL;
	GeeArrayList* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gboolean _tmp7_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_array_list_new (GTK_TYPE_WIDGET, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	l = _tmp0_;
	_tmp2_ = row;
	_tmp3_ = self->priv->n_rows;
	if (_tmp2_ < _tmp3_) {
		gint _tmp4_ = 0;
		ContactsRowGroup* _tmp5_ = NULL;
		gint _tmp6_ = 0;
		_tmp4_ = col;
		_tmp5_ = self->priv->group;
		_tmp6_ = _tmp5_->n_columns;
		_tmp1_ = _tmp4_ < _tmp6_;
	} else {
		_tmp1_ = FALSE;
	}
	_tmp7_ = _tmp1_;
	if (_tmp7_) {
		ContactsRowChild* child_info = NULL;
		ContactsRowChild* _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		gint _tmp8__length2 = 0;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
		_tmp8_ = self->priv->row_children;
		_tmp8__length1 = self->priv->row_children_length1;
		_tmp8__length2 = self->priv->row_children_length2;
		_tmp9_ = col;
		_tmp10_ = row;
		child_info = &_tmp8_[(_tmp9_ * _tmp8__length2) + _tmp10_];
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp11_ = FALSE;
				_tmp11_ = TRUE;
				while (TRUE) {
					gboolean _tmp12_ = FALSE;
					gboolean _tmp14_ = FALSE;
					ContactsRowChild* _tmp15_ = NULL;
					GtkWidget** _tmp16_ = NULL;
					gint _tmp16__length1 = 0;
					gboolean _tmp20_ = FALSE;
					GeeArrayList* _tmp21_ = NULL;
					ContactsRowChild* _tmp22_ = NULL;
					GtkWidget** _tmp23_ = NULL;
					gint _tmp23__length1 = 0;
					gint _tmp24_ = 0;
					GtkWidget* _tmp25_ = NULL;
					_tmp12_ = _tmp11_;
					if (!_tmp12_) {
						gint _tmp13_ = 0;
						_tmp13_ = i;
						i = _tmp13_ + 1;
					}
					_tmp11_ = FALSE;
					_tmp15_ = child_info;
					_tmp16_ = (*_tmp15_).widgets;
					_tmp16__length1 = (*_tmp15_).widgets_length1;
					if (_tmp16_ != NULL) {
						gint _tmp17_ = 0;
						ContactsRowChild* _tmp18_ = NULL;
						GtkWidget** _tmp19_ = NULL;
						gint _tmp19__length1 = 0;
						_tmp17_ = i;
						_tmp18_ = child_info;
						_tmp19_ = (*_tmp18_).widgets;
						_tmp19__length1 = (*_tmp18_).widgets_length1;
						_tmp14_ = _tmp17_ < _tmp19__length1;
					} else {
						_tmp14_ = FALSE;
					}
					_tmp20_ = _tmp14_;
					if (!_tmp20_) {
						break;
					}
					_tmp21_ = l;
					_tmp22_ = child_info;
					_tmp23_ = (*_tmp22_).widgets;
					_tmp23__length1 = (*_tmp22_).widgets_length1;
					_tmp24_ = i;
					_tmp25_ = _tmp23_[_tmp24_];
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, _tmp25_);
				}
			}
		}
	}
	result = (GeeList*) l;
	return result;
}


static void contacts_row_real_forall_internal (GtkContainer* base, gboolean include_internals, GtkCallback callback, void* callback_target) {
	ContactsRow * self;
	self = (ContactsRow*) base;
	{
		gint row = 0;
		row = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp1_ = FALSE;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
				_tmp1_ = _tmp0_;
				if (!_tmp1_) {
					gint _tmp2_ = 0;
					_tmp2_ = row;
					row = _tmp2_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp3_ = row;
				_tmp4_ = self->priv->n_rows;
				if (!(_tmp3_ < _tmp4_)) {
					break;
				}
				{
					gint col = 0;
					col = 0;
					{
						gboolean _tmp5_ = FALSE;
						_tmp5_ = TRUE;
						while (TRUE) {
							gboolean _tmp6_ = FALSE;
							gint _tmp8_ = 0;
							ContactsRowGroup* _tmp9_ = NULL;
							gint _tmp10_ = 0;
							ContactsRowChild* child_info = NULL;
							ContactsRowChild* _tmp11_ = NULL;
							gint _tmp11__length1 = 0;
							gint _tmp11__length2 = 0;
							gint _tmp12_ = 0;
							gint _tmp13_ = 0;
							_tmp6_ = _tmp5_;
							if (!_tmp6_) {
								gint _tmp7_ = 0;
								_tmp7_ = col;
								col = _tmp7_ + 1;
							}
							_tmp5_ = FALSE;
							_tmp8_ = col;
							_tmp9_ = self->priv->group;
							_tmp10_ = _tmp9_->n_columns;
							if (!(_tmp8_ < _tmp10_)) {
								break;
							}
							_tmp11_ = self->priv->row_children;
							_tmp11__length1 = self->priv->row_children_length1;
							_tmp11__length2 = self->priv->row_children_length2;
							_tmp12_ = col;
							_tmp13_ = row;
							child_info = &_tmp11_[(_tmp12_ * _tmp11__length2) + _tmp13_];
							{
								gint i = 0;
								i = 0;
								{
									gboolean _tmp14_ = FALSE;
									_tmp14_ = TRUE;
									while (TRUE) {
										gboolean _tmp15_ = FALSE;
										gboolean _tmp17_ = FALSE;
										ContactsRowChild* _tmp18_ = NULL;
										GtkWidget** _tmp19_ = NULL;
										gint _tmp19__length1 = 0;
										gboolean _tmp23_ = FALSE;
										GtkCallback _tmp24_ = NULL;
										void* _tmp24__target = NULL;
										ContactsRowChild* _tmp25_ = NULL;
										GtkWidget** _tmp26_ = NULL;
										gint _tmp26__length1 = 0;
										gint _tmp27_ = 0;
										GtkWidget* _tmp28_ = NULL;
										_tmp15_ = _tmp14_;
										if (!_tmp15_) {
											gint _tmp16_ = 0;
											_tmp16_ = i;
											i = _tmp16_ + 1;
										}
										_tmp14_ = FALSE;
										_tmp18_ = child_info;
										_tmp19_ = (*_tmp18_).widgets;
										_tmp19__length1 = (*_tmp18_).widgets_length1;
										if (_tmp19_ != NULL) {
											gint _tmp20_ = 0;
											ContactsRowChild* _tmp21_ = NULL;
											GtkWidget** _tmp22_ = NULL;
											gint _tmp22__length1 = 0;
											_tmp20_ = i;
											_tmp21_ = child_info;
											_tmp22_ = (*_tmp21_).widgets;
											_tmp22__length1 = (*_tmp21_).widgets_length1;
											_tmp17_ = _tmp20_ < _tmp22__length1;
										} else {
											_tmp17_ = FALSE;
										}
										_tmp23_ = _tmp17_;
										if (!_tmp23_) {
											break;
										}
										_tmp24_ = callback;
										_tmp24__target = callback_target;
										_tmp25_ = child_info;
										_tmp26_ = (*_tmp25_).widgets;
										_tmp26__length1 = (*_tmp25_).widgets_length1;
										_tmp27_ = i;
										_tmp28_ = _tmp26_[_tmp27_];
										_tmp24_ (_tmp28_, _tmp24__target);
									}
								}
							}
						}
					}
				}
			}
		}
	}
}


static void contacts_row_real_compute_expand_internal (GtkWidget* base, gboolean* hexpand, gboolean* vexpand) {
	ContactsRow * self;
	gboolean _vala_hexpand = FALSE;
	gboolean _vala_vexpand = FALSE;
	ContactsRowGroup* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	self = (ContactsRow*) base;
	_tmp0_ = self->priv->group;
	_tmp1_ = contacts_row_group_is_expanding (_tmp0_);
	_vala_hexpand = _tmp1_;
	_vala_vexpand = FALSE;
	{
		gint row = 0;
		row = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gboolean _tmp3_ = FALSE;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				_tmp3_ = _tmp2_;
				if (!_tmp3_) {
					gint _tmp4_ = 0;
					_tmp4_ = row;
					row = _tmp4_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp5_ = row;
				_tmp6_ = self->priv->n_rows;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				{
					gint col = 0;
					col = 0;
					{
						gboolean _tmp7_ = FALSE;
						_tmp7_ = TRUE;
						while (TRUE) {
							gboolean _tmp8_ = FALSE;
							gint _tmp10_ = 0;
							ContactsRowGroup* _tmp11_ = NULL;
							gint _tmp12_ = 0;
							ContactsRowChild* child_info = NULL;
							ContactsRowChild* _tmp13_ = NULL;
							gint _tmp13__length1 = 0;
							gint _tmp13__length2 = 0;
							gint _tmp14_ = 0;
							gint _tmp15_ = 0;
							_tmp8_ = _tmp7_;
							if (!_tmp8_) {
								gint _tmp9_ = 0;
								_tmp9_ = col;
								col = _tmp9_ + 1;
							}
							_tmp7_ = FALSE;
							_tmp10_ = col;
							_tmp11_ = self->priv->group;
							_tmp12_ = _tmp11_->n_columns;
							if (!(_tmp10_ < _tmp12_)) {
								break;
							}
							_tmp13_ = self->priv->row_children;
							_tmp13__length1 = self->priv->row_children_length1;
							_tmp13__length2 = self->priv->row_children_length2;
							_tmp14_ = col;
							_tmp15_ = row;
							child_info = &_tmp13_[(_tmp14_ * _tmp13__length2) + _tmp15_];
							{
								gint i = 0;
								i = 0;
								{
									gboolean _tmp16_ = FALSE;
									_tmp16_ = TRUE;
									while (TRUE) {
										gboolean _tmp17_ = FALSE;
										gboolean _tmp19_ = FALSE;
										ContactsRowChild* _tmp20_ = NULL;
										GtkWidget** _tmp21_ = NULL;
										gint _tmp21__length1 = 0;
										gboolean _tmp25_ = FALSE;
										gboolean _tmp26_ = FALSE;
										ContactsRowChild* _tmp27_ = NULL;
										GtkWidget** _tmp28_ = NULL;
										gint _tmp28__length1 = 0;
										gint _tmp29_ = 0;
										GtkWidget* _tmp30_ = NULL;
										gboolean _tmp31_ = FALSE;
										_tmp17_ = _tmp16_;
										if (!_tmp17_) {
											gint _tmp18_ = 0;
											_tmp18_ = i;
											i = _tmp18_ + 1;
										}
										_tmp16_ = FALSE;
										_tmp20_ = child_info;
										_tmp21_ = (*_tmp20_).widgets;
										_tmp21__length1 = (*_tmp20_).widgets_length1;
										if (_tmp21_ != NULL) {
											gint _tmp22_ = 0;
											ContactsRowChild* _tmp23_ = NULL;
											GtkWidget** _tmp24_ = NULL;
											gint _tmp24__length1 = 0;
											_tmp22_ = i;
											_tmp23_ = child_info;
											_tmp24_ = (*_tmp23_).widgets;
											_tmp24__length1 = (*_tmp23_).widgets_length1;
											_tmp19_ = _tmp22_ < _tmp24__length1;
										} else {
											_tmp19_ = FALSE;
										}
										_tmp25_ = _tmp19_;
										if (!_tmp25_) {
											break;
										}
										_tmp26_ = _vala_vexpand;
										_tmp27_ = child_info;
										_tmp28_ = (*_tmp27_).widgets;
										_tmp28__length1 = (*_tmp27_).widgets_length1;
										_tmp29_ = i;
										_tmp30_ = _tmp28_[_tmp29_];
										_tmp31_ = gtk_widget_compute_expand (_tmp30_, GTK_ORIENTATION_VERTICAL);
										_vala_vexpand = _tmp26_ | _tmp31_;
									}
								}
							}
						}
					}
				}
			}
		}
	}
	if (hexpand) {
		*hexpand = _vala_hexpand;
	}
	if (vexpand) {
		*vexpand = _vala_vexpand;
	}
}


static GType contacts_row_real_child_type (GtkContainer* base) {
	ContactsRow * self;
	GType result = 0UL;
	self = (ContactsRow*) base;
	result = GTK_TYPE_WIDGET;
	return result;
}


static GtkSizeRequestMode contacts_row_real_get_request_mode (GtkWidget* base) {
	ContactsRow * self;
	GtkSizeRequestMode result = 0;
	self = (ContactsRow*) base;
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}


static void contacts_row_real_get_preferred_height (GtkWidget* base, gint* minimum_height, gint* natural_height) {
	ContactsRow * self;
	gint _vala_minimum_height = 0;
	gint _vala_natural_height = 0;
	gint natural_width = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	self = (ContactsRow*) base;
	gtk_widget_get_preferred_width ((GtkWidget*) self, NULL, &_tmp0_);
	natural_width = _tmp0_;
	gtk_widget_get_preferred_height_for_width ((GtkWidget*) self, natural_width, &_tmp1_, &_tmp2_);
	_vala_minimum_height = _tmp1_;
	_vala_natural_height = _tmp2_;
	if (minimum_height) {
		*minimum_height = _vala_minimum_height;
	}
	if (natural_height) {
		*natural_height = _vala_natural_height;
	}
}


static gint* contacts_row_distribute_heights (ContactsRow* self, gint height, ContactsRowRowInfo* row_info, int row_info_length1, int* result_length1) {
	gint* result = NULL;
	gint* heights = NULL;
	gint _tmp0_ = 0;
	gint* _tmp1_ = NULL;
	gint heights_length1 = 0;
	gint _heights_size_ = 0;
	gint n_children = 0;
	gint* _tmp105_ = NULL;
	gint _tmp105__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->n_rows;
	_tmp1_ = g_new0 (gint, _tmp0_);
	heights = _tmp1_;
	heights_length1 = _tmp0_;
	_heights_size_ = heights_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gboolean _tmp3_ = FALSE;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				ContactsRowRowInfo* info = NULL;
				ContactsRowRowInfo* _tmp7_ = NULL;
				gint _tmp7__length1 = 0;
				gint _tmp8_ = 0;
				gint _tmp9_ = 0;
				ContactsRowRowInfo* _tmp10_ = NULL;
				gint _tmp11_ = 0;
				_tmp3_ = _tmp2_;
				if (!_tmp3_) {
					gint _tmp4_ = 0;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp5_ = i;
				_tmp6_ = self->priv->n_rows;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = row_info;
				_tmp7__length1 = row_info_length1;
				_tmp8_ = i;
				info = &_tmp7_[_tmp8_];
				_tmp9_ = height;
				_tmp10_ = info;
				_tmp11_ = (*_tmp10_).min_height;
				if (_tmp9_ > _tmp11_) {
					gint* _tmp12_ = NULL;
					gint _tmp12__length1 = 0;
					gint _tmp13_ = 0;
					ContactsRowRowInfo* _tmp14_ = NULL;
					gint _tmp15_ = 0;
					gint _tmp16_ = 0;
					gint _tmp17_ = 0;
					ContactsRowRowInfo* _tmp18_ = NULL;
					gint _tmp19_ = 0;
					_tmp12_ = heights;
					_tmp12__length1 = heights_length1;
					_tmp13_ = i;
					_tmp14_ = info;
					_tmp15_ = (*_tmp14_).min_height;
					_tmp12_[_tmp13_] = _tmp15_;
					_tmp16_ = _tmp12_[_tmp13_];
					_tmp17_ = height;
					_tmp18_ = info;
					_tmp19_ = (*_tmp18_).min_height;
					height = _tmp17_ - _tmp19_;
				} else {
					gint _tmp20_ = 0;
					_tmp20_ = height;
					if (_tmp20_ > 0) {
						gint* _tmp21_ = NULL;
						gint _tmp21__length1 = 0;
						gint _tmp22_ = 0;
						gint _tmp23_ = 0;
						gint _tmp24_ = 0;
						_tmp21_ = heights;
						_tmp21__length1 = heights_length1;
						_tmp22_ = i;
						_tmp23_ = height;
						_tmp21_[_tmp22_] = _tmp23_;
						_tmp24_ = _tmp21_[_tmp22_];
						height = 0;
					} else {
						gint* _tmp25_ = NULL;
						gint _tmp25__length1 = 0;
						gint _tmp26_ = 0;
						gint _tmp27_ = 0;
						_tmp25_ = heights;
						_tmp25__length1 = heights_length1;
						_tmp26_ = i;
						_tmp25_[_tmp26_] = 0;
						_tmp27_ = _tmp25_[_tmp26_];
					}
				}
			}
		}
	}
	while (TRUE) {
		gint _tmp28_ = 0;
		gint max_extra = 0;
		gint _tmp29_ = 0;
		gint _tmp65_ = 0;
		gint distribute = 0;
		gint _tmp66_ = 0;
		gint _tmp67_ = 0;
		gint _tmp68_ = 0;
		gint _tmp69_ = 0;
		gint _tmp70_ = 0;
		gint _tmp71_ = 0;
		gint per_child = 0;
		gint _tmp72_ = 0;
		gint _tmp73_ = 0;
		gint per_child_extra = 0;
		gint _tmp74_ = 0;
		gint _tmp75_ = 0;
		gint per_child_extra_sum = 0;
		_tmp28_ = height;
		if (!(_tmp28_ > 0)) {
			break;
		}
		n_children = 0;
		_tmp29_ = height;
		max_extra = _tmp29_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp30_ = FALSE;
				_tmp30_ = TRUE;
				while (TRUE) {
					gboolean _tmp31_ = FALSE;
					gint _tmp33_ = 0;
					gint _tmp34_ = 0;
					ContactsRowRowInfo* info = NULL;
					ContactsRowRowInfo* _tmp35_ = NULL;
					gint _tmp35__length1 = 0;
					gint _tmp36_ = 0;
					gboolean _tmp37_ = FALSE;
					ContactsRowRowInfo* _tmp38_ = NULL;
					gboolean _tmp39_ = FALSE;
					gboolean _tmp45_ = FALSE;
					_tmp31_ = _tmp30_;
					if (!_tmp31_) {
						gint _tmp32_ = 0;
						_tmp32_ = i;
						i = _tmp32_ + 1;
					}
					_tmp30_ = FALSE;
					_tmp33_ = i;
					_tmp34_ = self->priv->n_rows;
					if (!(_tmp33_ < _tmp34_)) {
						break;
					}
					_tmp35_ = row_info;
					_tmp35__length1 = row_info_length1;
					_tmp36_ = i;
					info = &_tmp35_[_tmp36_];
					_tmp38_ = info;
					_tmp39_ = (*_tmp38_).expand;
					if (_tmp39_) {
						_tmp37_ = TRUE;
					} else {
						gint* _tmp40_ = NULL;
						gint _tmp40__length1 = 0;
						gint _tmp41_ = 0;
						gint _tmp42_ = 0;
						ContactsRowRowInfo* _tmp43_ = NULL;
						gint _tmp44_ = 0;
						_tmp40_ = heights;
						_tmp40__length1 = heights_length1;
						_tmp41_ = i;
						_tmp42_ = _tmp40_[_tmp41_];
						_tmp43_ = info;
						_tmp44_ = (*_tmp43_).nat_height;
						_tmp37_ = _tmp42_ < _tmp44_;
					}
					_tmp45_ = _tmp37_;
					if (_tmp45_) {
						gint _tmp46_ = 0;
						gboolean _tmp47_ = FALSE;
						ContactsRowRowInfo* _tmp48_ = NULL;
						gint _tmp49_ = 0;
						gint* _tmp50_ = NULL;
						gint _tmp50__length1 = 0;
						gint _tmp51_ = 0;
						gint _tmp52_ = 0;
						gboolean _tmp59_ = FALSE;
						_tmp46_ = n_children;
						n_children = _tmp46_ + 1;
						_tmp48_ = info;
						_tmp49_ = (*_tmp48_).nat_height;
						_tmp50_ = heights;
						_tmp50__length1 = heights_length1;
						_tmp51_ = i;
						_tmp52_ = _tmp50_[_tmp51_];
						if (_tmp49_ < _tmp52_) {
							ContactsRowRowInfo* _tmp53_ = NULL;
							gint _tmp54_ = 0;
							gint* _tmp55_ = NULL;
							gint _tmp55__length1 = 0;
							gint _tmp56_ = 0;
							gint _tmp57_ = 0;
							gint _tmp58_ = 0;
							_tmp53_ = info;
							_tmp54_ = (*_tmp53_).nat_height;
							_tmp55_ = heights;
							_tmp55__length1 = heights_length1;
							_tmp56_ = i;
							_tmp57_ = _tmp55_[_tmp56_];
							_tmp58_ = max_extra;
							_tmp47_ = (_tmp54_ - _tmp57_) < _tmp58_;
						} else {
							_tmp47_ = FALSE;
						}
						_tmp59_ = _tmp47_;
						if (_tmp59_) {
							ContactsRowRowInfo* _tmp60_ = NULL;
							gint _tmp61_ = 0;
							gint* _tmp62_ = NULL;
							gint _tmp62__length1 = 0;
							gint _tmp63_ = 0;
							gint _tmp64_ = 0;
							_tmp60_ = info;
							_tmp61_ = (*_tmp60_).nat_height;
							_tmp62_ = heights;
							_tmp62__length1 = heights_length1;
							_tmp63_ = i;
							_tmp64_ = _tmp62_[_tmp63_];
							max_extra = _tmp61_ - _tmp64_;
						}
					}
				}
			}
		}
		_tmp65_ = n_children;
		if (_tmp65_ == 0) {
			break;
		}
		_tmp66_ = height;
		_tmp67_ = max_extra;
		_tmp68_ = n_children;
		_tmp69_ = MIN (_tmp66_, _tmp67_ * _tmp68_);
		distribute = _tmp69_;
		_tmp70_ = height;
		_tmp71_ = distribute;
		height = _tmp70_ - _tmp71_;
		_tmp72_ = distribute;
		_tmp73_ = n_children;
		per_child = _tmp72_ / _tmp73_;
		_tmp74_ = distribute;
		_tmp75_ = n_children;
		per_child_extra = _tmp74_ % _tmp75_;
		per_child_extra_sum = 0;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp76_ = FALSE;
				_tmp76_ = TRUE;
				while (TRUE) {
					gboolean _tmp77_ = FALSE;
					gint _tmp79_ = 0;
					gint _tmp80_ = 0;
					ContactsRowRowInfo* info = NULL;
					ContactsRowRowInfo* _tmp81_ = NULL;
					gint _tmp81__length1 = 0;
					gint _tmp82_ = 0;
					gboolean _tmp83_ = FALSE;
					gint* _tmp84_ = NULL;
					gint _tmp84__length1 = 0;
					gint _tmp85_ = 0;
					gint _tmp86_ = 0;
					ContactsRowRowInfo* _tmp87_ = NULL;
					gint _tmp88_ = 0;
					gboolean _tmp91_ = FALSE;
					_tmp77_ = _tmp76_;
					if (!_tmp77_) {
						gint _tmp78_ = 0;
						_tmp78_ = i;
						i = _tmp78_ + 1;
					}
					_tmp76_ = FALSE;
					_tmp79_ = i;
					_tmp80_ = self->priv->n_rows;
					if (!(_tmp79_ < _tmp80_)) {
						break;
					}
					_tmp81_ = row_info;
					_tmp81__length1 = row_info_length1;
					_tmp82_ = i;
					info = &_tmp81_[_tmp82_];
					_tmp84_ = heights;
					_tmp84__length1 = heights_length1;
					_tmp85_ = i;
					_tmp86_ = _tmp84_[_tmp85_];
					_tmp87_ = info;
					_tmp88_ = (*_tmp87_).nat_height;
					if (_tmp86_ < _tmp88_) {
						_tmp83_ = TRUE;
					} else {
						gint _tmp89_ = 0;
						gint _tmp90_ = 0;
						_tmp89_ = n_children;
						_tmp90_ = self->priv->n_rows;
						_tmp83_ = _tmp89_ == _tmp90_;
					}
					_tmp91_ = _tmp83_;
					if (_tmp91_) {
						gint* _tmp92_ = NULL;
						gint _tmp92__length1 = 0;
						gint _tmp93_ = 0;
						gint _tmp94_ = 0;
						gint _tmp95_ = 0;
						gint _tmp96_ = 0;
						gint _tmp97_ = 0;
						gint _tmp98_ = 0;
						gint _tmp99_ = 0;
						_tmp92_ = heights;
						_tmp92__length1 = heights_length1;
						_tmp93_ = i;
						_tmp94_ = per_child;
						_tmp92_[_tmp93_] += _tmp94_;
						_tmp95_ = _tmp92_[_tmp93_];
						_tmp96_ = per_child_extra_sum;
						_tmp97_ = per_child_extra;
						per_child_extra_sum = _tmp96_ + _tmp97_;
						_tmp98_ = per_child_extra_sum;
						_tmp99_ = distribute;
						if (_tmp98_ > _tmp99_) {
							gint* _tmp100_ = NULL;
							gint _tmp100__length1 = 0;
							gint _tmp101_ = 0;
							gint _tmp102_ = 0;
							gint _tmp103_ = 0;
							gint _tmp104_ = 0;
							_tmp100_ = heights;
							_tmp100__length1 = heights_length1;
							_tmp101_ = i;
							_tmp100_[_tmp101_] += 1;
							_tmp102_ = _tmp100_[_tmp101_];
							_tmp103_ = per_child_extra_sum;
							_tmp104_ = distribute;
							per_child_extra_sum = _tmp103_ - _tmp104_;
						}
					}
				}
			}
		}
	}
	_tmp105_ = heights;
	_tmp105__length1 = heights_length1;
	if (result_length1) {
		*result_length1 = _tmp105__length1;
	}
	result = _tmp105_;
	return result;
}


static ContactsRowRowInfo* contacts_row_get_row_heights_for_widths (ContactsRow* self, gint* widths, int widths_length1, int* result_length1) {
	ContactsRowRowInfo* result = NULL;
	ContactsRowRowInfo* info = NULL;
	gint _tmp0_ = 0;
	ContactsRowRowInfo* _tmp1_ = NULL;
	gint info_length1 = 0;
	gint _info_size_ = 0;
	ContactsRowRowInfo* _tmp60_ = NULL;
	gint _tmp60__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->n_rows;
	_tmp1_ = g_new0 (ContactsRowRowInfo, _tmp0_);
	info = _tmp1_;
	info_length1 = _tmp0_;
	_info_size_ = info_length1;
	{
		gint row = 0;
		row = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gboolean _tmp3_ = FALSE;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				gint row_min = 0;
				gint row_nat = 0;
				gboolean first = FALSE;
				gboolean expand = FALSE;
				ContactsRowRowInfo* _tmp51_ = NULL;
				gint _tmp51__length1 = 0;
				gint _tmp52_ = 0;
				gint _tmp53_ = 0;
				ContactsRowRowInfo* _tmp54_ = NULL;
				gint _tmp54__length1 = 0;
				gint _tmp55_ = 0;
				gint _tmp56_ = 0;
				ContactsRowRowInfo* _tmp57_ = NULL;
				gint _tmp57__length1 = 0;
				gint _tmp58_ = 0;
				gboolean _tmp59_ = FALSE;
				_tmp3_ = _tmp2_;
				if (!_tmp3_) {
					gint _tmp4_ = 0;
					_tmp4_ = row;
					row = _tmp4_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp5_ = row;
				_tmp6_ = self->priv->n_rows;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				row_min = 0;
				row_nat = 0;
				first = TRUE;
				expand = FALSE;
				{
					gint col = 0;
					col = 0;
					{
						gboolean _tmp7_ = FALSE;
						_tmp7_ = TRUE;
						while (TRUE) {
							gboolean _tmp8_ = FALSE;
							gint _tmp10_ = 0;
							ContactsRowGroup* _tmp11_ = NULL;
							gint _tmp12_ = 0;
							ContactsRowChild* child_info = NULL;
							ContactsRowChild* _tmp13_ = NULL;
							gint _tmp13__length1 = 0;
							gint _tmp13__length2 = 0;
							gint _tmp14_ = 0;
							gint _tmp15_ = 0;
							_tmp8_ = _tmp7_;
							if (!_tmp8_) {
								gint _tmp9_ = 0;
								_tmp9_ = col;
								col = _tmp9_ + 1;
							}
							_tmp7_ = FALSE;
							_tmp10_ = col;
							_tmp11_ = self->priv->group;
							_tmp12_ = _tmp11_->n_columns;
							if (!(_tmp10_ < _tmp12_)) {
								break;
							}
							_tmp13_ = self->priv->row_children;
							_tmp13__length1 = self->priv->row_children_length1;
							_tmp13__length2 = self->priv->row_children_length2;
							_tmp14_ = col;
							_tmp15_ = row;
							child_info = &_tmp13_[(_tmp14_ * _tmp13__length2) + _tmp15_];
							{
								gint i = 0;
								i = 0;
								{
									gboolean _tmp16_ = FALSE;
									_tmp16_ = TRUE;
									while (TRUE) {
										gboolean _tmp17_ = FALSE;
										gboolean _tmp19_ = FALSE;
										ContactsRowChild* _tmp20_ = NULL;
										GtkWidget** _tmp21_ = NULL;
										gint _tmp21__length1 = 0;
										gboolean _tmp25_ = FALSE;
										GtkWidget* widget = NULL;
										ContactsRowChild* _tmp26_ = NULL;
										GtkWidget** _tmp27_ = NULL;
										gint _tmp27__length1 = 0;
										gint _tmp28_ = 0;
										GtkWidget* _tmp29_ = NULL;
										GtkWidget* _tmp30_ = NULL;
										GtkWidget* _tmp31_ = NULL;
										gboolean _tmp32_ = FALSE;
										gint child_min = 0;
										gint child_nat = 0;
										GtkWidget* _tmp33_ = NULL;
										gint* _tmp34_ = NULL;
										gint _tmp34__length1 = 0;
										gint _tmp35_ = 0;
										gint _tmp36_ = 0;
										gint _tmp37_ = 0;
										gint _tmp38_ = 0;
										gboolean _tmp39_ = FALSE;
										GtkWidget* _tmp40_ = NULL;
										gboolean _tmp41_ = FALSE;
										gboolean _tmp42_ = FALSE;
										_tmp17_ = _tmp16_;
										if (!_tmp17_) {
											gint _tmp18_ = 0;
											_tmp18_ = i;
											i = _tmp18_ + 1;
										}
										_tmp16_ = FALSE;
										_tmp20_ = child_info;
										_tmp21_ = (*_tmp20_).widgets;
										_tmp21__length1 = (*_tmp20_).widgets_length1;
										if (_tmp21_ != NULL) {
											gint _tmp22_ = 0;
											ContactsRowChild* _tmp23_ = NULL;
											GtkWidget** _tmp24_ = NULL;
											gint _tmp24__length1 = 0;
											_tmp22_ = i;
											_tmp23_ = child_info;
											_tmp24_ = (*_tmp23_).widgets;
											_tmp24__length1 = (*_tmp23_).widgets_length1;
											_tmp19_ = _tmp22_ < _tmp24__length1;
										} else {
											_tmp19_ = FALSE;
										}
										_tmp25_ = _tmp19_;
										if (!_tmp25_) {
											break;
										}
										_tmp26_ = child_info;
										_tmp27_ = (*_tmp26_).widgets;
										_tmp27__length1 = (*_tmp26_).widgets_length1;
										_tmp28_ = i;
										_tmp29_ = _tmp27_[_tmp28_];
										_tmp30_ = _g_object_ref0 (_tmp29_);
										widget = _tmp30_;
										_tmp31_ = widget;
										_tmp32_ = gtk_widget_get_visible (_tmp31_);
										if (!_tmp32_) {
											_g_object_unref0 (widget);
											continue;
										}
										_tmp33_ = widget;
										_tmp34_ = widths;
										_tmp34__length1 = widths_length1;
										_tmp35_ = col;
										_tmp36_ = _tmp34_[_tmp35_];
										gtk_widget_get_preferred_height_for_width (_tmp33_, _tmp36_, &_tmp37_, &_tmp38_);
										child_min = _tmp37_;
										child_nat = _tmp38_;
										_tmp39_ = expand;
										_tmp40_ = widget;
										_tmp41_ = gtk_widget_compute_expand (_tmp40_, GTK_ORIENTATION_VERTICAL);
										expand = _tmp39_ | _tmp41_;
										_tmp42_ = first;
										if (_tmp42_) {
											gint _tmp43_ = 0;
											gint _tmp44_ = 0;
											first = FALSE;
											_tmp43_ = child_min;
											row_min = _tmp43_;
											_tmp44_ = child_nat;
											row_nat = _tmp44_;
										} else {
											gint _tmp45_ = 0;
											gint _tmp46_ = 0;
											gint _tmp47_ = 0;
											gint _tmp48_ = 0;
											gint _tmp49_ = 0;
											gint _tmp50_ = 0;
											_tmp45_ = row_min;
											_tmp46_ = child_min;
											_tmp47_ = MAX (_tmp45_, _tmp46_);
											row_min = _tmp47_;
											_tmp48_ = row_nat;
											_tmp49_ = child_nat;
											_tmp50_ = MAX (_tmp48_, _tmp49_);
											row_nat = _tmp50_;
										}
										_g_object_unref0 (widget);
									}
								}
							}
						}
					}
				}
				_tmp51_ = info;
				_tmp51__length1 = info_length1;
				_tmp52_ = row;
				_tmp53_ = row_min;
				_tmp51_[_tmp52_].min_height = _tmp53_;
				_tmp54_ = info;
				_tmp54__length1 = info_length1;
				_tmp55_ = row;
				_tmp56_ = row_nat;
				_tmp54_[_tmp55_].nat_height = _tmp56_;
				_tmp57_ = info;
				_tmp57__length1 = info_length1;
				_tmp58_ = row;
				_tmp59_ = expand;
				_tmp57_[_tmp58_].expand = _tmp59_;
			}
		}
	}
	_tmp60_ = info;
	_tmp60__length1 = info_length1;
	if (result_length1) {
		*result_length1 = _tmp60__length1;
	}
	result = _tmp60_;
	return result;
}


static void contacts_row_real_get_preferred_height_for_width (GtkWidget* base, gint width, gint* minimum_height, gint* natural_height) {
	ContactsRow * self;
	gint _vala_minimum_height = 0;
	gint _vala_natural_height = 0;
	gint* widths = NULL;
	ContactsRowGroup* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint* _tmp3_ = NULL;
	gint widths_length1 = 0;
	gint _widths_size_ = 0;
	ContactsRowRowInfo* row_info = NULL;
	gint* _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	gint _tmp5_ = 0;
	ContactsRowRowInfo* _tmp6_ = NULL;
	gint row_info_length1 = 0;
	gint _row_info_size_ = 0;
	self = (ContactsRow*) base;
	_tmp0_ = self->priv->group;
	_tmp1_ = width;
	_tmp3_ = contacts_row_group_distribute_widths (_tmp0_, _tmp1_, &_tmp2_);
	widths = _tmp3_;
	widths_length1 = _tmp2_;
	_widths_size_ = widths_length1;
	_tmp4_ = widths;
	_tmp4__length1 = widths_length1;
	_tmp6_ = contacts_row_get_row_heights_for_widths (self, _tmp4_, _tmp4__length1, &_tmp5_);
	row_info = _tmp6_;
	row_info_length1 = _tmp5_;
	_row_info_size_ = row_info_length1;
	_vala_minimum_height = 0;
	_vala_natural_height = 0;
	{
		gint row = 0;
		row = 0;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				gboolean _tmp8_ = FALSE;
				gint _tmp10_ = 0;
				gint _tmp11_ = 0;
				gint _tmp12_ = 0;
				ContactsRowRowInfo* _tmp13_ = NULL;
				gint _tmp13__length1 = 0;
				gint _tmp14_ = 0;
				ContactsRowRowInfo _tmp15_ = {0};
				gint _tmp16_ = 0;
				gint _tmp17_ = 0;
				ContactsRowRowInfo* _tmp18_ = NULL;
				gint _tmp18__length1 = 0;
				gint _tmp19_ = 0;
				ContactsRowRowInfo _tmp20_ = {0};
				gint _tmp21_ = 0;
				_tmp8_ = _tmp7_;
				if (!_tmp8_) {
					gint _tmp9_ = 0;
					_tmp9_ = row;
					row = _tmp9_ + 1;
				}
				_tmp7_ = FALSE;
				_tmp10_ = row;
				_tmp11_ = self->priv->n_rows;
				if (!(_tmp10_ < _tmp11_)) {
					break;
				}
				_tmp12_ = _vala_minimum_height;
				_tmp13_ = row_info;
				_tmp13__length1 = row_info_length1;
				_tmp14_ = row;
				_tmp15_ = _tmp13_[_tmp14_];
				_tmp16_ = _tmp15_.min_height;
				_vala_minimum_height = _tmp12_ + _tmp16_;
				_tmp17_ = _vala_natural_height;
				_tmp18_ = row_info;
				_tmp18__length1 = row_info_length1;
				_tmp19_ = row;
				_tmp20_ = _tmp18_[_tmp19_];
				_tmp21_ = _tmp20_.nat_height;
				_vala_natural_height = _tmp17_ + _tmp21_;
			}
		}
	}
	row_info = (g_free (row_info), NULL);
	widths = (g_free (widths), NULL);
	if (minimum_height) {
		*minimum_height = _vala_minimum_height;
	}
	if (natural_height) {
		*natural_height = _vala_natural_height;
	}
}


static void contacts_row_real_get_preferred_width (GtkWidget* base, gint* minimum_width, gint* natural_width) {
	ContactsRow * self;
	gint _vala_minimum_width = 0;
	gint _vala_natural_width = 0;
	ContactsRowGroup* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	self = (ContactsRow*) base;
	_tmp0_ = self->priv->group;
	contacts_row_group_get_width (_tmp0_, &_tmp1_, &_tmp2_);
	_vala_minimum_width = _tmp1_;
	_vala_natural_width = _tmp2_;
	if (minimum_width) {
		*minimum_width = _vala_minimum_width;
	}
	if (natural_width) {
		*natural_width = _vala_natural_width;
	}
}


static void contacts_row_real_get_preferred_width_for_height (GtkWidget* base, gint height, gint* minimum_width, gint* natural_width) {
	ContactsRow * self;
	gint _vala_minimum_width = 0;
	gint _vala_natural_width = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	self = (ContactsRow*) base;
	gtk_widget_get_preferred_width ((GtkWidget*) self, &_tmp0_, &_tmp1_);
	_vala_minimum_width = _tmp0_;
	_vala_natural_width = _tmp1_;
	if (minimum_width) {
		*minimum_width = _vala_minimum_width;
	}
	if (natural_width) {
		*natural_width = _vala_natural_width;
	}
}


static void contacts_row_real_size_allocate (GtkWidget* base, GtkAllocation* allocation) {
	ContactsRow * self;
	gint* widths = NULL;
	ContactsRowGroup* _tmp0_ = NULL;
	GtkAllocation _tmp1_ = {0};
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint* _tmp4_ = NULL;
	gint widths_length1 = 0;
	gint _widths_size_ = 0;
	ContactsRowRowInfo* row_info = NULL;
	gint* _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
	gint _tmp6_ = 0;
	ContactsRowRowInfo* _tmp7_ = NULL;
	gint row_info_length1 = 0;
	gint _row_info_size_ = 0;
	gint* heights = NULL;
	GtkAllocation _tmp8_ = {0};
	gint _tmp9_ = 0;
	ContactsRowRowInfo* _tmp10_ = NULL;
	gint _tmp10__length1 = 0;
	gint _tmp11_ = 0;
	gint* _tmp12_ = NULL;
	gint heights_length1 = 0;
	gint _heights_size_ = 0;
	GtkAllocation _tmp13_ = {0};
	GdkWindow* _tmp14_ = NULL;
	gint y = 0;
	self = (ContactsRow*) base;
	g_return_if_fail (allocation != NULL);
	_tmp0_ = self->priv->group;
	_tmp1_ = *allocation;
	_tmp2_ = _tmp1_.width;
	_tmp4_ = contacts_row_group_distribute_widths (_tmp0_, _tmp2_, &_tmp3_);
	widths = _tmp4_;
	widths_length1 = _tmp3_;
	_widths_size_ = widths_length1;
	_tmp5_ = widths;
	_tmp5__length1 = widths_length1;
	_tmp7_ = contacts_row_get_row_heights_for_widths (self, _tmp5_, _tmp5__length1, &_tmp6_);
	row_info = _tmp7_;
	row_info_length1 = _tmp6_;
	_row_info_size_ = row_info_length1;
	_tmp8_ = *allocation;
	_tmp9_ = _tmp8_.height;
	_tmp10_ = row_info;
	_tmp10__length1 = row_info_length1;
	_tmp12_ = contacts_row_distribute_heights (self, _tmp9_, _tmp10_, _tmp10__length1, &_tmp11_);
	heights = _tmp12_;
	heights_length1 = _tmp11_;
	_heights_size_ = heights_length1;
	_tmp13_ = *allocation;
	gtk_widget_set_allocation ((GtkWidget*) self, &_tmp13_);
	_tmp14_ = self->event_window;
	if (_tmp14_ != NULL) {
		GdkWindow* _tmp15_ = NULL;
		GtkAllocation _tmp16_ = {0};
		gint _tmp17_ = 0;
		GtkAllocation _tmp18_ = {0};
		gint _tmp19_ = 0;
		GtkAllocation _tmp20_ = {0};
		gint _tmp21_ = 0;
		GtkAllocation _tmp22_ = {0};
		gint _tmp23_ = 0;
		_tmp15_ = self->event_window;
		_tmp16_ = *allocation;
		_tmp17_ = _tmp16_.x;
		_tmp18_ = *allocation;
		_tmp19_ = _tmp18_.y;
		_tmp20_ = *allocation;
		_tmp21_ = _tmp20_.width;
		_tmp22_ = *allocation;
		_tmp23_ = _tmp22_.height;
		gdk_window_move_resize (_tmp15_, _tmp17_, _tmp19_, _tmp21_, _tmp23_);
	}
	y = 0;
	{
		gint row = 0;
		row = 0;
		{
			gboolean _tmp24_ = FALSE;
			_tmp24_ = TRUE;
			while (TRUE) {
				gboolean _tmp25_ = FALSE;
				gint _tmp27_ = 0;
				gint _tmp28_ = 0;
				gint x = 0;
				gint _tmp84_ = 0;
				gint* _tmp85_ = NULL;
				gint _tmp85__length1 = 0;
				gint _tmp86_ = 0;
				gint _tmp87_ = 0;
				_tmp25_ = _tmp24_;
				if (!_tmp25_) {
					gint _tmp26_ = 0;
					_tmp26_ = row;
					row = _tmp26_ + 1;
				}
				_tmp24_ = FALSE;
				_tmp27_ = row;
				_tmp28_ = self->priv->n_rows;
				if (!(_tmp27_ < _tmp28_)) {
					break;
				}
				x = 0;
				{
					gint col = 0;
					col = 0;
					{
						gboolean _tmp29_ = FALSE;
						_tmp29_ = TRUE;
						while (TRUE) {
							gboolean _tmp30_ = FALSE;
							gint _tmp32_ = 0;
							ContactsRowGroup* _tmp33_ = NULL;
							gint _tmp34_ = 0;
							ContactsRowChild* child_info = NULL;
							ContactsRowChild* _tmp35_ = NULL;
							gint _tmp35__length1 = 0;
							gint _tmp35__length2 = 0;
							gint _tmp36_ = 0;
							gint _tmp37_ = 0;
							gint _tmp76_ = 0;
							gint* _tmp77_ = NULL;
							gint _tmp77__length1 = 0;
							gint _tmp78_ = 0;
							gint _tmp79_ = 0;
							ContactsRowGroup* _tmp80_ = NULL;
							gint _tmp81_ = 0;
							ContactsRowGroupColumnInfo* _tmp82_ = NULL;
							gint _tmp83_ = 0;
							_tmp30_ = _tmp29_;
							if (!_tmp30_) {
								gint _tmp31_ = 0;
								_tmp31_ = col;
								col = _tmp31_ + 1;
							}
							_tmp29_ = FALSE;
							_tmp32_ = col;
							_tmp33_ = self->priv->group;
							_tmp34_ = _tmp33_->n_columns;
							if (!(_tmp32_ < _tmp34_)) {
								break;
							}
							_tmp35_ = self->priv->row_children;
							_tmp35__length1 = self->priv->row_children_length1;
							_tmp35__length2 = self->priv->row_children_length2;
							_tmp36_ = col;
							_tmp37_ = row;
							child_info = &_tmp35_[(_tmp36_ * _tmp35__length2) + _tmp37_];
							{
								gint i = 0;
								i = 0;
								{
									gboolean _tmp38_ = FALSE;
									_tmp38_ = TRUE;
									while (TRUE) {
										gboolean _tmp39_ = FALSE;
										gboolean _tmp41_ = FALSE;
										ContactsRowChild* _tmp42_ = NULL;
										GtkWidget** _tmp43_ = NULL;
										gint _tmp43__length1 = 0;
										gboolean _tmp47_ = FALSE;
										GtkWidget* widget = NULL;
										ContactsRowChild* _tmp48_ = NULL;
										GtkWidget** _tmp49_ = NULL;
										gint _tmp49__length1 = 0;
										gint _tmp50_ = 0;
										GtkWidget* _tmp51_ = NULL;
										GtkWidget* _tmp52_ = NULL;
										GtkAllocation child_allocation = {0};
										GtkAllocation _tmp53_ = {0};
										gint* _tmp54_ = NULL;
										gint _tmp54__length1 = 0;
										gint _tmp55_ = 0;
										gint _tmp56_ = 0;
										gint* _tmp57_ = NULL;
										gint _tmp57__length1 = 0;
										gint _tmp58_ = 0;
										gint _tmp59_ = 0;
										GtkTextDirection _tmp60_ = 0;
										GtkAllocation _tmp71_ = {0};
										gint _tmp72_ = 0;
										gint _tmp73_ = 0;
										GtkWidget* _tmp74_ = NULL;
										GtkAllocation _tmp75_ = {0};
										_tmp39_ = _tmp38_;
										if (!_tmp39_) {
											gint _tmp40_ = 0;
											_tmp40_ = i;
											i = _tmp40_ + 1;
										}
										_tmp38_ = FALSE;
										_tmp42_ = child_info;
										_tmp43_ = (*_tmp42_).widgets;
										_tmp43__length1 = (*_tmp42_).widgets_length1;
										if (_tmp43_ != NULL) {
											gint _tmp44_ = 0;
											ContactsRowChild* _tmp45_ = NULL;
											GtkWidget** _tmp46_ = NULL;
											gint _tmp46__length1 = 0;
											_tmp44_ = i;
											_tmp45_ = child_info;
											_tmp46_ = (*_tmp45_).widgets;
											_tmp46__length1 = (*_tmp45_).widgets_length1;
											_tmp41_ = _tmp44_ < _tmp46__length1;
										} else {
											_tmp41_ = FALSE;
										}
										_tmp47_ = _tmp41_;
										if (!_tmp47_) {
											break;
										}
										_tmp48_ = child_info;
										_tmp49_ = (*_tmp48_).widgets;
										_tmp49__length1 = (*_tmp48_).widgets_length1;
										_tmp50_ = i;
										_tmp51_ = _tmp49_[_tmp50_];
										_tmp52_ = _g_object_ref0 (_tmp51_);
										widget = _tmp52_;
										_tmp53_.x = 0;
										_tmp53_.y = 0;
										_tmp53_.width = 0;
										_tmp53_.height = 0;
										child_allocation = _tmp53_;
										_tmp54_ = widths;
										_tmp54__length1 = widths_length1;
										_tmp55_ = col;
										_tmp56_ = _tmp54_[_tmp55_];
										child_allocation.width = _tmp56_;
										_tmp57_ = heights;
										_tmp57__length1 = heights_length1;
										_tmp58_ = row;
										_tmp59_ = _tmp57_[_tmp58_];
										child_allocation.height = _tmp59_;
										_tmp60_ = gtk_widget_get_direction ((GtkWidget*) self);
										if (_tmp60_ == GTK_TEXT_DIR_RTL) {
											GtkAllocation _tmp61_ = {0};
											gint _tmp62_ = 0;
											GtkAllocation _tmp63_ = {0};
											gint _tmp64_ = 0;
											gint _tmp65_ = 0;
											GtkAllocation _tmp66_ = {0};
											gint _tmp67_ = 0;
											_tmp61_ = *allocation;
											_tmp62_ = _tmp61_.x;
											_tmp63_ = *allocation;
											_tmp64_ = _tmp63_.width;
											_tmp65_ = x;
											_tmp66_ = child_allocation;
											_tmp67_ = _tmp66_.width;
											child_allocation.x = ((_tmp62_ + _tmp64_) - _tmp65_) - _tmp67_;
										} else {
											GtkAllocation _tmp68_ = {0};
											gint _tmp69_ = 0;
											gint _tmp70_ = 0;
											_tmp68_ = *allocation;
											_tmp69_ = _tmp68_.x;
											_tmp70_ = x;
											child_allocation.x = _tmp69_ + _tmp70_;
										}
										_tmp71_ = *allocation;
										_tmp72_ = _tmp71_.y;
										_tmp73_ = y;
										child_allocation.y = _tmp72_ + _tmp73_;
										_tmp74_ = widget;
										_tmp75_ = child_allocation;
										gtk_widget_size_allocate (_tmp74_, &_tmp75_);
										_g_object_unref0 (widget);
									}
								}
							}
							_tmp76_ = x;
							_tmp77_ = widths;
							_tmp77__length1 = widths_length1;
							_tmp78_ = col;
							_tmp79_ = _tmp77_[_tmp78_];
							_tmp80_ = self->priv->group;
							_tmp81_ = col;
							_tmp82_ = contacts_row_group_get_column_info (_tmp80_, _tmp81_);
							_tmp83_ = (*_tmp82_).spacing;
							x = _tmp76_ + (_tmp79_ + _tmp83_);
						}
					}
				}
				_tmp84_ = y;
				_tmp85_ = heights;
				_tmp85__length1 = heights_length1;
				_tmp86_ = row;
				_tmp87_ = _tmp85_[_tmp86_];
				y = _tmp84_ + _tmp87_;
			}
		}
	}
	heights = (g_free (heights), NULL);
	row_info = (g_free (row_info), NULL);
	widths = (g_free (widths), NULL);
}


static ContactsRowRowInfo* contacts_row_row_info_dup (const ContactsRowRowInfo* self) {
	ContactsRowRowInfo* dup;
	dup = g_new0 (ContactsRowRowInfo, 1);
	memcpy (dup, self, sizeof (ContactsRowRowInfo));
	return dup;
}


static void contacts_row_row_info_free (ContactsRowRowInfo* self) {
	g_free (self);
}


static GType contacts_row_row_info_get_type (void) {
	static volatile gsize contacts_row_row_info_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_row_row_info_type_id__volatile)) {
		GType contacts_row_row_info_type_id;
		contacts_row_row_info_type_id = g_boxed_type_register_static ("ContactsRowRowInfo", (GBoxedCopyFunc) contacts_row_row_info_dup, (GBoxedFreeFunc) contacts_row_row_info_free);
		g_once_init_leave (&contacts_row_row_info_type_id__volatile, contacts_row_row_info_type_id);
	}
	return contacts_row_row_info_type_id__volatile;
}


static GtkWidget** _vala_array_dup3 (GtkWidget** self, int length) {
	GtkWidget** result;
	int i;
	result = g_new0 (GtkWidget*, length + 1);
	for (i = 0; i < length; i++) {
		GtkWidget* _tmp0_ = NULL;
		_tmp0_ = _g_object_ref0 (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static void contacts_row_child_copy (const ContactsRowChild* self, ContactsRowChild* dest) {
	GtkWidget** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	GtkWidget** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	_tmp0_ = (*self).widgets;
	_tmp0__length1 = (*self).widgets_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup3 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	(*dest).widgets = (_vala_array_free ((*dest).widgets, (*dest).widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	(*dest).widgets = _tmp1_;
	(*dest).widgets_length1 = _tmp1__length1;
	(*dest)._widgets_size_ = (*dest).widgets_length1;
}


static void contacts_row_child_destroy (ContactsRowChild* self) {
	(*self).widgets = (_vala_array_free ((*self).widgets, (*self).widgets_length1, (GDestroyNotify) g_object_unref), NULL);
}


static ContactsRowChild* contacts_row_child_dup (const ContactsRowChild* self) {
	ContactsRowChild* dup;
	dup = g_new0 (ContactsRowChild, 1);
	contacts_row_child_copy (self, dup);
	return dup;
}


static void contacts_row_child_free (ContactsRowChild* self) {
	contacts_row_child_destroy (self);
	g_free (self);
}


static GType contacts_row_child_get_type (void) {
	static volatile gsize contacts_row_child_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_row_child_type_id__volatile)) {
		GType contacts_row_child_type_id;
		contacts_row_child_type_id = g_boxed_type_register_static ("ContactsRowChild", (GBoxedCopyFunc) contacts_row_child_dup, (GBoxedFreeFunc) contacts_row_child_free);
		g_once_init_leave (&contacts_row_child_type_id__volatile, contacts_row_child_type_id);
	}
	return contacts_row_child_type_id__volatile;
}


static void contacts_row_class_init (ContactsRowClass * klass) {
	contacts_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsRowPrivate));
	GTK_WIDGET_CLASS (klass)->realize = contacts_row_real_realize;
	GTK_WIDGET_CLASS (klass)->unrealize = contacts_row_real_unrealize;
	GTK_WIDGET_CLASS (klass)->map = contacts_row_real_map;
	GTK_WIDGET_CLASS (klass)->unmap = contacts_row_real_unmap;
	GTK_CONTAINER_CLASS (klass)->add = contacts_row_real_add;
	GTK_CONTAINER_CLASS (klass)->remove = contacts_row_real_remove;
	GTK_CONTAINER_CLASS (klass)->forall = contacts_row_real_forall_internal;
	GTK_WIDGET_CLASS (klass)->compute_expand = contacts_row_real_compute_expand_internal;
	GTK_CONTAINER_CLASS (klass)->child_type = contacts_row_real_child_type;
	GTK_WIDGET_CLASS (klass)->get_request_mode = contacts_row_real_get_request_mode;
	GTK_WIDGET_CLASS (klass)->get_preferred_height = contacts_row_real_get_preferred_height;
	GTK_WIDGET_CLASS (klass)->get_preferred_height_for_width = contacts_row_real_get_preferred_height_for_width;
	GTK_WIDGET_CLASS (klass)->get_preferred_width = contacts_row_real_get_preferred_width;
	GTK_WIDGET_CLASS (klass)->get_preferred_width_for_height = contacts_row_real_get_preferred_width_for_height;
	GTK_WIDGET_CLASS (klass)->size_allocate = contacts_row_real_size_allocate;
	G_OBJECT_CLASS (klass)->finalize = contacts_row_finalize;
}


static void contacts_row_instance_init (ContactsRow * self) {
	self->priv = CONTACTS_ROW_GET_PRIVATE (self);
}


static void contacts_row_finalize (GObject* obj) {
	ContactsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_ROW, ContactsRow);
	_g_object_unref0 (self->event_window);
	_g_object_unref0 (self->priv->group);
	self->priv->row_children = (_vala_ContactsRowChild_array_free (self->priv->row_children, self->priv->row_children_length1 * self->priv->row_children_length2), NULL);
	G_OBJECT_CLASS (contacts_row_parent_class)->finalize (obj);
}


GType contacts_row_get_type (void) {
	static volatile gsize contacts_row_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_row_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsRow), 0, (GInstanceInitFunc) contacts_row_instance_init, NULL };
		GType contacts_row_type_id;
		contacts_row_type_id = g_type_register_static (GTK_TYPE_CONTAINER, "ContactsRow", &g_define_type_info, 0);
		g_once_init_leave (&contacts_row_type_id__volatile, contacts_row_type_id);
	}
	return contacts_row_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



