/* process-row-item.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from process-row-item.vala, do not modify */

/* process-row.vala
 *
 * Copyright (C) 2017 Red Hat, Inc.
 * Copyright (C) 2023-2024 Markus Göllnitz
 *
 * This program 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 program 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 program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Petr Štětka <pstetka@redhat.com>
 *          Markus Göllnitz <camelcasenick@bewares.it>
 */

#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>

#define USAGE_PROCESS_ROW_ITEM_CSS_TAG_USER "tag-user"
#define USAGE_PROCESS_ROW_ITEM_CSS_TAG_ROOT "tag-root"
#define USAGE_PROCESS_ROW_ITEM_CSS_TAG_SYSTEM "tag-system"
#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 USAGE_TYPE_PROCESS_ROW_ITEM (usage_process_row_item_get_type ())
#define USAGE_PROCESS_ROW_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_PROCESS_ROW_ITEM, UsageProcessRowItem))
#define USAGE_PROCESS_ROW_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_PROCESS_ROW_ITEM, UsageProcessRowItemClass))
#define USAGE_IS_PROCESS_ROW_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_PROCESS_ROW_ITEM))
#define USAGE_IS_PROCESS_ROW_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_PROCESS_ROW_ITEM))
#define USAGE_PROCESS_ROW_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_PROCESS_ROW_ITEM, UsageProcessRowItemClass))

typedef struct _UsageProcessRowItem UsageProcessRowItem;
typedef struct _UsageProcessRowItemClass UsageProcessRowItemClass;
typedef struct _UsageProcessRowItemPrivate UsageProcessRowItemPrivate;

#define USAGE_TYPE_PROCESS_LIST_BOX_TYPE (usage_process_list_box_type_get_type ())
typedef struct _UsageProcessListBoxType UsageProcessListBoxType;

#define USAGE_TYPE_APP_ITEM (usage_app_item_get_type ())
#define USAGE_APP_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_APP_ITEM, UsageAppItem))
#define USAGE_APP_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_APP_ITEM, UsageAppItemClass))
#define USAGE_IS_APP_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_APP_ITEM))
#define USAGE_IS_APP_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_APP_ITEM))
#define USAGE_APP_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_APP_ITEM, UsageAppItemClass))

typedef struct _UsageAppItem UsageAppItem;
typedef struct _UsageAppItemClass UsageAppItemClass;
typedef gboolean (*UsageFilterFunc) (gconstpointer object, gpointer user_data);
typedef GtkWidget* (*UsageWidgetFactoryFunc) (gconstpointer object, gpointer user_data);
enum  {
	USAGE_PROCESS_ROW_ITEM_0_PROPERTY,
	USAGE_PROCESS_ROW_ITEM_APP_PROPERTY,
	USAGE_PROCESS_ROW_ITEM_LOAD_WIDGET_PROPERTY,
	USAGE_PROCESS_ROW_ITEM_USER_PROPERTY,
	USAGE_PROCESS_ROW_ITEM_NOT_CURRENT_USER_PROPERTY,
	USAGE_PROCESS_ROW_ITEM_USER_TYPE_PROPERTY,
	USAGE_PROCESS_ROW_ITEM_CONTAINER_ICON_PROPERTY,
	USAGE_PROCESS_ROW_ITEM_NUM_PROPERTIES
};
static GParamSpec* usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define USAGE_FDO_TYPE_ACCOUNTS_USER (usage_fdo_accounts_user_get_type ())
#define USAGE_FDO_ACCOUNTS_USER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_FDO_TYPE_ACCOUNTS_USER, UsageFdoAccountsUser))
#define USAGE_FDO_IS_ACCOUNTS_USER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_FDO_TYPE_ACCOUNTS_USER))
#define USAGE_FDO_ACCOUNTS_USER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), USAGE_FDO_TYPE_ACCOUNTS_USER, UsageFdoAccountsUserIface))

typedef struct _UsageFdoAccountsUser UsageFdoAccountsUser;
typedef struct _UsageFdoAccountsUserIface UsageFdoAccountsUserIface;

