/* games-mass-edit-button.c generated by valac 0.56.19, the Vala compiler
 * generated from games-mass-edit-button.vala, do not modify */

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

enum  {
	PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_mass_edit_button_properties[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_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))
enum  {
	PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_MASS_EDIT_REQUESTED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_NUM_SIGNALS
};
static guint proton_plus_widgets_games_mass_edit_button_signals[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsGamesMassEditButtonPrivate {
	GtkListBox* _game_list_box;
	AdwButtonContent* _mass_edit_button_content;
};

static gint ProtonPlusWidgetsGamesMassEditButton_private_offset;
static gpointer proton_plus_widgets_games_mass_edit_button_parent_class = NULL;
static ProtonPlusUtilsControllerDirectionalFocusIface * proton_plus_widgets_games_mass_edit_button_proton_plus_utils_controller_directional_focus_parent_iface = NULL;

static void proton_plus_widgets_games_mass_edit_button_set_game_list_box (ProtonPlusWidgetsGamesMassEditButton* self,
                                                                   GtkListBox* value);
static AdwButtonContent* proton_plus_widgets_games_mass_edit_button_get_mass_edit_button_content (ProtonPlusWidgetsGamesMassEditButton* self);
static gboolean proton_plus_widgets_games_mass_edit_button_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                                     GObject* focused_object,
                                                                                     ProtonPlusUtilsControllerNavigationDirection direction);
static GtkListBox* proton_plus_widgets_games_mass_edit_button_get_game_list_box (ProtonPlusWidgetsGamesMassEditButton* self);
static void proton_plus_widgets_games_mass_edit_button_mass_edit_button_clicked (ProtonPlusWidgetsGamesMassEditButton* self);
static void proton_plus_widgets_games_mass_edit_button_set_mass_edit_button_content (ProtonPlusWidgetsGamesMassEditButton* self,
                                                                              AdwButtonContent* value);
static void g_cclosure_user_marshal_VOID__POINTER_INT (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data);
static GObject * proton_plus_widgets_games_mass_edit_button_constructor (GType type,
                                                                  guint n_construct_properties,
                                                                  GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_games_mass_edit_button_mass_edit_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                              gpointer self);
