/* AppRow.c generated by valac 0.56.19, the Vala compiler
 * generated from AppRow.vala, do not modify */

/*
 * SPDX-License-Identifier: LGPL-3.0-or-later
 * SPDX-FileCopyrightText: 2018-2023 elementary, Inc. (https://elementary.io)
 */

#include "screentime-limits.h"
#include <gio/gio.h>
#include <glib.h>
#include <flatpak.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gdesktopappinfo.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>
#include <granite-7.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  {
	PC_WIDGETS_APP_ROW_0_PROPERTY,
	PC_WIDGETS_APP_ROW_APP_INFO_PROPERTY,
	PC_WIDGETS_APP_ROW_HAS_DELETE_PROPERTY,
	PC_WIDGETS_APP_ROW_IS_FLATPAK_PROPERTY,
	PC_WIDGETS_APP_ROW_FLATPAK_REF_PROPERTY,
	PC_WIDGETS_APP_ROW_NUM_PROPERTIES
};
static GParamSpec* pc_widgets_app_row_properties[PC_WIDGETS_APP_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))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
enum  {
	PC_WIDGETS_APP_ROW_DELETED_SIGNAL,
	PC_WIDGETS_APP_ROW_NUM_SIGNALS
};
static guint pc_widgets_app_row_signals[PC_WIDGETS_APP_ROW_NUM_SIGNALS] = {0};

struct _PCWidgetsAppRowPrivate {
	GAppInfo* _app_info;
	gboolean _has_delete;
};

static gint PCWidgetsAppRow_private_offset;
static gpointer pc_widgets_app_row_parent_class = NULL;
static FlatpakInstallation* pc_widgets_app_row_system_installation;
static FlatpakInstallation* pc_widgets_app_row_system_installation = NULL;
static FlatpakInstallation* pc_widgets_app_row_user_installation;
static FlatpakInstallation* pc_widgets_app_row_user_installation = NULL;

static GObject * pc_widgets_app_row_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static void _pc_widgets_app_row___lambda11_ (PCWidgetsAppRow* self);
static void __pc_widgets_app_row___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                          gpointer self);
static void pc_widgets_app_row_finalize (GObject * obj);
static GType pc_widgets_app_row_get_type_once (void);
static void _vala_pc_widgets_app_row_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_pc_widgets_app_row_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);

static inline gpointer
pc_widgets_app_row_get_instance_private (PCWidgetsAppRow* self)
{
	return G_STRUCT_MEMBER_P (self, PCWidgetsAppRow_private_offset);
}

PCWidgetsAppRow*
pc_widgets_app_row_construct (GType object_type,
                              GAppInfo* app_info)
{
	PCWidgetsAppRow * self = NULL;
	g_return_val_if_fail (app_info != NULL, NULL);
	self = (PCWidgetsAppRow*) g_object_new (object_type, "app-info", app_info, NULL);
	return self;
}

PCWidgetsAppRow*
pc_widgets_app_row_new (GAppInfo* app_info)
{
	return pc_widgets_app_row_construct (PC_WIDGETS_TYPE_APP_ROW, app_info);
}

PCWidgetsAppRow*
pc_widgets_app_row_construct_with_delete_button (GType object_type,
                                                 GAppInfo* app_info)
{
	PCWidgetsAppRow * self = NULL;
	g_return_val_if_fail (app_info != NULL, NULL);
	self = (PCWidgetsAppRow*) g_object_new (object_type, "app-info", app_info, "has-delete", TRUE, NULL);
	return self;
}

PCWidgetsAppRow*
pc_widgets_app_row_new_with_delete_button (GAppInfo* app_info)
{
	return pc_widgets_app_row_construct_with_delete_button (PC_WIDGETS_TYPE_APP_ROW, app_info);
}

static gint
vala_g_ptr_array_get_length (GPtrArray* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint) self->len;
	return result;
}