#define USAGE_FDO_TYPE_ACCOUNTS_USER_PROXY (usage_fdo_accounts_user_proxy_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
typedef enum  {
	USAGE_USER_ACCOUNT_TYPE_STANDARD,
	USAGE_USER_ACCOUNT_TYPE_ADMINISTRATOR
} UsageUserAccountType;

#define USAGE_TYPE_USER_ACCOUNT_TYPE (usage_user_account_type_get_type ())

struct _UsageProcessRowItem {
	GObject parent_instance;
	UsageProcessRowItemPrivate * priv;
};

struct _UsageProcessRowItemClass {
	GObjectClass parent_class;
	GtkWidget* (*get_load_widget) (UsageProcessRowItem* self);
	gchar* (*get_user) (UsageProcessRowItem* self);
	gboolean (*get_not_current_user) (UsageProcessRowItem* self);
	const gchar* (*get_user_type) (UsageProcessRowItem* self);
	GIcon* (*get_container_icon) (UsageProcessRowItem* self);
};

struct _UsageProcessListBoxType {
	GCompareDataFunc comparator;
	gpointer comparator_target;
	UsageFilterFunc filter;
	gpointer filter_target;
	UsageWidgetFactoryFunc load_widget_factory;
	gpointer load_widget_factory_target;
};

struct _UsageProcessRowItemPrivate {
	UsageProcessListBoxType type;
	UsageAppItem* _app;
};

struct _UsageFdoAccountsUserIface {
	GTypeInterface parent_iface;
	gboolean (*get_SystemAccount) (UsageFdoAccountsUser* self);
	gboolean (*get_LocalAccount) (UsageFdoAccountsUser* self);
	gint32 (*get_AccountType) (UsageFdoAccountsUser* self);
	gchar* (*get_RealName) (UsageFdoAccountsUser* self);
	gchar* (*get_UserName) (UsageFdoAccountsUser* self);
	guint64 (*get_Uid) (UsageFdoAccountsUser* self);
};

static gint UsageProcessRowItem_private_offset;
static gpointer usage_process_row_item_parent_class = NULL;

VALA_EXTERN GType usage_process_row_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageProcessRowItem, g_object_unref)
VALA_EXTERN GType usage_process_list_box_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType usage_app_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageAppItem, g_object_unref)
VALA_EXTERN UsageProcessListBoxType* usage_process_list_box_type_dup (const UsageProcessListBoxType* self);
VALA_EXTERN void usage_process_list_box_type_free (UsageProcessListBoxType* self);
VALA_EXTERN GtkWidget* usage_process_row_item_get_load_widget (UsageProcessRowItem* self);
VALA_EXTERN gchar* usage_process_row_item_get_user (UsageProcessRowItem* self);
VALA_EXTERN gboolean usage_process_row_item_get_not_current_user (UsageProcessRowItem* self);
VALA_EXTERN const gchar* usage_process_row_item_get_user_type (UsageProcessRowItem* self);
VALA_EXTERN GIcon* usage_process_row_item_get_container_icon (UsageProcessRowItem* self);
VALA_EXTERN UsageProcessRowItem* usage_process_row_item_new (UsageAppItem* app,
                                                 UsageProcessListBoxType* type);
VALA_EXTERN UsageProcessRowItem* usage_process_row_item_construct (GType object_type,
                                                       UsageAppItem* app,
                                                       UsageProcessListBoxType* type);
static void usage_process_row_item_set_app (UsageProcessRowItem* self,
                                     UsageAppItem* value);
VALA_EXTERN UsageAppItem* usage_process_row_item_get_app (UsageProcessRowItem* self);
VALA_EXTERN GType usage_fdo_accounts_user_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageFdoAccountsUser, g_object_unref)
VALA_EXTERN GType usage_fdo_accounts_user_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint usage_fdo_accounts_user_register_object (void* object,
                                               GDBusConnection* connection,
                                               const gchar* path,
                                               GError** error);