static void proton_plus_widgets_games_mass_edit_button_finalize (GObject * obj);
static GType proton_plus_widgets_games_mass_edit_button_get_type_once (void);
static void _vala_proton_plus_widgets_games_mass_edit_button_get_property (GObject * object,
                                                                    guint property_id,
                                                                    GValue * value,
                                                                    GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_mass_edit_button_set_property (GObject * object,
                                                                    guint property_id,
                                                                    const GValue * value,
                                                                    GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
proton_plus_widgets_games_mass_edit_button_get_instance_private (ProtonPlusWidgetsGamesMassEditButton* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesMassEditButton_private_offset);
}

ProtonPlusWidgetsGamesMassEditButton*
proton_plus_widgets_games_mass_edit_button_construct (GType object_type,
                                                      GtkListBox* game_list_box)
{
	ProtonPlusWidgetsGamesMassEditButton * self = NULL;
	g_return_val_if_fail (game_list_box != NULL, NULL);
	self = (ProtonPlusWidgetsGamesMassEditButton*) g_object_new (object_type, NULL);
	proton_plus_widgets_games_mass_edit_button_set_game_list_box (self, game_list_box);
	return self;
}

ProtonPlusWidgetsGamesMassEditButton*
proton_plus_widgets_games_mass_edit_button_new (GtkListBox* game_list_box)
{
	return proton_plus_widgets_games_mass_edit_button_construct (PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_BUTTON, game_list_box);
}

void
proton_plus_widgets_games_mass_edit_button_set_selected_count (ProtonPlusWidgetsGamesMassEditButton* self,
                                                               gint count)
{
	AdwButtonContent* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_mass_edit_button_content;
	_tmp1_ = g_strdup_printf (ngettext ("Modify %d selected game", "Modify %d selected games", (gulong) count), count);
	_tmp2_ = _tmp1_;
	adw_button_content_set_label (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = g_strdup_printf (ngettext ("Modify %d selected game all at once", "Modify %d selected games all at once", (gulong) count), count);
	_tmp4_ = _tmp3_;
	gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp4_);
	_g_free0 (_tmp4_);
}

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

static gboolean
proton_plus_widgets_games_mass_edit_button_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                            GObject* focused_object,
                                                                            ProtonPlusUtilsControllerNavigationDirection direction)
{
	ProtonPlusWidgetsGamesMassEditButton * self;
	GtkWidget* focused = NULL;
	GtkWidget* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	GtkWidget* _tmp3_;
	GtkWidget* child = NULL;
	GtkListBox* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp9_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesMassEditButton*) base;
	g_return_val_if_fail (focused_object != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (focused_object, gtk_widget_get_type ()) ? ((GtkWidget*) focused_object) : NULL);
	focused = _tmp0_;
	_tmp3_ = focused;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		gboolean _tmp4_ = FALSE;
		GtkWidget* _tmp5_;
		_tmp5_ = focused;
		if (_tmp5_ != G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)) {
			GtkWidget* _tmp6_;
			_tmp6_ = focused;
			_tmp4_ = !gtk_widget_is_ancestor (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), (GtkWidget*) self);
		} else {
			_tmp4_ = FALSE;
		}
		_tmp2_ = _tmp4_;
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = direction != PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_DIRECTION_UP;
	}
	if (_tmp1_) {
		result = FALSE;
		_g_object_unref0 (focused);
		return result;
	}
	_tmp7_ = self->priv->_game_list_box;
	_tmp8_ = gtk_widget_get_last_child ((GtkWidget*) _tmp7_);
	_tmp9_ = _g_object_ref0 (_tmp8_);
	child = _tmp9_;
	while (TRUE) {
		GtkWidget* _tmp10_;
		gboolean _tmp11_ = FALSE;
		gboolean _tmp12_ = FALSE;
		gboolean _tmp13_ = FALSE;
		gboolean _tmp14_ = FALSE;
		gboolean _tmp15_ = FALSE;
		GtkWidget* _tmp16_;
		GtkWidget* _tmp23_;
		GtkWidget* _tmp24_;
		GtkWidget* _tmp25_;
		_tmp10_ = child;
		if (!(_tmp10_ != NULL)) {
			break;
		}
		_tmp16_ = child;
		if (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ROW (_tmp16_)) {
			GtkWidget* _tmp17_;
			_tmp17_ = child;
			_tmp15_ = gtk_widget_get_mapped (_tmp17_);
		} else {
			_tmp15_ = FALSE;
		}
		if (_tmp15_) {
			GtkWidget* _tmp18_;
			_tmp18_ = child;
			_tmp14_ = gtk_widget_is_visible (_tmp18_);
		} else {
			_tmp14_ = FALSE;
		}
		if (_tmp14_) {
			GtkWidget* _tmp19_;
			_tmp19_ = child;
			_tmp13_ = gtk_widget_get_child_visible (_tmp19_);
		} else {
			_tmp13_ = FALSE;
		}
		if (_tmp13_) {
			GtkWidget* _tmp20_;
			_tmp20_ = child;
			_tmp12_ = gtk_widget_is_sensitive (_tmp20_);
		} else {
			_tmp12_ = FALSE;
		}
		if (_tmp12_) {
			GtkWidget* _tmp21_;
			_tmp21_ = child;
			_tmp11_ = gtk_widget_get_focusable (_tmp21_);
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			GtkWidget* _tmp22_;
			_tmp22_ = child;
			result = gtk_widget_grab_focus (_tmp22_);
			_g_object_unref0 (child);
			_g_object_unref0 (focused);
			return result;
		}
		_tmp23_ = child;
		_tmp24_ = gtk_widget_get_prev_sibling (_tmp23_);
		_tmp25_ = _g_object_ref0 (_tmp24_);
		_g_object_unref0 (child);
		child = _tmp25_;
	}
	result = FALSE;
	_g_object_unref0 (child);
	_g_object_unref0 (focused);
	return result;
}