gchar*
pc_widgets_app_row_get_flatpak_ref_for_id (const gchar* id)
{
	gchar* ref = NULL;
	const gchar* _tmp34_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (id != NULL, NULL);
	ref = NULL;
	{
		FlatpakInstallation* _tmp0_;
		GPtrArray* refs = NULL;
		FlatpakInstallation* _tmp4_;
		GPtrArray* _tmp5_;
		_tmp0_ = pc_widgets_app_row_system_installation;
		if (_tmp0_ == NULL) {
			FlatpakInstallation* _tmp1_ = NULL;
			FlatpakInstallation* _tmp2_;
			FlatpakInstallation* _tmp3_;
			_tmp2_ = flatpak_installation_new_system (NULL, &_inner_error0_);
			_tmp1_ = _tmp2_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp3_ = _tmp1_;
			_tmp1_ = NULL;
			_g_object_unref0 (pc_widgets_app_row_system_installation);
			pc_widgets_app_row_system_installation = _tmp3_;
			_g_object_unref0 (_tmp1_);
		}
		_tmp4_ = pc_widgets_app_row_system_installation;
		_tmp5_ = flatpak_installation_list_installed_refs_by_kind (_tmp4_, FLATPAK_REF_KIND_APP, NULL, &_inner_error0_);
		refs = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp6_ = FALSE;
				_tmp6_ = TRUE;
				while (TRUE) {
					GPtrArray* _tmp8_;
					gint _tmp9_;
					gint _tmp10_;
					FlatpakInstalledRef* installed_ref = NULL;
					GPtrArray* _tmp11_;
					gconstpointer _tmp12_;
					FlatpakInstalledRef* _tmp13_;
					const gchar* _tmp14_;
					if (!_tmp6_) {
						gint _tmp7_;
						_tmp7_ = i;
						i = _tmp7_ + 1;
					}
					_tmp6_ = FALSE;
					_tmp8_ = refs;
					_tmp9_ = vala_g_ptr_array_get_length (_tmp8_);
					_tmp10_ = _tmp9_;
					if (!(i < _tmp10_)) {
						break;
					}
					_tmp11_ = refs;
					_tmp12_ = g_ptr_array_index (_tmp11_, (guint) i);
					installed_ref = (FlatpakInstalledRef*) _tmp12_;
					_tmp13_ = installed_ref;
					_tmp14_ = flatpak_ref_get_name ((FlatpakRef*) _tmp13_);
					if (g_strcmp0 (_tmp14_, id) == 0) {
						FlatpakInstalledRef* _tmp15_;
						gchar* _tmp16_;
						_tmp15_ = installed_ref;
						_tmp16_ = flatpak_ref_format_ref ((FlatpakRef*) _tmp15_);
						_g_free0 (ref);
						ref = _tmp16_;
					}
				}
			}
		}
		_g_ptr_array_unref0 (refs);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (ref);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	{
		FlatpakInstallation* _tmp17_;
		GPtrArray* refs = NULL;
		FlatpakInstallation* _tmp21_;
		GPtrArray* _tmp22_;
		_tmp17_ = pc_widgets_app_row_user_installation;
		if (_tmp17_ == NULL) {
			FlatpakInstallation* _tmp18_ = NULL;
			FlatpakInstallation* _tmp19_;
			FlatpakInstallation* _tmp20_;
			_tmp19_ = flatpak_installation_new_user (NULL, &_inner_error0_);
			_tmp18_ = _tmp19_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			_tmp20_ = _tmp18_;
			_tmp18_ = NULL;
			_g_object_unref0 (pc_widgets_app_row_user_installation);
			pc_widgets_app_row_user_installation = _tmp20_;
			_g_object_unref0 (_tmp18_);
		}
		_tmp21_ = pc_widgets_app_row_user_installation;
		_tmp22_ = flatpak_installation_list_installed_refs_by_kind (_tmp21_, FLATPAK_REF_KIND_APP, NULL, &_inner_error0_);
		refs = _tmp22_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp23_ = FALSE;
				_tmp23_ = TRUE;
				while (TRUE) {
					GPtrArray* _tmp25_;
					gint _tmp26_;
					gint _tmp27_;
					FlatpakInstalledRef* installed_ref = NULL;
					GPtrArray* _tmp28_;
					gconstpointer _tmp29_;
					FlatpakInstalledRef* _tmp30_;
					const gchar* _tmp31_;
					if (!_tmp23_) {
						gint _tmp24_;
						_tmp24_ = i;
						i = _tmp24_ + 1;
					}
					_tmp23_ = FALSE;
					_tmp25_ = refs;
					_tmp26_ = vala_g_ptr_array_get_length (_tmp25_);
					_tmp27_ = _tmp26_;
					if (!(i < _tmp27_)) {
						break;
					}
					_tmp28_ = refs;
					_tmp29_ = g_ptr_array_index (_tmp28_, (guint) i);
					installed_ref = (FlatpakInstalledRef*) _tmp29_;
					_tmp30_ = installed_ref;
					_tmp31_ = flatpak_ref_get_name ((FlatpakRef*) _tmp30_);
					if (g_strcmp0 (_tmp31_, id) == 0) {
						FlatpakInstalledRef* _tmp32_;
						gchar* _tmp33_;
						_tmp32_ = installed_ref;
						_tmp33_ = flatpak_ref_format_ref ((FlatpakRef*) _tmp32_);
						_g_free0 (ref);
						ref = _tmp33_;
					}
				}
			}
		}
		_g_ptr_array_unref0 (refs);
	}
	goto __finally1;
	__catch1_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (ref);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp34_ = ref;
	if (_tmp34_ != NULL) {
		result = ref;
		return result;
	}
	result = NULL;
	_g_free0 (ref);
	return result;
}

