/* game-view.c generated by valac 0.16.0, the Vala compiler
 * generated from game-view.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <clutter/clutter.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>
#include <gobject/gvaluecollector.h>


#define TYPE_GAME_VIEW (game_view_get_type ())
#define GAME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAME_VIEW, GameView))
#define GAME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAME_VIEW, GameViewClass))
#define IS_GAME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAME_VIEW))
#define IS_GAME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAME_VIEW))
#define GAME_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAME_VIEW, GameViewClass))

typedef struct _GameView GameView;
typedef struct _GameViewClass GameViewClass;
typedef struct _GameViewPrivate GameViewPrivate;

#define TYPE_TILE_ACTOR (tile_actor_get_type ())
#define TILE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TILE_ACTOR, TileActor))
#define TILE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TILE_ACTOR, TileActorClass))
#define IS_TILE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TILE_ACTOR))
#define IS_TILE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TILE_ACTOR))
#define TILE_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TILE_ACTOR, TileActorClass))

typedef struct _TileActor TileActor;
typedef struct _TileActorClass TileActorClass;

#define TYPE_CURSOR_ACTOR (cursor_actor_get_type ())
#define CURSOR_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CURSOR_ACTOR, CursorActor))
#define CURSOR_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CURSOR_ACTOR, CursorActorClass))
#define IS_CURSOR_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CURSOR_ACTOR))
#define IS_CURSOR_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CURSOR_ACTOR))
#define CURSOR_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CURSOR_ACTOR, CursorActorClass))

typedef struct _CursorActor CursorActor;
typedef struct _CursorActorClass CursorActorClass;

#define TYPE_GAME (game_get_type ())
#define GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAME, Game))
#define GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAME, GameClass))
#define IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAME))
#define IS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAME))
#define GAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAME, GameClass))

typedef struct _Game Game;
typedef struct _GameClass GameClass;

#define TYPE_THEME (theme_get_type ())
#define THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THEME, Theme))
#define THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THEME, ThemeClass))
#define IS_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THEME))
#define IS_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THEME))
#define THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THEME, ThemeClass))

typedef struct _Theme Theme;
typedef struct _ThemeClass ThemeClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _theme_unref0(var) ((var == NULL) ? NULL : (var = (theme_unref (var), NULL)))

#define TYPE_TILE (tile_get_type ())
#define TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TILE, Tile))
#define TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TILE, TileClass))
#define IS_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TILE))
#define IS_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TILE))
#define TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TILE, TileClass))

typedef struct _Tile Tile;
typedef struct _TileClass TileClass;
#define _tile_unref0(var) ((var == NULL) ? NULL : (var = (tile_unref (var), NULL)))
typedef struct _ThemePrivate ThemePrivate;
typedef struct _TilePrivate TilePrivate;
typedef struct _TileActorPrivate TileActorPrivate;
#define __g_list_free__tile_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__tile_unref0_ (var), NULL)))

#define TYPE_SCORE_ACTOR (score_actor_get_type ())
#define SCORE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCORE_ACTOR, ScoreActor))
#define SCORE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SCORE_ACTOR, ScoreActorClass))
#define IS_SCORE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SCORE_ACTOR))
#define IS_SCORE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SCORE_ACTOR))
#define SCORE_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SCORE_ACTOR, ScoreActorClass))

typedef struct _ScoreActor ScoreActor;
typedef struct _ScoreActorClass ScoreActorClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ParamSpecTheme ParamSpecTheme;
typedef struct _CursorActorPrivate CursorActorPrivate;
typedef struct _ScoreActorPrivate ScoreActorPrivate;

struct _GameView {
	ClutterGroup parent_instance;
	GameViewPrivate * priv;
	gboolean is_zealous;
};

struct _GameViewClass {
	ClutterGroupClass parent_class;
};

struct _GameViewPrivate {
	TileActor* highlighted;
	CursorActor* cursor;
	gboolean cursor_active;
	gint _cursor_x;
	gint _cursor_y;
	TileActor** tiles;
	gint tiles_length1;
	gint tiles_length2;
	ClutterGroup* game_actors;
	Game* _game;
	GHashTable* themes;
	gchar* _theme_name;
	gint tile_size;
};

struct _Theme {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ThemePrivate * priv;
	ClutterTexture** textures;
	gint textures_length1;
	ClutterTexture* cursor;
};

struct _ThemeClass {
	GTypeClass parent_class;
	void (*finalize) (Theme *self);
};

struct _Tile {
	GTypeInstance parent_instance;
	volatile int ref_count;
	TilePrivate * priv;
	gint grid_x;
	gint grid_y;
	gint color;
	gboolean visited;
};

struct _TileClass {
	GTypeClass parent_class;
	void (*finalize) (Tile *self);
};

struct _TileActor {
	ClutterClone parent_instance;
	TileActorPrivate * priv;
	Tile* tile;
};

struct _TileActorClass {
	ClutterCloneClass parent_class;
};

struct _ParamSpecTheme {
	GParamSpec parent_instance;
};

struct _CursorActor {
	ClutterClone parent_instance;
	CursorActorPrivate * priv;
};

struct _CursorActorClass {
	ClutterCloneClass parent_class;
};

struct _ScoreActor {
	ClutterGroup parent_instance;
	ScoreActorPrivate * priv;
};

struct _ScoreActorClass {
	ClutterGroupClass parent_class;
};

struct _ScoreActorPrivate {
	ClutterText* label;
	gfloat scene_width;
	gfloat scene_height;
};


static gpointer game_view_parent_class = NULL;
static gpointer theme_parent_class = NULL;
static gpointer tile_actor_parent_class = NULL;
static gpointer cursor_actor_parent_class = NULL;
static gpointer score_actor_parent_class = NULL;

GType game_view_get_type (void) G_GNUC_CONST;
GType tile_actor_get_type (void) G_GNUC_CONST;
GType cursor_actor_get_type (void) G_GNUC_CONST;
GType game_get_type (void) G_GNUC_CONST;
gpointer theme_ref (gpointer instance);
void theme_unref (gpointer instance);
GParamSpec* param_spec_theme (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_theme (GValue* value, gpointer v_object);
void value_take_theme (GValue* value, gpointer v_object);
gpointer value_get_theme (const GValue* value);
GType theme_get_type (void) G_GNUC_CONST;
#define GAME_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_GAME_VIEW, GameViewPrivate))
enum  {
	GAME_VIEW_DUMMY_PROPERTY,
	GAME_VIEW_CURSOR_X,
	GAME_VIEW_CURSOR_Y,
	GAME_VIEW_GAME,
	GAME_VIEW_THEME_NAME
};
static void game_view_remove_tiles (GameView* self);
Game* game_view_get_game (GameView* self);
gint game_get_columns (Game* self);
gint game_get_rows (Game* self);
static void game_view_place_tiles (GameView* self);
const gchar* game_view_get_theme_name (GameView* self);
gpointer tile_ref (gpointer instance);
void tile_unref (gpointer instance);
GParamSpec* param_spec_tile (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_tile (GValue* value, gpointer v_object);
void value_take_tile (GValue* value, gpointer v_object);
gpointer value_get_tile (const GValue* value);
GType tile_get_type (void) G_GNUC_CONST;
Tile* game_get_tile (Game* self, gint x, gint y);
gboolean tile_get_closed (Tile* self);
TileActor* tile_actor_new (Tile* tile, ClutterTexture* texture, gint size);
TileActor* tile_actor_construct (GType object_type, Tile* tile, ClutterTexture* texture, gint size);
void game_view_move_cb (GameView* self, gint old_x, gint old_y, gint new_x, gint new_y);
static void _game_view_move_cb_tile_move (Tile* _sender, gint old_x, gint old_y, gint new_x, gint new_y, gpointer self);
void game_view_close_cb (GameView* self, gint grid_x, gint grid_y);
static void _game_view_close_cb_tile_close (Tile* _sender, gint grid_x, gint grid_y, gpointer self);
static gboolean game_view_remove_region_cb (GameView* self, ClutterActor* actor, ClutterButtonEvent* event);
static gboolean _game_view_remove_region_cb_clutter_actor_button_release_event (ClutterActor* _sender, ClutterButtonEvent* event, gpointer self);
static gboolean game_view_tile_entered_cb (GameView* self, ClutterActor* actor, ClutterCrossingEvent* event);
static gboolean _game_view_tile_entered_cb_clutter_actor_enter_event (ClutterActor* _sender, ClutterCrossingEvent* event, gpointer self);
static gboolean game_view_tile_left_cb (GameView* self, ClutterActor* actor, ClutterCrossingEvent* event);
static gboolean _game_view_tile_left_cb_clutter_actor_leave_event (ClutterActor* _sender, ClutterCrossingEvent* event, gpointer self);
CursorActor* cursor_actor_new (ClutterTexture* texture, gint size);
CursorActor* cursor_actor_construct (GType object_type, ClutterTexture* texture, gint size);
GameView* game_view_new (void);
GameView* game_view_construct (GType object_type);
static void _g_free0_ (gpointer var);
static void _theme_unref0_ (gpointer var);
Theme* theme_new (const gchar* name);
Theme* theme_construct (GType object_type, const gchar* name);
void tile_actor_animate_out (TileActor* self);
void tile_actor_animate_to (TileActor* self, gdouble new_x, gdouble new_y, gboolean is_zealous);
static void game_view_opacity_for_connected_tiles (GameView* self, TileActor* actor, gint opacity);
GList* game_connected_tiles (Game* self, Tile* li);
static void _tile_unref0_ (gpointer var);
static void _g_list_free__tile_unref0_ (GList* self);
void game_view_set_cursor_x (GameView* self, gint value);
void game_view_set_cursor_y (GameView* self, gint value);
gboolean game_remove_connected_tiles (Game* self, Tile* tile);
gboolean game_view_board_left_cb (GameView* self);
void game_reset_visit (Game* self);
void game_view_cursor_move (GameView* self, gint x, gint y);
gint game_view_get_cursor_x (GameView* self);
gint game_view_get_cursor_y (GameView* self);
void game_view_cursor_click (GameView* self);
void game_view_update_score_cb (GameView* self, gint points_awarded);
ScoreActor* score_actor_new (gdouble x, gdouble y, gdouble width, gdouble height);
ScoreActor* score_actor_construct (GType object_type, gdouble x, gdouble y, gdouble width, gdouble height);
GType score_actor_get_type (void) G_GNUC_CONST;
void score_actor_animate_score (ScoreActor* self, gint points);
void game_view_game_complete_cb (GameView* self);
void score_actor_animate_final_score (ScoreActor* self, guint points);
gint game_get_score (Game* self);
void game_view_set_game (GameView* self, Game* value);
static void _game_view_game_complete_cb_game_complete (Game* _sender, gpointer self);
static void _game_view_update_score_cb_game_update_score (Game* _sender, gint points_awarded, gpointer self);
void game_view_set_theme_name (GameView* self, const gchar* value);
static void game_view_finalize (GObject* obj);
static void _vala_game_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_game_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
enum  {
	THEME_DUMMY_PROPERTY
};
static void theme_finalize (Theme* obj);
enum  {
	TILE_ACTOR_DUMMY_PROPERTY
};
static void tile_actor_hide_tile_cb (TileActor* self);
static void _tile_actor_hide_tile_cb_clutter_timeline_completed (ClutterTimeline* _sender, gpointer self);
static void tile_actor_finalize (GObject* obj);
enum  {
	CURSOR_ACTOR_DUMMY_PROPERTY
};
#define SCORE_ACTOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SCORE_ACTOR, ScoreActorPrivate))
enum  {
	SCORE_ACTOR_DUMMY_PROPERTY
};
static void __lambda2_ (ScoreActor* self);
static void ___lambda2__clutter_timeline_completed (ClutterTimeline* _sender, gpointer self);
static void score_actor_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);


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


static void game_view_remove_tiles (GameView* self) {
	Game* _tmp0_;
	Game* _tmp1_;
	CursorActor* _tmp30_;
	g_return_if_fail (self != NULL);
	_tmp0_ = game_view_get_game (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	{
		gint x;
		x = 0;
		{
			gboolean _tmp2_;
			_tmp2_ = TRUE;
			while (TRUE) {
				gboolean _tmp3_;
				gint _tmp5_;
				Game* _tmp6_;
				Game* _tmp7_;
				gint _tmp8_;
				gint _tmp9_;
				_tmp3_ = _tmp2_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = x;
					x = _tmp4_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp5_ = x;
				_tmp6_ = game_view_get_game (self);
				_tmp7_ = _tmp6_;
				_tmp8_ = game_get_columns (_tmp7_);
				_tmp9_ = _tmp8_;
				if (!(_tmp5_ < _tmp9_)) {
					break;
				}
				{
					gint y;
					y = 0;
					{
						gboolean _tmp10_;
						_tmp10_ = TRUE;
						while (TRUE) {
							gboolean _tmp11_;
							gint _tmp13_;
							Game* _tmp14_;
							Game* _tmp15_;
							gint _tmp16_;
							gint _tmp17_;
							TileActor** _tmp18_;
							gint _tmp18__length1;
							gint _tmp18__length2;
							gint _tmp19_;
							gint _tmp20_;
							TileActor* _tmp21_;
							TileActor* _tmp22_;
							TileActor* tile;
							TileActor* _tmp23_;
							TileActor** _tmp24_;
							gint _tmp24__length1;
							gint _tmp24__length2;
							gint _tmp25_;
							gint _tmp26_;
							TileActor* _tmp27_;
							TileActor* _tmp28_;
							TileActor* _tmp29_;
							_tmp11_ = _tmp10_;
							if (!_tmp11_) {
								gint _tmp12_;
								_tmp12_ = y;
								y = _tmp12_ + 1;
							}
							_tmp10_ = FALSE;
							_tmp13_ = y;
							_tmp14_ = game_view_get_game (self);
							_tmp15_ = _tmp14_;
							_tmp16_ = game_get_rows (_tmp15_);
							_tmp17_ = _tmp16_;
							if (!(_tmp13_ < _tmp17_)) {
								break;
							}
							_tmp18_ = self->priv->tiles;
							_tmp18__length1 = self->priv->tiles_length1;
							_tmp18__length2 = self->priv->tiles_length2;
							_tmp19_ = x;
							_tmp20_ = y;
							_tmp21_ = _tmp18_[(_tmp19_ * _tmp18__length2) + _tmp20_];
							_tmp22_ = _g_object_ref0 (_tmp21_);
							tile = _tmp22_;
							_tmp23_ = tile;
							if (_tmp23_ == NULL) {
								_g_object_unref0 (tile);
								continue;
							}
							_tmp24_ = self->priv->tiles;
							_tmp24__length1 = self->priv->tiles_length1;
							_tmp24__length2 = self->priv->tiles_length2;
							_tmp25_ = x;
							_tmp26_ = y;
							_g_object_unref0 (_tmp24_[(_tmp25_ * _tmp24__length2) + _tmp26_]);
							_tmp24_[(_tmp25_ * _tmp24__length2) + _tmp26_] = NULL;
							_tmp27_ = _tmp24_[(_tmp25_ * _tmp24__length2) + _tmp26_];
							_tmp28_ = tile;
							g_signal_handlers_disconnect_matched (_tmp28_, G_SIGNAL_MATCH_DATA, (guint) 0, (GQuark) 0, NULL, NULL, self);
							_tmp29_ = tile;
							clutter_actor_destroy ((ClutterActor*) _tmp29_);
							_g_object_unref0 (tile);
						}
					}
				}
			}
		}
	}
	_tmp30_ = self->priv->cursor;
	clutter_actor_destroy ((ClutterActor*) _tmp30_);
}


static gpointer _theme_ref0 (gpointer self) {
	return self ? theme_ref (self) : NULL;
}


static void _game_view_move_cb_tile_move (Tile* _sender, gint old_x, gint old_y, gint new_x, gint new_y, gpointer self) {
	game_view_move_cb (self, old_x, old_y, new_x, new_y);
}


static void _game_view_close_cb_tile_close (Tile* _sender, gint grid_x, gint grid_y, gpointer self) {
	game_view_close_cb (self, grid_x, grid_y);
}


static gboolean _game_view_remove_region_cb_clutter_actor_button_release_event (ClutterActor* _sender, ClutterButtonEvent* event, gpointer self) {
	gboolean result;
	result = game_view_remove_region_cb (self, _sender, event);
	return result;
}


static gboolean _game_view_tile_entered_cb_clutter_actor_enter_event (ClutterActor* _sender, ClutterCrossingEvent* event, gpointer self) {
	gboolean result;
	result = game_view_tile_entered_cb (self, _sender, event);
	return result;
}


static gboolean _game_view_tile_left_cb_clutter_actor_leave_event (ClutterActor* _sender, ClutterCrossingEvent* event, gpointer self) {
	gboolean result;
	result = game_view_tile_left_cb (self, _sender, event);
	return result;
}


static void game_view_place_tiles (GameView* self) {
	Game* _tmp0_;
	Game* _tmp1_;
	GHashTable* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gconstpointer _tmp5_ = NULL;
	Theme* _tmp6_;
	Theme* theme;
	Theme* _tmp7_;
	Theme* _tmp74_;
	ClutterTexture* _tmp75_;
	gint _tmp76_;
	CursorActor* _tmp77_;
	CursorActor* _tmp78_;
	ClutterGroup* _tmp79_;
	CursorActor* _tmp80_;
	CursorActor* _tmp81_;
	g_return_if_fail (self != NULL);
	_tmp0_ = game_view_get_game (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = self->priv->themes;
	_tmp3_ = game_view_get_theme_name (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_hash_table_lookup (_tmp2_, _tmp4_);
	_tmp6_ = _theme_ref0 ((Theme*) _tmp5_);
	theme = _tmp6_;
	_tmp7_ = theme;
	if (_tmp7_ == NULL) {
		GHashTable* _tmp8_;
		gconstpointer _tmp9_ = NULL;
		Theme* _tmp10_;
		_tmp8_ = self->priv->themes;
		_tmp9_ = g_hash_table_lookup (_tmp8_, "shapesandcolors");
		_tmp10_ = _theme_ref0 ((Theme*) _tmp9_);
		_theme_unref0 (theme);
		theme = _tmp10_;
	}
	{
		gint x;
		x = 0;
		{
			gboolean _tmp11_;
			_tmp11_ = TRUE;
			while (TRUE) {
				gboolean _tmp12_;
				gint _tmp14_;
				Game* _tmp15_;
				Game* _tmp16_;
				gint _tmp17_;
				gint _tmp18_;
				_tmp12_ = _tmp11_;
				if (!_tmp12_) {
					gint _tmp13_;
					_tmp13_ = x;
					x = _tmp13_ + 1;
				}
				_tmp11_ = FALSE;
				_tmp14_ = x;
				_tmp15_ = game_view_get_game (self);
				_tmp16_ = _tmp15_;
				_tmp17_ = game_get_columns (_tmp16_);
				_tmp18_ = _tmp17_;
				if (!(_tmp14_ < _tmp18_)) {
					break;
				}
				{
					gint y;
					y = 0;
					{
						gboolean _tmp19_;
						_tmp19_ = TRUE;
						while (TRUE) {
							gboolean _tmp20_;
							gint _tmp22_;
							Game* _tmp23_;
							Game* _tmp24_;
							gint _tmp25_;
							gint _tmp26_;
							Game* _tmp27_;
							Game* _tmp28_;
							gint _tmp29_;
							gint _tmp30_;
							Tile* _tmp31_ = NULL;
							Tile* l;
							gboolean _tmp32_ = FALSE;
							Tile* _tmp33_;
							gboolean _tmp37_;
							Tile* _tmp38_;
							Theme* _tmp39_;
							ClutterTexture** _tmp40_;
							gint _tmp40__length1;
							Tile* _tmp41_;
							gint _tmp42_;
							ClutterTexture* _tmp43_;
							gint _tmp44_;
							TileActor* _tmp45_;
							TileActor* _tmp46_;
							TileActor* tile;
							Tile* _tmp47_;
							Tile* _tmp48_;
							gfloat xx = 0.0F;
							gfloat yy = 0.0F;
							gint _tmp49_;
							gint _tmp50_;
							gint _tmp51_;
							Game* _tmp52_;
							Game* _tmp53_;
							gint _tmp54_;
							gint _tmp55_;
							gint _tmp56_;
							gint _tmp57_;
							gint _tmp58_;
							TileActor* _tmp59_;
							gfloat _tmp60_;
							gfloat _tmp61_;
							TileActor* _tmp62_;
							TileActor* _tmp63_;
							TileActor* _tmp64_;
							TileActor* _tmp65_;
							TileActor** _tmp66_;
							gint _tmp66__length1;
							gint _tmp66__length2;
							gint _tmp67_;
							gint _tmp68_;
							TileActor* _tmp69_;
							TileActor* _tmp70_;
							TileActor* _tmp71_;
							ClutterGroup* _tmp72_;
							TileActor* _tmp73_;
							_tmp20_ = _tmp19_;
							if (!_tmp20_) {
								gint _tmp21_;
								_tmp21_ = y;
								y = _tmp21_ + 1;
							}
							_tmp19_ = FALSE;
							_tmp22_ = y;
							_tmp23_ = game_view_get_game (self);
							_tmp24_ = _tmp23_;
							_tmp25_ = game_get_rows (_tmp24_);
							_tmp26_ = _tmp25_;
							if (!(_tmp22_ < _tmp26_)) {
								break;
							}
							_tmp27_ = game_view_get_game (self);
							_tmp28_ = _tmp27_;
							_tmp29_ = x;
							_tmp30_ = y;
							_tmp31_ = game_get_tile (_tmp28_, _tmp29_, _tmp30_);
							l = _tmp31_;
							_tmp33_ = l;
							if (_tmp33_ == NULL) {
								_tmp32_ = TRUE;
							} else {
								Tile* _tmp34_;
								gboolean _tmp35_;
								gboolean _tmp36_;
								_tmp34_ = l;
								_tmp35_ = tile_get_closed (_tmp34_);
								_tmp36_ = _tmp35_;
								_tmp32_ = _tmp36_;
							}
							_tmp37_ = _tmp32_;
							if (_tmp37_) {
								_tile_unref0 (l);
								continue;
							}
							_tmp38_ = l;
							_tmp39_ = theme;
							_tmp40_ = _tmp39_->textures;
							_tmp40__length1 = _tmp39_->textures_length1;
							_tmp41_ = l;
							_tmp42_ = _tmp41_->color;
							_tmp43_ = _tmp40_[_tmp42_];
							_tmp44_ = self->priv->tile_size;
							_tmp45_ = tile_actor_new (_tmp38_, _tmp43_, _tmp44_);
							_tmp46_ = g_object_ref_sink (_tmp45_);
							tile = _tmp46_;
							_tmp47_ = l;
							g_signal_connect_object (_tmp47_, "move", (GCallback) _game_view_move_cb_tile_move, self, 0);
							_tmp48_ = l;
							g_signal_connect_object (_tmp48_, "close", (GCallback) _game_view_close_cb_tile_close, self, 0);
							_tmp49_ = x;
							_tmp50_ = self->priv->tile_size;
							_tmp51_ = self->priv->tile_size;
							xx = (gfloat) ((_tmp49_ * _tmp50_) + (_tmp51_ / 2));
							_tmp52_ = game_view_get_game (self);
							_tmp53_ = _tmp52_;
							_tmp54_ = game_get_rows (_tmp53_);
							_tmp55_ = _tmp54_;
							_tmp56_ = y;
							_tmp57_ = self->priv->tile_size;
							_tmp58_ = self->priv->tile_size;
							yy = (gfloat) ((((_tmp55_ - _tmp56_) - 1) * _tmp57_) + (_tmp58_ / 2));
							_tmp59_ = tile;
							_tmp60_ = xx;
							_tmp61_ = yy;
							clutter_actor_set_position ((ClutterActor*) _tmp59_, _tmp60_, _tmp61_);
							_tmp62_ = tile;
							clutter_actor_set_reactive ((ClutterActor*) _tmp62_, TRUE);
							_tmp63_ = tile;
							g_signal_connect_object ((ClutterActor*) _tmp63_, "button-release-event", (GCallback) _game_view_remove_region_cb_clutter_actor_button_release_event, self, 0);
							_tmp64_ = tile;
							g_signal_connect_object ((ClutterActor*) _tmp64_, "enter-event", (GCallback) _game_view_tile_entered_cb_clutter_actor_enter_event, self, 0);
							_tmp65_ = tile;
							g_signal_connect_object ((ClutterActor*) _tmp65_, "leave-event", (GCallback) _game_view_tile_left_cb_clutter_actor_leave_event, self, 0);
							_tmp66_ = self->priv->tiles;
							_tmp66__length1 = self->priv->tiles_length1;
							_tmp66__length2 = self->priv->tiles_length2;
							_tmp67_ = x;
							_tmp68_ = y;
							_tmp69_ = tile;
							_tmp70_ = _g_object_ref0 (_tmp69_);
							_g_object_unref0 (_tmp66_[(_tmp67_ * _tmp66__length2) + _tmp68_]);
							_tmp66_[(_tmp67_ * _tmp66__length2) + _tmp68_] = _tmp70_;
							_tmp71_ = _tmp66_[(_tmp67_ * _tmp66__length2) + _tmp68_];
							_tmp72_ = self->priv->game_actors;
							_tmp73_ = tile;
							clutter_container_add_actor ((ClutterContainer*) _tmp72_, (ClutterActor*) _tmp73_);
							_g_object_unref0 (tile);
							_tile_unref0 (l);
						}
					}
				}
			}
		}
	}
	_tmp74_ = theme;
	_tmp75_ = _tmp74_->cursor;
	_tmp76_ = self->priv->tile_size;
	_tmp77_ = cursor_actor_new (_tmp75_, _tmp76_);
	_tmp78_ = g_object_ref_sink (_tmp77_);
	_g_object_unref0 (self->priv->cursor);
	self->priv->cursor = _tmp78_;
	_tmp79_ = self->priv->game_actors;
	_tmp80_ = self->priv->cursor;
	clutter_container_add_actor ((ClutterContainer*) _tmp79_, (ClutterActor*) _tmp80_);
	_tmp81_ = self->priv->cursor;
	clutter_actor_hide ((ClutterActor*) _tmp81_);
	_theme_unref0 (theme);
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static void _theme_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (theme_unref (var), NULL));
}


GameView* game_view_construct (GType object_type) {
	GameView * self = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	Theme* _tmp3_;
	Theme* theme;
	GHashTable* _tmp4_;
	gchar* _tmp5_;
	Theme* _tmp6_;
	Theme* _tmp7_;
	Theme* _tmp8_;
	ClutterTexture** _tmp9_;
	gint _tmp9__length1;
	Theme* _tmp13_;
	ClutterTexture* _tmp14_;
	Theme* _tmp15_;
	ClutterTexture* _tmp16_;
	Theme* _tmp17_;
	GHashTable* _tmp18_;
	gchar* _tmp19_;
	Theme* _tmp20_;
	Theme* _tmp21_;
	Theme* _tmp22_;
	ClutterTexture** _tmp23_;
	gint _tmp23__length1;
	Theme* _tmp27_;
	ClutterTexture* _tmp28_;
	Theme* _tmp29_;
	ClutterTexture* _tmp30_;
	self = (GameView*) g_object_new (object_type, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _theme_unref0_);
	_g_hash_table_unref0 (self->priv->themes);
	self->priv->themes = _tmp2_;
	_tmp3_ = theme_new ("colors");
	theme = _tmp3_;
	_tmp4_ = self->priv->themes;
	_tmp5_ = g_strdup ("colors");
	_tmp6_ = theme;
	_tmp7_ = _theme_ref0 (_tmp6_);
	g_hash_table_insert (_tmp4_, _tmp5_, _tmp7_);
	_tmp8_ = theme;
	_tmp9_ = _tmp8_->textures;
	_tmp9__length1 = _tmp8_->textures_length1;
	{
		ClutterTexture** t_collection = NULL;
		gint t_collection_length1 = 0;
		gint _t_collection_size_ = 0;
		gint t_it = 0;
		t_collection = _tmp9_;
		t_collection_length1 = _tmp9__length1;
		for (t_it = 0; t_it < _tmp9__length1; t_it = t_it + 1) {
			ClutterTexture* _tmp10_;
			ClutterTexture* t = NULL;
			_tmp10_ = _g_object_ref0 (t_collection[t_it]);
			t = _tmp10_;
			{
				ClutterTexture* _tmp11_;
				ClutterTexture* _tmp12_;
				_tmp11_ = t;
				clutter_actor_hide ((ClutterActor*) _tmp11_);
				_tmp12_ = t;
				clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) _tmp12_);
				_g_object_unref0 (t);
			}
		}
	}
	_tmp13_ = theme;
	_tmp14_ = _tmp13_->cursor;
	clutter_actor_hide ((ClutterActor*) _tmp14_);
	_tmp15_ = theme;
	_tmp16_ = _tmp15_->cursor;
	clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) _tmp16_);
	_tmp17_ = theme_new ("shapesandcolors");
	_theme_unref0 (theme);
	theme = _tmp17_;
	_tmp18_ = self->priv->themes;
	_tmp19_ = g_strdup ("shapesandcolors");
	_tmp20_ = theme;
	_tmp21_ = _theme_ref0 (_tmp20_);
	g_hash_table_insert (_tmp18_, _tmp19_, _tmp21_);
	_tmp22_ = theme;
	_tmp23_ = _tmp22_->textures;
	_tmp23__length1 = _tmp22_->textures_length1;
	{
		ClutterTexture** t_collection = NULL;
		gint t_collection_length1 = 0;
		gint _t_collection_size_ = 0;
		gint t_it = 0;
		t_collection = _tmp23_;
		t_collection_length1 = _tmp23__length1;
		for (t_it = 0; t_it < _tmp23__length1; t_it = t_it + 1) {
			ClutterTexture* _tmp24_;
			ClutterTexture* t = NULL;
			_tmp24_ = _g_object_ref0 (t_collection[t_it]);
			t = _tmp24_;
			{
				ClutterTexture* _tmp25_;
				ClutterTexture* _tmp26_;
				_tmp25_ = t;
				clutter_actor_hide ((ClutterActor*) _tmp25_);
				_tmp26_ = t;
				clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) _tmp26_);
				_g_object_unref0 (t);
			}
		}
	}
	_tmp27_ = theme;
	_tmp28_ = _tmp27_->cursor;
	clutter_actor_hide ((ClutterActor*) _tmp28_);
	_tmp29_ = theme;
	_tmp30_ = _tmp29_->cursor;
	clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) _tmp30_);
	_theme_unref0 (theme);
	return self;
}


GameView* game_view_new (void) {
	return game_view_construct (TYPE_GAME_VIEW);
}


void game_view_close_cb (GameView* self, gint grid_x, gint grid_y) {
	TileActor** _tmp0_;
	gint _tmp0__length1;
	gint _tmp0__length2;
	gint _tmp1_;
	gint _tmp2_;
	TileActor* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tiles;
	_tmp0__length1 = self->priv->tiles_length1;
	_tmp0__length2 = self->priv->tiles_length2;
	_tmp1_ = grid_x;
	_tmp2_ = grid_y;
	_tmp3_ = _tmp0_[(_tmp1_ * _tmp0__length2) + _tmp2_];
	tile_actor_animate_out (_tmp3_);
}


void game_view_move_cb (GameView* self, gint old_x, gint old_y, gint new_x, gint new_y) {
	TileActor** _tmp0_;
	gint _tmp0__length1;
	gint _tmp0__length2;
	gint _tmp1_;
	gint _tmp2_;
	TileActor* _tmp3_;
	TileActor* _tmp4_;
	TileActor* tile;
	TileActor** _tmp5_;
	gint _tmp5__length1;
	gint _tmp5__length2;
	gint _tmp6_;
	gint _tmp7_;
	TileActor* _tmp8_;
	TileActor* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gdouble new_xx;
	Game* _tmp13_;
	Game* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	gdouble new_yy;
	gboolean _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tiles;
	_tmp0__length1 = self->priv->tiles_length1;
	_tmp0__length2 = self->priv->tiles_length2;
	_tmp1_ = old_x;
	_tmp2_ = old_y;
	_tmp3_ = _tmp0_[(_tmp1_ * _tmp0__length2) + _tmp2_];
	_tmp4_ = _g_object_ref0 (_tmp3_);
	tile = _tmp4_;
	_tmp5_ = self->priv->tiles;
	_tmp5__length1 = self->priv->tiles_length1;
	_tmp5__length2 = self->priv->tiles_length2;
	_tmp6_ = new_x;
	_tmp7_ = new_y;
	_tmp8_ = _g_object_ref0 (tile);
	_g_object_unref0 (_tmp5_[(_tmp6_ * _tmp5__length2) + _tmp7_]);
	_tmp5_[(_tmp6_ * _tmp5__length2) + _tmp7_] = _tmp8_;
	_tmp9_ = _tmp5_[(_tmp6_ * _tmp5__length2) + _tmp7_];
	_tmp10_ = new_x;
	_tmp11_ = self->priv->tile_size;
	_tmp12_ = self->priv->tile_size;
	new_xx = (_tmp10_ * _tmp11_) + (_tmp12_ / 2.0);
	_tmp13_ = game_view_get_game (self);
	_tmp14_ = _tmp13_;
	_tmp15_ = game_get_rows (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = new_y;
	_tmp18_ = self->priv->tile_size;
	_tmp19_ = self->priv->tile_size;
	new_yy = (((_tmp16_ - _tmp17_) - 1) * _tmp18_) + (_tmp19_ / 2.0);
	_tmp20_ = self->is_zealous;
	tile_actor_animate_to (tile, new_xx, new_yy, _tmp20_);
	_g_object_unref0 (tile);
}


static gpointer _tile_ref0 (gpointer self) {
	return self ? tile_ref (self) : NULL;
}


static void _tile_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (tile_unref (var), NULL));
}


static void _g_list_free__tile_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _tile_unref0_, NULL);
	g_list_free (self);
}


static void game_view_opacity_for_connected_tiles (GameView* self, TileActor* actor, gint opacity) {
	TileActor* _tmp0_;
	Game* _tmp1_;
	Game* _tmp2_;
	TileActor* _tmp3_;
	Tile* _tmp4_;
	GList* _tmp5_ = NULL;
	GList* connected_tiles;
	GList* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = actor;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = game_view_get_game (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = actor;
	_tmp4_ = _tmp3_->tile;
	_tmp5_ = game_connected_tiles (_tmp2_, _tmp4_);
	connected_tiles = _tmp5_;
	_tmp6_ = connected_tiles;
	{
		GList* l_collection = NULL;
		GList* l_it = NULL;
		l_collection = _tmp6_;
		for (l_it = l_collection; l_it != NULL; l_it = l_it->next) {
			Tile* _tmp7_;
			Tile* l = NULL;
			_tmp7_ = _tile_ref0 ((Tile*) l_it->data);
			l = _tmp7_;
			{
				TileActor** _tmp8_;
				gint _tmp8__length1;
				gint _tmp8__length2;
				Tile* _tmp9_;
				gint _tmp10_;
				Tile* _tmp11_;
				gint _tmp12_;
				TileActor* _tmp13_;
				gint _tmp14_;
				_tmp8_ = self->priv->tiles;
				_tmp8__length1 = self->priv->tiles_length1;
				_tmp8__length2 = self->priv->tiles_length2;
				_tmp9_ = l;
				_tmp10_ = _tmp9_->grid_x;
				_tmp11_ = l;
				_tmp12_ = _tmp11_->grid_y;
				_tmp13_ = _tmp8_[(_tmp10_ * _tmp8__length2) + _tmp12_];
				_tmp14_ = opacity;
				clutter_actor_set_opacity ((ClutterActor*) _tmp13_, (guint) _tmp14_);
				_tile_unref0 (l);
			}
		}
	}
	__g_list_free__tile_unref0_0 (connected_tiles);
}


static gboolean game_view_tile_entered_cb (GameView* self, ClutterActor* actor, ClutterCrossingEvent* event) {
	gboolean result = FALSE;
	gboolean _tmp0_;
	ClutterActor* _tmp1_;
	TileActor* _tmp2_;
	TileActor* tile;
	TileActor* _tmp3_;
	TileActor* _tmp4_;
	TileActor* _tmp5_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (actor != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->cursor_active;
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp1_ = actor;
	_tmp2_ = _g_object_ref0 (TILE_ACTOR (_tmp1_));
	tile = _tmp2_;
	_tmp3_ = tile;
	game_view_opacity_for_connected_tiles (self, _tmp3_, 255);
	_tmp4_ = tile;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (self->priv->highlighted);
	self->priv->highlighted = _tmp5_;
	result = FALSE;
	_g_object_unref0 (tile);
	return result;
}


static gboolean game_view_tile_left_cb (GameView* self, ClutterActor* actor, ClutterCrossingEvent* event) {
	gboolean result = FALSE;
	gboolean _tmp0_;
	ClutterActor* _tmp1_;
	TileActor* _tmp2_;
	TileActor* tile;
	TileActor* _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (actor != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->cursor_active;
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp1_ = actor;
	_tmp2_ = _g_object_ref0 (TILE_ACTOR (_tmp1_));
	tile = _tmp2_;
	_tmp3_ = tile;
	game_view_opacity_for_connected_tiles (self, _tmp3_, 180);
	result = FALSE;
	_g_object_unref0 (tile);
	return result;
}


static gboolean game_view_remove_region_cb (GameView* self, ClutterActor* actor, ClutterButtonEvent* event) {
	gboolean result = FALSE;
	ClutterActor* _tmp0_;
	TileActor* _tmp1_;
	TileActor* tile;
	TileActor* _tmp2_;
	gboolean _tmp3_;
	TileActor* _tmp5_;
	Tile* _tmp6_;
	gint _tmp7_;
	TileActor* _tmp8_;
	Tile* _tmp9_;
	gint _tmp10_;
	Game* _tmp11_;
	Game* _tmp12_;
	TileActor* _tmp13_;
	Tile* _tmp14_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (actor != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = actor;
	_tmp1_ = _g_object_ref0 (TILE_ACTOR (_tmp0_));
	tile = _tmp1_;
	_tmp2_ = self->priv->highlighted;
	game_view_opacity_for_connected_tiles (self, _tmp2_, 180);
	_tmp3_ = self->priv->cursor_active;
	if (_tmp3_) {
		CursorActor* _tmp4_;
		self->priv->cursor_active = FALSE;
		_tmp4_ = self->priv->cursor;
		clutter_actor_hide ((ClutterActor*) _tmp4_);
	}
	_tmp5_ = tile;
	_tmp6_ = _tmp5_->tile;
	_tmp7_ = _tmp6_->grid_x;
	game_view_set_cursor_x (self, _tmp7_);
	_tmp8_ = tile;
	_tmp9_ = _tmp8_->tile;
	_tmp10_ = _tmp9_->grid_y;
	game_view_set_cursor_y (self, _tmp10_);
	_tmp11_ = game_view_get_game (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = tile;
	_tmp14_ = _tmp13_->tile;
	game_remove_connected_tiles (_tmp12_, _tmp14_);
	result = FALSE;
	_g_object_unref0 (tile);
	return result;
}


gboolean game_view_board_left_cb (GameView* self) {
	gboolean result = FALSE;
	Game* _tmp0_;
	Game* _tmp1_;
	TileActor** _tmp2_;
	gint _tmp2__length1;
	gint _tmp2__length2;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = game_view_get_game (self);
	_tmp1_ = _tmp0_;
	game_reset_visit (_tmp1_);
	_tmp2_ = self->priv->tiles;
	_tmp2__length1 = self->priv->tiles_length1;
	_tmp2__length2 = self->priv->tiles_length2;
	{
		TileActor** tile_collection = NULL;
		gint tile_collection_length1 = 0;
		gint tile_collection_length2 = 0;
		gint tile_it = 0;
		tile_collection = _tmp2_;
		tile_collection_length1 = _tmp2__length1 * _tmp2__length2;
		for (tile_it = 0; tile_it < (_tmp2__length1 * _tmp2__length2); tile_it = tile_it + 1) {
			TileActor* _tmp3_;
			TileActor* tile = NULL;
			_tmp3_ = _g_object_ref0 (tile_collection[tile_it]);
			tile = _tmp3_;
			{
				TileActor* _tmp4_;
				_tmp4_ = tile;
				clutter_actor_set_opacity ((ClutterActor*) _tmp4_, (guint) 180);
				_g_object_unref0 (tile);
			}
		}
	}
	result = FALSE;
	return result;
}


void game_view_cursor_move (GameView* self, gint x, gint y) {
	TileActor* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	TileActor** _tmp7_;
	gint _tmp7__length1;
	gint _tmp7__length2;
	gint _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	TileActor* _tmp12_;
	TileActor* _tmp13_;
	TileActor* _tmp14_;
	gfloat xx = 0.0F;
	gfloat yy = 0.0F;
	gint _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	Game* _tmp19_;
	Game* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
	gint _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	CursorActor* _tmp27_;
	CursorActor* _tmp28_;
	g_return_if_fail (self != NULL);
	self->priv->cursor_active = TRUE;
	_tmp0_ = self->priv->highlighted;
	game_view_opacity_for_connected_tiles (self, _tmp0_, 180);
	_tmp1_ = game_view_get_cursor_x (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = x;
	game_view_set_cursor_x (self, _tmp2_ + _tmp3_);
	_tmp4_ = game_view_get_cursor_y (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = y;
	game_view_set_cursor_y (self, _tmp5_ + _tmp6_);
	_tmp7_ = self->priv->tiles;
	_tmp7__length1 = self->priv->tiles_length1;
	_tmp7__length2 = self->priv->tiles_length2;
	_tmp8_ = game_view_get_cursor_x (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = game_view_get_cursor_y (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp7_[(_tmp9_ * _tmp7__length2) + _tmp11_];
	_tmp13_ = _g_object_ref0 (_tmp12_);
	_g_object_unref0 (self->priv->highlighted);
	self->priv->highlighted = _tmp13_;
	_tmp14_ = self->priv->highlighted;
	game_view_opacity_for_connected_tiles (self, _tmp14_, 255);
	_tmp15_ = game_view_get_cursor_x (self);
	_tmp16_ = _tmp15_;
	_tmp17_ = self->priv->tile_size;
	_tmp18_ = self->priv->tile_size;
	xx = (gfloat) ((_tmp16_ * _tmp17_) + (_tmp18_ / 2));
	_tmp19_ = game_view_get_game (self);
	_tmp20_ = _tmp19_;
	_tmp21_ = game_get_rows (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = game_view_get_cursor_y (self);
	_tmp24_ = _tmp23_;
	_tmp25_ = self->priv->tile_size;
	_tmp26_ = self->priv->tile_size;
	yy = (gfloat) ((((_tmp22_ - 1) - _tmp24_) * _tmp25_) + (_tmp26_ / 2));
	_tmp27_ = self->priv->cursor;
	clutter_actor_set_position ((ClutterActor*) _tmp27_, xx, yy);
	_tmp28_ = self->priv->cursor;
	clutter_actor_show ((ClutterActor*) _tmp28_);
}


void game_view_cursor_click (GameView* self) {
	Game* _tmp0_;
	Game* _tmp1_;
	TileActor** _tmp2_;
	gint _tmp2__length1;
	gint _tmp2__length2;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	TileActor* _tmp7_;
	Tile* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = game_view_get_game (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->tiles;
	_tmp2__length1 = self->priv->tiles_length1;
	_tmp2__length2 = self->priv->tiles_length2;
	_tmp3_ = game_view_get_cursor_x (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = game_view_get_cursor_y (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp2_[(_tmp4_ * _tmp2__length2) + _tmp6_];
	_tmp8_ = _tmp7_->tile;
	game_remove_connected_tiles (_tmp1_, _tmp8_);
}


void game_view_update_score_cb (GameView* self, gint points_awarded) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->is_zealous;
	if (_tmp0_) {
		gfloat _tmp1_;
		gfloat _tmp2_;
		gfloat _tmp3_;
		gfloat _tmp4_;
		gfloat _tmp5_;
		gfloat _tmp6_;
		gfloat _tmp7_;
		gfloat _tmp8_;
		ScoreActor* _tmp9_;
		ScoreActor* _tmp10_;
		ScoreActor* text;
		ClutterGroup* _tmp11_;
		ScoreActor* _tmp12_;
		ScoreActor* _tmp13_;
		gint _tmp14_;
		_tmp1_ = clutter_actor_get_width ((ClutterActor*) self);
		_tmp2_ = _tmp1_;
		_tmp3_ = clutter_actor_get_height ((ClutterActor*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = clutter_actor_get_width ((ClutterActor*) self);
		_tmp6_ = _tmp5_;
		_tmp7_ = clutter_actor_get_height ((ClutterActor*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = score_actor_new (_tmp2_ / 2.0, _tmp4_ / 2.0, (gdouble) _tmp6_, (gdouble) _tmp8_);
		_tmp10_ = g_object_ref_sink (_tmp9_);
		text = _tmp10_;
		_tmp11_ = self->priv->game_actors;
		_tmp12_ = text;
		clutter_container_add_actor ((ClutterContainer*) _tmp11_, (ClutterActor*) _tmp12_);
		_tmp13_ = text;
		_tmp14_ = points_awarded;
		score_actor_animate_score (_tmp13_, _tmp14_);
		_g_object_unref0 (text);
	}
}


void game_view_game_complete_cb (GameView* self) {
	gfloat _tmp0_;
	gfloat _tmp1_;
	gfloat _tmp2_;
	gfloat _tmp3_;
	gfloat _tmp4_;
	gfloat _tmp5_;
	gfloat _tmp6_;
	gfloat _tmp7_;
	ScoreActor* _tmp8_;
	ScoreActor* _tmp9_;
	ScoreActor* text;
	ClutterGroup* _tmp10_;
	Game* _tmp11_;
	Game* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clutter_actor_get_width ((ClutterActor*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = clutter_actor_get_height ((ClutterActor*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = clutter_actor_get_width ((ClutterActor*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = clutter_actor_get_height ((ClutterActor*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = score_actor_new (_tmp1_ / 2.0, _tmp3_ / 2.0, (gdouble) _tmp5_, (gdouble) _tmp7_);
	_tmp9_ = g_object_ref_sink (_tmp8_);
	text = _tmp9_;
	_tmp10_ = self->priv->game_actors;
	clutter_container_add_actor ((ClutterContainer*) _tmp10_, (ClutterActor*) text);
	_tmp11_ = game_view_get_game (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = game_get_score (_tmp12_);
	_tmp14_ = _tmp13_;
	score_actor_animate_final_score (text, (guint) _tmp14_);
	_g_object_unref0 (text);
}


gint game_view_get_cursor_x (GameView* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_cursor_x;
	result = _tmp0_;
	return result;
}


void game_view_set_cursor_x (GameView* self, gint value) {
	gint _tmp0_;
	Game* _tmp1_;
	Game* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = game_view_get_game (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = game_get_columns (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = CLAMP (_tmp0_, 0, _tmp4_ - 1);
	self->priv->_cursor_x = _tmp5_;
	g_object_notify ((GObject *) self, "cursor-x");
}


gint game_view_get_cursor_y (GameView* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_cursor_y;
	result = _tmp0_;
	return result;
}


void game_view_set_cursor_y (GameView* self, gint value) {
	gint _tmp0_;
	Game* _tmp1_;
	Game* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = game_view_get_game (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = game_get_rows (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = CLAMP (_tmp0_, 0, _tmp4_ - 1);
	self->priv->_cursor_y = _tmp5_;
	g_object_notify ((GObject *) self, "cursor-y");
}


Game* game_view_get_game (GameView* self) {
	Game* result;
	Game* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game;
	result = _tmp0_;
	return result;
}


static void _game_view_game_complete_cb_game_complete (Game* _sender, gpointer self) {
	game_view_game_complete_cb (self);
}


static void _game_view_update_score_cb_game_update_score (Game* _sender, gint points_awarded, gpointer self) {
	game_view_update_score_cb (self, points_awarded);
}


void game_view_set_game (GameView* self, Game* value) {
	ClutterGroup* _tmp0_;
	ClutterGroup* _tmp2_;
	ClutterGroup* _tmp3_;
	ClutterGroup* _tmp4_;
	Game* _tmp5_;
	Game* _tmp6_;
	Game* _tmp9_;
	Game* _tmp10_;
	Game* _tmp11_;
	Game* _tmp12_;
	Game* _tmp13_;
	Game* _tmp14_;
	Game* _tmp15_;
	Game* _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	Game* _tmp19_;
	Game* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	TileActor** _tmp23_ = NULL;
	gint _tmp24_;
	Game* _tmp25_;
	Game* _tmp26_;
	gint _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	Game* _tmp30_;
	Game* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->game_actors;
	if (_tmp0_ != NULL) {
		ClutterGroup* _tmp1_;
		_tmp1_ = self->priv->game_actors;
		clutter_actor_destroy ((ClutterActor*) _tmp1_);
	}
	_tmp2_ = (ClutterGroup*) clutter_group_new ();
	_tmp3_ = g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->game_actors);
	self->priv->game_actors = _tmp3_;
	_tmp4_ = self->priv->game_actors;
	clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) _tmp4_);
	game_view_remove_tiles (self);
	_tmp5_ = game_view_get_game (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		Game* _tmp7_;
		Game* _tmp8_;
		_tmp7_ = game_view_get_game (self);
		_tmp8_ = _tmp7_;
		g_signal_handlers_disconnect_matched (_tmp8_, G_SIGNAL_MATCH_DATA, (guint) 0, (GQuark) 0, NULL, NULL, self);
	}
	_tmp9_ = value;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	_g_object_unref0 (self->priv->_game);
	self->priv->_game = _tmp10_;
	_tmp11_ = game_view_get_game (self);
	_tmp12_ = _tmp11_;
	g_signal_connect_object (_tmp12_, "complete", (GCallback) _game_view_game_complete_cb_game_complete, self, 0);
	_tmp13_ = game_view_get_game (self);
	_tmp14_ = _tmp13_;
	g_signal_connect_object (_tmp14_, "update-score", (GCallback) _game_view_update_score_cb_game_update_score, self, 0);
	_tmp15_ = game_view_get_game (self);
	_tmp16_ = _tmp15_;
	_tmp17_ = game_get_columns (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = game_view_get_game (self);
	_tmp20_ = _tmp19_;
	_tmp21_ = game_get_rows (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = g_new0 (TileActor*, (_tmp18_ * _tmp22_) + 1);
	self->priv->tiles = (_vala_array_free (self->priv->tiles, self->priv->tiles_length1 * self->priv->tiles_length2, (GDestroyNotify) g_object_unref), NULL);
	self->priv->tiles = _tmp23_;
	self->priv->tiles_length1 = _tmp18_;
	self->priv->tiles_length2 = _tmp22_;
	game_view_place_tiles (self);
	_tmp24_ = self->priv->tile_size;
	_tmp25_ = game_view_get_game (self);
	_tmp26_ = _tmp25_;
	_tmp27_ = game_get_columns (_tmp26_);
	_tmp28_ = _tmp27_;
	clutter_actor_set_width ((ClutterActor*) self, (gfloat) (_tmp24_ * _tmp28_));
	_tmp29_ = self->priv->tile_size;
	_tmp30_ = game_view_get_game (self);
	_tmp31_ = _tmp30_;
	_tmp32_ = game_get_rows (_tmp31_);
	_tmp33_ = _tmp32_;
	clutter_actor_set_height ((ClutterActor*) self, (gfloat) (_tmp29_ * _tmp33_));
	g_object_notify ((GObject *) self, "game");
}


const gchar* game_view_get_theme_name (GameView* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_theme_name;
	result = _tmp0_;
	return result;
}


void game_view_set_theme_name (GameView* self, const gchar* value) {
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = game_view_get_theme_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = value;
	if (g_strcmp0 (_tmp1_, _tmp2_) == 0) {
		return;
	}
	_tmp3_ = value;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (self->priv->_theme_name);
	self->priv->_theme_name = _tmp4_;
	game_view_remove_tiles (self);
	game_view_place_tiles (self);
	g_object_notify ((GObject *) self, "theme-name");
}


static void game_view_class_init (GameViewClass * klass) {
	game_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GameViewPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_game_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_game_view_set_property;
	G_OBJECT_CLASS (klass)->finalize = game_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_VIEW_CURSOR_X, g_param_spec_int ("cursor-x", "cursor-x", "cursor-x", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_VIEW_CURSOR_Y, g_param_spec_int ("cursor-y", "cursor-y", "cursor-y", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_VIEW_GAME, g_param_spec_object ("game", "game", "game", TYPE_GAME, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_VIEW_THEME_NAME, g_param_spec_string ("theme-name", "theme-name", "theme-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void game_view_instance_init (GameView * self) {
	gchar* _tmp0_;
	self->priv = GAME_VIEW_GET_PRIVATE (self);
	self->priv->highlighted = NULL;
	self->priv->cursor_active = FALSE;
	self->priv->game_actors = NULL;
	self->priv->_game = NULL;
	_tmp0_ = g_strdup ("shapesandcolors");
	self->priv->_theme_name = _tmp0_;
	self->priv->tile_size = 50;
}


static void game_view_finalize (GObject* obj) {
	GameView * self;
	self = GAME_VIEW (obj);
	_g_object_unref0 (self->priv->highlighted);
	_g_object_unref0 (self->priv->cursor);
	self->priv->tiles = (_vala_array_free (self->priv->tiles, self->priv->tiles_length1 * self->priv->tiles_length2, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->game_actors);
	_g_object_unref0 (self->priv->_game);
	_g_hash_table_unref0 (self->priv->themes);
	_g_free0 (self->priv->_theme_name);
	G_OBJECT_CLASS (game_view_parent_class)->finalize (obj);
}


/**
 *  This class defines the view of a game. All clutter related stuff goes here. It follows the
 *  principle of MVC framework. This class deals with the presentation (view) layer. It communicates
 *  with the model class by composite relation and with the control layer by means of signals and
 *  events.
 */
