/* score-dialog.c generated by valac 0.34.0.4-5c9b2, the Vala compiler
 * generated from score-dialog.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 <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <pango/pango.h>
#include <float.h>
#include <math.h>


#define TYPE_SCORE_DIALOG (score_dialog_get_type ())
#define SCORE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCORE_DIALOG, ScoreDialog))
#define SCORE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SCORE_DIALOG, ScoreDialogClass))
#define IS_SCORE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SCORE_DIALOG))
#define IS_SCORE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SCORE_DIALOG))
#define SCORE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SCORE_DIALOG, ScoreDialogClass))

typedef struct _ScoreDialog ScoreDialog;
typedef struct _ScoreDialogClass ScoreDialogClass;
typedef struct _ScoreDialogPrivate ScoreDialogPrivate;

#define TYPE_HISTORY (history_get_type ())
#define HISTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HISTORY, History))
#define HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HISTORY, HistoryClass))
#define IS_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HISTORY))
#define IS_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HISTORY))
#define HISTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HISTORY, HistoryClass))

typedef struct _History History;
typedef struct _HistoryClass HistoryClass;

#define TYPE_HISTORY_ENTRY (history_entry_get_type ())
#define HISTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HISTORY_ENTRY, HistoryEntry))
#define HISTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HISTORY_ENTRY, HistoryEntryClass))
#define IS_HISTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HISTORY_ENTRY))
#define IS_HISTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HISTORY_ENTRY))
#define HISTORY_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HISTORY_ENTRY, HistoryEntryClass))

typedef struct _HistoryEntry HistoryEntry;
typedef struct _HistoryEntryClass HistoryEntryClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _HistoryPrivate HistoryPrivate;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _HistoryEntryPrivate HistoryEntryPrivate;
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ScoreDialog {
	GtkDialog parent_instance;
	ScoreDialogPrivate * priv;
};

struct _ScoreDialogClass {
	GtkDialogClass parent_class;
};

struct _ScoreDialogPrivate {
	History* history;
	HistoryEntry* selected_entry;
	GtkListStore* score_model;
	GtkTreeView* scores;
};

struct _History {
	GObject parent_instance;
	HistoryPrivate * priv;
	gchar* filename;
	GList* entries;
};

struct _HistoryClass {
	GObjectClass parent_class;
};

struct _HistoryEntry {
	GObject parent_instance;
	HistoryEntryPrivate * priv;
	GDateTime* date;
	gint score;
};

struct _HistoryEntryClass {
	GObjectClass parent_class;
};


static gpointer score_dialog_parent_class = NULL;

GType score_dialog_get_type (void) G_GNUC_CONST;
GType history_get_type (void) G_GNUC_CONST;
GType history_entry_get_type (void) G_GNUC_CONST;
#define SCORE_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SCORE_DIALOG, ScoreDialogPrivate))
enum  {
	SCORE_DIALOG_DUMMY_PROPERTY
};
ScoreDialog* score_dialog_new (History* history, HistoryEntry* selected_entry, gboolean show_close);
ScoreDialog* score_dialog_construct (GType object_type, History* history, HistoryEntry* selected_entry, gboolean show_close);
static void score_dialog_entry_added_cb (ScoreDialog* self, HistoryEntry* entry);
static void _score_dialog_entry_added_cb_history_entry_added (History* _sender, HistoryEntry* entry, gpointer self);
static gint score_dialog_compare_entries (HistoryEntry* a, HistoryEntry* b);
static gint _score_dialog_compare_entries_gcompare_func (gconstpointer a, gconstpointer b);
static void score_dialog_finalize (GObject* obj);


static gpointer _g_object_ref0 (gpointer self) {
#line 20 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	return self ? g_object_ref (self) : NULL;
#line 123 "score-dialog.c"
}


static void _score_dialog_entry_added_cb_history_entry_added (History* _sender, HistoryEntry* entry, gpointer self) {
#line 21 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	score_dialog_entry_added_cb ((ScoreDialog*) self, entry);
#line 130 "score-dialog.c"
}


static gint _score_dialog_compare_entries_gcompare_func (gconstpointer a, gconstpointer b) {
	gint result;
	result = score_dialog_compare_entries ((HistoryEntry*) a, (HistoryEntry*) b);
#line 57 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	return result;
#line 139 "score-dialog.c"
}


ScoreDialog* score_dialog_construct (GType object_type, History* history, HistoryEntry* selected_entry, gboolean show_close) {
	ScoreDialog * self = NULL;
	History* _tmp0_ = NULL;
	History* _tmp1_ = NULL;
	History* _tmp2_ = NULL;
	HistoryEntry* _tmp3_ = NULL;
	HistoryEntry* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	GtkBox* vbox = NULL;
	GtkBox* _tmp9_ = NULL;
	GtkBox* _tmp10_ = NULL;
	GtkBox* _tmp11_ = NULL;
	GtkBox* _tmp12_ = NULL;
	GtkBox* _tmp13_ = NULL;
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp14_ = NULL;
	GtkScrolledWindow* _tmp15_ = NULL;
	GtkScrolledWindow* _tmp16_ = NULL;
	GtkScrolledWindow* _tmp17_ = NULL;
	GtkBox* _tmp18_ = NULL;
	GtkScrolledWindow* _tmp19_ = NULL;
	GtkListStore* _tmp20_ = NULL;
	GtkTreeView* _tmp21_ = NULL;
	GtkCellRendererText* renderer = NULL;
	GtkCellRendererText* _tmp22_ = NULL;
	GtkTreeView* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	GtkCellRendererText* _tmp25_ = NULL;
	GtkCellRendererText* _tmp26_ = NULL;
	GtkCellRendererText* _tmp27_ = NULL;
	GtkTreeView* _tmp28_ = NULL;
	const gchar* _tmp29_ = NULL;
	GtkCellRendererText* _tmp30_ = NULL;
	GtkTreeView* _tmp31_ = NULL;
	GtkListStore* _tmp32_ = NULL;
	GtkTreeView* _tmp33_ = NULL;
	GtkScrolledWindow* _tmp34_ = NULL;
	GtkTreeView* _tmp35_ = NULL;
	GList* entries = NULL;
	History* _tmp36_ = NULL;
	GList* _tmp37_ = NULL;
	GList* _tmp38_ = NULL;
	GList* _tmp39_ = NULL;
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_return_val_if_fail (history != NULL, NULL);
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self = (ScoreDialog*) g_object_new (object_type, NULL);
#line 20 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp0_ = history;
#line 20 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 20 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->history);
#line 20 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self->priv->history = _tmp1_;
#line 21 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp2_ = history;
#line 21 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_signal_connect_object (_tmp2_, "entry-added", (GCallback) _score_dialog_entry_added_cb_history_entry_added, self, 0);
#line 22 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp3_ = selected_entry;
#line 22 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 22 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->selected_entry);
#line 22 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self->priv->selected_entry = _tmp4_;
#line 24 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp5_ = show_close;
#line 24 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	if (_tmp5_) {
#line 214 "score-dialog.c"
		const gchar* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
#line 26 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp6_ = _ ("_Close");
#line 26 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		gtk_dialog_add_button ((GtkDialog*) self, _tmp6_, (gint) GTK_RESPONSE_CLOSE);
#line 27 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp7_ = _ ("New Game");
#line 27 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		gtk_dialog_add_button ((GtkDialog*) self, _tmp7_, (gint) GTK_RESPONSE_OK);
#line 225 "score-dialog.c"
	} else {
		const gchar* _tmp8_ = NULL;
#line 30 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp8_ = _ ("_OK");
#line 30 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		gtk_dialog_add_button ((GtkDialog*) self, _tmp8_, (gint) GTK_RESPONSE_DELETE_EVENT);
#line 232 "score-dialog.c"
	}
#line 31 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_widget_set_size_request ((GtkWidget*) self, 200, 300);
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp9_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_object_ref_sink (_tmp9_);
#line 33 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	vbox = _tmp9_;
#line 34 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp10_ = vbox;
#line 34 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_container_set_border_width ((GtkContainer*) _tmp10_, (guint) 6);
#line 35 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp11_ = vbox;
#line 35 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_widget_show ((GtkWidget*) _tmp11_);
#line 36 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp12_ = (GtkBox*) gtk_dialog_get_content_area ((GtkDialog*) self);
#line 36 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp13_ = vbox;
#line 36 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_box_pack_start (_tmp12_, (GtkWidget*) _tmp13_, TRUE, TRUE, (guint) 0);
#line 38 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp14_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
#line 38 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_object_ref_sink (_tmp14_);
#line 38 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	scroll = _tmp14_;
#line 39 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp15_ = scroll;
#line 39 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_scrolled_window_set_shadow_type (_tmp15_, GTK_SHADOW_ETCHED_IN);
#line 40 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp16_ = scroll;
#line 40 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_scrolled_window_set_policy (_tmp16_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
#line 41 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp17_ = scroll;
#line 41 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_widget_show ((GtkWidget*) _tmp17_);
#line 42 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp18_ = vbox;
#line 42 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp19_ = scroll;
#line 42 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_box_pack_start (_tmp18_, (GtkWidget*) _tmp19_, TRUE, TRUE, (guint) 0);
#line 44 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp20_ = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, -1);
#line 44 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->score_model);
#line 44 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self->priv->score_model = _tmp20_;
#line 46 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp21_ = (GtkTreeView*) gtk_tree_view_new ();
#line 46 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_object_ref_sink (_tmp21_);
#line 46 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->scores);
#line 46 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self->priv->scores = _tmp21_;
#line 47 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp22_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
#line 47 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_object_ref_sink (_tmp22_);
#line 47 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	renderer = _tmp22_;
#line 48 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp23_ = self->priv->scores;
#line 48 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp24_ = _ ("Date");
#line 48 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp25_ = renderer;
#line 48 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_tree_view_insert_column_with_attributes (_tmp23_, -1, _tmp24_, (GtkCellRenderer*) _tmp25_, "text", 0, "weight", 2, NULL);
#line 49 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp26_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
#line 49 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_object_ref_sink (_tmp26_);
#line 49 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (renderer);
#line 49 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	renderer = _tmp26_;
#line 50 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp27_ = renderer;
#line 50 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_object_set ((GtkCellRenderer*) _tmp27_, "xalign", 1.0f, NULL);
#line 51 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp28_ = self->priv->scores;
#line 51 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp29_ = _ ("Score");
#line 51 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp30_ = renderer;
#line 51 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_tree_view_insert_column_with_attributes (_tmp28_, -1, _tmp29_, (GtkCellRenderer*) _tmp30_, "text", 1, "weight", 2, NULL);
#line 52 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp31_ = self->priv->scores;
#line 52 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp32_ = self->priv->score_model;
#line 52 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_tree_view_set_model (_tmp31_, (GtkTreeModel*) _tmp32_);
#line 53 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp33_ = self->priv->scores;
#line 53 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_widget_show ((GtkWidget*) _tmp33_);
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp34_ = scroll;
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp35_ = self->priv->scores;
#line 54 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_container_add ((GtkContainer*) _tmp34_, (GtkWidget*) _tmp35_);
#line 56 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp36_ = history;
#line 56 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp37_ = _tmp36_->entries;
#line 56 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp38_ = g_list_copy (_tmp37_);
#line 56 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	entries = _tmp38_;
#line 57 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	entries = g_list_sort (entries, _score_dialog_compare_entries_gcompare_func);
#line 58 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp39_ = entries;
#line 356 "score-dialog.c"
	{
		GList* entry_collection = NULL;
		GList* entry_it = NULL;
#line 58 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		entry_collection = _tmp39_;
#line 58 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		for (entry_it = entry_collection; entry_it != NULL; entry_it = entry_it->next) {
#line 364 "score-dialog.c"
			HistoryEntry* entry = NULL;
#line 58 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			entry = (HistoryEntry*) entry_it->data;
#line 368 "score-dialog.c"
			{
				HistoryEntry* _tmp40_ = NULL;
#line 59 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
				_tmp40_ = entry;
#line 59 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
				score_dialog_entry_added_cb (self, _tmp40_);
#line 375 "score-dialog.c"
			}
		}
	}
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_list_free0 (entries);
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (renderer);
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (scroll);
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (vbox);
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	return self;
#line 389 "score-dialog.c"
}


ScoreDialog* score_dialog_new (History* history, HistoryEntry* selected_entry, gboolean show_close) {
#line 18 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	return score_dialog_construct (TYPE_SCORE_DIALOG, history, selected_entry, show_close);
#line 396 "score-dialog.c"
}


static gint score_dialog_compare_entries (HistoryEntry* a, HistoryEntry* b) {
	gint result = 0;
	HistoryEntry* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	HistoryEntry* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	HistoryEntry* _tmp8_ = NULL;
	GDateTime* _tmp9_ = NULL;
	HistoryEntry* _tmp10_ = NULL;
	GDateTime* _tmp11_ = NULL;
	gint _tmp12_ = 0;
#line 62 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_return_val_if_fail (a != NULL, 0);
#line 62 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_return_val_if_fail (b != NULL, 0);
#line 64 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp0_ = a;
#line 64 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp1_ = _tmp0_->score;
#line 64 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp2_ = b;
#line 64 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp3_ = _tmp2_->score;
#line 64 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	if (_tmp1_ != _tmp3_) {
#line 425 "score-dialog.c"
		HistoryEntry* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		HistoryEntry* _tmp6_ = NULL;
		gint _tmp7_ = 0;
#line 65 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp4_ = b;
#line 65 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp5_ = _tmp4_->score;
#line 65 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp6_ = a;
#line 65 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp7_ = _tmp6_->score;
#line 65 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		result = _tmp5_ - _tmp7_;
#line 65 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		return result;
#line 442 "score-dialog.c"
	}
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp8_ = a;
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp9_ = _tmp8_->date;
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp10_ = b;
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp11_ = _tmp10_->date;
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp12_ = g_date_time_compare (_tmp9_, _tmp11_);
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	result = _tmp12_;
#line 66 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	return result;
#line 458 "score-dialog.c"
}


static void score_dialog_entry_added_cb (ScoreDialog* self, HistoryEntry* entry) {
	gchar* date_label = NULL;
	HistoryEntry* _tmp0_ = NULL;
	GDateTime* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* score_label = NULL;
	HistoryEntry* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gchar* _tmp5_ = NULL;
	gint weight = 0;
	HistoryEntry* _tmp6_ = NULL;
	HistoryEntry* _tmp7_ = NULL;
	GtkTreeIter iter = {0};
	GtkListStore* _tmp8_ = NULL;
	GtkTreeIter _tmp9_ = {0};
	GtkListStore* _tmp10_ = NULL;
	GtkTreeIter _tmp11_ = {0};
	const gchar* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	gint _tmp14_ = 0;
	HistoryEntry* _tmp15_ = NULL;
	HistoryEntry* _tmp16_ = NULL;
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_return_if_fail (self != NULL);
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_return_if_fail (entry != NULL);
#line 71 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp0_ = entry;
#line 71 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp1_ = _tmp0_->date;
#line 71 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp2_ = g_date_time_format (_tmp1_, "%d/%m/%Y");
#line 71 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	date_label = _tmp2_;
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp3_ = entry;
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp4_ = _tmp3_->score;
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp5_ = g_strdup_printf ("%i", _tmp4_);
#line 72 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	score_label = _tmp5_;
#line 74 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	weight = (gint) PANGO_WEIGHT_NORMAL;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp6_ = entry;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp7_ = self->priv->selected_entry;
#line 75 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	if (_tmp6_ == _tmp7_) {
#line 76 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		weight = (gint) PANGO_WEIGHT_BOLD;
#line 514 "score-dialog.c"
	}
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp8_ = self->priv->score_model;
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_list_store_append (_tmp8_, &_tmp9_);
#line 79 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	iter = _tmp9_;
#line 80 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp10_ = self->priv->score_model;
#line 80 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp11_ = iter;
#line 80 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp12_ = date_label;
#line 80 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp13_ = score_label;
#line 80 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp14_ = weight;
#line 80 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	gtk_list_store_set (_tmp10_, &_tmp11_, 0, _tmp12_, 1, _tmp13_, 2, _tmp14_, -1);
#line 82 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp15_ = entry;
#line 82 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_tmp16_ = self->priv->selected_entry;
#line 82 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	if (_tmp15_ == _tmp16_) {
#line 540 "score-dialog.c"
		GtkTreeIter piter = {0};
		GtkTreeIter _tmp17_ = {0};
		GtkListStore* _tmp18_ = NULL;
		gboolean _tmp19_ = FALSE;
		GtkTreeView* _tmp25_ = NULL;
		GtkListStore* _tmp26_ = NULL;
		GtkTreeIter _tmp27_ = {0};
		GtkTreePath* _tmp28_ = NULL;
		GtkTreePath* _tmp29_ = NULL;
#line 84 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp17_ = iter;
#line 84 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		piter = _tmp17_;
#line 85 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp18_ = self->priv->score_model;
#line 85 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp19_ = gtk_tree_model_iter_previous ((GtkTreeModel*) _tmp18_, &piter);
#line 85 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		if (_tmp19_) {
#line 560 "score-dialog.c"
			GtkTreeIter ppiter = {0};
			GtkTreeIter _tmp20_ = {0};
			GtkListStore* _tmp21_ = NULL;
			gboolean _tmp22_ = FALSE;
#line 87 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			_tmp20_ = piter;
#line 87 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			ppiter = _tmp20_;
#line 88 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			_tmp21_ = self->priv->score_model;
#line 88 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			_tmp22_ = gtk_tree_model_iter_previous ((GtkTreeModel*) _tmp21_, &ppiter);
#line 88 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			if (_tmp22_) {
#line 575 "score-dialog.c"
				GtkTreeIter _tmp23_ = {0};
#line 89 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
				_tmp23_ = ppiter;
#line 89 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
				piter = _tmp23_;
#line 581 "score-dialog.c"
			}
		} else {
			GtkTreeIter _tmp24_ = {0};
#line 92 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			_tmp24_ = iter;
#line 92 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
			piter = _tmp24_;
#line 589 "score-dialog.c"
		}
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp25_ = self->priv->scores;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp26_ = self->priv->score_model;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp27_ = piter;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp28_ = gtk_tree_model_get_path ((GtkTreeModel*) _tmp26_, &_tmp27_);
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_tmp29_ = _tmp28_;
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		gtk_tree_view_scroll_to_cell (_tmp25_, _tmp29_, NULL, FALSE, (gfloat) 0, (gfloat) 0);
#line 93 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
		_gtk_tree_path_free0 (_tmp29_);
#line 605 "score-dialog.c"
	}
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_free0 (score_label);
#line 69 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_free0 (date_label);
#line 611 "score-dialog.c"
}


static void score_dialog_class_init (ScoreDialogClass * klass) {
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	score_dialog_parent_class = g_type_class_peek_parent (klass);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	g_type_class_add_private (klass, sizeof (ScoreDialogPrivate));
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	G_OBJECT_CLASS (klass)->finalize = score_dialog_finalize;
#line 622 "score-dialog.c"
}


static void score_dialog_instance_init (ScoreDialog * self) {
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self->priv = SCORE_DIALOG_GET_PRIVATE (self);
#line 14 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self->priv->selected_entry = NULL;
#line 631 "score-dialog.c"
}


static void score_dialog_finalize (GObject* obj) {
	ScoreDialog * self;
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SCORE_DIALOG, ScoreDialog);
#line 13 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->history);
#line 14 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->selected_entry);
#line 15 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->score_model);
#line 16 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	_g_object_unref0 (self->priv->scores);
#line 11 "/home/mcatanzaro/src/jhbuild/checkout/quadrapassel/src/score-dialog.vala"
	G_OBJECT_CLASS (score_dialog_parent_class)->finalize (obj);
#line 649 "score-dialog.c"
}


GType score_dialog_get_type (void) {
	static volatile gsize score_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&score_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ScoreDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) score_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScoreDialog), 0, (GInstanceInitFunc) score_dialog_instance_init, NULL };
		GType score_dialog_type_id;
		score_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "ScoreDialog", &g_define_type_info, 0);
		g_once_init_leave (&score_dialog_type_id__volatile, score_dialog_type_id);
	}
	return score_dialog_type_id__volatile;
}