GAppInfo*
pc_widgets_app_row_get_app_info (PCWidgetsAppRow* self)
{
	GAppInfo* result;
	GAppInfo* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_app_info;
	result = _tmp0_;
	return result;
}

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

static void
pc_widgets_app_row_set_app_info (PCWidgetsAppRow* self,
                                 GAppInfo* value)
{
	GAppInfo* old_value;
	g_return_if_fail (self != NULL);
	old_value = pc_widgets_app_row_get_app_info (self);
	if (old_value != value) {
		GAppInfo* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_app_info);
		self->priv->_app_info = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pc_widgets_app_row_properties[PC_WIDGETS_APP_ROW_APP_INFO_PROPERTY]);
	}
}

gboolean
pc_widgets_app_row_get_has_delete (PCWidgetsAppRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_delete;
	return result;
}

static void
pc_widgets_app_row_set_has_delete (PCWidgetsAppRow* self,
                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = pc_widgets_app_row_get_has_delete (self);
	if (old_value != value) {
		self->priv->_has_delete = value;
		g_object_notify_by_pspec ((GObject *) self, pc_widgets_app_row_properties[PC_WIDGETS_APP_ROW_HAS_DELETE_PROPERTY]);
	}
}

gboolean
pc_widgets_app_row_get_is_flatpak (PCWidgetsAppRow* self)
{
	gboolean result;
	GAppInfo* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_app_info;
	result = g_desktop_app_info_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, G_TYPE_DESKTOP_APP_INFO, GDesktopAppInfo), "X-Flatpak");
	return result;
}

gchar*
pc_widgets_app_row_get_flatpak_ref (PCWidgetsAppRow* self)
{
	gchar* result;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gchar* id = NULL;
	GAppInfo* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = pc_widgets_app_row_get_is_flatpak (self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		result = NULL;
		return result;
	}
	_tmp2_ = self->priv->_app_info;
	_tmp3_ = g_desktop_app_info_get_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, G_TYPE_DESKTOP_APP_INFO, GDesktopAppInfo), "X-Flatpak");
	id = _tmp3_;
	_tmp4_ = id;
	_tmp5_ = pc_widgets_app_row_get_flatpak_ref_for_id (_tmp4_);
	result = _tmp5_;
	_g_free0 (id);
	return result;
}

static void
_pc_widgets_app_row___lambda11_ (PCWidgetsAppRow* self)
{
	g_signal_emit (self, pc_widgets_app_row_signals[PC_WIDGETS_APP_ROW_DELETED_SIGNAL], 0);
}

static void
__pc_widgets_app_row___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                     gpointer self)
{
	_pc_widgets_app_row___lambda11_ ((PCWidgetsAppRow*) self);
}

