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

/* Copyright 2013 Jens Bav
 * Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include <glib.h>
#include <glib-object.h>
#include <shotwell-plugin-dev-1.0.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <cairo.h>
#include <gdk/gdk.h>


#define TYPE_SHOTWELL_TRANSITION_DESCRIPTOR (shotwell_transition_descriptor_get_type ())
#define SHOTWELL_TRANSITION_DESCRIPTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHOTWELL_TRANSITION_DESCRIPTOR, ShotwellTransitionDescriptor))
#define SHOTWELL_TRANSITION_DESCRIPTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHOTWELL_TRANSITION_DESCRIPTOR, ShotwellTransitionDescriptorClass))
#define IS_SHOTWELL_TRANSITION_DESCRIPTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHOTWELL_TRANSITION_DESCRIPTOR))
#define IS_SHOTWELL_TRANSITION_DESCRIPTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHOTWELL_TRANSITION_DESCRIPTOR))
#define SHOTWELL_TRANSITION_DESCRIPTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHOTWELL_TRANSITION_DESCRIPTOR, ShotwellTransitionDescriptorClass))

typedef struct _ShotwellTransitionDescriptor ShotwellTransitionDescriptor;
typedef struct _ShotwellTransitionDescriptorClass ShotwellTransitionDescriptorClass;
typedef struct _ShotwellTransitionDescriptorPrivate ShotwellTransitionDescriptorPrivate;

#define TYPE_SQUARES_EFFECT_DESCRIPTOR (squares_effect_descriptor_get_type ())
#define SQUARES_EFFECT_DESCRIPTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SQUARES_EFFECT_DESCRIPTOR, SquaresEffectDescriptor))
#define SQUARES_EFFECT_DESCRIPTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SQUARES_EFFECT_DESCRIPTOR, SquaresEffectDescriptorClass))
#define IS_SQUARES_EFFECT_DESCRIPTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SQUARES_EFFECT_DESCRIPTOR))
#define IS_SQUARES_EFFECT_DESCRIPTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SQUARES_EFFECT_DESCRIPTOR))
#define SQUARES_EFFECT_DESCRIPTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SQUARES_EFFECT_DESCRIPTOR, SquaresEffectDescriptorClass))

typedef struct _SquaresEffectDescriptor SquaresEffectDescriptor;
typedef struct _SquaresEffectDescriptorClass SquaresEffectDescriptorClass;
typedef struct _SquaresEffectDescriptorPrivate SquaresEffectDescriptorPrivate;

#define TYPE_SQUARES_EFFECT (squares_effect_get_type ())
#define SQUARES_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SQUARES_EFFECT, SquaresEffect))
#define SQUARES_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SQUARES_EFFECT, SquaresEffectClass))
#define IS_SQUARES_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SQUARES_EFFECT))
#define IS_SQUARES_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SQUARES_EFFECT))
#define SQUARES_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SQUARES_EFFECT, SquaresEffectClass))

typedef struct _SquaresEffect SquaresEffect;
typedef struct _SquaresEffectClass SquaresEffectClass;
typedef struct _SquaresEffectPrivate SquaresEffectPrivate;

struct _ShotwellTransitionDescriptor {
	GObject parent_instance;
	ShotwellTransitionDescriptorPrivate * priv;
};

struct _ShotwellTransitionDescriptorClass {
	GObjectClass parent_class;
	const gchar* (*get_id) (ShotwellTransitionDescriptor* self);
	const gchar* (*get_pluggable_name) (ShotwellTransitionDescriptor* self);
	SpitTransitionsEffect* (*create) (ShotwellTransitionDescriptor* self, SpitHostInterface* host);
};

struct _SquaresEffectDescriptor {
	ShotwellTransitionDescriptor parent_instance;
	SquaresEffectDescriptorPrivate * priv;
};

struct _SquaresEffectDescriptorClass {
	ShotwellTransitionDescriptorClass parent_class;
};

struct _SquaresEffect {
	GObject parent_instance;
	SquaresEffectPrivate * priv;
};

struct _SquaresEffectClass {
	GObjectClass parent_class;
};

struct _SquaresEffectPrivate {
	gdouble square_count_x;
	gdouble square_count_y;
};


static gpointer squares_effect_descriptor_parent_class = NULL;
static gpointer squares_effect_parent_class = NULL;
static SpitTransitionsEffectIface* squares_effect_spit_transitions_effect_parent_iface = NULL;

GType shotwell_transition_descriptor_get_type (void) G_GNUC_CONST;
GType squares_effect_descriptor_get_type (void) G_GNUC_CONST;
enum  {
	SQUARES_EFFECT_DESCRIPTOR_DUMMY_PROPERTY
};
SquaresEffectDescriptor* squares_effect_descriptor_new (GFile* resource_directory);
SquaresEffectDescriptor* squares_effect_descriptor_construct (GType object_type, GFile* resource_directory);
ShotwellTransitionDescriptor* shotwell_transition_descriptor_construct (GType object_type, GFile* resource_directory);
static const gchar* squares_effect_descriptor_real_get_id (ShotwellTransitionDescriptor* base);
static const gchar* squares_effect_descriptor_real_get_pluggable_name (ShotwellTransitionDescriptor* base);
static SpitTransitionsEffect* squares_effect_descriptor_real_create (ShotwellTransitionDescriptor* base, SpitHostInterface* host);
SquaresEffect* squares_effect_new (void);
SquaresEffect* squares_effect_construct (GType object_type);
GType squares_effect_get_type (void) G_GNUC_CONST;
#define SQUARES_EFFECT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SQUARES_EFFECT, SquaresEffectPrivate))
enum  {
	SQUARES_EFFECT_DUMMY_PROPERTY
};
#define SQUARES_EFFECT_DESIRED_FPS 25
#define SQUARES_EFFECT_MIN_FPS 10
#define SQUARES_EFFECT_SQUARE_SIZE 100
static void squares_effect_real_get_fps (SpitTransitionsEffect* base, gint* desired_fps, gint* min_fps);
static void squares_effect_real_start (SpitTransitionsEffect* base, SpitTransitionsVisuals* visuals, SpitTransitionsMotion* motion);
static gboolean squares_effect_real_needs_clear_background (SpitTransitionsEffect* base);
static void squares_effect_real_paint (SpitTransitionsEffect* base, SpitTransitionsVisuals* visuals, SpitTransitionsMotion* motion, cairo_t* ctx, gint width, gint height, gint frame_number);
static void squares_effect_real_advance (SpitTransitionsEffect* base, SpitTransitionsVisuals* visuals, SpitTransitionsMotion* motion, gint frame_number);
static void squares_effect_real_cancel (SpitTransitionsEffect* base);
static void squares_effect_finalize (GObject* obj);


SquaresEffectDescriptor* squares_effect_descriptor_construct (GType object_type, GFile* resource_directory) {
	SquaresEffectDescriptor * self = NULL;
	GFile* _tmp0_ = NULL;
#line 11 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_val_if_fail (G_IS_FILE (resource_directory), NULL);
#line 12 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp0_ = resource_directory;
#line 12 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = (SquaresEffectDescriptor*) shotwell_transition_descriptor_construct (object_type, _tmp0_);
#line 11 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return self;
#line 139 "SquaresEffect.c"
}


SquaresEffectDescriptor* squares_effect_descriptor_new (GFile* resource_directory) {
#line 11 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return squares_effect_descriptor_construct (TYPE_SQUARES_EFFECT_DESCRIPTOR, resource_directory);
#line 146 "SquaresEffect.c"
}


static const gchar* squares_effect_descriptor_real_get_id (ShotwellTransitionDescriptor* base) {
	SquaresEffectDescriptor * self;
	const gchar* result = NULL;
#line 15 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT_DESCRIPTOR, SquaresEffectDescriptor);
#line 16 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	result = "org.yorba.shotwell.transitions.squares";
#line 16 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return result;
#line 159 "SquaresEffect.c"
}


static const gchar* squares_effect_descriptor_real_get_pluggable_name (ShotwellTransitionDescriptor* base) {
	SquaresEffectDescriptor * self;
	const gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
#line 19 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT_DESCRIPTOR, SquaresEffectDescriptor);
#line 20 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp0_ = _ ("Squares");
#line 20 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	result = _tmp0_;
#line 20 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return result;
#line 175 "SquaresEffect.c"
}


static SpitTransitionsEffect* squares_effect_descriptor_real_create (ShotwellTransitionDescriptor* base, SpitHostInterface* host) {
	SquaresEffectDescriptor * self;
	SpitTransitionsEffect* result = NULL;
	SquaresEffect* _tmp0_ = NULL;
#line 23 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT_DESCRIPTOR, SquaresEffectDescriptor);
#line 23 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_val_if_fail (SPIT_IS_HOST_INTERFACE (host), NULL);
#line 24 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp0_ = squares_effect_new ();
#line 24 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TRANSITIONS_TYPE_EFFECT, SpitTransitionsEffect);
#line 24 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return result;
#line 193 "SquaresEffect.c"
}


static void squares_effect_descriptor_class_init (SquaresEffectDescriptorClass * klass) {
#line 10 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	squares_effect_descriptor_parent_class = g_type_class_peek_parent (klass);
#line 10 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	((ShotwellTransitionDescriptorClass *) klass)->get_id = squares_effect_descriptor_real_get_id;
#line 10 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	((ShotwellTransitionDescriptorClass *) klass)->get_pluggable_name = squares_effect_descriptor_real_get_pluggable_name;
#line 10 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	((ShotwellTransitionDescriptorClass *) klass)->create = squares_effect_descriptor_real_create;
#line 206 "SquaresEffect.c"
}


static void squares_effect_descriptor_instance_init (SquaresEffectDescriptor * self) {
}


GType squares_effect_descriptor_get_type (void) {
	static volatile gsize squares_effect_descriptor_type_id__volatile = 0;
	if (g_once_init_enter (&squares_effect_descriptor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SquaresEffectDescriptorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) squares_effect_descriptor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SquaresEffectDescriptor), 0, (GInstanceInitFunc) squares_effect_descriptor_instance_init, NULL };
		GType squares_effect_descriptor_type_id;
		squares_effect_descriptor_type_id = g_type_register_static (TYPE_SHOTWELL_TRANSITION_DESCRIPTOR, "SquaresEffectDescriptor", &g_define_type_info, 0);
		g_once_init_leave (&squares_effect_descriptor_type_id__volatile, squares_effect_descriptor_type_id);
	}
	return squares_effect_descriptor_type_id__volatile;
}


SquaresEffect* squares_effect_construct (GType object_type) {
	SquaresEffect * self = NULL;
#line 35 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = (SquaresEffect*) g_object_new (object_type, NULL);
#line 35 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return self;
#line 232 "SquaresEffect.c"
}


SquaresEffect* squares_effect_new (void) {
#line 35 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return squares_effect_construct (TYPE_SQUARES_EFFECT);
#line 239 "SquaresEffect.c"
}


static void squares_effect_real_get_fps (SpitTransitionsEffect* base, gint* desired_fps, gint* min_fps) {
	SquaresEffect * self;
	gint _vala_desired_fps = 0;
	gint _vala_min_fps = 0;
#line 38 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT, SquaresEffect);
#line 39 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_vala_desired_fps = SQUARES_EFFECT_DESIRED_FPS;
#line 40 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_vala_min_fps = SQUARES_EFFECT_MIN_FPS;
#line 38 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	if (desired_fps) {
#line 38 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		*desired_fps = _vala_desired_fps;
#line 257 "SquaresEffect.c"
	}
#line 38 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	if (min_fps) {
#line 38 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		*min_fps = _vala_min_fps;
#line 263 "SquaresEffect.c"
	}
}


static void squares_effect_real_start (SpitTransitionsEffect* base, SpitTransitionsVisuals* visuals, SpitTransitionsMotion* motion) {
	SquaresEffect * self;
	SpitTransitionsVisuals* _tmp0_ = NULL;
	GdkRectangle _tmp1_ = {0};
	GdkRectangle _tmp2_ = {0};
	gint _tmp3_ = 0;
	SpitTransitionsVisuals* _tmp4_ = NULL;
	GdkRectangle _tmp5_ = {0};
	GdkRectangle _tmp6_ = {0};
	gint _tmp7_ = 0;
#line 43 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT, SquaresEffect);
#line 43 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_if_fail (SPIT_TRANSITIONS_IS_VISUALS (visuals));
#line 43 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_if_fail (SPIT_TRANSITIONS_IS_MOTION (motion));
#line 44 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp0_ = visuals;
#line 44 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	spit_transitions_visuals_get_to_pos (_tmp0_, &_tmp1_);
#line 44 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp2_ = _tmp1_;
#line 44 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp3_ = _tmp2_.width;
#line 44 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self->priv->square_count_x = (gdouble) ((_tmp3_ / SQUARES_EFFECT_SQUARE_SIZE) + 1);
#line 45 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp4_ = visuals;
#line 45 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	spit_transitions_visuals_get_to_pos (_tmp4_, &_tmp5_);
#line 45 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp6_ = _tmp5_;
#line 45 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp7_ = _tmp6_.height;
#line 45 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self->priv->square_count_y = (gdouble) ((_tmp7_ / SQUARES_EFFECT_SQUARE_SIZE) + 1);
#line 304 "SquaresEffect.c"
}


static gboolean squares_effect_real_needs_clear_background (SpitTransitionsEffect* base) {
	SquaresEffect * self;
	gboolean result = FALSE;
#line 48 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT, SquaresEffect);
#line 49 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	result = TRUE;
#line 49 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	return result;
#line 317 "SquaresEffect.c"
}


static void squares_effect_real_paint (SpitTransitionsEffect* base, SpitTransitionsVisuals* visuals, SpitTransitionsMotion* motion, cairo_t* ctx, gint width, gint height, gint frame_number) {
	SquaresEffect * self;
	gdouble alpha = 0.0;
	SpitTransitionsMotion* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gdouble _tmp2_ = 0.0;
	SpitTransitionsVisuals* _tmp3_ = NULL;
	GdkPixbuf* _tmp4_ = NULL;
	GdkPixbuf* _tmp5_ = NULL;
	SpitTransitionsVisuals* _tmp20_ = NULL;
	GdkPixbuf* _tmp21_ = NULL;
	GdkPixbuf* _tmp22_ = NULL;
#line 52 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT, SquaresEffect);
#line 52 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_if_fail (SPIT_TRANSITIONS_IS_VISUALS (visuals));
#line 52 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_if_fail (SPIT_TRANSITIONS_IS_MOTION (motion));
#line 52 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_if_fail (ctx != NULL);
#line 54 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp0_ = motion;
#line 54 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp1_ = frame_number;
#line 54 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp2_ = spit_transitions_motion_get_alpha (_tmp0_, _tmp1_);
#line 54 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	alpha = _tmp2_;
#line 55 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp3_ = visuals;
#line 55 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp4_ = spit_transitions_visuals_get_from_pixbuf (_tmp3_);
#line 55 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp5_ = _tmp4_;
#line 55 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	if (_tmp5_ != NULL) {
#line 357 "SquaresEffect.c"
		cairo_t* _tmp6_ = NULL;
		SpitTransitionsVisuals* _tmp7_ = NULL;
		GdkPixbuf* _tmp8_ = NULL;
		GdkPixbuf* _tmp9_ = NULL;
		SpitTransitionsVisuals* _tmp10_ = NULL;
		GdkRectangle _tmp11_ = {0};
		GdkRectangle _tmp12_ = {0};
		gint _tmp13_ = 0;
		SpitTransitionsVisuals* _tmp14_ = NULL;
		GdkRectangle _tmp15_ = {0};
		GdkRectangle _tmp16_ = {0};
		gint _tmp17_ = 0;
		cairo_t* _tmp18_ = NULL;
		gdouble _tmp19_ = 0.0;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp6_ = ctx;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp7_ = visuals;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp8_ = spit_transitions_visuals_get_from_pixbuf (_tmp7_);
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp9_ = _tmp8_;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp10_ = visuals;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		spit_transitions_visuals_get_from_pos (_tmp10_, &_tmp11_);
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp12_ = _tmp11_;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp13_ = _tmp12_.x;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp14_ = visuals;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		spit_transitions_visuals_get_from_pos (_tmp14_, &_tmp15_);
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp16_ = _tmp15_;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp17_ = _tmp16_.y;
#line 56 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		gdk_cairo_set_source_pixbuf (_tmp6_, _tmp9_, (gdouble) _tmp13_, (gdouble) _tmp17_);
#line 58 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp18_ = ctx;
#line 58 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp19_ = alpha;
#line 58 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		cairo_paint_with_alpha (_tmp18_, 1 - _tmp19_);
#line 404 "SquaresEffect.c"
	}
#line 61 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp20_ = visuals;
#line 61 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp21_ = spit_transitions_visuals_get_to_pixbuf (_tmp20_);
#line 61 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	_tmp22_ = _tmp21_;
#line 61 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	if (_tmp22_ != NULL) {
#line 414 "SquaresEffect.c"
		cairo_t* _tmp23_ = NULL;
		SpitTransitionsVisuals* _tmp24_ = NULL;
		GdkPixbuf* _tmp25_ = NULL;
		GdkPixbuf* _tmp26_ = NULL;
		SpitTransitionsVisuals* _tmp27_ = NULL;
		GdkRectangle _tmp28_ = {0};
		GdkRectangle _tmp29_ = {0};
		gint _tmp30_ = 0;
		SpitTransitionsVisuals* _tmp31_ = NULL;
		GdkRectangle _tmp32_ = {0};
		GdkRectangle _tmp33_ = {0};
		gint _tmp34_ = 0;
		cairo_t* _tmp65_ = NULL;
		cairo_t* _tmp66_ = NULL;
		gdouble _tmp67_ = 0.0;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp23_ = ctx;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp24_ = visuals;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp25_ = spit_transitions_visuals_get_to_pixbuf (_tmp24_);
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp26_ = _tmp25_;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp27_ = visuals;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		spit_transitions_visuals_get_to_pos (_tmp27_, &_tmp28_);
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp29_ = _tmp28_;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp30_ = _tmp29_.x;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp31_ = visuals;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		spit_transitions_visuals_get_to_pos (_tmp31_, &_tmp32_);
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp33_ = _tmp32_;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp34_ = _tmp33_.y;
#line 62 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		gdk_cairo_set_source_pixbuf (_tmp23_, _tmp26_, (gdouble) _tmp30_, (gdouble) _tmp34_);
#line 456 "SquaresEffect.c"
		{
			gdouble y = 0.0;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
			y = (gdouble) 0;
#line 461 "SquaresEffect.c"
			{
				gboolean _tmp35_ = FALSE;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
				_tmp35_ = TRUE;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
				while (TRUE) {
#line 468 "SquaresEffect.c"
					gdouble _tmp37_ = 0.0;
					gdouble _tmp38_ = 0.0;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
					if (!_tmp35_) {
#line 473 "SquaresEffect.c"
						gdouble _tmp36_ = 0.0;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
						_tmp36_ = y;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
						y = _tmp36_ + 1;
#line 479 "SquaresEffect.c"
					}
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
					_tmp35_ = FALSE;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
					_tmp37_ = y;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
					_tmp38_ = self->priv->square_count_y;
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
					if (!(_tmp37_ <= _tmp38_)) {
#line 63 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
						break;
#line 491 "SquaresEffect.c"
					}
					{
						gdouble x = 0.0;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
						x = (gdouble) 0;
#line 497 "SquaresEffect.c"
						{
							gboolean _tmp39_ = FALSE;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
							_tmp39_ = TRUE;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
							while (TRUE) {
#line 504 "SquaresEffect.c"
								gdouble _tmp41_ = 0.0;
								gdouble _tmp42_ = 0.0;
								gdouble size = 0.0;
								gdouble _tmp43_ = 0.0;
								gdouble _tmp44_ = 0.0;
								gdouble _tmp45_ = 0.0;
								gdouble _tmp46_ = 0.0;
								gdouble _tmp47_ = 0.0;
								gdouble _tmp48_ = 0.0;
								gdouble _tmp49_ = 0.0;
								gdouble _tmp50_ = 0.0;
								cairo_t* _tmp51_ = NULL;
								SpitTransitionsVisuals* _tmp52_ = NULL;
								GdkRectangle _tmp53_ = {0};
								GdkRectangle _tmp54_ = {0};
								gint _tmp55_ = 0;
								gdouble _tmp56_ = 0.0;
								SpitTransitionsVisuals* _tmp57_ = NULL;
								GdkRectangle _tmp58_ = {0};
								GdkRectangle _tmp59_ = {0};
								gint _tmp60_ = 0;
								gdouble _tmp61_ = 0.0;
								gdouble _tmp62_ = 0.0;
								gdouble _tmp63_ = 0.0;
								cairo_t* _tmp64_ = NULL;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								if (!_tmp39_) {
#line 532 "SquaresEffect.c"
									gdouble _tmp40_ = 0.0;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
									_tmp40_ = x;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
									x = _tmp40_ + 1;
#line 538 "SquaresEffect.c"
								}
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp39_ = FALSE;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp41_ = x;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp42_ = self->priv->square_count_x;
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								if (!(_tmp41_ <= _tmp42_)) {
#line 64 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
									break;
#line 550 "SquaresEffect.c"
								}
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp43_ = alpha;
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp44_ = self->priv->square_count_x;
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp45_ = x;
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp46_ = self->priv->square_count_x;
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp47_ = self->priv->square_count_y;
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp48_ = y;
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp49_ = self->priv->square_count_y;
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp50_ = fmin ((gdouble) 1, _tmp43_ + ((((_tmp44_ - _tmp45_) / _tmp46_) + ((_tmp47_ - _tmp48_) / _tmp49_)) / 2.5));
#line 65 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								size = SQUARES_EFFECT_SQUARE_SIZE * _tmp50_;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp51_ = ctx;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp52_ = visuals;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								spit_transitions_visuals_get_to_pos (_tmp52_, &_tmp53_);
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp54_ = _tmp53_;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp55_ = _tmp54_.x;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp56_ = x;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp57_ = visuals;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								spit_transitions_visuals_get_to_pos (_tmp57_, &_tmp58_);
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp59_ = _tmp58_;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp60_ = _tmp59_.y;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp61_ = y;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp62_ = size;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp63_ = size;
#line 68 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								cairo_rectangle (_tmp51_, _tmp55_ + (_tmp56_ * SQUARES_EFFECT_SQUARE_SIZE), _tmp60_ + (_tmp61_ * SQUARES_EFFECT_SQUARE_SIZE), _tmp62_, _tmp63_);
#line 71 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								_tmp64_ = ctx;
#line 71 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
								cairo_fill (_tmp64_);
#line 602 "SquaresEffect.c"
							}
						}
					}
				}
			}
		}
#line 75 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp65_ = ctx;
#line 75 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		cairo_clip (_tmp65_);
#line 76 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp66_ = ctx;
#line 76 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		_tmp67_ = alpha;
#line 76 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
		cairo_paint_with_alpha (_tmp66_, _tmp67_);
#line 619 "SquaresEffect.c"
	}
}


static void squares_effect_real_advance (SpitTransitionsEffect* base, SpitTransitionsVisuals* visuals, SpitTransitionsMotion* motion, gint frame_number) {
	SquaresEffect * self;
#line 80 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT, SquaresEffect);
#line 80 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_if_fail (SPIT_TRANSITIONS_IS_VISUALS (visuals));
#line 80 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_return_if_fail (SPIT_TRANSITIONS_IS_MOTION (motion));
#line 632 "SquaresEffect.c"
}


static void squares_effect_real_cancel (SpitTransitionsEffect* base) {
	SquaresEffect * self;
#line 83 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SQUARES_EFFECT, SquaresEffect);
#line 640 "SquaresEffect.c"
}


static void squares_effect_class_init (SquaresEffectClass * klass) {
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	squares_effect_parent_class = g_type_class_peek_parent (klass);
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	g_type_class_add_private (klass, sizeof (SquaresEffectPrivate));
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	G_OBJECT_CLASS (klass)->finalize = squares_effect_finalize;
#line 651 "SquaresEffect.c"
}


static void squares_effect_spit_transitions_effect_interface_init (SpitTransitionsEffectIface * iface) {
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	squares_effect_spit_transitions_effect_parent_iface = g_type_interface_peek_parent (iface);
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	iface->get_fps = (void (*)(SpitTransitionsEffect*, gint*, gint*)) squares_effect_real_get_fps;
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	iface->start = (void (*)(SpitTransitionsEffect*, SpitTransitionsVisuals*, SpitTransitionsMotion*)) squares_effect_real_start;
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	iface->needs_clear_background = (gboolean (*)(SpitTransitionsEffect*)) squares_effect_real_needs_clear_background;
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	iface->paint = (void (*)(SpitTransitionsEffect*, SpitTransitionsVisuals*, SpitTransitionsMotion*, cairo_t*, gint, gint, gint)) squares_effect_real_paint;
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	iface->advance = (void (*)(SpitTransitionsEffect*, SpitTransitionsVisuals*, SpitTransitionsMotion*, gint)) squares_effect_real_advance;
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	iface->cancel = (void (*)(SpitTransitionsEffect*)) squares_effect_real_cancel;
#line 670 "SquaresEffect.c"
}


static void squares_effect_instance_init (SquaresEffect * self) {
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self->priv = SQUARES_EFFECT_GET_PRIVATE (self);
#line 677 "SquaresEffect.c"
}


static void squares_effect_finalize (GObject* obj) {
	SquaresEffect * self;
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SQUARES_EFFECT, SquaresEffect);
#line 28 "/home/jens/Source/shotwell/plugins/shotwell-transitions/SquaresEffect.vala"
	G_OBJECT_CLASS (squares_effect_parent_class)->finalize (obj);
#line 687 "SquaresEffect.c"
}


GType squares_effect_get_type (void) {
	static volatile gsize squares_effect_type_id__volatile = 0;
	if (g_once_init_enter (&squares_effect_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SquaresEffectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) squares_effect_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SquaresEffect), 0, (GInstanceInitFunc) squares_effect_instance_init, NULL };
		static const GInterfaceInfo spit_transitions_effect_info = { (GInterfaceInitFunc) squares_effect_spit_transitions_effect_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType squares_effect_type_id;
		squares_effect_type_id = g_type_register_static (G_TYPE_OBJECT, "SquaresEffect", &g_define_type_info, 0);
		g_type_add_interface_static (squares_effect_type_id, SPIT_TRANSITIONS_TYPE_EFFECT, &spit_transitions_effect_info);
		g_once_init_leave (&squares_effect_type_id__volatile, squares_effect_type_id);
	}
	return squares_effect_type_id__volatile;
}