GType game_view_get_type (void) {
	static volatile gsize game_view_type_id__volatile = 0;
	if (g_once_init_enter (&game_view_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GameViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) game_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GameView), 0, (GInstanceInitFunc) game_view_instance_init, NULL };
		GType game_view_type_id;
		game_view_type_id = g_type_register_static (clutter_group_get_type (), "GameView", &g_define_type_info, 0);
		g_once_init_leave (&game_view_type_id__volatile, game_view_type_id);
	}
	return game_view_type_id__volatile;
}


static void _vala_game_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GameView * self;
	self = GAME_VIEW (object);
	switch (property_id) {
		case GAME_VIEW_CURSOR_X:
		g_value_set_int (value, game_view_get_cursor_x (self));
		break;
		case GAME_VIEW_CURSOR_Y:
		g_value_set_int (value, game_view_get_cursor_y (self));
		break;
		case GAME_VIEW_GAME:
		g_value_set_object (value, game_view_get_game (self));
		break;
		case GAME_VIEW_THEME_NAME:
		g_value_set_string (value, game_view_get_theme_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_game_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GameView * self;
	self = GAME_VIEW (object);
	switch (property_id) {
		case GAME_VIEW_CURSOR_X:
		game_view_set_cursor_x (self, g_value_get_int (value));
		break;
		case GAME_VIEW_CURSOR_Y:
		game_view_set_cursor_y (self, g_value_get_int (value));
		break;
		case GAME_VIEW_GAME:
		game_view_set_game (self, g_value_get_object (value));
		break;
		case GAME_VIEW_THEME_NAME:
		game_view_set_theme_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


Theme* theme_construct (GType object_type, const gchar* name) {
	Theme* self = NULL;
	ClutterTexture** _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_ = NULL;
	gchar** colors;
	gint colors_length1;
	gint _colors_size_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	self = (Theme*) g_type_create_instance (object_type);
	_tmp0_ = g_new0 (ClutterTexture*, 4 + 1);
	self->textures = (_vala_array_free (self->textures, self->textures_length1, (GDestroyNotify) g_object_unref), NULL);
	self->textures = _tmp0_;
	self->textures_length1 = 4;
	_tmp1_ = g_strdup ("blue");
	_tmp2_ = g_strdup ("green");
	_tmp3_ = g_strdup ("yellow");
	_tmp4_ = g_strdup ("red");
	_tmp5_ = g_new0 (gchar*, 4 + 1);
	_tmp5_[0] = _tmp1_;
	_tmp5_[1] = _tmp2_;
	_tmp5_[2] = _tmp3_;
	_tmp5_[3] = _tmp4_;
	colors = _tmp5_;
	colors_length1 = 4;
	_colors_size_ = colors_length1;
	{
		const gchar* _tmp26_;
		gchar* _tmp27_ = NULL;
		gchar* _tmp28_;
		ClutterTexture* _tmp29_;
		ClutterTexture* _tmp30_;
		ClutterTexture* _tmp31_;
		ClutterTexture* _tmp32_;
		ClutterTexture* _tmp33_;
		{
			gint i;
			i = 0;
			{
				gboolean _tmp6_;
				_tmp6_ = TRUE;
				while (TRUE) {
					gboolean _tmp7_;
					gint _tmp9_;
					const gchar* _tmp10_;
					gchar** _tmp11_;
					gint _tmp11__length1;
					gint _tmp12_;
					const gchar* _tmp13_;
					gchar* _tmp14_;
					gchar* _tmp15_;
					gchar* _tmp16_ = NULL;
					gchar* _tmp17_;
					ClutterTexture* _tmp18_;
					ClutterTexture* _tmp19_;
					ClutterTexture* _tmp20_;
					ClutterTexture* _tmp21_;
					ClutterTexture** _tmp22_;
					gint _tmp22__length1;
					gint _tmp23_;
					ClutterTexture* _tmp24_;
					ClutterTexture* _tmp25_;
					_tmp7_ = _tmp6_;
					if (!_tmp7_) {
						gint _tmp8_;
						_tmp8_ = i;
						i = _tmp8_ + 1;
					}
					_tmp6_ = FALSE;
					_tmp9_ = i;
					if (!(_tmp9_ < 4)) {
						break;
					}
					_tmp10_ = name;
					_tmp11_ = colors;
					_tmp11__length1 = colors_length1;
					_tmp12_ = i;
					_tmp13_ = _tmp11_[_tmp12_];
					_tmp14_ = g_strconcat (_tmp13_, ".svg", NULL);
					_tmp15_ = _tmp14_;
					_tmp16_ = g_build_filename (DATADIR, "themes", _tmp10_, _tmp15_, NULL);
					_tmp17_ = _tmp16_;
					_tmp18_ = (ClutterTexture*) clutter_texture_new_from_file (_tmp17_, &_inner_error_);
					_tmp19_ = g_object_ref_sink (_tmp18_);
					_tmp20_ = _tmp19_;
					_g_free0 (_tmp17_);
					_g_free0 (_tmp15_);
					_tmp21_ = _tmp20_;
					if (_inner_error_ != NULL) {
						if (_inner_error_->domain == CLUTTER_TEXTURE_ERROR) {
							goto __catch0_clutter_texture_error;
						}
						colors = (_vala_array_free (colors, colors_length1, (GDestroyNotify) g_free), NULL);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
						return NULL;
					}
					_tmp22_ = self->textures;
					_tmp22__length1 = self->textures_length1;
					_tmp23_ = i;
					_tmp24_ = g_object_ref_sink (_tmp21_);
					_g_object_unref0 (_tmp22_[_tmp23_]);
					_tmp22_[_tmp23_] = _tmp24_;
					_tmp25_ = _tmp22_[_tmp23_];
				}
			}
		}
		_tmp26_ = name;
		_tmp27_ = g_build_filename (DATADIR, "themes", _tmp26_, "highlight.svg", NULL);
		_tmp28_ = _tmp27_;
		_tmp29_ = (ClutterTexture*) clutter_texture_new_from_file (_tmp28_, &_inner_error_);
		_tmp30_ = g_object_ref_sink (_tmp29_);
		_tmp31_ = _tmp30_;
		_g_free0 (_tmp28_);
		_tmp32_ = _tmp31_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == CLUTTER_TEXTURE_ERROR) {
				goto __catch0_clutter_texture_error;
			}
			colors = (_vala_array_free (colors, colors_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp33_ = g_object_ref_sink (_tmp32_);
		_g_object_unref0 (self->cursor);
		self->cursor = _tmp33_;
	}
	goto __finally0;
	__catch0_clutter_texture_error:
	{
		GError* e = NULL;
		GError* _tmp34_;
		const gchar* _tmp35_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp34_ = e;
		_tmp35_ = _tmp34_->message;
		g_warning ("game-view.vala:335: Failed to load textures: %s", _tmp35_);
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		colors = (_vala_array_free (colors, colors_length1, (GDestroyNotify) g_free), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	colors = (_vala_array_free (colors, colors_length1, (GDestroyNotify) g_free), NULL);
	return self;
}


Theme* theme_new (const gchar* name) {
	return theme_construct (TYPE_THEME, name);
}


static void value_theme_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_theme_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		theme_unref (value->data[0].v_pointer);
	}
}


static void value_theme_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = theme_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_theme_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_theme_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		Theme* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = theme_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_theme_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	Theme** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = theme_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_theme (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecTheme* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_THEME), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_theme (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_THEME), NULL);
	return value->data[0].v_pointer;
}


void value_set_theme (GValue* value, gpointer v_object) {
	Theme* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_THEME));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_THEME));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		theme_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		theme_unref (old);
	}
}


