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

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-

   This file is part of a GNOME game

   Copyright (C) 2019 – Arnaud Bonatti <arnaud.bonatti@gmail.com>

   This application 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 application 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 application.  If not, see <https://www.gnu.org/licenses/>.
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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 TYPE_ADAPTATIVE_WIDGET (adaptative_widget_get_type ())
#define ADAPTATIVE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADAPTATIVE_WIDGET, AdaptativeWidget))
#define IS_ADAPTATIVE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADAPTATIVE_WIDGET))
#define ADAPTATIVE_WIDGET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_ADAPTATIVE_WIDGET, AdaptativeWidgetIface))

typedef struct _AdaptativeWidget AdaptativeWidget;
typedef struct _AdaptativeWidgetIface AdaptativeWidgetIface;
typedef enum  {
	ADAPTATIVE_WIDGET_WINDOW_SIZE_START_SIZE,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_USUAL_SIZE,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_QUITE_THIN,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_PHONE_VERT,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_PHONE_HZTL,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_PHONE_BOTH,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_EXTRA_THIN,
	ADAPTATIVE_WIDGET_WINDOW_SIZE_EXTRA_FLAT
} AdaptativeWidgetWindowSize;

#define ADAPTATIVE_WIDGET_TYPE_WINDOW_SIZE (adaptative_widget_window_size_get_type ())

#define TYPE_GAME_ACTION_BAR (game_action_bar_get_type ())
#define GAME_ACTION_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAME_ACTION_BAR, GameActionBar))
#define GAME_ACTION_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAME_ACTION_BAR, GameActionBarClass))
#define IS_GAME_ACTION_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAME_ACTION_BAR))
#define IS_GAME_ACTION_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAME_ACTION_BAR))
#define GAME_ACTION_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAME_ACTION_BAR, GameActionBarClass))

typedef struct _GameActionBar GameActionBar;
typedef struct _GameActionBarClass GameActionBarClass;
typedef struct _GameActionBarPrivate GameActionBarPrivate;
enum  {
	GAME_ACTION_BAR_0_PROPERTY,
	GAME_ACTION_BAR_SHOW_ACTIONBAR_PROPERTY,
	GAME_ACTION_BAR_WINDOW_HAS_NAME_PROPERTY,
	GAME_ACTION_BAR_WINDOW_NAME_PROPERTY,
	GAME_ACTION_BAR_GAME_WIDGET_PROPERTY,
	GAME_ACTION_BAR_NUM_PROPERTIES
};
static GParamSpec* game_action_bar_properties[GAME_ACTION_BAR_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_GAME_ACTION_BAR_PLACE_HOLDER (game_action_bar_place_holder_get_type ())
#define GAME_ACTION_BAR_PLACE_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAME_ACTION_BAR_PLACE_HOLDER, GameActionBarPlaceHolder))
#define GAME_ACTION_BAR_PLACE_HOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAME_ACTION_BAR_PLACE_HOLDER, GameActionBarPlaceHolderClass))
#define IS_GAME_ACTION_BAR_PLACE_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAME_ACTION_BAR_PLACE_HOLDER))
#define IS_GAME_ACTION_BAR_PLACE_HOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAME_ACTION_BAR_PLACE_HOLDER))
#define GAME_ACTION_BAR_PLACE_HOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAME_ACTION_BAR_PLACE_HOLDER, GameActionBarPlaceHolderClass))

typedef struct _GameActionBarPlaceHolder GameActionBarPlaceHolder;
typedef struct _GameActionBarPlaceHolderClass GameActionBarPlaceHolderClass;
typedef struct _GameActionBarPlaceHolderPrivate GameActionBarPlaceHolderPrivate;
enum  {
	GAME_ACTION_BAR_PLACE_HOLDER_0_PROPERTY,
	GAME_ACTION_BAR_PLACE_HOLDER_NUM_PROPERTIES
};
static GParamSpec* game_action_bar_place_holder_properties[GAME_ACTION_BAR_PLACE_HOLDER_NUM_PROPERTIES];

struct _AdaptativeWidgetIface {
	GTypeInterface parent_iface;
	void (*set_window_size) (AdaptativeWidget* self, AdaptativeWidgetWindowSize new_size);
};

struct _GameActionBar {
	GtkRevealer parent_instance;
	GameActionBarPrivate * priv;
};

struct _GameActionBarClass {
	GtkRevealerClass parent_class;
};

struct _GameActionBarPrivate {
	gboolean _show_actionbar;
	gboolean _window_has_name;
	gchar* _window_name;
	GtkWidget* _game_widget;
	GtkActionBar* action_bar;
	GtkLabel* game_label;
	gboolean is_extra_thin;
};

struct _GameActionBarPlaceHolder {
	GtkRevealer parent_instance;
	GameActionBarPlaceHolderPrivate * priv;
};

struct _GameActionBarPlaceHolderClass {
	GtkRevealerClass parent_class;
};

struct _GameActionBarPlaceHolderPrivate {
	GtkWidget* placeholder_child;
	GameActionBar* actionbar;
	gboolean is_extra_thin;
};

static gint GameActionBar_private_offset;
static gpointer game_action_bar_parent_class = NULL;
static AdaptativeWidgetIface * game_action_bar_adaptative_widget_parent_iface = NULL;
static gint GameActionBarPlaceHolder_private_offset;
static gpointer game_action_bar_place_holder_parent_class = NULL;
static AdaptativeWidgetIface * game_action_bar_place_holder_adaptative_widget_parent_iface = NULL;

VALA_EXTERN GType adaptative_widget_window_size_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType adaptative_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AdaptativeWidget, g_object_unref)
VALA_EXTERN GType game_action_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GameActionBar, g_object_unref)
VALA_EXTERN GameActionBar* game_action_bar_new (const gchar* _game_name,
                                    GtkWidget* _game_widget,
                                    gboolean _show_actionbar);