VALA_EXTERN UsageFdoAccountsUser* usage_app_item_get_user (UsageAppItem* self);
VALA_EXTERN gchar* usage_fdo_accounts_user_get_UserName (UsageFdoAccountsUser* self);
VALA_EXTERN gboolean usage_fdo_accounts_user_get_LocalAccount (UsageFdoAccountsUser* self);
VALA_EXTERN gint32 usage_fdo_accounts_user_get_AccountType (UsageFdoAccountsUser* self);
VALA_EXTERN GType usage_user_account_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gboolean usage_fdo_accounts_user_get_SystemAccount (UsageFdoAccountsUser* self);
VALA_EXTERN const gchar* usage_app_item_get_container (UsageAppItem* self);
static void usage_process_row_item_finalize (GObject * obj);
static GType usage_process_row_item_get_type_once (void);
static void _vala_usage_process_row_item_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_usage_process_row_item_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
usage_process_row_item_get_instance_private (UsageProcessRowItem* self)
{
	return G_STRUCT_MEMBER_P (self, UsageProcessRowItem_private_offset);
}

UsageProcessRowItem*
usage_process_row_item_construct (GType object_type,
                                  UsageAppItem* app,
                                  UsageProcessListBoxType* type)
{
	UsageProcessRowItem * self = NULL;
	UsageProcessListBoxType _tmp0_;
	g_return_val_if_fail (app != NULL, NULL);
	g_return_val_if_fail (type != NULL, NULL);
	self = (UsageProcessRowItem*) g_object_new (object_type, NULL);
	usage_process_row_item_set_app (self, app);
	_tmp0_ = *type;
	self->priv->type = _tmp0_;
	return self;
}

UsageProcessRowItem*
usage_process_row_item_new (UsageAppItem* app,
                            UsageProcessListBoxType* type)
{
	return usage_process_row_item_construct (USAGE_TYPE_PROCESS_ROW_ITEM, app, type);
}

UsageAppItem*
usage_process_row_item_get_app (UsageProcessRowItem* self)
{
	UsageAppItem* result;
	UsageAppItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_app;
	result = _tmp0_;
	return result;
}

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

static void
usage_process_row_item_set_app (UsageProcessRowItem* self,
                                UsageAppItem* value)
{
	UsageAppItem* old_value;
	g_return_if_fail (self != NULL);
	old_value = usage_process_row_item_get_app (self);
	if (old_value != value) {
		UsageAppItem* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_app);
		self->priv->_app = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_APP_PROPERTY]);
	}
}

GtkWidget*
usage_process_row_item_get_load_widget (UsageProcessRowItem* self)
{
	UsageProcessRowItemClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = USAGE_PROCESS_ROW_ITEM_GET_CLASS (self);
	if (_klass_->get_load_widget) {
		return _klass_->get_load_widget (self);
	}
	return NULL;
}

static GtkWidget*
usage_process_row_item_real_get_load_widget (UsageProcessRowItem* base)
{
	GtkWidget* result;
	UsageProcessRowItem* self;
	UsageProcessListBoxType _tmp0_;
	UsageWidgetFactoryFunc _tmp1_;
	gpointer _tmp1__target;
	UsageAppItem* _tmp2_;
	GtkWidget* _tmp3_;
	self = base;
	_tmp0_ = self->priv->type;
	_tmp1_ = _tmp0_.load_widget_factory;
	_tmp1__target = _tmp0_.load_widget_factory_target;
	_tmp2_ = self->priv->_app;
	_tmp3_ = _tmp1_ (_tmp2_, _tmp1__target);
	result = _tmp3_;
	return result;
}

gchar*
usage_process_row_item_get_user (UsageProcessRowItem* self)
{
	UsageProcessRowItemClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = USAGE_PROCESS_ROW_ITEM_GET_CLASS (self);
	if (_klass_->get_user) {
		return _klass_->get_user (self);
	}
	return NULL;
}

