/* progress-bin.c generated by valac 0.34.7, the Vala compiler
 * generated from progress-bin.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include "libgitg/libgitg.h"
#include <stdio.h>
#include <gdk/gdk.h>
#include <gobject/gvaluecollector.h>


#define TYPE_TEST_PROGRESS_GRID (test_progress_grid_get_type ())
#define TEST_PROGRESS_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_PROGRESS_GRID, TestProgressGrid))
#define TEST_PROGRESS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_PROGRESS_GRID, TestProgressGridClass))
#define IS_TEST_PROGRESS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_PROGRESS_GRID))
#define IS_TEST_PROGRESS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_PROGRESS_GRID))
#define TEST_PROGRESS_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_PROGRESS_GRID, TestProgressGridClass))

typedef struct _TestProgressGrid TestProgressGrid;
typedef struct _TestProgressGridClass TestProgressGridClass;
typedef struct _TestProgressGridPrivate TestProgressGridPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ParamSpecTestProgressGrid ParamSpecTestProgressGrid;

struct _TestProgressGrid {
	GTypeInstance parent_instance;
	volatile int ref_count;
	TestProgressGridPrivate * priv;
};

struct _TestProgressGridClass {
	GTypeClass parent_class;
	void (*finalize) (TestProgressGrid *self);
};

struct _ParamSpecTestProgressGrid {
	GParamSpec parent_instance;
};


static gpointer test_progress_grid_parent_class = NULL;

gpointer test_progress_grid_ref (gpointer instance);
void test_progress_grid_unref (gpointer instance);
GParamSpec* param_spec_test_progress_grid (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_test_progress_grid (GValue* value, gpointer v_object);
void value_take_test_progress_grid (GValue* value, gpointer v_object);
gpointer value_get_test_progress_grid (const GValue* value);
GType test_progress_grid_get_type (void) G_GNUC_CONST;
enum  {
	TEST_PROGRESS_GRID_DUMMY_PROPERTY
};
gint test_progress_grid_main (gchar** args, int args_length1);
static gboolean __lambda4_ (GtkWidget* w, GdkEventAny* ev);
static gboolean ___lambda4__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self);
TestProgressGrid* test_progress_grid_new (void);
TestProgressGrid* test_progress_grid_construct (GType object_type);
static void test_progress_grid_finalize (TestProgressGrid* obj);


static gboolean __lambda4_ (GtkWidget* w, GdkEventAny* ev) {
	gboolean result = FALSE;
#line 27 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_return_val_if_fail (w != NULL, FALSE);
#line 27 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_return_val_if_fail (ev != NULL, FALSE);
#line 28 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	gtk_main_quit ();
#line 29 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	result = TRUE;
#line 29 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return result;
#line 79 "progress-bin.c"
}


static gboolean ___lambda4__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self) {
	gboolean result;
	result = __lambda4_ (_sender, event);
#line 27 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return result;
#line 88 "progress-bin.c"
}


gint test_progress_grid_main (gchar** args, int args_length1) {
	gint result = 0;
	GtkWindow* window = NULL;
	GtkWindow* _tmp4_ = NULL;
	GtkWindow* _tmp5_ = NULL;
	GitgProgressBin* grid = NULL;
	GitgProgressBin* _tmp6_ = NULL;
	GitgProgressBin* _tmp7_ = NULL;
	GtkWindow* _tmp8_ = NULL;
	GitgProgressBin* _tmp9_ = NULL;
	GtkWindow* _tmp10_ = NULL;
	GtkWindow* _tmp11_ = NULL;
	GError * _inner_error_ = NULL;
#line 8 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	gtk_init (&args_length1, &args);
#line 107 "progress-bin.c"
	{
#line 12 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		gitg_init (&_inner_error_);
#line 12 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 113 "progress-bin.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FILE* _tmp0_ = NULL;
		GError* _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
#line 10 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		e = _inner_error_;
#line 10 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		_inner_error_ = NULL;
#line 16 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		_tmp0_ = stderr;
#line 16 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		_tmp1_ = e;
#line 16 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		_tmp2_ = _tmp1_->message;
#line 16 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		fprintf (_tmp0_, "Failed to initialize ggit: %s\n", _tmp2_);
#line 17 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		result = 1;
#line 17 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		_g_error_free0 (e);
#line 17 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		return result;
#line 142 "progress-bin.c"
	}
	__finally0:
#line 10 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 147 "progress-bin.c"
		gint _tmp3_ = 0;
#line 10 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 10 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		g_clear_error (&_inner_error_);
#line 10 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		return _tmp3_;
#line 155 "progress-bin.c"
	}
#line 20 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp4_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
#line 20 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_object_ref_sink (_tmp4_);
#line 20 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	window = _tmp4_;
#line 21 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp5_ = window;
#line 21 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	gtk_window_set_default_size (_tmp5_, 300, 300);
#line 22 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp6_ = gitg_progress_bin_new ();
#line 22 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_object_ref_sink (_tmp6_);
#line 22 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	grid = _tmp6_;
#line 23 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp7_ = grid;
#line 23 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	gitg_progress_bin_set_fraction (_tmp7_, 0.3);
#line 24 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp8_ = window;
#line 24 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp9_ = grid;
#line 24 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	gtk_container_add ((GtkContainer*) _tmp8_, (GtkWidget*) _tmp9_);
#line 25 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp10_ = window;
#line 25 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	gtk_widget_show_all ((GtkWidget*) _tmp10_);
#line 27 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_tmp11_ = window;
#line 27 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_signal_connect ((GtkWidget*) _tmp11_, "delete-event", (GCallback) ___lambda4__gtk_widget_delete_event, NULL);
#line 32 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	gtk_main ();
#line 34 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	result = 0;
#line 34 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_g_object_unref0 (grid);
#line 34 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	_g_object_unref0 (window);
#line 34 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return result;
#line 201 "progress-bin.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 6 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return test_progress_grid_main (argv, argc);
#line 211 "progress-bin.c"
}


TestProgressGrid* test_progress_grid_construct (GType object_type) {
	TestProgressGrid* self = NULL;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	self = (TestProgressGrid*) g_type_create_instance (object_type);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return self;
#line 221 "progress-bin.c"
}


TestProgressGrid* test_progress_grid_new (void) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return test_progress_grid_construct (TYPE_TEST_PROGRESS_GRID);
#line 228 "progress-bin.c"
}


static void value_test_progress_grid_init (GValue* value) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	value->data[0].v_pointer = NULL;
#line 235 "progress-bin.c"
}


static void value_test_progress_grid_free_value (GValue* value) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (value->data[0].v_pointer) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		test_progress_grid_unref (value->data[0].v_pointer);
#line 244 "progress-bin.c"
	}
}


static void value_test_progress_grid_copy_value (const GValue* src_value, GValue* dest_value) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (src_value->data[0].v_pointer) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		dest_value->data[0].v_pointer = test_progress_grid_ref (src_value->data[0].v_pointer);
#line 254 "progress-bin.c"
	} else {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		dest_value->data[0].v_pointer = NULL;
#line 258 "progress-bin.c"
	}
}


static gpointer value_test_progress_grid_peek_pointer (const GValue* value) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return value->data[0].v_pointer;
#line 266 "progress-bin.c"
}


static gchar* value_test_progress_grid_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (collect_values[0].v_pointer) {
#line 273 "progress-bin.c"
		TestProgressGrid* object;
		object = collect_values[0].v_pointer;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		if (object->parent_instance.g_class == NULL) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 280 "progress-bin.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 284 "progress-bin.c"
		}
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		value->data[0].v_pointer = test_progress_grid_ref (object);
#line 288 "progress-bin.c"
	} else {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		value->data[0].v_pointer = NULL;
#line 292 "progress-bin.c"
	}
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return NULL;
#line 296 "progress-bin.c"
}


static gchar* value_test_progress_grid_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	TestProgressGrid** object_p;
	object_p = collect_values[0].v_pointer;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (!object_p) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 307 "progress-bin.c"
	}
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (!value->data[0].v_pointer) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		*object_p = NULL;
#line 313 "progress-bin.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		*object_p = value->data[0].v_pointer;
#line 317 "progress-bin.c"
	} else {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		*object_p = test_progress_grid_ref (value->data[0].v_pointer);
#line 321 "progress-bin.c"
	}
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return NULL;
#line 325 "progress-bin.c"
}


GParamSpec* param_spec_test_progress_grid (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecTestProgressGrid* spec;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_TEST_PROGRESS_GRID), NULL);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return G_PARAM_SPEC (spec);
#line 339 "progress-bin.c"
}


gpointer value_get_test_progress_grid (const GValue* value) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_PROGRESS_GRID), NULL);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return value->data[0].v_pointer;
#line 348 "progress-bin.c"
}


void value_set_test_progress_grid (GValue* value, gpointer v_object) {
	TestProgressGrid* old;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_PROGRESS_GRID));
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	old = value->data[0].v_pointer;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (v_object) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_PROGRESS_GRID));
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		value->data[0].v_pointer = v_object;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		test_progress_grid_ref (value->data[0].v_pointer);
#line 368 "progress-bin.c"
	} else {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		value->data[0].v_pointer = NULL;
#line 372 "progress-bin.c"
	}
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (old) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		test_progress_grid_unref (old);
#line 378 "progress-bin.c"
	}
}


void value_take_test_progress_grid (GValue* value, gpointer v_object) {
	TestProgressGrid* old;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST_PROGRESS_GRID));
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	old = value->data[0].v_pointer;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (v_object) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST_PROGRESS_GRID));
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		value->data[0].v_pointer = v_object;
#line 397 "progress-bin.c"
	} else {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		value->data[0].v_pointer = NULL;
#line 401 "progress-bin.c"
	}
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (old) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		test_progress_grid_unref (old);
#line 407 "progress-bin.c"
	}
}


static void test_progress_grid_class_init (TestProgressGridClass * klass) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	test_progress_grid_parent_class = g_type_class_peek_parent (klass);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	((TestProgressGridClass *) klass)->finalize = test_progress_grid_finalize;
#line 417 "progress-bin.c"
}


static void test_progress_grid_instance_init (TestProgressGrid * self) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	self->ref_count = 1;
#line 424 "progress-bin.c"
}


static void test_progress_grid_finalize (TestProgressGrid* obj) {
	TestProgressGrid * self;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEST_PROGRESS_GRID, TestProgressGrid);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_signal_handlers_destroy (self);
#line 434 "progress-bin.c"
}


GType test_progress_grid_get_type (void) {
	static volatile gsize test_progress_grid_type_id__volatile = 0;
	if (g_once_init_enter (&test_progress_grid_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_test_progress_grid_init, value_test_progress_grid_free_value, value_test_progress_grid_copy_value, value_test_progress_grid_peek_pointer, "p", value_test_progress_grid_collect_value, "p", value_test_progress_grid_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (TestProgressGridClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_progress_grid_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TestProgressGrid), 0, (GInstanceInitFunc) test_progress_grid_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType test_progress_grid_type_id;
		test_progress_grid_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TestProgressGrid", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&test_progress_grid_type_id__volatile, test_progress_grid_type_id);
	}
	return test_progress_grid_type_id__volatile;
}


gpointer test_progress_grid_ref (gpointer instance) {
	TestProgressGrid* self;
	self = instance;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	g_atomic_int_inc (&self->ref_count);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	return instance;
#line 459 "progress-bin.c"
}


void test_progress_grid_unref (gpointer instance) {
	TestProgressGrid* self;
	self = instance;
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		TEST_PROGRESS_GRID_GET_CLASS (self)->finalize (self);
#line 4 "/home/jesse/dev/gitg/tests/progress-bin.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 472 "progress-bin.c"
	}
}