VALA_EXTERN GameActionBar* game_action_bar_construct (GType object_type,
                                          const gchar* _game_name,
                                          GtkWidget* _game_widget,
                                          gboolean _show_actionbar);
static void game_action_bar_real_set_window_size (AdaptativeWidget* base,
                                           AdaptativeWidgetWindowSize new_size);
VALA_EXTERN gboolean adaptative_widget_window_size_is_extra_thin (AdaptativeWidgetWindowSize window_size);
static void game_action_bar_update_visibility (GameActionBar* self);
static gboolean game_action_bar_get_show_actionbar (GameActionBar* self);
VALA_EXTERN void game_action_bar_update_title (GameActionBar* self,
                                   const gchar* new_title);
VALA_EXTERN void game_action_bar_set_window_name (GameActionBar* self,
                                      const gchar* value);
VALA_EXTERN void game_action_bar_set_window_has_name (GameActionBar* self,
                                          gboolean value);
static const gchar* game_action_bar_get_window_name (GameActionBar* self);
VALA_EXTERN void game_action_bar_set_visibility (GameActionBar* self,
                                     gboolean new_visibility);
VALA_EXTERN void game_action_bar_set_show_actionbar (GameActionBar* self,
                                         gboolean value);
static gboolean game_action_bar_get_window_has_name (GameActionBar* self);
static GtkWidget* game_action_bar_get_game_widget (GameActionBar* self);
static void game_action_bar_set_game_widget (GameActionBar* self,
                                      GtkWidget* value);
static GObject * game_action_bar_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
VALA_EXTERN void adaptative_widget_set_window_size (AdaptativeWidget* self,
                                        AdaptativeWidgetWindowSize new_size);
static void game_action_bar_finalize (GObject * obj);
static GType game_action_bar_get_type_once (void);
static void _vala_game_action_bar_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_game_action_bar_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);
VALA_EXTERN GType game_action_bar_place_holder_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GameActionBarPlaceHolder, g_object_unref)
VALA_EXTERN GameActionBarPlaceHolder* game_action_bar_place_holder_new (GameActionBar* _actionbar);
VALA_EXTERN GameActionBarPlaceHolder* game_action_bar_place_holder_construct (GType object_type,
                                                                  GameActionBar* _actionbar);
