/* tools-game-row.c generated by valac 0.56.19, the Vala compiler
 * generated from tools-game-row.vala, do not modify */

#include "protonplus_core.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <glib-object.h>
#include <adwaita.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

enum  {
	PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_GAME_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_SELECTED_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_tools_game_row_properties[PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ProtonPlusWidgetsToolsGameRowPrivate {
	GtkCheckButton* select_check_button;
	ProtonPlusModelsGame* _game;
	gboolean _selected;
};

static gint ProtonPlusWidgetsToolsGameRow_private_offset;
static gpointer proton_plus_widgets_tools_game_row_parent_class = NULL;

static void proton_plus_widgets_tools_game_row_finalize (GObject * obj);
static GType proton_plus_widgets_tools_game_row_get_type_once (void);
static void _vala_proton_plus_widgets_tools_game_row_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_proton_plus_widgets_tools_game_row_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_tools_game_row_get_instance_private (ProtonPlusWidgetsToolsGameRow* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsToolsGameRow_private_offset);
}

ProtonPlusWidgetsToolsGameRow*
proton_plus_widgets_tools_game_row_construct (GType object_type,
                                              ProtonPlusModelsGame* game)
{
	ProtonPlusWidgetsToolsGameRow * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkCheckButton* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GtkCheckButton* _tmp15_;
	GtkCheckButton* _tmp16_;
	GtkCheckButton* _tmp17_;
	g_return_val_if_fail (game != NULL, NULL);
	self = (ProtonPlusWidgetsToolsGameRow*) g_object_new (object_type, NULL);
	proton_plus_widgets_tools_game_row_set_game (self, game);
	_tmp0_ = proton_plus_models_game_get_name (game);
	_tmp1_ = _tmp0_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _tmp1_);
	_tmp2_ = proton_plus_models_game_get_name (game);
	_tmp3_ = _tmp2_;
	gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp3_);
	_tmp4_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->select_check_button);
	self->priv->select_check_button = _tmp4_;
	_tmp5_ = self->priv->select_check_button;
	_tmp6_ = proton_plus_models_game_get_name (game);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf (_ ("Select %s"), _tmp7_);
	_tmp9_ = _tmp8_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp5_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = self->priv->select_check_button;
	_tmp11_ = proton_plus_models_game_get_name (game);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup_printf (_ ("Select %s"), _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_accessible_update_property ((GtkAccessible*) _tmp10_, GTK_ACCESSIBLE_PROPERTY_LABEL, _tmp14_, -1, -1);
	_g_free0 (_tmp14_);
	_tmp15_ = self->priv->select_check_button;
	g_object_bind_property_with_closures ((GObject*) _tmp15_, "active", (GObject*) self, "selected", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp16_ = self->priv->select_check_button;
	adw_action_row_add_prefix ((AdwActionRow*) self, (GtkWidget*) _tmp16_);
	_tmp17_ = self->priv->select_check_button;
	adw_action_row_set_activatable_widget ((AdwActionRow*) self, (GtkWidget*) _tmp17_);
	gtk_list_box_row_set_selectable ((GtkListBoxRow*) self, FALSE);
	return self;
}

ProtonPlusWidgetsToolsGameRow*
proton_plus_widgets_tools_game_row_new (ProtonPlusModelsGame* game)
{
	return proton_plus_widgets_tools_game_row_construct (PROTON_PLUS_WIDGETS_TOOLS_TYPE_GAME_ROW, game);
}

ProtonPlusModelsGame*
proton_plus_widgets_tools_game_row_get_game (ProtonPlusWidgetsToolsGameRow* self)
{
	ProtonPlusModelsGame* result;
	ProtonPlusModelsGame* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game;
	result = _tmp0_;
	return result;
}

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

void
proton_plus_widgets_tools_game_row_set_game (ProtonPlusWidgetsToolsGameRow* self,
                                             ProtonPlusModelsGame* value)
{
	ProtonPlusModelsGame* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_game_row_get_game (self);
	if (old_value != value) {
		ProtonPlusModelsGame* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_game);
		self->priv->_game = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_game_row_properties[PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_GAME_PROPERTY]);
	}
}