static void
proton_plus_widgets_games_mass_edit_button_mass_edit_button_clicked (ProtonPlusWidgetsGamesMassEditButton* self)
{
	gint count = 0;
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	g_return_if_fail (self != NULL);
	count = 0;
	_tmp0_ = self->priv->_game_list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		gboolean _tmp4_ = FALSE;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		GtkWidget* _tmp12_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp5_ = child;
		if (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ROW (_tmp5_)) {
			GtkWidget* _tmp6_;
			gboolean _tmp7_;
			gboolean _tmp8_;
			_tmp6_ = child;
			_tmp7_ = proton_plus_widgets_games_game_row_get_selected (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow));
			_tmp8_ = _tmp7_;
			_tmp4_ = _tmp8_;
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			gint _tmp9_;
			_tmp9_ = count;
			count = _tmp9_ + 1;
		}
		_tmp10_ = child;
		_tmp11_ = gtk_widget_get_next_sibling (_tmp10_);
		_tmp12_ = _g_object_ref0 (_tmp11_);
		_g_object_unref0 (child);
		child = _tmp12_;
	}
	if (count > 0) {
		ProtonPlusWidgetsGamesGameRow** game_rows = NULL;
		ProtonPlusWidgetsGamesGameRow** _tmp13_;
		gint game_rows_length1;
		gint _game_rows_size_;
		gint i = 0;
		GtkListBox* _tmp14_;
		GtkWidget* _tmp15_;
		GtkWidget* _tmp16_;
		ProtonPlusWidgetsGamesGameRow** _tmp30_;
		gint _tmp30__length1;
		_tmp13_ = g_new0 (ProtonPlusWidgetsGamesGameRow*, count + 1);
		game_rows = _tmp13_;
		game_rows_length1 = count;
		_game_rows_size_ = game_rows_length1;
		i = 0;
		_tmp14_ = self->priv->_game_list_box;
		_tmp15_ = gtk_widget_get_first_child ((GtkWidget*) _tmp14_);
		_tmp16_ = _g_object_ref0 (_tmp15_);
		_g_object_unref0 (child);
		child = _tmp16_;
		while (TRUE) {
			GtkWidget* _tmp17_;
			gboolean _tmp18_ = FALSE;
			GtkWidget* _tmp19_;
			GtkWidget* _tmp27_;
			GtkWidget* _tmp28_;
			GtkWidget* _tmp29_;
			_tmp17_ = child;
			if (!(_tmp17_ != NULL)) {
				break;
			}
			_tmp19_ = child;
			if (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ROW (_tmp19_)) {
				GtkWidget* _tmp20_;
				gboolean _tmp21_;
				gboolean _tmp22_;
				_tmp20_ = child;
				_tmp21_ = proton_plus_widgets_games_game_row_get_selected (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow));
				_tmp22_ = _tmp21_;
				_tmp18_ = _tmp22_;
			} else {
				_tmp18_ = FALSE;
			}
			if (_tmp18_) {
				ProtonPlusWidgetsGamesGameRow** _tmp23_;
				gint _tmp23__length1;
				GtkWidget* _tmp24_;
				ProtonPlusWidgetsGamesGameRow* _tmp25_;
				gint _tmp26_;
				_tmp23_ = game_rows;
				_tmp23__length1 = game_rows_length1;
				_tmp24_ = child;
				_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow));
				_g_object_unref0 (_tmp23_[i]);
				_tmp23_[i] = _tmp25_;
				_tmp26_ = i;
				i = _tmp26_ + 1;
			}
			_tmp27_ = child;
			_tmp28_ = gtk_widget_get_next_sibling (_tmp27_);
			_tmp29_ = _g_object_ref0 (_tmp28_);
			_g_object_unref0 (child);
			child = _tmp29_;
		}
		_tmp30_ = game_rows;
		_tmp30__length1 = game_rows_length1;
		g_signal_emit (self, proton_plus_widgets_games_mass_edit_button_signals[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_MASS_EDIT_REQUESTED_SIGNAL], 0, _tmp30_, (gint) _tmp30__length1);
		game_rows = (_vala_array_free (game_rows, game_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	} else {
		ProtonPlusWidgetsMainWarningDialog* dialog = NULL;
		ProtonPlusWidgetsMainWarningDialog* _tmp31_;
		ProtonPlusWidgetsMainWarningDialog* _tmp32_;
		GtkRoot* _tmp33_;
		_tmp31_ = proton_plus_widgets_main_warning_dialog_new (_ ("Warning"), _ ("Please make sure to select at least one game before using the mass edi" \
"t feature."));
		g_object_ref_sink (_tmp31_);
		dialog = _tmp31_;
		_tmp32_ = dialog;
		_tmp33_ = gtk_widget_get_root ((GtkWidget*) self);
		proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp32_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_window_get_type (), GtkWindow));
		_g_object_unref0 (dialog);
	}
	_g_object_unref0 (child);
}

