/* result-page.c generated by valac 0.56.18, the Vala compiler
 * generated from result-page.vala, do not modify */

/* result-page.vala
 *
 * Copyright 2022 Vojtěch Perník
 *
 * 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define WG_TYPE_RESULT_PAGE (wg_result_page_get_type ())
#define WG_RESULT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WG_TYPE_RESULT_PAGE, WGResultPage))
#define WG_RESULT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WG_TYPE_RESULT_PAGE, WGResultPageClass))
#define WG_IS_RESULT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WG_TYPE_RESULT_PAGE))
#define WG_IS_RESULT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WG_TYPE_RESULT_PAGE))
#define WG_RESULT_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WG_TYPE_RESULT_PAGE, WGResultPageClass))

typedef struct _WGResultPage WGResultPage;
typedef struct _WGResultPageClass WGResultPageClass;
typedef struct _WGResultPagePrivate WGResultPagePrivate;

#define WG_DATA_PARSER_TYPE_WORD (wg_data_parser_word_get_type ())
#define WG_DATA_PARSER_WORD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WG_DATA_PARSER_TYPE_WORD, WGDataParserWord))
#define WG_DATA_PARSER_WORD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WG_DATA_PARSER_TYPE_WORD, WGDataParserWordClass))
#define WG_DATA_PARSER_IS_WORD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WG_DATA_PARSER_TYPE_WORD))
#define WG_DATA_PARSER_IS_WORD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WG_DATA_PARSER_TYPE_WORD))
#define WG_DATA_PARSER_WORD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WG_DATA_PARSER_TYPE_WORD, WGDataParserWordClass))

typedef struct _WGDataParserWord WGDataParserWord;
typedef struct _WGDataParserWordClass WGDataParserWordClass;
enum  {
	WG_RESULT_PAGE_0_PROPERTY,
	WG_RESULT_PAGE_WORD_PROPERTY,
	WG_RESULT_PAGE_WIN_PROPERTY,
	WG_RESULT_PAGE_NUM_PROPERTIES
};
static GParamSpec* wg_result_page_properties[WG_RESULT_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define WG_TYPE_CELL (wg_cell_get_type ())
#define WG_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WG_TYPE_CELL, WGCell))
#define WG_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WG_TYPE_CELL, WGCellClass))
#define WG_IS_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WG_TYPE_CELL))
#define WG_IS_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WG_TYPE_CELL))
#define WG_CELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WG_TYPE_CELL, WGCellClass))

typedef struct _WGCell WGCell;
typedef struct _WGCellClass WGCellClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef enum  {
	WG_CELL_STATE_CORRECT,
	WG_CELL_STATE_WRONG,
	WG_CELL_STATE_WRONG_POSITION,
	WG_CELL_STATE_UNKNOWN,
	WG_CELL_STATE_NONE
} WGCellState;

#define WG_TYPE_CELL_STATE (wg_cell_state_get_type ())
enum  {
	WG_RESULT_PAGE_PLAY_AGAIN_SIGNAL,
	WG_RESULT_PAGE_QUIT_SIGNAL,
	WG_RESULT_PAGE_NUM_SIGNALS
};
static guint wg_result_page_signals[WG_RESULT_PAGE_NUM_SIGNALS] = {0};

struct _WGResultPage {
	AdwBin parent_instance;
	WGResultPagePrivate * priv;
};

struct _WGResultPageClass {
	AdwBinClass parent_class;
};

struct _WGResultPagePrivate {
	WGDataParserWord* _word;
	gboolean _win;
	GtkLabel* title_label;
	AdwBin* word_container;
};

static gint WGResultPage_private_offset;
static gpointer wg_result_page_parent_class = NULL;

VALA_EXTERN GType wg_result_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WGResultPage, g_object_unref)
VALA_EXTERN GType wg_data_parser_word_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WGDataParserWord, g_object_unref)
VALA_EXTERN void wg_result_page_reload (WGResultPage* self);
VALA_EXTERN gboolean wg_result_page_get_win (WGResultPage* self);
static GtkWidget* wg_result_page_get_cells_for_word (WGResultPage* self,
                                              WGDataParserWord* word,
                                              gboolean win);
VALA_EXTERN WGDataParserWord* wg_result_page_get_word (WGResultPage* self);
VALA_EXTERN gchar** wg_data_parser_word_get_characters (WGDataParserWord* self,
                                            gint* result_length1);
VALA_EXTERN GType wg_cell_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WGCell, g_object_unref)
VALA_EXTERN WGCell* wg_cell_new (void);
VALA_EXTERN WGCell* wg_cell_construct (GType object_type);
VALA_EXTERN void wg_cell_set_content (WGCell* self,
                          const gchar* value);
VALA_EXTERN GType wg_cell_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void wg_cell_set_state (WGCell* self,
                        WGCellState value);
VALA_EXTERN WGResultPage* wg_result_page_new (void);
VALA_EXTERN WGResultPage* wg_result_page_construct (GType object_type);
VALA_EXTERN void wg_result_page_set_word (WGResultPage* self,
                              WGDataParserWord* value);
VALA_EXTERN void wg_result_page_set_win (WGResultPage* self,
                             gboolean value);
static GObject * wg_result_page_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties);
static void _wg_result_page___lambda15_ (WGResultPage* self);
static void __wg_result_page___lambda15__gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self);
static void _wg_result_page___lambda16_ (WGResultPage* self);
static void __wg_result_page___lambda16__gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self);
static void wg_result_page_finalize (GObject * obj);
static GType wg_result_page_get_type_once (void);
static void _vala_wg_result_page_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_wg_result_page_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);

static inline gpointer
wg_result_page_get_instance_private (WGResultPage* self)
{
	return G_STRUCT_MEMBER_P (self, WGResultPage_private_offset);
}

void
wg_result_page_reload (WGResultPage* self)
{
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_ = NULL;
	gboolean _tmp3_;
	GtkLabel* _tmp4_;
	const gchar* _tmp5_ = NULL;
	gboolean _tmp6_;
	GtkLabel* _tmp7_;
	AdwBin* _tmp8_;
	WGDataParserWord* _tmp9_;
	gboolean _tmp10_;
	GtkWidget* _tmp11_;
	GtkWidget* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title_label;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "success");
	_tmp1_ = self->priv->title_label;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "error");
	_tmp3_ = self->priv->_win;
	if (_tmp3_) {
		_tmp2_ = "success";
	} else {
		_tmp2_ = "error";
	}
	_tmp4_ = self->priv->title_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp4_, _tmp2_);
	_tmp6_ = self->priv->_win;
	if (_tmp6_) {
		_tmp5_ = _ ("You won!");
	} else {
		_tmp5_ = _ ("You lost!");
	}
	_tmp7_ = self->priv->title_label;
	gtk_label_set_label (_tmp7_, _tmp5_);
	_tmp8_ = self->priv->word_container;
	_tmp9_ = self->priv->_word;
	_tmp10_ = self->priv->_win;
	_tmp11_ = wg_result_page_get_cells_for_word (self, _tmp9_, _tmp10_);
	_tmp12_ = _tmp11_;
	adw_bin_set_child (_tmp8_, _tmp12_);
	_g_object_unref0 (_tmp12_);
}

static GtkWidget*
wg_result_page_get_cells_for_word (WGResultPage* self,
                                   WGDataParserWord* word,
                                   gboolean win)
{
	GtkBox* box = NULL;
	GtkBox* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (word != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	_tmp1_ = wg_data_parser_word_get_characters (word, &_tmp2_);
	_tmp1__length1 = _tmp2_;
	_tmp3_ = _tmp1_;
	_tmp3__length1 = _tmp1__length1;
	{
		gchar** _cell_collection = NULL;
		gint _cell_collection_length1 = 0;
		gint __cell_collection_size_ = 0;
		gint _cell_it = 0;
		_cell_collection = _tmp3_;
		_cell_collection_length1 = _tmp3__length1;
		for (_cell_it = 0; _cell_it < _cell_collection_length1; _cell_it = _cell_it + 1) {
			gchar* _tmp4_;
			gchar* _cell = NULL;
			_tmp4_ = g_strdup (_cell_collection[_cell_it]);
			_cell = _tmp4_;
			{
				WGCell* cell = NULL;
				WGCell* _tmp5_;
				WGCell* _tmp6_;
				const gchar* _tmp7_;
				gchar* _tmp8_;
				gchar* _tmp9_;
				GtkBox* _tmp11_;
				WGCell* _tmp12_;
				_tmp5_ = wg_cell_new ();
				g_object_ref_sink (_tmp5_);
				cell = _tmp5_;
				_tmp6_ = cell;
				_tmp7_ = _cell;
				_tmp8_ = g_utf8_strup (_tmp7_, (gssize) -1);
				_tmp9_ = _tmp8_;
				wg_cell_set_content (_tmp6_, _tmp9_);
				_g_free0 (_tmp9_);
				if (win) {
					WGCell* _tmp10_;
					_tmp10_ = cell;
					wg_cell_set_state (_tmp10_, WG_CELL_STATE_CORRECT);
				}
				_tmp11_ = box;
				_tmp12_ = cell;
				gtk_box_append (_tmp11_, (GtkWidget*) _tmp12_);
				_g_object_unref0 (cell);
				_g_free0 (_cell);
			}
		}
	}
	result = (GtkWidget*) box;
	return result;
}

WGResultPage*
wg_result_page_construct (GType object_type)
{
	WGResultPage * self = NULL;
	self = (WGResultPage*) g_object_new (object_type, NULL);
	return self;
}

WGResultPage*
wg_result_page_new (void)
{
	return wg_result_page_construct (WG_TYPE_RESULT_PAGE);
}

WGDataParserWord*
wg_result_page_get_word (WGResultPage* self)
{
	WGDataParserWord* result;
	WGDataParserWord* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_word;
	result = _tmp0_;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
wg_result_page_set_word (WGResultPage* self,
                         WGDataParserWord* value)
{
	WGDataParserWord* old_value;
	g_return_if_fail (self != NULL);
	old_value = wg_result_page_get_word (self);
	if (old_value != value) {
		WGDataParserWord* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_word);
		self->priv->_word = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, wg_result_page_properties[WG_RESULT_PAGE_WORD_PROPERTY]);
	}
}

gboolean
wg_result_page_get_win (WGResultPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_win;
	return result;
}

void
wg_result_page_set_win (WGResultPage* self,
                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = wg_result_page_get_win (self);
	if (old_value != value) {
		self->priv->_win = value;
		g_object_notify_by_pspec ((GObject *) self, wg_result_page_properties[WG_RESULT_PAGE_WIN_PROPERTY]);
	}
}

static void
_wg_result_page___lambda15_ (WGResultPage* self)
{
	g_signal_emit (self, wg_result_page_signals[WG_RESULT_PAGE_PLAY_AGAIN_SIGNAL], 0);
}

static void
__wg_result_page___lambda15__gtk_button_clicked (GtkButton* _sender,
                                                 gpointer self)
{
	_wg_result_page___lambda15_ ((WGResultPage*) self);
}

static void
_wg_result_page___lambda16_ (WGResultPage* self)
{
	g_signal_emit (self, wg_result_page_signals[WG_RESULT_PAGE_QUIT_SIGNAL], 0);
}

static void
__wg_result_page___lambda16__gtk_button_clicked (GtkButton* _sender,
                                                 gpointer self)
{
	_wg_result_page___lambda16_ ((WGResultPage*) self);
}

static GObject *
wg_result_page_constructor (GType type,
                            guint n_construct_properties,
                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WGResultPage * self;
	GtkScrolledWindow* scrolled_window = NULL;
	GtkScrolledWindow* _tmp0_;
	GtkScrolledWindow* _tmp1_;
	GtkViewport* viewport = NULL;
	GtkViewport* _tmp2_;
	GtkScrolledWindow* _tmp3_;
	GtkViewport* _tmp4_;
	AdwClamp* clamp = NULL;
	AdwClamp* _tmp5_;
	GtkViewport* _tmp6_;
	AdwClamp* _tmp7_;
	AdwClamp* _tmp8_;
	AdwClamp* _tmp9_;
	AdwClamp* _tmp10_;
	GtkBox* main_box = NULL;
	GtkBox* _tmp11_;
	AdwClamp* _tmp12_;
	GtkBox* _tmp13_;
	GtkBox* _tmp14_;
	GtkBox* _tmp15_;
	GtkLabel* _tmp16_;
	GtkLabel* _tmp17_;
	GtkLabel* _tmp18_;
	GtkBox* word_box = NULL;
	GtkBox* _tmp19_;
	GtkBox* _tmp20_;
	GtkBox* _tmp21_;
	GtkLabel* word_label = NULL;
	GtkLabel* _tmp22_;
	GtkBox* _tmp23_;
	GtkLabel* _tmp24_;
	GtkLabel* _tmp25_;
	GtkBox* _tmp26_;
	AdwBin* _tmp27_;
	AdwBin* _tmp28_;
	GtkBox* buttons_box = NULL;
	GtkBox* _tmp29_;
	GtkBox* _tmp30_;
	GtkBox* _tmp31_;
	GtkBox* _tmp32_;
	GtkButton* play_button = NULL;
	GtkButton* _tmp33_;
	GtkBox* _tmp34_;
	GtkButton* _tmp35_;
	GtkButton* _tmp36_;
	GtkButton* _tmp37_;
	GtkButton* _tmp38_;
	GtkButton* quit_button = NULL;
	GtkButton* _tmp39_;
	GtkBox* _tmp40_;
	GtkButton* _tmp41_;
	GtkButton* _tmp42_;
	GtkButton* _tmp43_;
	parent_class = G_OBJECT_CLASS (wg_result_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WG_TYPE_RESULT_PAGE, WGResultPage);
	gtk_widget_set_vexpand ((GtkWidget*) self, TRUE);
	_tmp0_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_ref_sink (_tmp0_);
	scrolled_window = _tmp0_;
	_tmp1_ = scrolled_window;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp1_);
	_tmp2_ = (GtkViewport*) gtk_viewport_new (NULL, NULL);
	g_object_ref_sink (_tmp2_);
	viewport = _tmp2_;
	_tmp3_ = scrolled_window;
	_tmp4_ = viewport;
	gtk_scrolled_window_set_child (_tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = (AdwClamp*) adw_clamp_new ();
	g_object_ref_sink (_tmp5_);
	clamp = _tmp5_;
	_tmp6_ = viewport;
	_tmp7_ = clamp;
	gtk_viewport_set_child (_tmp6_, (GtkWidget*) _tmp7_);
	_tmp8_ = clamp;
	adw_clamp_set_tightening_threshold (_tmp8_, 400);
	_tmp9_ = clamp;
	adw_clamp_set_maximum_size (_tmp9_, 600);
	_tmp10_ = clamp;
	gtk_widget_add_css_class ((GtkWidget*) _tmp10_, "container");
	_tmp11_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 32);
	g_object_ref_sink (_tmp11_);
	main_box = _tmp11_;
	_tmp12_ = clamp;
	_tmp13_ = main_box;
	adw_clamp_set_child (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = main_box;
	gtk_widget_set_valign ((GtkWidget*) _tmp14_, GTK_ALIGN_CENTER);
	_tmp15_ = main_box;
	_tmp16_ = self->priv->title_label;
	gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = self->priv->title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp17_, GTK_ALIGN_CENTER);
	_tmp18_ = self->priv->title_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp18_, "title-1");
	_tmp19_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	g_object_ref_sink (_tmp19_);
	word_box = _tmp19_;
	_tmp20_ = main_box;
	_tmp21_ = word_box;
	gtk_box_append (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = (GtkLabel*) gtk_label_new (_ ("The word was:"));
	g_object_ref_sink (_tmp22_);
	word_label = _tmp22_;
	_tmp23_ = word_box;
	_tmp24_ = word_label;
	gtk_box_append (_tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = word_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp25_, GTK_ALIGN_CENTER);
	_tmp26_ = word_box;
	_tmp27_ = self->priv->word_container;
	gtk_box_append (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = self->priv->word_container;
	gtk_widget_set_halign ((GtkWidget*) _tmp28_, GTK_ALIGN_CENTER);
	_tmp29_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	g_object_ref_sink (_tmp29_);
	buttons_box = _tmp29_;
	_tmp30_ = main_box;
	_tmp31_ = buttons_box;
	gtk_box_append (_tmp30_, (GtkWidget*) _tmp31_);
	_tmp32_ = buttons_box;
	gtk_widget_set_halign ((GtkWidget*) _tmp32_, GTK_ALIGN_CENTER);
	_tmp33_ = (GtkButton*) gtk_button_new_with_mnemonic (_ ("_Play Again"));
	g_object_ref_sink (_tmp33_);
	play_button = _tmp33_;
	_tmp34_ = buttons_box;
	_tmp35_ = play_button;
	gtk_box_append (_tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = play_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp36_, "pill");
	_tmp37_ = play_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp37_, "suggested-action");
	_tmp38_ = play_button;
	g_signal_connect_object (_tmp38_, "clicked", (GCallback) __wg_result_page___lambda15__gtk_button_clicked, self, 0);
	_tmp39_ = (GtkButton*) gtk_button_new_with_mnemonic (_ ("_Quit"));
	g_object_ref_sink (_tmp39_);
	quit_button = _tmp39_;
	_tmp40_ = buttons_box;
	_tmp41_ = quit_button;
	gtk_box_append (_tmp40_, (GtkWidget*) _tmp41_);
	_tmp42_ = quit_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp42_, "pill");
	_tmp43_ = quit_button;
	g_signal_connect_object (_tmp43_, "clicked", (GCallback) __wg_result_page___lambda16__gtk_button_clicked, self, 0);
	_g_object_unref0 (quit_button);
	_g_object_unref0 (play_button);
	_g_object_unref0 (buttons_box);
	_g_object_unref0 (word_label);
	_g_object_unref0 (word_box);
	_g_object_unref0 (main_box);
	_g_object_unref0 (clamp);
	_g_object_unref0 (viewport);
	_g_object_unref0 (scrolled_window);
	return obj;
}

static void
wg_result_page_class_init (WGResultPageClass * klass,
                           gpointer klass_data)
{
	wg_result_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WGResultPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_wg_result_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_wg_result_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = wg_result_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = wg_result_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WG_RESULT_PAGE_WORD_PROPERTY, wg_result_page_properties[WG_RESULT_PAGE_WORD_PROPERTY] = g_param_spec_object ("word", "word", "word", WG_DATA_PARSER_TYPE_WORD, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WG_RESULT_PAGE_WIN_PROPERTY, wg_result_page_properties[WG_RESULT_PAGE_WIN_PROPERTY] = g_param_spec_boolean ("win", "win", "win", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	wg_result_page_signals[WG_RESULT_PAGE_PLAY_AGAIN_SIGNAL] = g_signal_new ("play-again", WG_TYPE_RESULT_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	wg_result_page_signals[WG_RESULT_PAGE_QUIT_SIGNAL] = g_signal_new ("quit", WG_TYPE_RESULT_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
wg_result_page_instance_init (WGResultPage * self,
                              gpointer klass)
{
	GtkLabel* _tmp0_;
	AdwBin* _tmp1_;
	self->priv = wg_result_page_get_instance_private (self);
	_tmp0_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp0_);
	self->priv->title_label = _tmp0_;
	_tmp1_ = (AdwBin*) adw_bin_new ();
	g_object_ref_sink (_tmp1_);
	self->priv->word_container = _tmp1_;
}

static void
wg_result_page_finalize (GObject * obj)
{
	WGResultPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WG_TYPE_RESULT_PAGE, WGResultPage);
	_g_object_unref0 (self->priv->_word);
	_g_object_unref0 (self->priv->title_label);
	_g_object_unref0 (self->priv->word_container);
	G_OBJECT_CLASS (wg_result_page_parent_class)->finalize (obj);
}

static GType
wg_result_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WGResultPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wg_result_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WGResultPage), 0, (GInstanceInitFunc) wg_result_page_instance_init, NULL };
	GType wg_result_page_type_id;
	wg_result_page_type_id = g_type_register_static (adw_bin_get_type (), "WGResultPage", &g_define_type_info, 0);
	WGResultPage_private_offset = g_type_add_instance_private (wg_result_page_type_id, sizeof (WGResultPagePrivate));
	return wg_result_page_type_id;
}

GType
wg_result_page_get_type (void)
{
	static volatile gsize wg_result_page_type_id__once = 0;
	if (g_once_init_enter (&wg_result_page_type_id__once)) {
		GType wg_result_page_type_id;
		wg_result_page_type_id = wg_result_page_get_type_once ();
		g_once_init_leave (&wg_result_page_type_id__once, wg_result_page_type_id);
	}
	return wg_result_page_type_id__once;
}

static void
_vala_wg_result_page_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	WGResultPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WG_TYPE_RESULT_PAGE, WGResultPage);
	switch (property_id) {
		case WG_RESULT_PAGE_WORD_PROPERTY:
		g_value_set_object (value, wg_result_page_get_word (self));
		break;
		case WG_RESULT_PAGE_WIN_PROPERTY:
		g_value_set_boolean (value, wg_result_page_get_win (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_wg_result_page_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	WGResultPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WG_TYPE_RESULT_PAGE, WGResultPage);
	switch (property_id) {
		case WG_RESULT_PAGE_WORD_PROPERTY:
		wg_result_page_set_word (self, g_value_get_object (value));
		break;
		case WG_RESULT_PAGE_WIN_PROPERTY:
		wg_result_page_set_win (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