gboolean
proton_plus_widgets_tools_game_row_get_selected (ProtonPlusWidgetsToolsGameRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_selected;
	return result;
}

void
proton_plus_widgets_tools_game_row_set_selected (ProtonPlusWidgetsToolsGameRow* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_game_row_get_selected (self);
	if (old_value != value) {
		self->priv->_selected = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_game_row_properties[PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_SELECTED_PROPERTY]);
	}
}

static void
proton_plus_widgets_tools_game_row_class_init (ProtonPlusWidgetsToolsGameRowClass * klass,
                                               gpointer klass_data)
{
	proton_plus_widgets_tools_game_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsToolsGameRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_tools_game_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_tools_game_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_tools_game_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_GAME_PROPERTY, proton_plus_widgets_tools_game_row_properties[PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_GAME_PROPERTY] = g_param_spec_object ("game", "game", "game", PROTON_PLUS_MODELS_TYPE_GAME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_SELECTED_PROPERTY, proton_plus_widgets_tools_game_row_properties[PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_SELECTED_PROPERTY] = g_param_spec_boolean ("selected", "selected", "selected", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_widgets_tools_game_row_instance_init (ProtonPlusWidgetsToolsGameRow * self,
                                                  gpointer klass)
{
	self->priv = proton_plus_widgets_tools_game_row_get_instance_private (self);
}

static void
proton_plus_widgets_tools_game_row_finalize (GObject * obj)
{
	ProtonPlusWidgetsToolsGameRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TOOLS_TYPE_GAME_ROW, ProtonPlusWidgetsToolsGameRow);
	_g_object_unref0 (self->priv->select_check_button);
	_g_object_unref0 (self->priv->_game);
	G_OBJECT_CLASS (proton_plus_widgets_tools_game_row_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_tools_game_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsToolsGameRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_tools_game_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsToolsGameRow), 0, (GInstanceInitFunc) proton_plus_widgets_tools_game_row_instance_init, NULL };
	GType proton_plus_widgets_tools_game_row_type_id;
	proton_plus_widgets_tools_game_row_type_id = g_type_register_static (adw_action_row_get_type (), "ProtonPlusWidgetsToolsGameRow", &g_define_type_info, 0);
	ProtonPlusWidgetsToolsGameRow_private_offset = g_type_add_instance_private (proton_plus_widgets_tools_game_row_type_id, sizeof (ProtonPlusWidgetsToolsGameRowPrivate));
	return proton_plus_widgets_tools_game_row_type_id;
}

GType
proton_plus_widgets_tools_game_row_get_type (void)
{
	static volatile gsize proton_plus_widgets_tools_game_row_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_tools_game_row_type_id__once)) {
		GType proton_plus_widgets_tools_game_row_type_id;
		proton_plus_widgets_tools_game_row_type_id = proton_plus_widgets_tools_game_row_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_tools_game_row_type_id__once, proton_plus_widgets_tools_game_row_type_id);
	}
	return proton_plus_widgets_tools_game_row_type_id__once;
}

static void
_vala_proton_plus_widgets_tools_game_row_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	ProtonPlusWidgetsToolsGameRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TOOLS_TYPE_GAME_ROW, ProtonPlusWidgetsToolsGameRow);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_GAME_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_tools_game_row_get_game (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_SELECTED_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_tools_game_row_get_selected (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_tools_game_row_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	ProtonPlusWidgetsToolsGameRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TOOLS_TYPE_GAME_ROW, ProtonPlusWidgetsToolsGameRow);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_GAME_PROPERTY:
		proton_plus_widgets_tools_game_row_set_game (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_GAME_ROW_SELECTED_PROPERTY:
		proton_plus_widgets_tools_game_row_set_selected (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