static GtkListBox*
proton_plus_widgets_games_mass_edit_button_get_game_list_box (ProtonPlusWidgetsGamesMassEditButton* self)
{
	GtkListBox* result;
	GtkListBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game_list_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_button_set_game_list_box (ProtonPlusWidgetsGamesMassEditButton* self,
                                                              GtkListBox* value)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_game_list_box);
	self->priv->_game_list_box = _tmp0_;
}

static AdwButtonContent*
proton_plus_widgets_games_mass_edit_button_get_mass_edit_button_content (ProtonPlusWidgetsGamesMassEditButton* self)
{
	AdwButtonContent* result;
	AdwButtonContent* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mass_edit_button_content;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_button_set_mass_edit_button_content (ProtonPlusWidgetsGamesMassEditButton* self,
                                                                         AdwButtonContent* value)
{
	AdwButtonContent* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_mass_edit_button_content);
	self->priv->_mass_edit_button_content = _tmp0_;
}

static void
g_cclosure_user_marshal_VOID__POINTER_INT (GClosure * closure,
                                           GValue * return_value,
                                           guint n_param_values,
                                           const GValue * param_values,
                                           gpointer invocation_hint,
                                           gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__POINTER_INT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer data2);
	register GMarshalFunc_VOID__POINTER_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__POINTER_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_pointer (param_values + 1), g_value_get_int (param_values + 2), data2);
}

static void
_proton_plus_widgets_games_mass_edit_button_mass_edit_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                         gpointer self)
{
	proton_plus_widgets_games_mass_edit_button_mass_edit_button_clicked ((ProtonPlusWidgetsGamesMassEditButton*) self);
}

