/* launchers-popover-list-row.c generated by valac 0.56.19, the Vala compiler
 * generated from launchers-popover-list-row.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gee.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 PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW (proton_plus_widgets_launchers_popover_list_row_get_type ())
#define PROTON_PLUS_WIDGETS_LAUNCHERS_POPOVER_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW, ProtonPlusWidgetsLaunchersPopoverListRow))
#define PROTON_PLUS_WIDGETS_LAUNCHERS_POPOVER_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW, ProtonPlusWidgetsLaunchersPopoverListRowClass))
#define PROTON_PLUS_WIDGETS_IS_LAUNCHERS_POPOVER_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW))
#define PROTON_PLUS_WIDGETS_IS_LAUNCHERS_POPOVER_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW))
#define PROTON_PLUS_WIDGETS_LAUNCHERS_POPOVER_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW, ProtonPlusWidgetsLaunchersPopoverListRowClass))

typedef struct _ProtonPlusWidgetsLaunchersPopoverListRow ProtonPlusWidgetsLaunchersPopoverListRow;
typedef struct _ProtonPlusWidgetsLaunchersPopoverListRowClass ProtonPlusWidgetsLaunchersPopoverListRowClass;
typedef struct _ProtonPlusWidgetsLaunchersPopoverListRowPrivate ProtonPlusWidgetsLaunchersPopoverListRowPrivate;

#define PROTON_PLUS_MODELS_TYPE_LAUNCHER (proton_plus_models_launcher_get_type ())
#define PROTON_PLUS_MODELS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncher))
#define PROTON_PLUS_MODELS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))
#define PROTON_PLUS_MODELS_IS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_IS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_LAUNCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))

typedef struct _ProtonPlusModelsLauncher ProtonPlusModelsLauncher;
typedef struct _ProtonPlusModelsLauncherClass ProtonPlusModelsLauncherClass;
enum  {
	PROTON_PLUS_WIDGETS_LAUNCHERS_POPOVER_LIST_ROW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_LAUNCHERS_POPOVER_LIST_ROW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_launchers_popover_list_row_properties[PROTON_PLUS_WIDGETS_LAUNCHERS_POPOVER_LIST_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ProtonPlusModelsLauncherPrivate ProtonPlusModelsLauncherPrivate;

#define PROTON_PLUS_MODELS_TYPE_GAME (proton_plus_models_game_get_type ())
#define PROTON_PLUS_MODELS_GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame))
#define PROTON_PLUS_MODELS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGameClass))
#define PROTON_PLUS_MODELS_IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_GAME))
#define PROTON_PLUS_MODELS_IS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_GAME))
#define PROTON_PLUS_MODELS_GAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGameClass))

typedef struct _ProtonPlusModelsGame ProtonPlusModelsGame;
typedef struct _ProtonPlusModelsGameClass ProtonPlusModelsGameClass;

#define PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER (proton_plus_models_simple_runner_get_type ())
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunner))
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunnerClass))
#define PROTON_PLUS_MODELS_IS_SIMPLE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER))
#define PROTON_PLUS_MODELS_IS_SIMPLE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER))
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunnerClass))

typedef struct _ProtonPlusModelsSimpleRunner ProtonPlusModelsSimpleRunner;
typedef struct _ProtonPlusModelsSimpleRunnerClass ProtonPlusModelsSimpleRunnerClass;

#define PROTON_PLUS_MODELS_TYPE_GROUP (proton_plus_models_group_get_type ())
#define PROTON_PLUS_MODELS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroup))
#define PROTON_PLUS_MODELS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroupClass))
#define PROTON_PLUS_MODELS_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_GROUP))
#define PROTON_PLUS_MODELS_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_GROUP))
#define PROTON_PLUS_MODELS_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroupClass))

typedef struct _ProtonPlusModelsGroup ProtonPlusModelsGroup;
typedef struct _ProtonPlusModelsGroupClass ProtonPlusModelsGroupClass;
typedef enum  {
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM,
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK,
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SNAP
} ProtonPlusModelsLauncherInstallationTypes;

#define PROTON_PLUS_MODELS_LAUNCHER_TYPE_INSTALLATION_TYPES (proton_plus_models_launcher_installation_types_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ProtonPlusWidgetsLaunchersPopoverListRow {
	GtkListBoxRow parent_instance;
	ProtonPlusWidgetsLaunchersPopoverListRowPrivate * priv;
	ProtonPlusModelsLauncher* launcher;
};

struct _ProtonPlusWidgetsLaunchersPopoverListRowClass {
	GtkListBoxRowClass parent_class;
};

struct _ProtonPlusModelsLauncher {
	GObject parent_instance;
	ProtonPlusModelsLauncherPrivate * priv;
	gchar* title;
	gchar* icon_path;
	gchar* directory;
	gboolean installed;
	gboolean has_library_support;
	GList* games;
	GeeArrayList* compatibility_tools;
	ProtonPlusModelsGroup** groups;
	gint groups_length1;
	ProtonPlusModelsLauncherInstallationTypes installation_type;
};

struct _ProtonPlusModelsLauncherClass {
	GObjectClass parent_class;
	void (*load_game_library) (ProtonPlusModelsLauncher* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*load_game_library_finish) (ProtonPlusModelsLauncher* self, GAsyncResult* _res_);
	gint (*get_compatibility_tool_usage_count) (ProtonPlusModelsLauncher* self, const gchar* compatibility_tool_name);
};

static gpointer proton_plus_widgets_launchers_popover_list_row_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_launchers_popover_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsLaunchersPopoverListRow, g_object_unref)
VALA_EXTERN GType proton_plus_models_launcher_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsLauncher, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsLaunchersPopoverListRow* proton_plus_widgets_launchers_popover_list_row_new (ProtonPlusModelsLauncher* launcher);
VALA_EXTERN ProtonPlusWidgetsLaunchersPopoverListRow* proton_plus_widgets_launchers_popover_list_row_construct (GType object_type,
                                                                                                    ProtonPlusModelsLauncher* launcher);
VALA_EXTERN GType proton_plus_models_game_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsGame, g_object_unref)
VALA_EXTERN GType proton_plus_models_simple_runner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsSimpleRunner, g_object_unref)
VALA_EXTERN GType proton_plus_models_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsGroup, g_object_unref)
VALA_EXTERN GType proton_plus_models_launcher_installation_types_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* proton_plus_models_launcher_get_installation_type_title (ProtonPlusModelsLauncher* self);
static void proton_plus_widgets_launchers_popover_list_row_finalize (GObject * obj);
static GType proton_plus_widgets_launchers_popover_list_row_get_type_once (void);

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

ProtonPlusWidgetsLaunchersPopoverListRow*
proton_plus_widgets_launchers_popover_list_row_construct (GType object_type,
                                                          ProtonPlusModelsLauncher* launcher)
{
	ProtonPlusWidgetsLaunchersPopoverListRow * self = NULL;
	ProtonPlusModelsLauncher* _tmp0_;
	GtkImage* icon = NULL;
	const gchar* _tmp1_;
	GtkImage* _tmp2_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* subtitle_label = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkBox* labels_box = NULL;
	GtkBox* _tmp9_;
	GtkBox* content_box = NULL;
	GtkBox* _tmp10_;
	const gchar* _tmp11_;
	g_return_val_if_fail (launcher != NULL, NULL);
	self = (ProtonPlusWidgetsLaunchersPopoverListRow*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (launcher);
	_g_object_unref0 (self->launcher);
	self->launcher = _tmp0_;
	_tmp1_ = launcher->icon_path;
	_tmp2_ = (GtkImage*) gtk_image_new_from_resource (_tmp1_);
	g_object_ref_sink (_tmp2_);
	icon = _tmp2_;
	gtk_image_set_pixel_size (icon, 48);
	_tmp3_ = launcher->title;
	_tmp4_ = (GtkLabel*) gtk_label_new (_tmp3_);
	g_object_ref_sink (_tmp4_);
	title_label = _tmp4_;
	gtk_widget_set_halign ((GtkWidget*) title_label, GTK_ALIGN_START);
	_tmp5_ = proton_plus_models_launcher_get_installation_type_title (launcher);
	_tmp6_ = _tmp5_;
	_tmp7_ = (GtkLabel*) gtk_label_new (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	_g_free0 (_tmp6_);
	subtitle_label = _tmp8_;
	gtk_widget_add_css_class ((GtkWidget*) subtitle_label, "dimmed");
	gtk_widget_set_halign ((GtkWidget*) subtitle_label, GTK_ALIGN_START);
	_tmp9_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp9_);
	labels_box = _tmp9_;
	gtk_widget_set_valign ((GtkWidget*) labels_box, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) labels_box, TRUE);
	gtk_box_append (labels_box, (GtkWidget*) title_label);
	gtk_box_append (labels_box, (GtkWidget*) subtitle_label);
	_tmp10_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
	g_object_ref_sink (_tmp10_);
	content_box = _tmp10_;
	gtk_box_append (content_box, (GtkWidget*) icon);
	gtk_box_append (content_box, (GtkWidget*) labels_box);
	gtk_widget_add_css_class ((GtkWidget*) content_box, "p-10");
	gtk_widget_add_css_class ((GtkWidget*) self, "card");
	_tmp11_ = launcher->directory;
	gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp11_);
	gtk_list_box_row_set_activatable ((GtkListBoxRow*) self, TRUE);
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) content_box);
	_g_object_unref0 (content_box);
	_g_object_unref0 (labels_box);
	_g_object_unref0 (subtitle_label);
	_g_object_unref0 (title_label);
	_g_object_unref0 (icon);
	return self;
}

ProtonPlusWidgetsLaunchersPopoverListRow*
proton_plus_widgets_launchers_popover_list_row_new (ProtonPlusModelsLauncher* launcher)
{
	return proton_plus_widgets_launchers_popover_list_row_construct (PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW, launcher);
}

static void
proton_plus_widgets_launchers_popover_list_row_class_init (ProtonPlusWidgetsLaunchersPopoverListRowClass * klass,
                                                           gpointer klass_data)
{
	proton_plus_widgets_launchers_popover_list_row_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_launchers_popover_list_row_finalize;
}

static void
proton_plus_widgets_launchers_popover_list_row_instance_init (ProtonPlusWidgetsLaunchersPopoverListRow * self,
                                                              gpointer klass)
{
}

static void
proton_plus_widgets_launchers_popover_list_row_finalize (GObject * obj)
{
	ProtonPlusWidgetsLaunchersPopoverListRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_LAUNCHERS_POPOVER_LIST_ROW, ProtonPlusWidgetsLaunchersPopoverListRow);
	_g_object_unref0 (self->launcher);
	G_OBJECT_CLASS (proton_plus_widgets_launchers_popover_list_row_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_launchers_popover_list_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsLaunchersPopoverListRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_launchers_popover_list_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsLaunchersPopoverListRow), 0, (GInstanceInitFunc) proton_plus_widgets_launchers_popover_list_row_instance_init, NULL };
	GType proton_plus_widgets_launchers_popover_list_row_type_id;
	proton_plus_widgets_launchers_popover_list_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ProtonPlusWidgetsLaunchersPopoverListRow", &g_define_type_info, 0);
	return proton_plus_widgets_launchers_popover_list_row_type_id;
}

GType
proton_plus_widgets_launchers_popover_list_row_get_type (void)
{
	static volatile gsize proton_plus_widgets_launchers_popover_list_row_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_launchers_popover_list_row_type_id__once)) {
		GType proton_plus_widgets_launchers_popover_list_row_type_id;
		proton_plus_widgets_launchers_popover_list_row_type_id = proton_plus_widgets_launchers_popover_list_row_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_launchers_popover_list_row_type_id__once, proton_plus_widgets_launchers_popover_list_row_type_id);
	}
	return proton_plus_widgets_launchers_popover_list_row_type_id__once;
}