static gchar*
usage_process_row_item_real_get_user (UsageProcessRowItem* base)
{
	gchar* result;
	UsageProcessRowItem* self;
	UsageAppItem* _tmp0_;
	UsageFdoAccountsUser* _tmp1_;
	UsageFdoAccountsUser* _tmp2_;
	gchar* _tmp8_;
	self = base;
	_tmp0_ = self->priv->_app;
	_tmp1_ = usage_app_item_get_user (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		UsageAppItem* _tmp3_;
		UsageFdoAccountsUser* _tmp4_;
		UsageFdoAccountsUser* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = self->priv->_app;
		_tmp4_ = usage_app_item_get_user (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = usage_fdo_accounts_user_get_UserName (_tmp5_);
		_tmp7_ = _tmp6_;
		result = _tmp7_;
		return result;
	}
	_tmp8_ = g_strdup ("");
	result = _tmp8_;
	return result;
}

gboolean
usage_process_row_item_get_not_current_user (UsageProcessRowItem* self)
{
	UsageProcessRowItemClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = USAGE_PROCESS_ROW_ITEM_GET_CLASS (self);
	if (_klass_->get_not_current_user) {
		return _klass_->get_not_current_user (self);
	}
	return FALSE;
}

static gboolean
usage_process_row_item_real_get_not_current_user (UsageProcessRowItem* base)
{
	gboolean result;
	UsageProcessRowItem* self;
	gboolean _tmp0_ = FALSE;
	UsageAppItem* _tmp1_;
	UsageFdoAccountsUser* _tmp2_;
	UsageFdoAccountsUser* _tmp3_;
	self = base;
	_tmp1_ = self->priv->_app;
	_tmp2_ = usage_app_item_get_user (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		UsageAppItem* _tmp4_;
		UsageFdoAccountsUser* _tmp5_;
		UsageFdoAccountsUser* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp4_ = self->priv->_app;
		_tmp5_ = usage_app_item_get_user (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = usage_fdo_accounts_user_get_UserName (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = g_get_user_name ();
		_tmp0_ = g_strcmp0 (_tmp9_, _tmp10_) != 0;
		_g_free0 (_tmp9_);
	}
	result = _tmp0_;
	return result;
}

const gchar*
usage_process_row_item_get_user_type (UsageProcessRowItem* self)
{
	UsageProcessRowItemClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = USAGE_PROCESS_ROW_ITEM_GET_CLASS (self);
	if (_klass_->get_user_type) {
		return _klass_->get_user_type (self);
	}
	return NULL;
}

static const gchar*
usage_process_row_item_real_get_user_type (UsageProcessRowItem* base)
{
	const gchar* result;
	UsageProcessRowItem* self;
	UsageAppItem* _tmp0_;
	UsageFdoAccountsUser* _tmp1_;
	UsageFdoAccountsUser* _tmp2_;
	UsageAppItem* _tmp3_;
	UsageFdoAccountsUser* _tmp4_;
	UsageFdoAccountsUser* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	self = base;
	_tmp0_ = self->priv->_app;
	_tmp1_ = usage_app_item_get_user (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp3_ = self->priv->_app;
	_tmp4_ = usage_app_item_get_user (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = usage_fdo_accounts_user_get_LocalAccount (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		result = USAGE_PROCESS_ROW_ITEM_CSS_TAG_USER;
		return result;
	} else {
		UsageAppItem* _tmp8_;
		UsageFdoAccountsUser* _tmp9_;
		UsageFdoAccountsUser* _tmp10_;
		gint32 _tmp11_;
		gint32 _tmp12_;
		_tmp8_ = self->priv->_app;
		_tmp9_ = usage_app_item_get_user (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = usage_fdo_accounts_user_get_AccountType (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_ == ((gint32) USAGE_USER_ACCOUNT_TYPE_ADMINISTRATOR)) {
			result = USAGE_PROCESS_ROW_ITEM_CSS_TAG_ROOT;
			return result;
		} else {
			UsageAppItem* _tmp13_;
			UsageFdoAccountsUser* _tmp14_;
			UsageFdoAccountsUser* _tmp15_;
			gboolean _tmp16_;
			gboolean _tmp17_;
			_tmp13_ = self->priv->_app;
			_tmp14_ = usage_app_item_get_user (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = usage_fdo_accounts_user_get_SystemAccount (_tmp15_);
			_tmp17_ = _tmp16_;
			if (_tmp17_) {
				result = USAGE_PROCESS_ROW_ITEM_CSS_TAG_SYSTEM;
				return result;
			}
		}
	}
	result = NULL;
	return result;
}

GIcon*
usage_process_row_item_get_container_icon (UsageProcessRowItem* self)
{
	UsageProcessRowItemClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = USAGE_PROCESS_ROW_ITEM_GET_CLASS (self);
	if (_klass_->get_container_icon) {
		return _klass_->get_container_icon (self);
	}
	return NULL;
}

static GIcon*
usage_process_row_item_real_get_container_icon (UsageProcessRowItem* base)
{
	GIcon* result;
	UsageProcessRowItem* self;
	gchar* container = NULL;
	UsageAppItem* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GQuark _tmp8_ = 0U;
	static GQuark _tmp7_label0 = 0;
	self = base;
	_tmp0_ = self->priv->_app;
	_tmp1_ = usage_app_item_get_container (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	container = _tmp3_;
	_tmp4_ = container;
	if (_tmp4_ == NULL) {
		result = NULL;
		_g_free0 (container);
		return result;
	}
	_tmp5_ = container;
	_tmp6_ = (const gchar*) _tmp5_;
	_tmp8_ = (NULL == _tmp6_) ? 0 : g_quark_from_string (_tmp6_);
	if (_tmp8_ == ((0 != _tmp7_label0) ? _tmp7_label0 : (_tmp7_label0 = g_quark_from_static_string ("Waydroid")))) {
		switch (0) {
			default:
			{
				GThemedIcon* _tmp9_;
				_tmp9_ = (GThemedIcon*) g_themed_icon_new ("android-app-symbolic");
				result = (GIcon*) _tmp9_;
				_g_free0 (container);
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = NULL;
				_g_free0 (container);
				return result;
			}
		}
	}
}

static void
usage_process_row_item_class_init (UsageProcessRowItemClass * klass,
                                   gpointer klass_data)
{
	usage_process_row_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &UsageProcessRowItem_private_offset);
	USAGE_PROCESS_ROW_ITEM_CLASS (klass)->get_load_widget = (GtkWidget* (*) (UsageProcessRowItem*)) usage_process_row_item_real_get_load_widget;
	USAGE_PROCESS_ROW_ITEM_CLASS (klass)->get_user = (gchar* (*) (UsageProcessRowItem*)) usage_process_row_item_real_get_user;
	USAGE_PROCESS_ROW_ITEM_CLASS (klass)->get_not_current_user = (gboolean (*) (UsageProcessRowItem*)) usage_process_row_item_real_get_not_current_user;
	USAGE_PROCESS_ROW_ITEM_CLASS (klass)->get_user_type = (const gchar* (*) (UsageProcessRowItem*)) usage_process_row_item_real_get_user_type;
	USAGE_PROCESS_ROW_ITEM_CLASS (klass)->get_container_icon = (GIcon* (*) (UsageProcessRowItem*)) usage_process_row_item_real_get_container_icon;
	G_OBJECT_CLASS (klass)->get_property = _vala_usage_process_row_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_usage_process_row_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = usage_process_row_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_PROCESS_ROW_ITEM_APP_PROPERTY, usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_APP_PROPERTY] = g_param_spec_object ("app", "app", "app", USAGE_TYPE_APP_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_PROCESS_ROW_ITEM_LOAD_WIDGET_PROPERTY, usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_LOAD_WIDGET_PROPERTY] = g_param_spec_object ("load-widget", "load-widget", "load-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_PROCESS_ROW_ITEM_USER_PROPERTY, usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_USER_PROPERTY] = g_param_spec_string ("user", "user", "user", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_PROCESS_ROW_ITEM_NOT_CURRENT_USER_PROPERTY, usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_NOT_CURRENT_USER_PROPERTY] = g_param_spec_boolean ("not-current-user", "not-current-user", "not-current-user", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_PROCESS_ROW_ITEM_USER_TYPE_PROPERTY, usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_USER_TYPE_PROPERTY] = g_param_spec_string ("user-type", "user-type", "user-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_PROCESS_ROW_ITEM_CONTAINER_ICON_PROPERTY, usage_process_row_item_properties[USAGE_PROCESS_ROW_ITEM_CONTAINER_ICON_PROPERTY] = g_param_spec_object ("container-icon", "container-icon", "container-icon", g_icon_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
usage_process_row_item_instance_init (UsageProcessRowItem * self,
                                      gpointer klass)
{
	self->priv = usage_process_row_item_get_instance_private (self);
}

static void
usage_process_row_item_finalize (GObject * obj)
{
	UsageProcessRowItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, USAGE_TYPE_PROCESS_ROW_ITEM, UsageProcessRowItem);
	_g_object_unref0 (self->priv->_app);
	G_OBJECT_CLASS (usage_process_row_item_parent_class)->finalize (obj);
}

static GType
usage_process_row_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UsageProcessRowItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) usage_process_row_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UsageProcessRowItem), 0, (GInstanceInitFunc) usage_process_row_item_instance_init, NULL };
	GType usage_process_row_item_type_id;
	usage_process_row_item_type_id = g_type_register_static (G_TYPE_OBJECT, "UsageProcessRowItem", &g_define_type_info, 0);
	UsageProcessRowItem_private_offset = g_type_add_instance_private (usage_process_row_item_type_id, sizeof (UsageProcessRowItemPrivate));
	return usage_process_row_item_type_id;
}

GType
usage_process_row_item_get_type (void)
{
	static volatile gsize usage_process_row_item_type_id__once = 0;
	if (g_once_init_enter (&usage_process_row_item_type_id__once)) {
		GType usage_process_row_item_type_id;
		usage_process_row_item_type_id = usage_process_row_item_get_type_once ();
		g_once_init_leave (&usage_process_row_item_type_id__once, usage_process_row_item_type_id);
	}
	return usage_process_row_item_type_id__once;
}

static void
_vala_usage_process_row_item_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	UsageProcessRowItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, USAGE_TYPE_PROCESS_ROW_ITEM, UsageProcessRowItem);
	switch (property_id) {
		case USAGE_PROCESS_ROW_ITEM_APP_PROPERTY:
		g_value_set_object (value, usage_process_row_item_get_app (self));
		break;
		case USAGE_PROCESS_ROW_ITEM_LOAD_WIDGET_PROPERTY:
		g_value_take_object (value, usage_process_row_item_get_load_widget (self));
		break;
		case USAGE_PROCESS_ROW_ITEM_USER_PROPERTY:
		g_value_take_string (value, usage_process_row_item_get_user (self));
		break;
		case USAGE_PROCESS_ROW_ITEM_NOT_CURRENT_USER_PROPERTY:
		g_value_set_boolean (value, usage_process_row_item_get_not_current_user (self));
		break;
		case USAGE_PROCESS_ROW_ITEM_USER_TYPE_PROPERTY:
		g_value_set_string (value, usage_process_row_item_get_user_type (self));
		break;
		case USAGE_PROCESS_ROW_ITEM_CONTAINER_ICON_PROPERTY:
		g_value_take_object (value, usage_process_row_item_get_container_icon (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_usage_process_row_item_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	UsageProcessRowItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, USAGE_TYPE_PROCESS_ROW_ITEM, UsageProcessRowItem);
	switch (property_id) {
		case USAGE_PROCESS_ROW_ITEM_APP_PROPERTY:
		usage_process_row_item_set_app (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