void value_take_theme (GValue* value, gpointer v_object) {
	Theme* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_THEME));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_THEME));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		theme_unref (old);
	}
}


static void theme_class_init (ThemeClass * klass) {
	theme_parent_class = g_type_class_peek_parent (klass);
	THEME_CLASS (klass)->finalize = theme_finalize;
}


static void theme_instance_init (Theme * self) {
	self->ref_count = 1;
}


static void theme_finalize (Theme* obj) {
	Theme * self;
	self = THEME (obj);
	self->textures = (_vala_array_free (self->textures, self->textures_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->cursor);
}


/**
 *  This class holds the textures for a specific theme. These textures are used for creating light
 *  actors and cursor actor.
 */
GType theme_get_type (void) {
	static volatile gsize theme_type_id__volatile = 0;
	if (g_once_init_enter (&theme_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_theme_init, value_theme_free_value, value_theme_copy_value, value_theme_peek_pointer, "p", value_theme_collect_value, "p", value_theme_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (ThemeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) theme_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Theme), 0, (GInstanceInitFunc) theme_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType theme_type_id;
		theme_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Theme", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&theme_type_id__volatile, theme_type_id);
	}
	return theme_type_id__volatile;
}


gpointer theme_ref (gpointer instance) {
	Theme* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void theme_unref (gpointer instance) {
	Theme* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		THEME_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


TileActor* tile_actor_construct (GType object_type, Tile* tile, ClutterTexture* texture, gint size) {
	TileActor * self = NULL;
	Tile* _tmp0_;
	Tile* _tmp1_;
	ClutterTexture* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	g_return_val_if_fail (tile != NULL, NULL);
	g_return_val_if_fail (texture != NULL, NULL);
	self = (TileActor*) g_object_new (object_type, NULL);
	_tmp0_ = tile;
	_tmp1_ = _tile_ref0 (_tmp0_);
	_tile_unref0 (self->tile);
	self->tile = _tmp1_;
	_tmp2_ = texture;
	clutter_clone_set_source ((ClutterClone*) self, (ClutterActor*) _tmp2_);
	clutter_actor_set_opacity ((ClutterActor*) self, (guint) 180);
	_tmp3_ = size;
	_tmp4_ = size;
	clutter_actor_set_size ((ClutterActor*) self, (gfloat) _tmp3_, (gfloat) _tmp4_);
	_tmp5_ = size;
	_tmp6_ = size;
	clutter_actor_set_anchor_point ((ClutterActor*) self, (gfloat) (_tmp5_ / 2), (gfloat) (_tmp6_ / 2));
	return self;
}


TileActor* tile_actor_new (Tile* tile, ClutterTexture* texture, gint size) {
	return tile_actor_construct (TYPE_TILE_ACTOR, tile, texture, size);
}


static void _tile_actor_hide_tile_cb_clutter_timeline_completed (ClutterTimeline* _sender, gpointer self) {
	tile_actor_hide_tile_cb (self);
}


void tile_actor_animate_out (TileActor* self) {
	ClutterAnimation* _tmp0_ = NULL;
	ClutterAnimation* _tmp1_;
	ClutterAnimation* a;
	ClutterTimeline* _tmp2_;
	ClutterTimeline* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clutter_actor_animate ((ClutterActor*) self, (gulong) CLUTTER_LINEAR, (guint) 500, "scale-x", 2.0, "scale-y", 2.0, "opacity", 0, NULL);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	a = _tmp1_;
	_tmp2_ = clutter_animation_get_timeline (a);
	_tmp3_ = _tmp2_;
	g_signal_connect_object (_tmp3_, "completed", (GCallback) _tile_actor_hide_tile_cb_clutter_timeline_completed, self, 0);
	_g_object_unref0 (a);
}


static void tile_actor_hide_tile_cb (TileActor* self) {
	g_return_if_fail (self != NULL);
	clutter_actor_hide ((ClutterActor*) self);
}


void tile_actor_animate_to (TileActor* self, gdouble new_x, gdouble new_y, gboolean is_zealous) {
	ClutterAnimationMode _tmp0_ = 0;
	gboolean _tmp1_;
	ClutterAnimationMode _tmp2_;
	ClutterAnimationMode anim_mode;
	gdouble _tmp3_;
	gdouble _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = is_zealous;
	if (_tmp1_) {
		_tmp0_ = CLUTTER_EASE_OUT_BOUNCE;
	} else {
		_tmp0_ = CLUTTER_EASE_OUT_QUAD;
	}
	_tmp2_ = _tmp0_;
	anim_mode = _tmp2_;
	_tmp3_ = new_x;
	_tmp4_ = new_y;
	clutter_actor_animate ((ClutterActor*) self, (gulong) anim_mode, (guint) 500, "x", _tmp3_, "y", _tmp4_, NULL);
}


static void tile_actor_class_init (TileActorClass * klass) {
	tile_actor_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = tile_actor_finalize;
}


static void tile_actor_instance_init (TileActor * self) {
}


static void tile_actor_finalize (GObject* obj) {
	TileActor * self;
	self = TILE_ACTOR (obj);
	_tile_unref0 (self->tile);
	G_OBJECT_CLASS (tile_actor_parent_class)->finalize (obj);
}


/**
 *  This class defines the view of a tile. All clutter related stuff goes here
 */
GType tile_actor_get_type (void) {
	static volatile gsize tile_actor_type_id__volatile = 0;
	if (g_once_init_enter (&tile_actor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TileActorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tile_actor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TileActor), 0, (GInstanceInitFunc) tile_actor_instance_init, NULL };
		GType tile_actor_type_id;
		tile_actor_type_id = g_type_register_static (clutter_clone_get_type (), "TileActor", &g_define_type_info, 0);
		g_once_init_leave (&tile_actor_type_id__volatile, tile_actor_type_id);
	}
	return tile_actor_type_id__volatile;
}


CursorActor* cursor_actor_construct (GType object_type, ClutterTexture* texture, gint size) {
	CursorActor * self = NULL;
	ClutterTexture* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_val_if_fail (texture != NULL, NULL);
	self = (CursorActor*) g_object_new (object_type, NULL);
	_tmp0_ = texture;
	clutter_clone_set_source ((ClutterClone*) self, (ClutterActor*) _tmp0_);
	clutter_actor_set_opacity ((ClutterActor*) self, (guint) 180);
	_tmp1_ = size;
	_tmp2_ = size;
	clutter_actor_set_size ((ClutterActor*) self, (gfloat) _tmp1_, (gfloat) _tmp2_);
	_tmp3_ = size;
	_tmp4_ = size;
	clutter_actor_set_anchor_point ((ClutterActor*) self, (gfloat) (_tmp3_ / 2), (gfloat) (_tmp4_ / 2));
	return self;
}


CursorActor* cursor_actor_new (ClutterTexture* texture, gint size) {
	return cursor_actor_construct (TYPE_CURSOR_ACTOR, texture, size);
}


static void cursor_actor_class_init (CursorActorClass * klass) {
	cursor_actor_parent_class = g_type_class_peek_parent (klass);
}


static void cursor_actor_instance_init (CursorActor * self) {
}


GType cursor_actor_get_type (void) {
	static volatile gsize cursor_actor_type_id__volatile = 0;
	if (g_once_init_enter (&cursor_actor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (CursorActorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) cursor_actor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CursorActor), 0, (GInstanceInitFunc) cursor_actor_instance_init, NULL };
		GType cursor_actor_type_id;
		cursor_actor_type_id = g_type_register_static (clutter_clone_get_type (), "CursorActor", &g_define_type_info, 0);
		g_once_init_leave (&cursor_actor_type_id__volatile, cursor_actor_type_id);
	}
	return cursor_actor_type_id__volatile;
}


ScoreActor* score_actor_construct (GType object_type, gdouble x, gdouble y, gdouble width, gdouble height) {
	ScoreActor * self = NULL;
	ClutterText* _tmp0_;
	ClutterText* _tmp1_;
	ClutterText* _tmp2_;
	ClutterColor _tmp3_ = {0};
	ClutterText* _tmp4_;
	gdouble _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	gdouble _tmp8_;
	self = (ScoreActor*) g_object_new (object_type, NULL);
	_tmp0_ = (ClutterText*) clutter_text_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->label);
	self->priv->label = _tmp1_;
	_tmp2_ = self->priv->label;
	clutter_color_from_string (&_tmp3_, "rgba(255, 255, 255, 255)");
	clutter_text_set_color (_tmp2_, &_tmp3_);
	g_object_set ((ClutterActor*) self, "anchor-gravity", CLUTTER_GRAVITY_CENTER, NULL);
	_tmp4_ = self->priv->label;
	clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) _tmp4_);
	_tmp5_ = x;
	clutter_actor_set_x ((ClutterActor*) self, (gfloat) _tmp5_);
	_tmp6_ = y;
	clutter_actor_set_y ((ClutterActor*) self, (gfloat) _tmp6_);
	_tmp7_ = width;
	self->priv->scene_width = (gfloat) _tmp7_;
	_tmp8_ = height;
	self->priv->scene_height = (gfloat) _tmp8_;
	return self;
}


