/* gitg-diff-image-slider.c generated by valac 0.34.7, the Vala compiler
 * generated from gitg-diff-image-slider.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2016 - Jesse van den Kieboom
 *
 * gitg 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.
 *
 * gitg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <cairo.h>
#include <gdk/gdk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>


#define GITG_TYPE_DIFF_IMAGE_COMPOSITE (gitg_diff_image_composite_get_type ())
#define GITG_DIFF_IMAGE_COMPOSITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_DIFF_IMAGE_COMPOSITE, GitgDiffImageComposite))
#define GITG_DIFF_IMAGE_COMPOSITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_DIFF_IMAGE_COMPOSITE, GitgDiffImageCompositeClass))
#define GITG_IS_DIFF_IMAGE_COMPOSITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_DIFF_IMAGE_COMPOSITE))
#define GITG_IS_DIFF_IMAGE_COMPOSITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_DIFF_IMAGE_COMPOSITE))
#define GITG_DIFF_IMAGE_COMPOSITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_DIFF_IMAGE_COMPOSITE, GitgDiffImageCompositeClass))

typedef struct _GitgDiffImageComposite GitgDiffImageComposite;
typedef struct _GitgDiffImageCompositeClass GitgDiffImageCompositeClass;
typedef struct _GitgDiffImageCompositePrivate GitgDiffImageCompositePrivate;

#define GITG_TYPE_DIFF_IMAGE_SLIDER (gitg_diff_image_slider_get_type ())
#define GITG_DIFF_IMAGE_SLIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_DIFF_IMAGE_SLIDER, GitgDiffImageSlider))
#define GITG_DIFF_IMAGE_SLIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_DIFF_IMAGE_SLIDER, GitgDiffImageSliderClass))
#define GITG_IS_DIFF_IMAGE_SLIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_DIFF_IMAGE_SLIDER))
#define GITG_IS_DIFF_IMAGE_SLIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_DIFF_IMAGE_SLIDER))
#define GITG_DIFF_IMAGE_SLIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_DIFF_IMAGE_SLIDER, GitgDiffImageSliderClass))

typedef struct _GitgDiffImageSlider GitgDiffImageSlider;
typedef struct _GitgDiffImageSliderClass GitgDiffImageSliderClass;
typedef struct _GitgDiffImageSliderPrivate GitgDiffImageSliderPrivate;

#define GITG_TYPE_DIFF_IMAGE_SURFACE_CACHE (gitg_diff_image_surface_cache_get_type ())
#define GITG_DIFF_IMAGE_SURFACE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_DIFF_IMAGE_SURFACE_CACHE, GitgDiffImageSurfaceCache))
#define GITG_IS_DIFF_IMAGE_SURFACE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_DIFF_IMAGE_SURFACE_CACHE))
#define GITG_DIFF_IMAGE_SURFACE_CACHE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GITG_TYPE_DIFF_IMAGE_SURFACE_CACHE, GitgDiffImageSurfaceCacheIface))

typedef struct _GitgDiffImageSurfaceCache GitgDiffImageSurfaceCache;
typedef struct _GitgDiffImageSurfaceCacheIface GitgDiffImageSurfaceCacheIface;
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GitgDiffImageComposite {
	GtkDrawingArea parent_instance;
	GitgDiffImageCompositePrivate * priv;
};

struct _GitgDiffImageCompositeClass {
	GtkDrawingAreaClass parent_class;
};

struct _GitgDiffImageSlider {
	GitgDiffImageComposite parent_instance;
	GitgDiffImageSliderPrivate * priv;
};

struct _GitgDiffImageSliderClass {
	GitgDiffImageCompositeClass parent_class;
};

struct _GitgDiffImageSliderPrivate {
	gdouble d_position;
};

struct _GitgDiffImageSurfaceCacheIface {
	GTypeInterface parent_iface;
	cairo_surface_t* (*get_old_surface) (GitgDiffImageSurfaceCache* self, GdkWindow* window);
	cairo_surface_t* (*get_new_surface) (GitgDiffImageSurfaceCache* self, GdkWindow* window);
	GdkPixbuf* (*get_old_pixbuf) (GitgDiffImageSurfaceCache* self);
	void (*set_old_pixbuf) (GitgDiffImageSurfaceCache* self, GdkPixbuf* value);
	GdkPixbuf* (*get_new_pixbuf) (GitgDiffImageSurfaceCache* self);
	void (*set_new_pixbuf) (GitgDiffImageSurfaceCache* self, GdkPixbuf* value);
	GdkWindow* (*get_window) (GitgDiffImageSurfaceCache* self);
	void (*set_window) (GitgDiffImageSurfaceCache* self, GdkWindow* value);
};


static gpointer gitg_diff_image_slider_parent_class = NULL;

GType gitg_diff_image_composite_get_type (void) G_GNUC_CONST;
GType gitg_diff_image_slider_get_type (void) G_GNUC_CONST;
#define GITG_DIFF_IMAGE_SLIDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_TYPE_DIFF_IMAGE_SLIDER, GitgDiffImageSliderPrivate))
enum  {
	GITG_DIFF_IMAGE_SLIDER_DUMMY_PROPERTY,
	GITG_DIFF_IMAGE_SLIDER_POSITION
};
static gboolean gitg_diff_image_slider_real_draw (GtkWidget* base, cairo_t* cr);
void gitg_diff_image_composite_get_sizing (GitgDiffImageComposite* self, gint width, gint* image_width, gint* image_height);
GType gitg_diff_image_surface_cache_get_type (void) G_GNUC_CONST;
GitgDiffImageSurfaceCache* gitg_diff_image_composite_get_cache (GitgDiffImageComposite* self);
cairo_surface_t* gitg_diff_image_surface_cache_get_old_surface (GitgDiffImageSurfaceCache* self, GdkWindow* window);
cairo_surface_t* gitg_diff_image_surface_cache_get_new_surface (GitgDiffImageSurfaceCache* self, GdkWindow* window);
gdouble gitg_diff_image_slider_get_position (GitgDiffImageSlider* self);
static void gitg_diff_image_slider_real_realize (GtkWidget* base);
GitgDiffImageSlider* gitg_diff_image_slider_new (void);
GitgDiffImageSlider* gitg_diff_image_slider_construct (GType object_type);
GitgDiffImageComposite* gitg_diff_image_composite_new (void);
GitgDiffImageComposite* gitg_diff_image_composite_construct (GType object_type);
void gitg_diff_image_slider_set_position (GitgDiffImageSlider* self, gdouble value);
static void gitg_diff_image_slider_finalize (GObject* obj);
static void _vala_gitg_diff_image_slider_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gitg_diff_image_slider_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static gpointer _g_object_ref0 (gpointer self) {
#line 46 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	return self ? g_object_ref (self) : NULL;
#line 131 "gitg-diff-image-slider.c"
}


static gboolean gitg_diff_image_slider_real_draw (GtkWidget* base, cairo_t* cr) {
	GitgDiffImageSlider * self;
	gboolean result = FALSE;
	cairo_t* _tmp0_ = NULL;
	GdkWindow* window = NULL;
	GdkWindow* _tmp1_ = NULL;
	GdkWindow* _tmp2_ = NULL;
	GtkAllocation alloc = {0};
	GtkAllocation _tmp3_ = {0};
	gint image_width = 0;
	gint image_height = 0;
	GtkAllocation _tmp4_ = {0};
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	cairo_surface_t* old_surface = NULL;
	GitgDiffImageSurfaceCache* _tmp8_ = NULL;
	GitgDiffImageSurfaceCache* _tmp9_ = NULL;
	GdkWindow* _tmp10_ = NULL;
	cairo_surface_t* _tmp11_ = NULL;
	cairo_surface_t* new_surface = NULL;
	GitgDiffImageSurfaceCache* _tmp12_ = NULL;
	GitgDiffImageSurfaceCache* _tmp13_ = NULL;
	GdkWindow* _tmp14_ = NULL;
	cairo_surface_t* _tmp15_ = NULL;
	gint x = 0;
	GtkAllocation _tmp16_ = {0};
	gint _tmp17_ = 0;
	gint _tmp18_ = 0;
	gint y = 0;
	gint pos = 0;
	gint _tmp19_ = 0;
	gdouble _tmp20_ = 0.0;
	gdouble _tmp21_ = 0.0;
	cairo_surface_t* _tmp22_ = NULL;
	cairo_surface_t* _tmp36_ = NULL;
#line 42 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	self = (GitgDiffImageSlider*) base;
#line 42 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	g_return_val_if_fail (cr != NULL, FALSE);
#line 44 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp0_ = cr;
#line 44 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	GTK_WIDGET_CLASS (gitg_diff_image_slider_parent_class)->draw ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GITG_TYPE_DIFF_IMAGE_COMPOSITE, GitgDiffImageComposite), _tmp0_);
#line 46 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp1_ = gtk_widget_get_window ((GtkWidget*) self);
#line 46 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 46 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	window = _tmp2_;
#line 49 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp3_);
#line 49 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	alloc = _tmp3_;
#line 52 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp4_ = alloc;
#line 52 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp5_ = _tmp4_.width;
#line 52 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	gitg_diff_image_composite_get_sizing ((GitgDiffImageComposite*) self, _tmp5_, &_tmp6_, &_tmp7_);
#line 52 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	image_width = _tmp6_;
#line 52 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	image_height = _tmp7_;
#line 54 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp8_ = gitg_diff_image_composite_get_cache ((GitgDiffImageComposite*) self);
#line 54 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp9_ = _tmp8_;
#line 54 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp10_ = window;
#line 54 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp11_ = gitg_diff_image_surface_cache_get_old_surface (_tmp9_, _tmp10_);
#line 54 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	old_surface = _tmp11_;
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp12_ = gitg_diff_image_composite_get_cache ((GitgDiffImageComposite*) self);
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp13_ = _tmp12_;
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp14_ = window;
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp15_ = gitg_diff_image_surface_cache_get_new_surface (_tmp13_, _tmp14_);
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	new_surface = _tmp15_;
#line 57 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp16_ = alloc;
#line 57 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp17_ = _tmp16_.width;
#line 57 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp18_ = image_width;
#line 57 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	x = (_tmp17_ - _tmp18_) / 2;
#line 58 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	y = 0;
#line 60 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp19_ = image_width;
#line 60 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp20_ = gitg_diff_image_slider_get_position (self);
#line 60 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp21_ = _tmp20_;
#line 60 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	pos = (gint) (_tmp19_ * _tmp21_);
#line 62 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp22_ = old_surface;
#line 62 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	if (_tmp22_ != NULL) {
#line 241 "gitg-diff-image-slider.c"
		cairo_t* _tmp23_ = NULL;
		cairo_t* _tmp35_ = NULL;
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		_tmp23_ = cr;
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		cairo_save (_tmp23_);
#line 248 "gitg-diff-image-slider.c"
		{
			cairo_t* _tmp24_ = NULL;
			gint _tmp25_ = 0;
			gint _tmp26_ = 0;
			gint _tmp27_ = 0;
			gint _tmp28_ = 0;
			cairo_t* _tmp29_ = NULL;
			cairo_t* _tmp30_ = NULL;
			cairo_surface_t* _tmp31_ = NULL;
			gint _tmp32_ = 0;
			gint _tmp33_ = 0;
			cairo_t* _tmp34_ = NULL;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp24_ = cr;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp25_ = x;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp26_ = y;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp27_ = pos;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp28_ = image_height;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_rectangle (_tmp24_, (gdouble) _tmp25_, (gdouble) _tmp26_, (gdouble) _tmp27_, (gdouble) _tmp28_);
#line 67 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp29_ = cr;
#line 67 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_clip (_tmp29_);
#line 68 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp30_ = cr;
#line 68 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp31_ = old_surface;
#line 68 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp32_ = x;
#line 68 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp33_ = y;
#line 68 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_set_source_surface (_tmp30_, _tmp31_, (gdouble) _tmp32_, (gdouble) _tmp33_);
#line 69 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp34_ = cr;
#line 69 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_paint (_tmp34_);
#line 291 "gitg-diff-image-slider.c"
		}
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		_tmp35_ = cr;
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		cairo_restore (_tmp35_);
#line 297 "gitg-diff-image-slider.c"
	}
#line 74 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp36_ = new_surface;
#line 74 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	if (_tmp36_ != NULL) {
#line 303 "gitg-diff-image-slider.c"
		cairo_t* _tmp37_ = NULL;
		cairo_t* _tmp51_ = NULL;
#line 76 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		_tmp37_ = cr;
#line 76 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		cairo_save (_tmp37_);
#line 310 "gitg-diff-image-slider.c"
		{
			cairo_t* _tmp38_ = NULL;
			gint _tmp39_ = 0;
			gint _tmp40_ = 0;
			gint _tmp41_ = 0;
			gint _tmp42_ = 0;
			gint _tmp43_ = 0;
			gint _tmp44_ = 0;
			cairo_t* _tmp45_ = NULL;
			cairo_t* _tmp46_ = NULL;
			cairo_surface_t* _tmp47_ = NULL;
			gint _tmp48_ = 0;
			gint _tmp49_ = 0;
			cairo_t* _tmp50_ = NULL;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp38_ = cr;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp39_ = x;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp40_ = pos;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp41_ = y;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp42_ = image_width;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp43_ = pos;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp44_ = image_height;
#line 78 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_rectangle (_tmp38_, (gdouble) (_tmp39_ + _tmp40_), (gdouble) _tmp41_, (gdouble) (_tmp42_ - _tmp43_), (gdouble) _tmp44_);
#line 79 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp45_ = cr;
#line 79 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_clip (_tmp45_);
#line 80 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp46_ = cr;
#line 80 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp47_ = new_surface;
#line 80 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp48_ = x;
#line 80 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp49_ = y;
#line 80 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_set_source_surface (_tmp46_, _tmp47_, (gdouble) _tmp48_, (gdouble) _tmp49_);
#line 81 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			_tmp50_ = cr;
#line 81 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
			cairo_paint (_tmp50_);
#line 359 "gitg-diff-image-slider.c"
		}
#line 83 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		_tmp51_ = cr;
#line 83 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		cairo_restore (_tmp51_);
#line 365 "gitg-diff-image-slider.c"
	}
#line 86 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	result = TRUE;
#line 86 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_cairo_surface_destroy0 (new_surface);
#line 86 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_cairo_surface_destroy0 (old_surface);
#line 86 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_g_object_unref0 (window);
#line 86 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	return result;
#line 377 "gitg-diff-image-slider.c"
}


static void gitg_diff_image_slider_real_realize (GtkWidget* base) {
	GitgDiffImageSlider * self;
#line 89 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	self = (GitgDiffImageSlider*) base;
#line 91 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	GTK_WIDGET_CLASS (gitg_diff_image_slider_parent_class)->realize ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GITG_TYPE_DIFF_IMAGE_COMPOSITE, GitgDiffImageComposite));
#line 92 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	gtk_widget_queue_resize ((GtkWidget*) self);
#line 389 "gitg-diff-image-slider.c"
}


GitgDiffImageSlider* gitg_diff_image_slider_construct (GType object_type) {
	GitgDiffImageSlider * self = NULL;
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	self = (GitgDiffImageSlider*) gitg_diff_image_composite_construct (object_type);
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	return self;
#line 399 "gitg-diff-image-slider.c"
}


GitgDiffImageSlider* gitg_diff_image_slider_new (void) {
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	return gitg_diff_image_slider_construct (GITG_TYPE_DIFF_IMAGE_SLIDER);
#line 406 "gitg-diff-image-slider.c"
}


gdouble gitg_diff_image_slider_get_position (GitgDiffImageSlider* self) {
	gdouble result;
	gdouble _tmp0_ = 0.0;
#line 26 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	g_return_val_if_fail (self != NULL, 0.0);
#line 26 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp0_ = self->priv->d_position;
#line 26 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	result = _tmp0_;
#line 26 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	return result;
#line 421 "gitg-diff-image-slider.c"
}


void gitg_diff_image_slider_set_position (GitgDiffImageSlider* self, gdouble value) {
	gdouble newpos = 0.0;
	gdouble _tmp0_ = 0.0;
	gdouble _tmp1_ = 0.0;
	gdouble _tmp2_ = 0.0;
	gdouble _tmp3_ = 0.0;
	gdouble _tmp4_ = 0.0;
#line 28 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	g_return_if_fail (self != NULL);
#line 30 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp0_ = value;
#line 30 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp1_ = MIN (_tmp0_, (gdouble) 1);
#line 30 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp2_ = MAX ((gdouble) 0, _tmp1_);
#line 30 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	newpos = _tmp2_;
#line 32 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp3_ = newpos;
#line 32 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	_tmp4_ = self->priv->d_position;
#line 32 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	if (_tmp3_ != _tmp4_) {
#line 448 "gitg-diff-image-slider.c"
		gdouble _tmp5_ = 0.0;
#line 34 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		_tmp5_ = newpos;
#line 34 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		self->priv->d_position = _tmp5_;
#line 35 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		gtk_widget_queue_draw ((GtkWidget*) self);
#line 456 "gitg-diff-image-slider.c"
	}
#line 28 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	g_object_notify ((GObject *) self, "position");
#line 460 "gitg-diff-image-slider.c"
}


static void gitg_diff_image_slider_class_init (GitgDiffImageSliderClass * klass) {
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	gitg_diff_image_slider_parent_class = g_type_class_peek_parent (klass);
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	g_type_class_add_private (klass, sizeof (GitgDiffImageSliderPrivate));
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	((GtkWidgetClass *) klass)->draw = (gboolean (*)(GtkWidget*, cairo_t*)) gitg_diff_image_slider_real_draw;
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	((GtkWidgetClass *) klass)->realize = (void (*)(GtkWidget*)) gitg_diff_image_slider_real_realize;
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_diff_image_slider_get_property;
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_diff_image_slider_set_property;
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_diff_image_slider_finalize;
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_DIFF_IMAGE_SLIDER_POSITION, g_param_spec_double ("position", "position", "position", -G_MAXDOUBLE, G_MAXDOUBLE, 0.5, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 481 "gitg-diff-image-slider.c"
}


static void gitg_diff_image_slider_instance_init (GitgDiffImageSlider * self) {
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	self->priv = GITG_DIFF_IMAGE_SLIDER_GET_PRIVATE (self);
#line 488 "gitg-diff-image-slider.c"
}


static void gitg_diff_image_slider_finalize (GObject* obj) {
	GitgDiffImageSlider * self;
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_DIFF_IMAGE_SLIDER, GitgDiffImageSlider);
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	G_OBJECT_CLASS (gitg_diff_image_slider_parent_class)->finalize (obj);
#line 498 "gitg-diff-image-slider.c"
}


GType gitg_diff_image_slider_get_type (void) {
	static volatile gsize gitg_diff_image_slider_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_diff_image_slider_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgDiffImageSliderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_diff_image_slider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgDiffImageSlider), 0, (GInstanceInitFunc) gitg_diff_image_slider_instance_init, NULL };
		GType gitg_diff_image_slider_type_id;
		gitg_diff_image_slider_type_id = g_type_register_static (GITG_TYPE_DIFF_IMAGE_COMPOSITE, "GitgDiffImageSlider", &g_define_type_info, 0);
		g_once_init_leave (&gitg_diff_image_slider_type_id__volatile, gitg_diff_image_slider_type_id);
	}
	return gitg_diff_image_slider_type_id__volatile;
}


static void _vala_gitg_diff_image_slider_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GitgDiffImageSlider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_DIFF_IMAGE_SLIDER, GitgDiffImageSlider);
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	switch (property_id) {
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		case GITG_DIFF_IMAGE_SLIDER_POSITION:
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		g_value_set_double (value, gitg_diff_image_slider_get_position (self));
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		break;
#line 525 "gitg-diff-image-slider.c"
		default:
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		break;
#line 531 "gitg-diff-image-slider.c"
	}
}


static void _vala_gitg_diff_image_slider_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GitgDiffImageSlider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_DIFF_IMAGE_SLIDER, GitgDiffImageSlider);
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
	switch (property_id) {
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		case GITG_DIFF_IMAGE_SLIDER_POSITION:
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		gitg_diff_image_slider_set_position (self, g_value_get_double (value));
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		break;
#line 547 "gitg-diff-image-slider.c"
		default:
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "/home/jesse/dev/gitg/libgitg/gitg-diff-image-slider.vala"
		break;
#line 553 "gitg-diff-image-slider.c"
	}
}