static GObject *
pc_widgets_app_row_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PCWidgetsAppRow * self;
	GtkImage* image = NULL;
	GAppInfo* _tmp0_;
	GIcon* _tmp1_;
	GtkImage* _tmp2_ = NULL;
	GtkLabel* app_name = NULL;
	GAppInfo* _tmp3_;
	const gchar* _tmp4_;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* app_comment = NULL;
	GAppInfo* _tmp6_;
	const gchar* _tmp7_;
	GtkLabel* _tmp8_ = NULL;
	GtkLabel* _tmp9_;
	GtkStyleContext* _tmp10_;
	GtkButton* delete_button = NULL;
	GAppInfo* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	GtkButton* _tmp14_ = NULL;
	GtkGrid* main_grid = NULL;
	GtkGrid* _tmp15_ = NULL;
	GtkGrid* _tmp16_;
	GtkImage* _tmp17_;
	GtkGrid* _tmp18_;
	GtkLabel* _tmp19_;
	GtkGrid* _tmp20_;
	GtkLabel* _tmp21_;
	gboolean _tmp22_;
	GtkGrid* _tmp25_;
	GtkButton* _tmp26_;
	parent_class = G_OBJECT_CLASS (pc_widgets_app_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PC_WIDGETS_TYPE_APP_ROW, PCWidgetsAppRow);
	_tmp0_ = self->priv->_app_info;
	_tmp1_ = g_app_info_get_icon (_tmp0_);
	_tmp2_ = (GtkImage*) gtk_image_new_from_gicon (_tmp1_);
	gtk_image_set_pixel_size (_tmp2_, 32);
	g_object_ref_sink (_tmp2_);
	image = _tmp2_;
	_tmp3_ = self->priv->_app_info;
	_tmp4_ = g_app_info_get_display_name (_tmp3_);
	_tmp5_ = (GtkLabel*) gtk_label_new (_tmp4_);
	gtk_label_set_xalign (_tmp5_, (gfloat) 0);
	g_object_ref_sink (_tmp5_);
	app_name = _tmp5_;
	_tmp6_ = self->priv->_app_info;
	_tmp7_ = g_app_info_get_description (_tmp6_);
	_tmp8_ = (GtkLabel*) gtk_label_new (_tmp7_);
	gtk_label_set_ellipsize (_tmp8_, PANGO_ELLIPSIZE_END);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_label_set_xalign (_tmp8_, (gfloat) 0);
	g_object_ref_sink (_tmp8_);
	app_comment = _tmp8_;
	_tmp9_ = app_comment;
	_tmp10_ = gtk_widget_get_style_context ((GtkWidget*) _tmp9_);
	gtk_style_context_add_class (_tmp10_, GRANITE_STYLE_CLASS_SMALL_LABEL);
	_tmp11_ = self->priv->_app_info;
	_tmp12_ = g_app_info_get_display_name (_tmp11_);
	_tmp13_ = g_strdup_printf (_ ("Unblock %s"), _tmp12_);
	_tmp14_ = (GtkButton*) gtk_button_new_from_icon_name ("edit-delete-symbolic");
	gtk_widget_set_halign ((GtkWidget*) _tmp14_, GTK_ALIGN_END);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp14_, TRUE);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp14_, _tmp13_);
	_g_free0 (_tmp13_);
	g_object_ref_sink (_tmp14_);
	delete_button = _tmp14_;
	_tmp15_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp15_, 6);
	g_object_ref_sink (_tmp15_);
	main_grid = _tmp15_;
	_tmp16_ = main_grid;
	_tmp17_ = image;
	gtk_grid_attach (_tmp16_, (GtkWidget*) _tmp17_, 0, 0, 1, 2);
	_tmp18_ = main_grid;
	_tmp19_ = app_name;
	gtk_grid_attach (_tmp18_, (GtkWidget*) _tmp19_, 1, 0, 1, 1);
	_tmp20_ = main_grid;
	_tmp21_ = app_comment;
	gtk_grid_attach (_tmp20_, (GtkWidget*) _tmp21_, 1, 1, 1, 1);
	_tmp22_ = self->priv->_has_delete;
	if (_tmp22_) {
		GtkGrid* _tmp23_;
		GtkButton* _tmp24_;
		_tmp23_ = main_grid;
		_tmp24_ = delete_button;
		gtk_grid_attach (_tmp23_, (GtkWidget*) _tmp24_, 2, 0, 1, 2);
	}
	_tmp25_ = main_grid;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp25_);
	_tmp26_ = delete_button;
	g_signal_connect_object (_tmp26_, "clicked", (GCallback) __pc_widgets_app_row___lambda11__gtk_button_clicked, self, 0);
	_g_object_unref0 (main_grid);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (app_comment);
	_g_object_unref0 (app_name);
	_g_object_unref0 (image);
	return obj;
}