static void game_action_bar_place_holder_set_height (GameActionBarPlaceHolder* self);
static void _game_action_bar_place_holder_set_height_gtk_widget_size_allocate (GtkWidget* _sender,
                                                                        GtkAllocation* allocation,
                                                                        gpointer self);
static void game_action_bar_place_holder_real_set_window_size (AdaptativeWidget* base,
                                                        AdaptativeWidgetWindowSize new_size);
static void game_action_bar_place_holder_finalize (GObject * obj);
static GType game_action_bar_place_holder_get_type_once (void);

static inline gpointer
game_action_bar_get_instance_private (GameActionBar* self)
{
	return G_STRUCT_MEMBER_P (self, GameActionBar_private_offset);
}

GameActionBar*
game_action_bar_construct (GType object_type,
                           const gchar* _game_name,
                           GtkWidget* _game_widget,
                           gboolean _show_actionbar)
{
	GameActionBar * self = NULL;
	g_return_val_if_fail (_game_name != NULL, NULL);
	self = (GameActionBar*) g_object_new (object_type, "window-has-name", g_strcmp0 (_game_name, "") != 0, "window-name", _game_name, "game-widget", _game_widget, "show-actionbar", _show_actionbar, NULL);
	return self;
}

GameActionBar*
game_action_bar_new (const gchar* _game_name,
                     GtkWidget* _game_widget,
                     gboolean _show_actionbar)
{
	return game_action_bar_construct (TYPE_GAME_ACTION_BAR, _game_name, _game_widget, _show_actionbar);
}

static void
game_action_bar_real_set_window_size (AdaptativeWidget* base,
                                      AdaptativeWidgetWindowSize new_size)
{
	GameActionBar * self;
	gboolean _is_extra_thin = FALSE;
	self = (GameActionBar*) base;
	_is_extra_thin = adaptative_widget_window_size_is_extra_thin (new_size);
	if (_is_extra_thin == self->priv->is_extra_thin) {
		return;
	}
	self->priv->is_extra_thin = _is_extra_thin;
	game_action_bar_update_visibility (self);
}

static void
game_action_bar_update_visibility (GameActionBar* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (self->priv->is_extra_thin) {
		gboolean _tmp1_;
		_tmp1_ = self->priv->_show_actionbar;
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, _tmp0_);
}

void
game_action_bar_update_title (GameActionBar* self,
                              const gchar* new_title)
{
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_title != NULL);
	game_action_bar_set_window_name (self, new_title);
	game_action_bar_set_window_has_name (self, g_strcmp0 (new_title, "") != 0);
	_tmp0_ = self->priv->game_label;
	_tmp1_ = self->priv->_window_name;
	gtk_label_set_label (_tmp0_, _tmp1_);
}

void
game_action_bar_set_visibility (GameActionBar* self,
                                gboolean new_visibility)
{
	g_return_if_fail (self != NULL);
	game_action_bar_set_show_actionbar (self, new_visibility);
	game_action_bar_update_visibility (self);
}

static gboolean
game_action_bar_get_show_actionbar (GameActionBar* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_actionbar;
	return result;
}

void
game_action_bar_set_show_actionbar (GameActionBar* self,
                                    gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_show_actionbar = value;
}

static gboolean
game_action_bar_get_window_has_name (GameActionBar* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_window_has_name;
	return result;
}

void
game_action_bar_set_window_has_name (GameActionBar* self,
                                     gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_window_has_name = value;
}

static const gchar*
game_action_bar_get_window_name (GameActionBar* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_window_name;
	result = _tmp0_;
	return result;
}

void
game_action_bar_set_window_name (GameActionBar* self,
                                 const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_window_name);
	self->priv->_window_name = _tmp0_;
}

static GtkWidget*
game_action_bar_get_game_widget (GameActionBar* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game_widget;
	result = _tmp0_;
	return result;
}

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

static void
game_action_bar_set_game_widget (GameActionBar* self,
                                 GtkWidget* value)
{
	GtkWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_game_widget);
	self->priv->_game_widget = _tmp0_;
}

