/* preview.c generated by valac 0.34.0.4-5c9b2, the Vala compiler
 * generated from preview.vala, do not modify */

/*
 * Copyright (C) 2010-2013 Robert Ancell
 *
 * 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. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#include <glib.h>
#include <glib-object.h>
#include <clutter-gtk/clutter-gtk.h>
#include <clutter/clutter.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_PREVIEW (preview_get_type ())
#define PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREVIEW, Preview))
#define PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREVIEW, PreviewClass))
#define IS_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREVIEW))
#define IS_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREVIEW))
#define PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREVIEW, PreviewClass))

typedef struct _Preview Preview;
typedef struct _PreviewClass PreviewClass;
typedef struct _PreviewPrivate PreviewPrivate;

#define TYPE_BLOCK_TEXTURE (block_texture_get_type ())
#define BLOCK_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BLOCK_TEXTURE, BlockTexture))
#define BLOCK_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BLOCK_TEXTURE, BlockTextureClass))
#define IS_BLOCK_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BLOCK_TEXTURE))
#define IS_BLOCK_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BLOCK_TEXTURE))
#define BLOCK_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BLOCK_TEXTURE, BlockTextureClass))

typedef struct _BlockTexture BlockTexture;
typedef struct _BlockTextureClass BlockTextureClass;

#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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _GamePrivate GamePrivate;

#define TYPE_SHAPE (shape_get_type ())
#define SHAPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHAPE, Shape))
#define SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHAPE, ShapeClass))
#define IS_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHAPE))
#define IS_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHAPE))
#define SHAPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHAPE, ShapeClass))

typedef struct _Shape Shape;
typedef struct _ShapeClass ShapeClass;

#define TYPE_BLOCK (block_get_type ())
#define BLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BLOCK, Block))
#define BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BLOCK, BlockClass))
#define IS_BLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BLOCK))
#define IS_BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BLOCK))
#define BLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BLOCK, BlockClass))

typedef struct _Block Block;
typedef struct _BlockClass BlockClass;
typedef struct _ShapePrivate ShapePrivate;
typedef struct _BlockPrivate BlockPrivate;

struct _Preview {
	GtkClutterEmbed parent_instance;
	PreviewPrivate * priv;
};

struct _PreviewClass {
	GtkClutterEmbedClass parent_class;
};

struct _PreviewPrivate {
	BlockTexture** block_textures;
	gint block_textures_length1;
	gint _block_textures_size_;
	ClutterActor* piece;
	GtkFrame* parent_frame;
	Game* _game;
	gboolean _enabled;
};

struct _Game {
	GObject parent_instance;
	GamePrivate * priv;
	Shape* shape;
	Shape* next_shape;
	Block** blocks;
	gint blocks_length1;
	gint blocks_length2;
	gint n_lines_destroyed;
	gint score;
	gboolean game_over;
};

struct _GameClass {
	GObjectClass parent_class;
};

struct _Shape {
	GObject parent_instance;
	ShapePrivate * priv;
	gint x;
	gint y;
	gint rotation;
	gint type;
	GList* blocks;
};

struct _ShapeClass {
	GObjectClass parent_class;
};

struct _Block {
	GObject parent_instance;
	BlockPrivate * priv;
	gint x;
	gint y;
	gint color;
};

struct _BlockClass {
	GObjectClass parent_class;
};


static gpointer preview_parent_class = NULL;

GType preview_get_type (void) G_GNUC_CONST;
GType block_texture_get_type (void) G_GNUC_CONST;
GType game_get_type (void) G_GNUC_CONST;
#define PREVIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PREVIEW, PreviewPrivate))
enum  {
	PREVIEW_DUMMY_PROPERTY,
	PREVIEW_THEME,
	PREVIEW_GAME,
	PREVIEW_ENABLED
};
Preview* preview_new (GtkFrame* parent);
Preview* preview_construct (GType object_type, GtkFrame* parent);
static void preview_size_allocate_cb (Preview* self, GtkAllocation* allocation);
static void _preview_size_allocate_cb_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self);
#define NCOLORS 7
BlockTexture* block_texture_new (gint color);
BlockTexture* block_texture_construct (GType object_type, gint color);
static void preview_shape_added_cb (Preview* self);
static void preview_update_block (Preview* self);
Game* preview_get_game (Preview* self);
GType shape_get_type (void) G_GNUC_CONST;
GType block_get_type (void) G_GNUC_CONST;
gboolean preview_get_enabled (Preview* self);
void preview_set_visible (Preview* self, gboolean visible);
static gint preview_get_cell_size (Preview* self);
void preview_set_theme (Preview* self, const gchar* value);
void block_texture_set_theme (BlockTexture* self, const gchar* value);
void preview_set_game (Preview* self, Game* value);
static void _preview_shape_added_cb_game_shape_added (Game* _sender, gpointer self);
void preview_set_enabled (Preview* self, gboolean value);
static void preview_finalize (GObject* obj);
static void _vala_preview_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_preview_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
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 void _preview_size_allocate_cb_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) {
#line 59 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_size_allocate_cb ((Preview*) self, allocation);
#line 186 "preview.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 61 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	return self ? g_object_ref (self) : NULL;
#line 193 "preview.c"
}


Preview* preview_construct (GType object_type, GtkFrame* parent) {
	Preview * self = NULL;
	GtkFrame* _tmp0_ = NULL;
	GtkFrame* _tmp1_ = NULL;
	ClutterStage* stage = NULL;
	ClutterActor* _tmp2_ = NULL;
	ClutterStage* _tmp3_ = NULL;
	ClutterColor stage_color = {0};
	ClutterColor _tmp4_ = {0};
	ClutterStage* _tmp5_ = NULL;
	ClutterColor _tmp6_ = {0};
	BlockTexture** _tmp7_ = NULL;
#line 57 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self = (Preview*) g_object_new (object_type, NULL);
#line 59 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_signal_connect_object ((GtkWidget*) self, "size-allocate", (GCallback) _preview_size_allocate_cb_gtk_widget_size_allocate, self, 0);
#line 61 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = parent;
#line 61 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 61 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (self->priv->parent_frame);
#line 61 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->parent_frame = _tmp1_;
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	gtk_widget_set_size_request ((GtkWidget*) self, 120, 120);
#line 67 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp2_ = gtk_clutter_embed_get_stage ((GtkClutterEmbed*) self);
#line 67 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, clutter_stage_get_type (), ClutterStage));
#line 67 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	stage = _tmp3_;
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp4_.red = (guint8) 0x0;
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp4_.green = (guint8) 0x0;
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp4_.blue = (guint8) 0x0;
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp4_.alpha = (guint8) 0xff;
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	stage_color = _tmp4_;
#line 70 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp5_ = stage;
#line 70 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp6_ = stage_color;
#line 70 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_set_background_color ((ClutterActor*) _tmp5_, &_tmp6_);
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp7_ = g_new0 (BlockTexture*, NCOLORS + 1);
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->block_textures = (_vala_array_free (self->priv->block_textures, self->priv->block_textures_length1, (GDestroyNotify) g_object_unref), NULL);
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->block_textures = _tmp7_;
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->block_textures_length1 = NCOLORS;
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->_block_textures_size_ = self->priv->block_textures_length1;
#line 255 "preview.c"
	{
		gint i = 0;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		i = 0;
#line 260 "preview.c"
		{
			gboolean _tmp8_ = FALSE;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			_tmp8_ = TRUE;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			while (TRUE) {
#line 267 "preview.c"
				gint _tmp10_ = 0;
				BlockTexture** _tmp11_ = NULL;
				gint _tmp11__length1 = 0;
				BlockTexture** _tmp12_ = NULL;
				gint _tmp12__length1 = 0;
				gint _tmp13_ = 0;
				gint _tmp14_ = 0;
				BlockTexture* _tmp15_ = NULL;
				BlockTexture* _tmp16_ = NULL;
				BlockTexture** _tmp17_ = NULL;
				gint _tmp17__length1 = 0;
				gint _tmp18_ = 0;
				BlockTexture* _tmp19_ = NULL;
				BlockTexture** _tmp20_ = NULL;
				gint _tmp20__length1 = 0;
				gint _tmp21_ = 0;
				BlockTexture* _tmp22_ = NULL;
				ClutterStage* _tmp23_ = NULL;
				BlockTexture** _tmp24_ = NULL;
				gint _tmp24__length1 = 0;
				gint _tmp25_ = 0;
				BlockTexture* _tmp26_ = NULL;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				if (!_tmp8_) {
#line 292 "preview.c"
					gint _tmp9_ = 0;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
					_tmp9_ = i;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
					i = _tmp9_ + 1;
#line 298 "preview.c"
				}
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp8_ = FALSE;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp10_ = i;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp11_ = self->priv->block_textures;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp11__length1 = self->priv->block_textures_length1;
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				if (!(_tmp10_ < _tmp11__length1)) {
#line 73 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
					break;
#line 312 "preview.c"
				}
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp12_ = self->priv->block_textures;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp12__length1 = self->priv->block_textures_length1;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp13_ = i;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp14_ = i;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp15_ = block_texture_new (_tmp14_);
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				g_object_ref_sink (_tmp15_);
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_g_object_unref0 (_tmp12_[_tmp13_]);
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp12_[_tmp13_] = _tmp15_;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp16_ = _tmp12_[_tmp13_];
#line 77 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp17_ = self->priv->block_textures;
#line 77 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp17__length1 = self->priv->block_textures_length1;
#line 77 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp18_ = i;
#line 77 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp19_ = _tmp17_[_tmp18_];
#line 77 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				clutter_cairo_texture_set_surface_size ((ClutterCairoTexture*) _tmp19_, (guint) 1, (guint) 1);
#line 78 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp20_ = self->priv->block_textures;
#line 78 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp20__length1 = self->priv->block_textures_length1;
#line 78 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp21_ = i;
#line 78 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp22_ = _tmp20_[_tmp21_];
#line 78 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				clutter_actor_hide ((ClutterActor*) _tmp22_);
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp23_ = stage;
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp24_ = self->priv->block_textures;
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp24__length1 = self->priv->block_textures_length1;
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp25_ = i;
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp26_ = _tmp24_[_tmp25_];
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				clutter_actor_add_child ((ClutterActor*) _tmp23_, (ClutterActor*) _tmp26_);
#line 364 "preview.c"
			}
		}
	}
#line 57 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (stage);
#line 57 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	return self;
#line 372 "preview.c"
}


Preview* preview_new (GtkFrame* parent) {
#line 57 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	return preview_construct (TYPE_PREVIEW, parent);
#line 379 "preview.c"
}


static void preview_shape_added_cb (Preview* self) {
#line 83 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (self != NULL);
#line 85 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_update_block (self);
#line 388 "preview.c"
}


static void preview_update_block (Preview* self) {
	ClutterActor* _tmp0_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	Game* _tmp4_ = NULL;
	Game* _tmp5_ = NULL;
	ClutterActor* _tmp13_ = NULL;
	ClutterStage* stage = NULL;
	ClutterActor* _tmp14_ = NULL;
	ClutterStage* _tmp15_ = NULL;
	ClutterStage* _tmp16_ = NULL;
	ClutterActor* _tmp17_ = NULL;
	gint min_width = 0;
	gint max_width = 0;
	gint min_height = 0;
	gint max_height = 0;
	Game* _tmp18_ = NULL;
	Game* _tmp19_ = NULL;
	Shape* _tmp20_ = NULL;
	GList* _tmp21_ = NULL;
	ClutterActor* _tmp60_ = NULL;
	ClutterActor* _tmp61_ = NULL;
	gint _tmp62_ = 0;
	gint _tmp63_ = 0;
	gint _tmp64_ = 0;
	gint _tmp65_ = 0;
	gint _tmp66_ = 0;
	gint _tmp67_ = 0;
	gint _tmp68_ = 0;
	gint _tmp69_ = 0;
	gint _tmp70_ = 0;
	gint _tmp71_ = 0;
	ClutterActor* _tmp72_ = NULL;
	ClutterActor* _tmp73_ = NULL;
	ClutterActor* _tmp74_ = NULL;
	ClutterActor* _tmp75_ = NULL;
	ClutterActor* _tmp76_ = NULL;
	ClutterActor* _tmp77_ = NULL;
#line 88 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (self != NULL);
#line 90 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = self->priv->piece;
#line 90 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	if (_tmp0_ != NULL) {
#line 436 "preview.c"
		ClutterActor* _tmp1_ = NULL;
#line 91 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp1_ = self->priv->piece;
#line 91 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		clutter_actor_destroy (_tmp1_);
#line 442 "preview.c"
	}
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp4_ = preview_get_game (self);
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp5_ = _tmp4_;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	if (_tmp5_ == NULL) {
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp3_ = TRUE;
#line 452 "preview.c"
	} else {
		Game* _tmp6_ = NULL;
		Game* _tmp7_ = NULL;
		Shape* _tmp8_ = NULL;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp6_ = preview_get_game (self);
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp7_ = _tmp6_;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp8_ = _tmp7_->next_shape;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp3_ = _tmp8_ == NULL;
#line 465 "preview.c"
	}
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	if (_tmp3_) {
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp2_ = TRUE;
#line 471 "preview.c"
	} else {
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp9_ = preview_get_enabled (self);
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp10_ = _tmp9_;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp2_ = !_tmp10_;
#line 481 "preview.c"
	}
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	if (_tmp2_) {
#line 485 "preview.c"
		gboolean _tmp11_ = FALSE;
		gboolean _tmp12_ = FALSE;
#line 96 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp11_ = preview_get_enabled (self);
#line 96 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp12_ = _tmp11_;
#line 96 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		preview_set_visible (self, _tmp12_);
#line 97 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		return;
#line 496 "preview.c"
	}
#line 100 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_set_visible (self, TRUE);
#line 102 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp13_ = clutter_actor_new ();
#line 102 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_object_ref_sink (_tmp13_);
#line 102 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (self->priv->piece);
#line 102 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->piece = _tmp13_;
#line 103 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp14_ = gtk_clutter_embed_get_stage ((GtkClutterEmbed*) self);
#line 103 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, clutter_stage_get_type (), ClutterStage));
#line 103 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	stage = _tmp15_;
#line 104 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp16_ = stage;
#line 104 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp17_ = self->priv->piece;
#line 104 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_add_child ((ClutterActor*) _tmp16_, _tmp17_);
#line 106 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	min_width = 4;
#line 106 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	max_width = 0;
#line 106 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	min_height = 4;
#line 106 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	max_height = 0;
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp18_ = preview_get_game (self);
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp19_ = _tmp18_;
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp20_ = _tmp19_->next_shape;
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp21_ = _tmp20_->blocks;
#line 536 "preview.c"
	{
		GList* b_collection = NULL;
		GList* b_it = NULL;
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		b_collection = _tmp21_;
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		for (b_it = b_collection; b_it != NULL; b_it = b_it->next) {
#line 544 "preview.c"
			Block* _tmp22_ = NULL;
			Block* b = NULL;
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			_tmp22_ = _g_object_ref0 ((Block*) b_it->data);
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			b = _tmp22_;
#line 551 "preview.c"
			{
				Block* _tmp23_ = NULL;
				gint _tmp24_ = 0;
				gint _tmp25_ = 0;
				gint _tmp26_ = 0;
				Block* _tmp27_ = NULL;
				gint _tmp28_ = 0;
				gint _tmp29_ = 0;
				gint _tmp30_ = 0;
				Block* _tmp31_ = NULL;
				gint _tmp32_ = 0;
				gint _tmp33_ = 0;
				gint _tmp34_ = 0;
				Block* _tmp35_ = NULL;
				gint _tmp36_ = 0;
				gint _tmp37_ = 0;
				gint _tmp38_ = 0;
				ClutterClone* a = NULL;
				BlockTexture** _tmp39_ = NULL;
				gint _tmp39__length1 = 0;
				Block* _tmp40_ = NULL;
				gint _tmp41_ = 0;
				BlockTexture* _tmp42_ = NULL;
				ClutterClone* _tmp43_ = NULL;
				ClutterClone* _tmp44_ = NULL;
				gint _tmp45_ = 0;
				gint _tmp46_ = 0;
				gint _tmp47_ = 0;
				gint _tmp48_ = 0;
				ClutterClone* _tmp49_ = NULL;
				Block* _tmp50_ = NULL;
				gint _tmp51_ = 0;
				gint _tmp52_ = 0;
				gint _tmp53_ = 0;
				Block* _tmp54_ = NULL;
				gint _tmp55_ = 0;
				gint _tmp56_ = 0;
				gint _tmp57_ = 0;
				ClutterActor* _tmp58_ = NULL;
				ClutterClone* _tmp59_ = NULL;
#line 109 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp23_ = b;
#line 109 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp24_ = _tmp23_->x;
#line 109 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp25_ = min_width;
#line 109 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp26_ = MIN (_tmp24_, _tmp25_);
#line 109 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				min_width = _tmp26_;
#line 110 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp27_ = b;
#line 110 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp28_ = _tmp27_->x;
#line 110 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp29_ = max_width;
#line 110 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp30_ = MAX (_tmp28_ + 1, _tmp29_);
#line 110 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				max_width = _tmp30_;
#line 111 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp31_ = b;
#line 111 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp32_ = _tmp31_->y;
#line 111 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp33_ = min_height;
#line 111 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp34_ = MIN (_tmp32_, _tmp33_);
#line 111 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				min_height = _tmp34_;
#line 112 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp35_ = b;
#line 112 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp36_ = _tmp35_->y;
#line 112 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp37_ = max_height;
#line 112 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp38_ = MAX (_tmp36_ + 1, _tmp37_);
#line 112 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				max_height = _tmp38_;
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp39_ = self->priv->block_textures;
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp39__length1 = self->priv->block_textures_length1;
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp40_ = b;
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp41_ = _tmp40_->color;
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp42_ = _tmp39_[_tmp41_];
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp43_ = (ClutterClone*) clutter_clone_new ((ClutterActor*) _tmp42_);
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				g_object_ref_sink (_tmp43_);
#line 114 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				a = _tmp43_;
#line 115 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp44_ = a;
#line 115 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp45_ = preview_get_cell_size (self);
#line 115 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp46_ = _tmp45_;
#line 115 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp47_ = preview_get_cell_size (self);
#line 115 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp48_ = _tmp47_;
#line 115 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				clutter_actor_set_size ((ClutterActor*) _tmp44_, (gfloat) _tmp46_, (gfloat) _tmp48_);
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp49_ = a;
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp50_ = b;
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp51_ = _tmp50_->x;
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp52_ = preview_get_cell_size (self);
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp53_ = _tmp52_;
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp54_ = b;
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp55_ = _tmp54_->y;
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp56_ = preview_get_cell_size (self);
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp57_ = _tmp56_;
#line 116 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				clutter_actor_set_position ((ClutterActor*) _tmp49_, (gfloat) (_tmp51_ * _tmp53_), (gfloat) (_tmp55_ * _tmp57_));
#line 117 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp58_ = self->priv->piece;
#line 117 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp59_ = a;
#line 117 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				clutter_actor_add_child (_tmp58_, (ClutterActor*) _tmp59_);
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_g_object_unref0 (a);
#line 107 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_g_object_unref0 (b);
#line 690 "preview.c"
			}
		}
	}
#line 120 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp60_ = self->priv->piece;
#line 120 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_set_pivot_point (_tmp60_, 0.5f, 0.5f);
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp61_ = self->priv->piece;
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp62_ = gtk_widget_get_allocated_width ((GtkWidget*) self);
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp63_ = min_width;
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp64_ = max_width;
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp65_ = preview_get_cell_size (self);
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp66_ = _tmp65_;
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp67_ = gtk_widget_get_allocated_height ((GtkWidget*) self);
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp68_ = min_height;
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp69_ = max_height;
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp70_ = preview_get_cell_size (self);
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp71_ = _tmp70_;
#line 121 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_set_position (_tmp61_, (gfloat) ((_tmp62_ - ((_tmp63_ + _tmp64_) * _tmp66_)) / 2), (gfloat) ((_tmp67_ - ((_tmp68_ + _tmp69_) * _tmp71_)) / 2));
#line 122 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp72_ = self->priv->piece;
#line 122 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_set_scale (_tmp72_, 0.6, 0.6);
#line 124 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp73_ = self->priv->piece;
#line 124 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_save_easing_state (_tmp73_);
#line 125 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp74_ = self->priv->piece;
#line 125 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_set_easing_mode (_tmp74_, CLUTTER_EASE_IN_OUT_SINE);
#line 126 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp75_ = self->priv->piece;
#line 126 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_set_easing_duration (_tmp75_, (guint) 180);
#line 127 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp76_ = self->priv->piece;
#line 127 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_set_scale (_tmp76_, 1.0, 1.0);
#line 128 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp77_ = self->priv->piece;
#line 128 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	clutter_actor_restore_easing_state (_tmp77_);
#line 88 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (stage);
#line 748 "preview.c"
}


void preview_set_visible (Preview* self, gboolean visible) {
	gboolean _tmp0_ = FALSE;
	GtkFrame* _tmp1_ = NULL;
#line 131 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (self != NULL);
#line 133 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = visible;
#line 133 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	gtk_widget_set_visible ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_clutter_embed_get_type (), GtkClutterEmbed), _tmp0_);
#line 134 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp1_ = self->priv->parent_frame;
#line 134 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	if (_tmp1_ != NULL) {
#line 765 "preview.c"
		GtkFrame* _tmp2_ = NULL;
		gboolean _tmp3_ = FALSE;
#line 136 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp2_ = self->priv->parent_frame;
#line 136 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp3_ = visible;
#line 136 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		gtk_widget_set_visible ((GtkWidget*) _tmp2_, _tmp3_);
#line 774 "preview.c"
	}
}


static void preview_size_allocate_cb (Preview* self, GtkAllocation* allocation) {
	BlockTexture** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
#line 140 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (self != NULL);
#line 140 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (allocation != NULL);
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = self->priv->block_textures;
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0__length1 = self->priv->block_textures_length1;
#line 790 "preview.c"
	{
		BlockTexture** texture_collection = NULL;
		gint texture_collection_length1 = 0;
		gint _texture_collection_size_ = 0;
		gint texture_it = 0;
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		texture_collection = _tmp0_;
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		texture_collection_length1 = _tmp0__length1;
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		for (texture_it = 0; texture_it < _tmp0__length1; texture_it = texture_it + 1) {
#line 802 "preview.c"
			BlockTexture* _tmp1_ = NULL;
			BlockTexture* texture = NULL;
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			_tmp1_ = _g_object_ref0 (texture_collection[texture_it]);
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			texture = _tmp1_;
#line 809 "preview.c"
			{
				BlockTexture* _tmp2_ = NULL;
				gint _tmp3_ = 0;
				gint _tmp4_ = 0;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
#line 143 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp2_ = texture;
#line 143 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp3_ = preview_get_cell_size (self);
#line 143 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp4_ = _tmp3_;
#line 143 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp5_ = preview_get_cell_size (self);
#line 143 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp6_ = _tmp5_;
#line 143 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				clutter_actor_set_size ((ClutterActor*) _tmp2_, (gfloat) _tmp4_, (gfloat) _tmp6_);
#line 142 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_g_object_unref0 (texture);
#line 830 "preview.c"
			}
		}
	}
#line 144 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_update_block (self);
#line 836 "preview.c"
}


void preview_set_theme (Preview* self, const gchar* value) {
	BlockTexture** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
#line 23 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (self != NULL);
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = self->priv->block_textures;
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0__length1 = self->priv->block_textures_length1;
#line 849 "preview.c"
	{
		BlockTexture** texture_collection = NULL;
		gint texture_collection_length1 = 0;
		gint _texture_collection_size_ = 0;
		gint texture_it = 0;
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		texture_collection = _tmp0_;
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		texture_collection_length1 = _tmp0__length1;
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		for (texture_it = 0; texture_it < _tmp0__length1; texture_it = texture_it + 1) {
#line 861 "preview.c"
			BlockTexture* _tmp1_ = NULL;
			BlockTexture* texture = NULL;
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			_tmp1_ = _g_object_ref0 (texture_collection[texture_it]);
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
			texture = _tmp1_;
#line 868 "preview.c"
			{
				BlockTexture* _tmp2_ = NULL;
				const gchar* _tmp3_ = NULL;
#line 26 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp2_ = texture;
#line 26 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_tmp3_ = value;
#line 26 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				block_texture_set_theme (_tmp2_, _tmp3_);
#line 25 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
				_g_object_unref0 (texture);
#line 880 "preview.c"
			}
		}
	}
#line 27 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_update_block (self);
#line 23 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_object_notify ((GObject *) self, "theme");
#line 888 "preview.c"
}


static gint preview_get_cell_size (Preview* self) {
	gint result;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = gtk_widget_get_allocated_width ((GtkWidget*) self);
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp1_ = gtk_widget_get_allocated_height ((GtkWidget*) self);
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	result = ((_tmp0_ + _tmp1_) / 2) / 5;
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	return result;
#line 906 "preview.c"
}


Game* preview_get_game (Preview* self) {
	Game* result;
	Game* _tmp0_ = NULL;
#line 39 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 39 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = self->priv->_game;
#line 39 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	result = _tmp0_;
#line 39 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	return result;
#line 921 "preview.c"
}


static void _preview_shape_added_cb_game_shape_added (Game* _sender, gpointer self) {
#line 45 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_shape_added_cb ((Preview*) self);
#line 928 "preview.c"
}


void preview_set_game (Preview* self, Game* value) {
	Game* _tmp0_ = NULL;
	Game* _tmp2_ = NULL;
	Game* _tmp3_ = NULL;
	Game* _tmp4_ = NULL;
#line 40 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (self != NULL);
#line 42 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = self->priv->_game;
#line 42 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	if (_tmp0_ != NULL) {
#line 943 "preview.c"
		Game* _tmp1_ = NULL;
#line 43 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		_tmp1_ = self->priv->_game;
#line 43 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_DATA, (guint) 0, (GQuark) 0, NULL, NULL, self);
#line 949 "preview.c"
	}
#line 44 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp2_ = value;
#line 44 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 44 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (self->priv->_game);
#line 44 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->_game = _tmp3_;
#line 45 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp4_ = self->priv->_game;
#line 45 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_signal_connect_object (_tmp4_, "shape-added", (GCallback) _preview_shape_added_cb_game_shape_added, self, 0);
#line 46 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_update_block (self);
#line 40 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_object_notify ((GObject *) self, "game");
#line 967 "preview.c"
}


gboolean preview_get_enabled (Preview* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
#line 53 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 53 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = self->priv->_enabled;
#line 53 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	result = _tmp0_;
#line 53 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	return result;
#line 982 "preview.c"
}


void preview_set_enabled (Preview* self, gboolean value) {
	gboolean _tmp0_ = FALSE;
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_return_if_fail (self != NULL);
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_tmp0_ = value;
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->_enabled = _tmp0_;
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_update_block (self);
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_object_notify ((GObject *) self, "enabled");
#line 998 "preview.c"
}


static void preview_class_init (PreviewClass * klass) {
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	preview_parent_class = g_type_class_peek_parent (klass);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_type_class_add_private (klass, sizeof (PreviewPrivate));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_preview_get_property;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_preview_set_property;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	G_OBJECT_CLASS (klass)->finalize = preview_finalize;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), PREVIEW_THEME, g_param_spec_string ("theme", "theme", "theme", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), PREVIEW_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));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), PREVIEW_ENABLED, g_param_spec_boolean ("enabled", "enabled", "enabled", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 1019 "preview.c"
}


static void preview_instance_init (Preview * self) {
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv = PREVIEW_GET_PRIVATE (self);
#line 17 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->piece = NULL;
#line 19 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->parent_frame = NULL;
#line 36 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->_game = NULL;
#line 50 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->_enabled = TRUE;
#line 1034 "preview.c"
}


static void preview_finalize (GObject* obj) {
	Preview * self;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PREVIEW, Preview);
#line 14 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	self->priv->block_textures = (_vala_array_free (self->priv->block_textures, self->priv->block_textures_length1, (GDestroyNotify) g_object_unref), NULL);
#line 17 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (self->priv->piece);
#line 19 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (self->priv->parent_frame);
#line 36 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	_g_object_unref0 (self->priv->_game);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	G_OBJECT_CLASS (preview_parent_class)->finalize (obj);
#line 1052 "preview.c"
}


GType preview_get_type (void) {
	static volatile gsize preview_type_id__volatile = 0;
	if (g_once_init_enter (&preview_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PreviewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) preview_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Preview), 0, (GInstanceInitFunc) preview_instance_init, NULL };
		GType preview_type_id;
		preview_type_id = g_type_register_static (gtk_clutter_embed_get_type (), "Preview", &g_define_type_info, 0);
		g_once_init_leave (&preview_type_id__volatile, preview_type_id);
	}
	return preview_type_id__volatile;
}


static void _vala_preview_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	Preview * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PREVIEW, Preview);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	switch (property_id) {
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		case PREVIEW_GAME:
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		g_value_set_object (value, preview_get_game (self));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		break;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		case PREVIEW_ENABLED:
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		g_value_set_boolean (value, preview_get_enabled (self));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		break;
#line 1085 "preview.c"
		default:
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		break;
#line 1091 "preview.c"
	}
}


static void _vala_preview_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	Preview * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PREVIEW, Preview);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
	switch (property_id) {
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		case PREVIEW_THEME:
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		preview_set_theme (self, g_value_get_string (value));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		break;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		case PREVIEW_GAME:
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		preview_set_game (self, g_value_get_object (value));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		break;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		case PREVIEW_ENABLED:
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		preview_set_enabled (self, g_value_get_boolean (value));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		break;
#line 1119 "preview.c"
		default:
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/preview.vala"
		break;
#line 1125 "preview.c"
	}
}


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);
}