static void
pc_widgets_app_row_class_init (PCWidgetsAppRowClass * klass,
                               gpointer klass_data)
{
	pc_widgets_app_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PCWidgetsAppRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_pc_widgets_app_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_pc_widgets_app_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = pc_widgets_app_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = pc_widgets_app_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PC_WIDGETS_APP_ROW_APP_INFO_PROPERTY, pc_widgets_app_row_properties[PC_WIDGETS_APP_ROW_APP_INFO_PROPERTY] = g_param_spec_object ("app-info", "app-info", "app-info", g_app_info_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PC_WIDGETS_APP_ROW_HAS_DELETE_PROPERTY, pc_widgets_app_row_properties[PC_WIDGETS_APP_ROW_HAS_DELETE_PROPERTY] = g_param_spec_boolean ("has-delete", "has-delete", "has-delete", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PC_WIDGETS_APP_ROW_IS_FLATPAK_PROPERTY, pc_widgets_app_row_properties[PC_WIDGETS_APP_ROW_IS_FLATPAK_PROPERTY] = g_param_spec_boolean ("is-flatpak", "is-flatpak", "is-flatpak", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PC_WIDGETS_APP_ROW_FLATPAK_REF_PROPERTY, pc_widgets_app_row_properties[PC_WIDGETS_APP_ROW_FLATPAK_REF_PROPERTY] = g_param_spec_string ("flatpak-ref", "flatpak-ref", "flatpak-ref", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	pc_widgets_app_row_signals[PC_WIDGETS_APP_ROW_DELETED_SIGNAL] = g_signal_new ("deleted", PC_WIDGETS_TYPE_APP_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
pc_widgets_app_row_instance_init (PCWidgetsAppRow * self,
                                  gpointer klass)
{
	self->priv = pc_widgets_app_row_get_instance_private (self);
	self->priv->_has_delete = FALSE;
}

static void
pc_widgets_app_row_finalize (GObject * obj)
{
	PCWidgetsAppRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PC_WIDGETS_TYPE_APP_ROW, PCWidgetsAppRow);
	_g_object_unref0 (self->priv->_app_info);
	G_OBJECT_CLASS (pc_widgets_app_row_parent_class)->finalize (obj);
}

static GType
pc_widgets_app_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PCWidgetsAppRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pc_widgets_app_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PCWidgetsAppRow), 0, (GInstanceInitFunc) pc_widgets_app_row_instance_init, NULL };
	GType pc_widgets_app_row_type_id;
	pc_widgets_app_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "PCWidgetsAppRow", &g_define_type_info, 0);
	PCWidgetsAppRow_private_offset = g_type_add_instance_private (pc_widgets_app_row_type_id, sizeof (PCWidgetsAppRowPrivate));
	return pc_widgets_app_row_type_id;
}

GType
pc_widgets_app_row_get_type (void)
{
	static volatile gsize pc_widgets_app_row_type_id__once = 0;
	if (g_once_init_enter (&pc_widgets_app_row_type_id__once)) {
		GType pc_widgets_app_row_type_id;
		pc_widgets_app_row_type_id = pc_widgets_app_row_get_type_once ();
		g_once_init_leave (&pc_widgets_app_row_type_id__once, pc_widgets_app_row_type_id);
	}
	return pc_widgets_app_row_type_id__once;
}

static void
_vala_pc_widgets_app_row_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	PCWidgetsAppRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PC_WIDGETS_TYPE_APP_ROW, PCWidgetsAppRow);
	switch (property_id) {
		case PC_WIDGETS_APP_ROW_APP_INFO_PROPERTY:
		g_value_set_object (value, pc_widgets_app_row_get_app_info (self));
		break;
		case PC_WIDGETS_APP_ROW_HAS_DELETE_PROPERTY:
		g_value_set_boolean (value, pc_widgets_app_row_get_has_delete (self));
		break;
		case PC_WIDGETS_APP_ROW_IS_FLATPAK_PROPERTY:
		g_value_set_boolean (value, pc_widgets_app_row_get_is_flatpak (self));
		break;
		case PC_WIDGETS_APP_ROW_FLATPAK_REF_PROPERTY:
		g_value_take_string (value, pc_widgets_app_row_get_flatpak_ref (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_pc_widgets_app_row_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	PCWidgetsAppRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PC_WIDGETS_TYPE_APP_ROW, PCWidgetsAppRow);
	switch (property_id) {
		case PC_WIDGETS_APP_ROW_APP_INFO_PROPERTY:
		pc_widgets_app_row_set_app_info (self, g_value_get_object (value));
		break;
		case PC_WIDGETS_APP_ROW_HAS_DELETE_PROPERTY:
		pc_widgets_app_row_set_has_delete (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