static GObject *
game_action_bar_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GameActionBar * self;
	GtkWidget* _tmp0_;
	gboolean _tmp3_;
	parent_class = G_OBJECT_CLASS (game_action_bar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GAME_ACTION_BAR, GameActionBar);
	_tmp0_ = self->priv->_game_widget;
	if (_tmp0_ != NULL) {
		GtkActionBar* _tmp1_;
		GtkWidget* _tmp2_;
		_tmp1_ = self->priv->action_bar;
		_tmp2_ = self->priv->_game_widget;
		gtk_action_bar_pack_end (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	}
	_tmp3_ = self->priv->_window_has_name;
	if (_tmp3_) {
		GtkLabel* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = self->priv->game_label;
		_tmp5_ = self->priv->_window_name;
		gtk_label_set_label (_tmp4_, _tmp5_);
	}
	game_action_bar_update_visibility (self);
	return obj;
}

static void
game_action_bar_class_init (GameActionBarClass * klass,
                            gpointer klass_data)
{
	game_action_bar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GameActionBar_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_game_action_bar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_game_action_bar_set_property;
	G_OBJECT_CLASS (klass)->constructor = game_action_bar_constructor;
	G_OBJECT_CLASS (klass)->finalize = game_action_bar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_ACTION_BAR_SHOW_ACTIONBAR_PROPERTY, game_action_bar_properties[GAME_ACTION_BAR_SHOW_ACTIONBAR_PROPERTY] = g_param_spec_boolean ("show-actionbar", "show-actionbar", "show-actionbar", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_ACTION_BAR_WINDOW_HAS_NAME_PROPERTY, game_action_bar_properties[GAME_ACTION_BAR_WINDOW_HAS_NAME_PROPERTY] = g_param_spec_boolean ("window-has-name", "window-has-name", "window-has-name", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_ACTION_BAR_WINDOW_NAME_PROPERTY, game_action_bar_properties[GAME_ACTION_BAR_WINDOW_NAME_PROPERTY] = g_param_spec_string ("window-name", "window-name", "window-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAME_ACTION_BAR_GAME_WIDGET_PROPERTY, game_action_bar_properties[GAME_ACTION_BAR_GAME_WIDGET_PROPERTY] = g_param_spec_object ("game-widget", "game-widget", "game-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Four-in-a-row/ui/game-actionbar.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "action_bar", FALSE, GameActionBar_private_offset + G_STRUCT_OFFSET (GameActionBarPrivate, action_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "game_label", FALSE, GameActionBar_private_offset + G_STRUCT_OFFSET (GameActionBarPrivate, game_label));
}

static void
game_action_bar_adaptative_widget_interface_init (AdaptativeWidgetIface * iface,
                                                  gpointer iface_data)
{
	game_action_bar_adaptative_widget_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_window_size = (void (*) (AdaptativeWidget*, AdaptativeWidgetWindowSize)) game_action_bar_real_set_window_size;
}

static void
game_action_bar_instance_init (GameActionBar * self,
                               gpointer klass)
{
	gchar* _tmp0_;
	self->priv = game_action_bar_get_instance_private (self);
	self->priv->_show_actionbar = FALSE;
	self->priv->_window_has_name = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->_window_name = _tmp0_;
	self->priv->_game_widget = NULL;
	self->priv->is_extra_thin = TRUE;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
game_action_bar_finalize (GObject * obj)
{
	GameActionBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GAME_ACTION_BAR, GameActionBar);
	_g_free0 (self->priv->_window_name);
	_g_object_unref0 (self->priv->_game_widget);
	G_OBJECT_CLASS (game_action_bar_parent_class)->finalize (obj);
}

static GType
game_action_bar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GameActionBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) game_action_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GameActionBar), 0, (GInstanceInitFunc) game_action_bar_instance_init, NULL };
	static const GInterfaceInfo adaptative_widget_info = { (GInterfaceInitFunc) game_action_bar_adaptative_widget_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType game_action_bar_type_id;
	game_action_bar_type_id = g_type_register_static (gtk_revealer_get_type (), "GameActionBar", &g_define_type_info, 0);
	g_type_add_interface_static (game_action_bar_type_id, TYPE_ADAPTATIVE_WIDGET, &adaptative_widget_info);
	GameActionBar_private_offset = g_type_add_instance_private (game_action_bar_type_id, sizeof (GameActionBarPrivate));
	return game_action_bar_type_id;
}