static GObject *
proton_plus_widgets_games_mass_edit_button_constructor (GType type,
                                                        guint n_construct_properties,
                                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsGamesMassEditButton * self;
	AdwButtonContent* _tmp0_;
	AdwButtonContent* _tmp1_;
	AdwButtonContent* _tmp2_;
	AdwButtonContent* _tmp3_;
	AdwButtonContent* _tmp4_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_games_mass_edit_button_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_BUTTON, ProtonPlusWidgetsGamesMassEditButton);
	_tmp0_ = (AdwButtonContent*) adw_button_content_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_games_mass_edit_button_set_mass_edit_button_content (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_mass_edit_button_content;
	adw_button_content_set_label (_tmp2_, _ ("Modify the selected games"));
	_tmp3_ = self->priv->_mass_edit_button_content;
	adw_button_content_set_icon_name (_tmp3_, "screwdriver-wrench-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) self, _ ("Modify the selected games all at once"));
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	gtk_widget_add_css_class ((GtkWidget*) self, "pill");
	gtk_widget_add_css_class ((GtkWidget*) self, "suggested-action");
	_tmp4_ = self->priv->_mass_edit_button_content;
	gtk_button_set_child ((GtkButton*) self, (GtkWidget*) _tmp4_);
	g_signal_connect_object ((GtkButton*) self, "clicked", (GCallback) _proton_plus_widgets_games_mass_edit_button_mass_edit_button_clicked_gtk_button_clicked, self, 0);
	return obj;
}

static void
proton_plus_widgets_games_mass_edit_button_class_init (ProtonPlusWidgetsGamesMassEditButtonClass * klass,
                                                       gpointer klass_data)
{
	proton_plus_widgets_games_mass_edit_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesMassEditButton_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_mass_edit_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_mass_edit_button_set_property;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_games_mass_edit_button_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_mass_edit_button_finalize;
	proton_plus_widgets_games_mass_edit_button_signals[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_BUTTON_MASS_EDIT_REQUESTED_SIGNAL] = g_signal_new ("mass-edit-requested", PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_BUTTON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__POINTER_INT, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
}

static void
proton_plus_widgets_games_mass_edit_button_proton_plus_utils_controller_directional_focus_interface_init (ProtonPlusUtilsControllerDirectionalFocusIface * iface,
                                                                                                          gpointer iface_data)
{
	proton_plus_widgets_games_mass_edit_button_proton_plus_utils_controller_directional_focus_parent_iface = g_type_interface_peek_parent (iface);
	iface->controller_focus_direction = (gboolean (*) (ProtonPlusUtilsControllerDirectionalFocus*, GObject*, ProtonPlusUtilsControllerNavigationDirection)) proton_plus_widgets_games_mass_edit_button_real_controller_focus_direction;
}

static void
proton_plus_widgets_games_mass_edit_button_instance_init (ProtonPlusWidgetsGamesMassEditButton * self,
                                                          gpointer klass)
{
	self->priv = proton_plus_widgets_games_mass_edit_button_get_instance_private (self);
}

static void
proton_plus_widgets_games_mass_edit_button_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesMassEditButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_BUTTON, ProtonPlusWidgetsGamesMassEditButton);
	_g_object_unref0 (self->priv->_game_list_box);
	_g_object_unref0 (self->priv->_mass_edit_button_content);
	G_OBJECT_CLASS (proton_plus_widgets_games_mass_edit_button_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_mass_edit_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesMassEditButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_mass_edit_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesMassEditButton), 0, (GInstanceInitFunc) proton_plus_widgets_games_mass_edit_button_instance_init, NULL };
	static const GInterfaceInfo proton_plus_utils_controller_directional_focus_info = { (GInterfaceInitFunc) proton_plus_widgets_games_mass_edit_button_proton_plus_utils_controller_directional_focus_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_games_mass_edit_button_type_id;
	proton_plus_widgets_games_mass_edit_button_type_id = g_type_register_static (gtk_button_get_type (), "ProtonPlusWidgetsGamesMassEditButton", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_games_mass_edit_button_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_DIRECTIONAL_FOCUS, &proton_plus_utils_controller_directional_focus_info);
	ProtonPlusWidgetsGamesMassEditButton_private_offset = g_type_add_instance_private (proton_plus_widgets_games_mass_edit_button_type_id, sizeof (ProtonPlusWidgetsGamesMassEditButtonPrivate));
	return proton_plus_widgets_games_mass_edit_button_type_id;
}

GType
proton_plus_widgets_games_mass_edit_button_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_mass_edit_button_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_mass_edit_button_type_id__once)) {
		GType proton_plus_widgets_games_mass_edit_button_type_id;
		proton_plus_widgets_games_mass_edit_button_type_id = proton_plus_widgets_games_mass_edit_button_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_mass_edit_button_type_id__once, proton_plus_widgets_games_mass_edit_button_type_id);
	}
	return proton_plus_widgets_games_mass_edit_button_type_id__once;
}

static void
_vala_proton_plus_widgets_games_mass_edit_button_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesMassEditButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_BUTTON, ProtonPlusWidgetsGamesMassEditButton);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_mass_edit_button_set_property (GObject * object,
                                                               guint property_id,
                                                               const GValue * value,
                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesMassEditButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_BUTTON, ProtonPlusWidgetsGamesMassEditButton);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