ScoreActor* score_actor_new (gdouble x, gdouble y, gdouble width, gdouble height) {
	return score_actor_construct (TYPE_SCORE_ACTOR, x, y, width, height);
}


static void __lambda2_ (ScoreActor* self) {
	clutter_actor_destroy ((ClutterActor*) self);
}


static void ___lambda2__clutter_timeline_completed (ClutterTimeline* _sender, gpointer self) {
	__lambda2_ (self);
}


void score_actor_animate_score (ScoreActor* self, gint points) {
	gint _tmp0_;
	ClutterText* _tmp1_;
	ClutterText* _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	ClutterAnimation* _tmp8_ = NULL;
	ClutterAnimation* _tmp9_;
	ClutterAnimation* a;
	ClutterAnimation* _tmp10_;
	ClutterTimeline* _tmp11_;
	ClutterTimeline* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = points;
	if (_tmp0_ <= 0) {
		return;
	}
	_tmp1_ = self->priv->label;
	clutter_text_set_font_name (_tmp1_, "Bitstrem Vera Sans Bold 40");
	_tmp2_ = self->priv->label;
	_tmp3_ = points;
	_tmp4_ = g_strdup_printf ("%i", _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat ("+", _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	clutter_text_set_text (_tmp2_, _tmp7_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp5_);
	clutter_actor_set_opacity ((ClutterActor*) self, (guint) 255);
	clutter_actor_set_depth ((ClutterActor*) self, (gfloat) 0);
	_tmp8_ = clutter_actor_animate ((ClutterActor*) self, (gulong) CLUTTER_EASE_OUT_SINE, (guint) 600, "depth", 500.0, "opacity", 0, NULL);
	_tmp9_ = _g_object_ref0 (_tmp8_);
	a = _tmp9_;
	_tmp10_ = a;
	_tmp11_ = clutter_animation_get_timeline (_tmp10_);
	_tmp12_ = _tmp11_;
	g_signal_connect_object (_tmp12_, "completed", (GCallback) ___lambda2__clutter_timeline_completed, self, 0);
	_g_object_unref0 (a);
}


void score_actor_animate_final_score (ScoreActor* self, guint points) {
	ClutterText* _tmp0_;
	guint _tmp1_;
	const gchar* _tmp2_ = NULL;
	guint _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* points_label;
	ClutterText* _tmp5_;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_;
	ClutterText* _tmp9_;
	gfloat _tmp10_;
	gfloat _tmp11_;
	gfloat _tmp12_;
	gfloat scale_to;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->label;
	clutter_text_set_font_name (_tmp0_, "Bitstrem Vera Sans 50");
	_tmp1_ = points;
	_tmp2_ = ngettext ("%u point", "%u points", (gulong) _tmp1_);
	_tmp3_ = points;
	_tmp4_ = g_strdup_printf (_tmp2_, _tmp3_);
	points_label = _tmp4_;
	_tmp5_ = self->priv->label;
	_tmp6_ = _ ("Game Over!");
	_tmp7_ = g_strdup_printf ("<b>%s</b>\n%s", _tmp6_, points_label);
	_tmp8_ = _tmp7_;
	clutter_text_set_markup (_tmp5_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = self->priv->label;
	clutter_text_set_line_alignment (_tmp9_, PANGO_ALIGN_CENTER);
	clutter_actor_set_opacity ((ClutterActor*) self, (guint) 255);
	clutter_actor_set_depth ((ClutterActor*) self, (gfloat) 0);
	g_object_set ((ClutterActor*) self, "scale-y", 0.0, NULL);
	g_object_set ((ClutterActor*) self, "scale-x", 0.0, NULL);
	_tmp10_ = self->priv->scene_width;
	_tmp11_ = clutter_actor_get_width ((ClutterActor*) self);
	_tmp12_ = _tmp11_;
	scale_to = _tmp10_ / _tmp12_;
	clutter_actor_animate ((ClutterActor*) self, (gulong) CLUTTER_EASE_OUT_ELASTIC, (guint) 2000, "scale-x", scale_to, "scale-y", scale_to, "opacity", 255, NULL);
	_g_free0 (points_label);
}


static void score_actor_class_init (ScoreActorClass * klass) {
	score_actor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ScoreActorPrivate));
	G_OBJECT_CLASS (klass)->finalize = score_actor_finalize;
}


static void score_actor_instance_init (ScoreActor * self) {
	self->priv = SCORE_ACTOR_GET_PRIVATE (self);
}


static void score_actor_finalize (GObject* obj) {
	ScoreActor * self;
	self = SCORE_ACTOR (obj);
	_g_object_unref0 (self->priv->label);
	G_OBJECT_CLASS (score_actor_parent_class)->finalize (obj);
}


/**
 *  This class defines the view of a score. All clutter related stuff goes here
 */
GType score_actor_get_type (void) {
	static volatile gsize score_actor_type_id__volatile = 0;
	if (g_once_init_enter (&score_actor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ScoreActorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) score_actor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScoreActor), 0, (GInstanceInitFunc) score_actor_instance_init, NULL };
		GType score_actor_type_id;
		score_actor_type_id = g_type_register_static (clutter_group_get_type (), "ScoreActor", &g_define_type_info, 0);
		g_once_init_leave (&score_actor_type_id__volatile, score_actor_type_id);
	}
	return score_actor_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);
}