GType
game_action_bar_get_type (void)
{
	static volatile gsize game_action_bar_type_id__once = 0;
	if (g_once_init_enter (&game_action_bar_type_id__once)) {
		GType game_action_bar_type_id;
		game_action_bar_type_id = game_action_bar_get_type_once ();
		g_once_init_leave (&game_action_bar_type_id__once, game_action_bar_type_id);
	}
	return game_action_bar_type_id__once;
}

static void
_vala_game_action_bar_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	GameActionBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_GAME_ACTION_BAR, GameActionBar);
	switch (property_id) {
		case GAME_ACTION_BAR_SHOW_ACTIONBAR_PROPERTY:
		g_value_set_boolean (value, game_action_bar_get_show_actionbar (self));
		break;
		case GAME_ACTION_BAR_WINDOW_HAS_NAME_PROPERTY:
		g_value_set_boolean (value, game_action_bar_get_window_has_name (self));
		break;
		case GAME_ACTION_BAR_WINDOW_NAME_PROPERTY:
		g_value_set_string (value, game_action_bar_get_window_name (self));
		break;
		case GAME_ACTION_BAR_GAME_WIDGET_PROPERTY:
		g_value_set_object (value, game_action_bar_get_game_widget (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_game_action_bar_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	GameActionBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_GAME_ACTION_BAR, GameActionBar);
	switch (property_id) {
		case GAME_ACTION_BAR_SHOW_ACTIONBAR_PROPERTY:
		game_action_bar_set_show_actionbar (self, g_value_get_boolean (value));
		break;
		case GAME_ACTION_BAR_WINDOW_HAS_NAME_PROPERTY:
		game_action_bar_set_window_has_name (self, g_value_get_boolean (value));
		break;
		case GAME_ACTION_BAR_WINDOW_NAME_PROPERTY:
		game_action_bar_set_window_name (self, g_value_get_string (value));
		break;
		case GAME_ACTION_BAR_GAME_WIDGET_PROPERTY:
		game_action_bar_set_game_widget (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
game_action_bar_place_holder_get_instance_private (GameActionBarPlaceHolder* self)
{
	return G_STRUCT_MEMBER_P (self, GameActionBarPlaceHolder_private_offset);
}

static void
_game_action_bar_place_holder_set_height_gtk_widget_size_allocate (GtkWidget* _sender,
                                                                   GtkAllocation* allocation,
                                                                   gpointer self)
{
	game_action_bar_place_holder_set_height ((GameActionBarPlaceHolder*) self);
}

GameActionBarPlaceHolder*
game_action_bar_place_holder_construct (GType object_type,
                                        GameActionBar* _actionbar)
{
	GameActionBarPlaceHolder * self = NULL;
	GameActionBar* _tmp0_;
	GameActionBar* _tmp1_;
	g_return_val_if_fail (_actionbar != NULL, NULL);
	self = (GameActionBarPlaceHolder*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (_actionbar);
	_g_object_unref0 (self->priv->actionbar);
	self->priv->actionbar = _tmp0_;
	_tmp1_ = self->priv->actionbar;
	g_signal_connect_object ((GtkWidget*) _tmp1_, "size-allocate", (GCallback) _game_action_bar_place_holder_set_height_gtk_widget_size_allocate, self, 0);
	game_action_bar_place_holder_set_height (self);
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, TRUE);
	return self;
}

GameActionBarPlaceHolder*
game_action_bar_place_holder_new (GameActionBar* _actionbar)
{
	return game_action_bar_place_holder_construct (TYPE_GAME_ACTION_BAR_PLACE_HOLDER, _actionbar);
}

static void
game_action_bar_place_holder_set_height (GameActionBarPlaceHolder* self)
{
	GtkRequisition natural_size = {0};
	GtkWidget* widget = NULL;
	GameActionBar* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	GtkRequisition _tmp5_ = {0};
	GtkWidget* _tmp6_;
	GtkRequisition _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->actionbar;
	_tmp1_ = gtk_bin_get_child ((GtkBin*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	widget = _tmp2_;
	_tmp3_ = widget;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (widget);
		return;
	}
	_tmp4_ = widget;
	gtk_widget_get_preferred_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), NULL, &_tmp5_);
	natural_size = _tmp5_;
	_tmp6_ = self->priv->placeholder_child;
	_tmp7_ = natural_size;
	g_object_set (_tmp6_, "height-request", _tmp7_.height, NULL);
	_g_object_unref0 (widget);
}

static void
game_action_bar_place_holder_real_set_window_size (AdaptativeWidget* base,
                                                   AdaptativeWidgetWindowSize new_size)
{
	GameActionBarPlaceHolder * self;
	gboolean _is_extra_thin = FALSE;
	self = (GameActionBarPlaceHolder*) base;
	_is_extra_thin = adaptative_widget_window_size_is_extra_thin (new_size);
	if (_is_extra_thin == self->priv->is_extra_thin) {
		return;
	}
	self->priv->is_extra_thin = _is_extra_thin;
	gtk_revealer_set_reveal_child ((GtkRevealer*) self, self->priv->is_extra_thin);
}

static void
game_action_bar_place_holder_class_init (GameActionBarPlaceHolderClass * klass,
                                         gpointer klass_data)
{
	game_action_bar_place_holder_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GameActionBarPlaceHolder_private_offset);
	G_OBJECT_CLASS (klass)->finalize = game_action_bar_place_holder_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Four-in-a-row/ui/game-actionbar-placeholder.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "placeholder_child", FALSE, GameActionBarPlaceHolder_private_offset + G_STRUCT_OFFSET (GameActionBarPlaceHolderPrivate, placeholder_child));
}

static void
game_action_bar_place_holder_adaptative_widget_interface_init (AdaptativeWidgetIface * iface,
                                                               gpointer iface_data)
{
	game_action_bar_place_holder_adaptative_widget_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_window_size = (void (*) (AdaptativeWidget*, AdaptativeWidgetWindowSize)) game_action_bar_place_holder_real_set_window_size;
}

static void
game_action_bar_place_holder_instance_init (GameActionBarPlaceHolder * self,
                                            gpointer klass)
{
	self->priv = game_action_bar_place_holder_get_instance_private (self);
	self->priv->is_extra_thin = TRUE;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
game_action_bar_place_holder_finalize (GObject * obj)
{
	GameActionBarPlaceHolder * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GAME_ACTION_BAR_PLACE_HOLDER, GameActionBarPlaceHolder);
	_g_object_unref0 (self->priv->actionbar);
	G_OBJECT_CLASS (game_action_bar_place_holder_parent_class)->finalize (obj);
}

static GType
game_action_bar_place_holder_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GameActionBarPlaceHolderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) game_action_bar_place_holder_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GameActionBarPlaceHolder), 0, (GInstanceInitFunc) game_action_bar_place_holder_instance_init, NULL };
	static const GInterfaceInfo adaptative_widget_info = { (GInterfaceInitFunc) game_action_bar_place_holder_adaptative_widget_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType game_action_bar_place_holder_type_id;
	game_action_bar_place_holder_type_id = g_type_register_static (gtk_revealer_get_type (), "GameActionBarPlaceHolder", &g_define_type_info, 0);
	g_type_add_interface_static (game_action_bar_place_holder_type_id, TYPE_ADAPTATIVE_WIDGET, &adaptative_widget_info);
	GameActionBarPlaceHolder_private_offset = g_type_add_instance_private (game_action_bar_place_holder_type_id, sizeof (GameActionBarPlaceHolderPrivate));
	return game_action_bar_place_holder_type_id;
}

GType
game_action_bar_place_holder_get_type (void)
{
	static volatile gsize game_action_bar_place_holder_type_id__once = 0;
	if (g_once_init_enter (&game_action_bar_place_holder_type_id__once)) {
		GType game_action_bar_place_holder_type_id;
		game_action_bar_place_holder_type_id = game_action_bar_place_holder_get_type_once ();
		g_once_init_leave (&game_action_bar_place_holder_type_id__once, game_action_bar_place_holder_type_id);
	}
	return game_action_bar_place_holder_type_id__once;
}

