/* app-dialog.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from app-dialog.vala, do not modify */

/* app-dialog.vala
 *
 * Copyright (C) 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: Markus Göllnitz <camelcasenick@bewares.it>
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <adwaita.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <signal.h>
#include <gdk/gdk.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 USAGE_TYPE_APP_DIALOG_PROPERTY (usage_app_dialog_property_get_type ())
#define USAGE_APP_DIALOG_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_APP_DIALOG_PROPERTY, UsageAppDialogProperty))
#define USAGE_APP_DIALOG_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_APP_DIALOG_PROPERTY, UsageAppDialogPropertyClass))
#define USAGE_IS_APP_DIALOG_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_APP_DIALOG_PROPERTY))
#define USAGE_IS_APP_DIALOG_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_APP_DIALOG_PROPERTY))
#define USAGE_APP_DIALOG_PROPERTY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_APP_DIALOG_PROPERTY, UsageAppDialogPropertyClass))

typedef struct _UsageAppDialogProperty UsageAppDialogProperty;
typedef struct _UsageAppDialogPropertyClass UsageAppDialogPropertyClass;
typedef struct _UsageAppDialogPropertyPrivate UsageAppDialogPropertyPrivate;
enum  {
	USAGE_APP_DIALOG_PROPERTY_0_PROPERTY,
	USAGE_APP_DIALOG_PROPERTY_NAME_PROPERTY,
	USAGE_APP_DIALOG_PROPERTY_VALUE_PROPERTY,
	USAGE_APP_DIALOG_PROPERTY_NUM_PROPERTIES
};
static GParamSpec* usage_app_dialog_property_properties[USAGE_APP_DIALOG_PROPERTY_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define USAGE_TYPE_APP_DIALOG_PROPERTIES (usage_app_dialog_properties_get_type ())
#define USAGE_APP_DIALOG_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_APP_DIALOG_PROPERTIES, UsageAppDialogProperties))
#define USAGE_APP_DIALOG_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_APP_DIALOG_PROPERTIES, UsageAppDialogPropertiesClass))
#define USAGE_IS_APP_DIALOG_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_APP_DIALOG_PROPERTIES))
#define USAGE_IS_APP_DIALOG_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_APP_DIALOG_PROPERTIES))
#define USAGE_APP_DIALOG_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_APP_DIALOG_PROPERTIES, UsageAppDialogPropertiesClass))

typedef struct _UsageAppDialogProperties UsageAppDialogProperties;
typedef struct _UsageAppDialogPropertiesClass UsageAppDialogPropertiesClass;
typedef struct _UsageAppDialogPropertiesPrivate UsageAppDialogPropertiesPrivate;
enum  {
	USAGE_APP_DIALOG_PROPERTIES_0_PROPERTY,
	USAGE_APP_DIALOG_PROPERTIES_NUM_PROPERTIES
};
static GParamSpec* usage_app_dialog_properties_properties[USAGE_APP_DIALOG_PROPERTIES_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define USAGE_TYPE_APP_DIALOG (usage_app_dialog_get_type ())
#define USAGE_APP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_APP_DIALOG, UsageAppDialog))
#define USAGE_APP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_APP_DIALOG, UsageAppDialogClass))
#define USAGE_IS_APP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_APP_DIALOG))
#define USAGE_IS_APP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_APP_DIALOG))
#define USAGE_APP_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_APP_DIALOG, UsageAppDialogClass))

typedef struct _UsageAppDialog UsageAppDialog;
typedef struct _UsageAppDialogClass UsageAppDialogClass;
typedef struct _UsageAppDialogPrivate UsageAppDialogPrivate;

#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;
enum  {
	USAGE_APP_DIALOG_0_PROPERTY,
	USAGE_APP_DIALOG_NUM_PROPERTIES
};
static GParamSpec* usage_app_dialog_properties[USAGE_APP_DIALOG_NUM_PROPERTIES];
typedef struct _Block1Data Block1Data;

#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 USAGE_TYPE_QUIT_PROCESS_DIALOG (usage_quit_process_dialog_get_type ())
#define USAGE_QUIT_PROCESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_QUIT_PROCESS_DIALOG, UsageQuitProcessDialog))
#define USAGE_QUIT_PROCESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_QUIT_PROCESS_DIALOG, UsageQuitProcessDialogClass))
#define USAGE_IS_QUIT_PROCESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_QUIT_PROCESS_DIALOG))
#define USAGE_IS_QUIT_PROCESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_QUIT_PROCESS_DIALOG))
#define USAGE_QUIT_PROCESS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_QUIT_PROCESS_DIALOG, UsageQuitProcessDialogClass))

typedef struct _UsageQuitProcessDialog UsageQuitProcessDialog;
typedef struct _UsageQuitProcessDialogClass UsageQuitProcessDialogClass;

#define USAGE_TYPE_SETTINGS (usage_settings_get_type ())
#define USAGE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_SETTINGS, UsageSettings))
#define USAGE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_SETTINGS, UsageSettingsClass))
#define USAGE_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_SETTINGS))
#define USAGE_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_SETTINGS))
#define USAGE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_SETTINGS, UsageSettingsClass))

typedef struct _UsageSettings UsageSettings;
typedef struct _UsageSettingsClass UsageSettingsClass;

struct _UsageAppDialogProperty {
	GObject parent_instance;
	UsageAppDialogPropertyPrivate * priv;
};

struct _UsageAppDialogPropertyClass {
	GObjectClass parent_class;
};

struct _UsageAppDialogPropertyPrivate {
	gchar* _name;
	gchar* _value;
};

struct _UsageAppDialogProperties {
	GObject parent_instance;
	UsageAppDialogPropertiesPrivate * priv;
};

struct _UsageAppDialogPropertiesClass {
	GObjectClass parent_class;
};

struct _UsageAppDialogPropertiesPrivate {
	GListStore* model;
};

struct _UsageAppDialog {
	AdwDialog parent_instance;
	UsageAppDialogPrivate * priv;
};

struct _UsageAppDialogClass {
	AdwDialogClass parent_class;
};

struct _UsageAppDialogPrivate {
	UsageAppItem* app;
	GtkImage* icon;
	GtkLabel* app_title;
	GtkLabel* app_user;
	GtkBox* in_background_info;
	GtkListView* simple_properties;
	GtkButton* quit_button;
	GtkButton* force_quit_button;
};

struct _Block1Data {
	int _ref_count_;
	UsageAppDialog* self;
	UsageAppDialogProperty* cpu_property;
	UsageAppDialogProperty* memory_property;
};

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 UsageAppDialogProperty_private_offset;
static gpointer usage_app_dialog_property_parent_class = NULL;
static gint UsageAppDialogProperties_private_offset;
static gpointer usage_app_dialog_properties_parent_class = NULL;
static GListModelInterface * usage_app_dialog_properties_g_list_model_parent_iface = NULL;
static gint UsageAppDialog_private_offset;
static gpointer usage_app_dialog_parent_class = NULL;

VALA_EXTERN GType usage_app_dialog_property_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageAppDialogProperty, g_object_unref)
VALA_EXTERN UsageAppDialogProperty* usage_app_dialog_property_new (void);
VALA_EXTERN UsageAppDialogProperty* usage_app_dialog_property_construct (GType object_type);
VALA_EXTERN const gchar* usage_app_dialog_property_get_name (UsageAppDialogProperty* self);
VALA_EXTERN void usage_app_dialog_property_set_name (UsageAppDialogProperty* self,
                                         const gchar* value);
VALA_EXTERN const gchar* usage_app_dialog_property_get_value (UsageAppDialogProperty* self);
VALA_EXTERN void usage_app_dialog_property_set_value (UsageAppDialogProperty* self,
                                          const gchar* value);
static void usage_app_dialog_property_finalize (GObject * obj);
static GType usage_app_dialog_property_get_type_once (void);
static void _vala_usage_app_dialog_property_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_usage_app_dialog_property_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);
VALA_EXTERN GType usage_app_dialog_properties_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageAppDialogProperties, g_object_unref)
VALA_EXTERN UsageAppDialogProperties* usage_app_dialog_properties_new (UsageAppDialogProperty** properties,
                                                           gint properties_length1);
VALA_EXTERN UsageAppDialogProperties* usage_app_dialog_properties_construct (GType object_type,
                                                                 UsageAppDialogProperty** properties,
                                                                 gint properties_length1);
static void _g_list_model_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                             guint position,
                                                             guint removed,
                                                             guint added,
                                                             gpointer self);
VALA_EXTERN void usage_app_dialog_properties_append (UsageAppDialogProperties* self,
                                         UsageAppDialogProperty* property);
static GObject* usage_app_dialog_properties_real_get_item (GListModel* base,
                                                    guint position);
static GType usage_app_dialog_properties_real_get_item_type (GListModel* base);
static guint usage_app_dialog_properties_real_get_n_items (GListModel* base);
static void usage_app_dialog_properties_finalize (GObject * obj);
static GType usage_app_dialog_properties_get_type_once (void);
VALA_EXTERN GType usage_app_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageAppDialog, g_object_unref)
VALA_EXTERN GType usage_app_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageAppItem, g_object_unref)
VALA_EXTERN UsageAppDialog* usage_app_dialog_new (UsageAppItem* app);
VALA_EXTERN UsageAppDialog* usage_app_dialog_construct (GType object_type,
                                            UsageAppItem* app);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
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_RealName (UsageFdoAccountsUser* self);
VALA_EXTERN gboolean usage_app_item_is_killable (UsageAppItem* self);
VALA_EXTERN gdouble usage_app_item_get_cpu_load (UsageAppItem* self);
static void __lambda4_ (Block1Data* _data1_);
static void ___lambda4__g_object_notify (GObject* _sender,
                                  GParamSpec* pspec,
                                  gpointer self);
VALA_EXTERN gchar* usage_utils_format_size_values (guint64 value,
                                       gulong** most_significant);
VALA_EXTERN guint64 usage_app_item_get_mem_usage (UsageAppItem* self);
static void __lambda5_ (Block1Data* _data1_);
static void ___lambda5__g_object_notify (GObject* _sender,
                                  GParamSpec* pspec,
                                  gpointer self);
VALA_EXTERN void usage_app_dialog_quit_clicked (UsageAppDialog* self,
                                    GtkButton* quit_button);
VALA_EXTERN GType usage_quit_process_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageQuitProcessDialog, g_object_unref)
VALA_EXTERN UsageQuitProcessDialog* usage_quit_process_dialog_new (UsageAppItem* app);
VALA_EXTERN UsageQuitProcessDialog* usage_quit_process_dialog_construct (GType object_type,
                                                             UsageAppItem* app);
static void ___lambda6_ (UsageAppDialog* self,
                  AdwAlertDialog* dialog,
                  const gchar* response_type);
static void ___lambda7_ (UsageAppDialog* self);
VALA_EXTERN gboolean usage_app_item_is_running (UsageAppItem* self);
static void ____lambda7__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
VALA_EXTERN GType usage_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageSettings, g_object_unref)
VALA_EXTERN UsageSettings* usage_settings_get_default (void);
VALA_EXTERN guint usage_settings_get_data_update_interval (UsageSettings* self);
static gboolean ___lambda8_ (UsageAppDialog* self);
static gboolean ____lambda8__gsource_func (gpointer self);
static void ____lambda6__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
static void _usage_app_dialog_quit_clicked_gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self);
VALA_EXTERN void usage_app_dialog_force_quit_clicked (UsageAppDialog* self,
                                          GtkButton* quit_button);
VALA_EXTERN void usage_app_item_kill (UsageAppItem* self,
                          int* sig);
static void _usage_app_dialog_force_quit_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self);
static void usage_app_dialog_finalize (GObject * obj);
static GType usage_app_dialog_get_type_once (void);
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
usage_app_dialog_property_get_instance_private (UsageAppDialogProperty* self)
{
	return G_STRUCT_MEMBER_P (self, UsageAppDialogProperty_private_offset);
}

UsageAppDialogProperty*
usage_app_dialog_property_construct (GType object_type)
{
	UsageAppDialogProperty * self = NULL;
	self = (UsageAppDialogProperty*) g_object_new (object_type, NULL);
	return self;
}

UsageAppDialogProperty*
usage_app_dialog_property_new (void)
{
	return usage_app_dialog_property_construct (USAGE_TYPE_APP_DIALOG_PROPERTY);
}

const gchar*
usage_app_dialog_property_get_name (UsageAppDialogProperty* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
usage_app_dialog_property_set_name (UsageAppDialogProperty* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = usage_app_dialog_property_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, usage_app_dialog_property_properties[USAGE_APP_DIALOG_PROPERTY_NAME_PROPERTY]);
	}
}

const gchar*
usage_app_dialog_property_get_value (UsageAppDialogProperty* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_value;
	result = _tmp0_;
	return result;
}

void
usage_app_dialog_property_set_value (UsageAppDialogProperty* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = usage_app_dialog_property_get_value (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_value);
		self->priv->_value = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, usage_app_dialog_property_properties[USAGE_APP_DIALOG_PROPERTY_VALUE_PROPERTY]);
	}
}

static void
usage_app_dialog_property_class_init (UsageAppDialogPropertyClass * klass,
                                      gpointer klass_data)
{
	usage_app_dialog_property_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &UsageAppDialogProperty_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_usage_app_dialog_property_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_usage_app_dialog_property_set_property;
	G_OBJECT_CLASS (klass)->finalize = usage_app_dialog_property_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_APP_DIALOG_PROPERTY_NAME_PROPERTY, usage_app_dialog_property_properties[USAGE_APP_DIALOG_PROPERTY_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USAGE_APP_DIALOG_PROPERTY_VALUE_PROPERTY, usage_app_dialog_property_properties[USAGE_APP_DIALOG_PROPERTY_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
usage_app_dialog_property_instance_init (UsageAppDialogProperty * self,
                                         gpointer klass)
{
	self->priv = usage_app_dialog_property_get_instance_private (self);
}

static void
usage_app_dialog_property_finalize (GObject * obj)
{
	UsageAppDialogProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, USAGE_TYPE_APP_DIALOG_PROPERTY, UsageAppDialogProperty);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_value);
	G_OBJECT_CLASS (usage_app_dialog_property_parent_class)->finalize (obj);
}

static GType
usage_app_dialog_property_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UsageAppDialogPropertyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) usage_app_dialog_property_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UsageAppDialogProperty), 0, (GInstanceInitFunc) usage_app_dialog_property_instance_init, NULL };
	GType usage_app_dialog_property_type_id;
	usage_app_dialog_property_type_id = g_type_register_static (G_TYPE_OBJECT, "UsageAppDialogProperty", &g_define_type_info, 0);
	UsageAppDialogProperty_private_offset = g_type_add_instance_private (usage_app_dialog_property_type_id, sizeof (UsageAppDialogPropertyPrivate));
	return usage_app_dialog_property_type_id;
}

GType
usage_app_dialog_property_get_type (void)
{
	static volatile gsize usage_app_dialog_property_type_id__once = 0;
	if (g_once_init_enter (&usage_app_dialog_property_type_id__once)) {
		GType usage_app_dialog_property_type_id;
		usage_app_dialog_property_type_id = usage_app_dialog_property_get_type_once ();
		g_once_init_leave (&usage_app_dialog_property_type_id__once, usage_app_dialog_property_type_id);
	}
	return usage_app_dialog_property_type_id__once;
}

static void
_vala_usage_app_dialog_property_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	UsageAppDialogProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, USAGE_TYPE_APP_DIALOG_PROPERTY, UsageAppDialogProperty);
	switch (property_id) {
		case USAGE_APP_DIALOG_PROPERTY_NAME_PROPERTY:
		g_value_set_string (value, usage_app_dialog_property_get_name (self));
		break;
		case USAGE_APP_DIALOG_PROPERTY_VALUE_PROPERTY:
		g_value_set_string (value, usage_app_dialog_property_get_value (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_usage_app_dialog_property_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	UsageAppDialogProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, USAGE_TYPE_APP_DIALOG_PROPERTY, UsageAppDialogProperty);
	switch (property_id) {
		case USAGE_APP_DIALOG_PROPERTY_NAME_PROPERTY:
		usage_app_dialog_property_set_name (self, g_value_get_string (value));
		break;
		case USAGE_APP_DIALOG_PROPERTY_VALUE_PROPERTY:
		usage_app_dialog_property_set_value (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
usage_app_dialog_properties_get_instance_private (UsageAppDialogProperties* self)
{
	return G_STRUCT_MEMBER_P (self, UsageAppDialogProperties_private_offset);
}

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

static void
_g_list_model_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                        guint position,
                                                        guint removed,
                                                        guint added,
                                                        gpointer self)
{
	g_list_model_items_changed ((GListModel*) self, position, removed, added);
}

UsageAppDialogProperties*
usage_app_dialog_properties_construct (GType object_type,
                                       UsageAppDialogProperty** properties,
                                       gint properties_length1)
{
	UsageAppDialogProperties * self = NULL;
	GListStore* _tmp3_;
	self = (UsageAppDialogProperties*) g_object_new (object_type, NULL);
	{
		UsageAppDialogProperty** property_collection = NULL;
		gint property_collection_length1 = 0;
		gint _property_collection_size_ = 0;
		gint property_it = 0;
		property_collection = properties;
		property_collection_length1 = properties_length1;
		for (property_it = 0; property_it < property_collection_length1; property_it = property_it + 1) {
			UsageAppDialogProperty* _tmp0_;
			UsageAppDialogProperty* property = NULL;
			_tmp0_ = _g_object_ref0 (property_collection[property_it]);
			property = _tmp0_;
			{
				GListStore* _tmp1_;
				UsageAppDialogProperty* _tmp2_;
				_tmp1_ = self->priv->model;
				_tmp2_ = property;
				g_list_store_append (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, G_TYPE_OBJECT, GObject));
				_g_object_unref0 (property);
			}
		}
	}
	_tmp3_ = self->priv->model;
	g_signal_connect_object ((GListModel*) _tmp3_, "items-changed", (GCallback) _g_list_model_items_changed_g_list_model_items_changed, (GListModel*) self, 0);
	return self;
}

UsageAppDialogProperties*
usage_app_dialog_properties_new (UsageAppDialogProperty** properties,
                                 gint properties_length1)
{
	return usage_app_dialog_properties_construct (USAGE_TYPE_APP_DIALOG_PROPERTIES, properties, properties_length1);
}

void
usage_app_dialog_properties_append (UsageAppDialogProperties* self,
                                    UsageAppDialogProperty* property)
{
	GListStore* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (property != NULL);
	_tmp0_ = self->priv->model;
	g_list_store_append (_tmp0_, (GObject*) property);
}

static GObject*
usage_app_dialog_properties_real_get_item (GListModel* base,
                                           guint position)
{
	UsageAppDialogProperties * self;
	GListStore* _tmp0_;
	GObject* _tmp1_;
	GObject* result;
	self = (UsageAppDialogProperties*) base;
	_tmp0_ = self->priv->model;
	_tmp1_ = g_list_model_get_item ((GListModel*) _tmp0_, position);
	result = _tmp1_;
	return result;
}

static GType
usage_app_dialog_properties_real_get_item_type (GListModel* base)
{
	UsageAppDialogProperties * self;
	GListStore* _tmp0_;
	GType result;
	self = (UsageAppDialogProperties*) base;
	_tmp0_ = self->priv->model;
	result = g_list_model_get_item_type ((GListModel*) _tmp0_);
	return result;
}

static guint
usage_app_dialog_properties_real_get_n_items (GListModel* base)
{
	UsageAppDialogProperties * self;
	GListStore* _tmp0_;
	guint result;
	self = (UsageAppDialogProperties*) base;
	_tmp0_ = self->priv->model;
	result = g_list_model_get_n_items ((GListModel*) _tmp0_);
	return result;
}

static void
usage_app_dialog_properties_class_init (UsageAppDialogPropertiesClass * klass,
                                        gpointer klass_data)
{
	usage_app_dialog_properties_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &UsageAppDialogProperties_private_offset);
	G_OBJECT_CLASS (klass)->finalize = usage_app_dialog_properties_finalize;
}

static void
usage_app_dialog_properties_g_list_model_interface_init (GListModelInterface * iface,
                                                         gpointer iface_data)
{
	usage_app_dialog_properties_g_list_model_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_item = (GObject* (*) (GListModel*, guint)) usage_app_dialog_properties_real_get_item;
	iface->get_item_type = (GType (*) (GListModel*)) usage_app_dialog_properties_real_get_item_type;
	iface->get_n_items = (guint (*) (GListModel*)) usage_app_dialog_properties_real_get_n_items;
}

static void
usage_app_dialog_properties_instance_init (UsageAppDialogProperties * self,
                                           gpointer klass)
{
	GListStore* _tmp0_;
	self->priv = usage_app_dialog_properties_get_instance_private (self);
	_tmp0_ = g_list_store_new (USAGE_TYPE_APP_DIALOG_PROPERTY);
	self->priv->model = _tmp0_;
}

static void
usage_app_dialog_properties_finalize (GObject * obj)
{
	UsageAppDialogProperties * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, USAGE_TYPE_APP_DIALOG_PROPERTIES, UsageAppDialogProperties);
	_g_object_unref0 (self->priv->model);
	G_OBJECT_CLASS (usage_app_dialog_properties_parent_class)->finalize (obj);
}

static GType
usage_app_dialog_properties_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UsageAppDialogPropertiesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) usage_app_dialog_properties_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UsageAppDialogProperties), 0, (GInstanceInitFunc) usage_app_dialog_properties_instance_init, NULL };
	static const GInterfaceInfo g_list_model_info = { (GInterfaceInitFunc) usage_app_dialog_properties_g_list_model_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType usage_app_dialog_properties_type_id;
	usage_app_dialog_properties_type_id = g_type_register_static (G_TYPE_OBJECT, "UsageAppDialogProperties", &g_define_type_info, 0);
	g_type_add_interface_static (usage_app_dialog_properties_type_id, g_list_model_get_type (), &g_list_model_info);
	UsageAppDialogProperties_private_offset = g_type_add_instance_private (usage_app_dialog_properties_type_id, sizeof (UsageAppDialogPropertiesPrivate));
	return usage_app_dialog_properties_type_id;
}

GType
usage_app_dialog_properties_get_type (void)
{
	static volatile gsize usage_app_dialog_properties_type_id__once = 0;
	if (g_once_init_enter (&usage_app_dialog_properties_type_id__once)) {
		GType usage_app_dialog_properties_type_id;
		usage_app_dialog_properties_type_id = usage_app_dialog_properties_get_type_once ();
		g_once_init_leave (&usage_app_dialog_properties_type_id__once, usage_app_dialog_properties_type_id);
	}
	return usage_app_dialog_properties_type_id__once;
}

static inline gpointer
usage_app_dialog_get_instance_private (UsageAppDialog* self)
{
	return G_STRUCT_MEMBER_P (self, UsageAppDialog_private_offset);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		UsageAppDialog* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->memory_property);
		_g_object_unref0 (_data1_->cpu_property);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
__lambda4_ (Block1Data* _data1_)
{
	UsageAppDialog* self;
	UsageAppItem* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	self = _data1_->self;
	_tmp0_ = self->priv->app;
	_tmp1_ = usage_app_item_get_cpu_load (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup_printf ("%.1f %%", _tmp2_ * 100);
	_tmp4_ = _tmp3_;
	usage_app_dialog_property_set_value (_data1_->cpu_property, _tmp4_);
	_g_free0 (_tmp4_);
	g_object_notify ((GObject*) _data1_->cpu_property, "value");
}

static void
___lambda4__g_object_notify (GObject* _sender,
                             GParamSpec* pspec,
                             gpointer self)
{
	__lambda4_ (self);
}

static void
__lambda5_ (Block1Data* _data1_)
{
	UsageAppDialog* self;
	UsageAppItem* _tmp0_;
	guint64 _tmp1_;
	guint64 _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	self = _data1_->self;
	_tmp0_ = self->priv->app;
	_tmp1_ = usage_app_item_get_mem_usage (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = usage_utils_format_size_values (_tmp2_, NULL);
	_tmp4_ = _tmp3_;
	usage_app_dialog_property_set_value (_data1_->memory_property, _tmp4_);
	_g_free0 (_tmp4_);
	g_object_notify ((GObject*) _data1_->memory_property, "value");
}

static void
___lambda5__g_object_notify (GObject* _sender,
                             GParamSpec* pspec,
                             gpointer self)
{
	__lambda5_ (self);
}

UsageAppDialog*
usage_app_dialog_construct (GType object_type,
                            UsageAppItem* app)
{
	UsageAppDialog * self = NULL;
	Block1Data* _data1_;
	UsageAppItem* _tmp0_;
	UsageAppItem* _tmp1_;
	UsageAppItem* _tmp2_;
	GtkLabel* _tmp3_;
	UsageFdoAccountsUser* _tmp4_ = NULL;
	UsageAppItem* _tmp5_;
	UsageFdoAccountsUser* _tmp6_;
	UsageFdoAccountsUser* _tmp7_;
	gchar* _tmp8_ = NULL;
	const gchar* _tmp11_ = NULL;
	GtkLabel* _tmp12_;
	UsageAppItem* _tmp13_;
	GtkBox* _tmp14_;
	UsageAppItem* _tmp15_;
	GtkImage* _tmp16_;
	GtkButton* _tmp17_;
	UsageAppItem* _tmp18_;
	gchar* _tmp19_;
	UsageAppItem* _tmp20_;
	gdouble _tmp21_;
	gdouble _tmp22_;
	gchar* _tmp23_;
	UsageAppDialogProperty* _tmp24_ = NULL;
	UsageAppItem* _tmp25_;
	gchar* _tmp26_;
	UsageAppItem* _tmp27_;
	guint64 _tmp28_;
	guint64 _tmp29_;
	gchar* _tmp30_;
	UsageAppDialogProperty* _tmp31_ = NULL;
	UsageAppItem* _tmp32_;
	GtkListView* _tmp33_;
	UsageAppDialogProperty* _tmp34_;
	UsageAppDialogProperty* _tmp35_;
	UsageAppDialogProperty** _tmp36_;
	UsageAppDialogProperty** _tmp37_;
	gint _tmp37__length1;
	UsageAppDialogProperties* _tmp38_;
	GtkNoSelection* _tmp39_;
	GtkNoSelection* _tmp40_;
	g_return_val_if_fail (app != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	self = (UsageAppDialog*) g_object_new (object_type, NULL);
	_data1_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (app);
	_g_object_unref0 (self->priv->app);
	self->priv->app = _tmp0_;
	_tmp1_ = self->priv->app;
	g_object_bind_property_with_closures ((GObject*) _tmp1_, "display_name", (GObject*) self, "title", 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)));
	_tmp2_ = self->priv->app;
	_tmp3_ = self->priv->app_title;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "display_name", (GObject*) _tmp3_, "label", 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)));
	_tmp5_ = self->priv->app;
	_tmp6_ = usage_app_item_get_user (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp4_ = _tmp7_;
	_tmp8_ = NULL;
	if (_tmp4_ != NULL) {
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp9_ = usage_fdo_accounts_user_get_RealName (_tmp4_);
		_tmp10_ = _tmp9_;
		_g_free0 (_tmp8_);
		_tmp8_ = _tmp10_;
	}
	_tmp11_ = _tmp8_;
	if (_tmp11_ == NULL) {
		_tmp11_ = "";
	}
	_tmp12_ = self->priv->app_user;
	gtk_label_set_label (_tmp12_, _tmp11_);
	_tmp13_ = self->priv->app;
	_tmp14_ = self->priv->in_background_info;
	g_object_bind_property_with_closures ((GObject*) _tmp13_, "is_background", (GObject*) _tmp14_, "visible", 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)));
	_tmp15_ = self->priv->app;
	_tmp16_ = self->priv->icon;
	g_object_bind_property_with_closures ((GObject*) _tmp15_, "icon", (GObject*) _tmp16_, "gicon", 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)));
	_tmp17_ = self->priv->quit_button;
	_tmp18_ = self->priv->app;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp17_, usage_app_item_is_killable (_tmp18_));
	_tmp19_ = g_strdup (_ ("CPU"));
	_tmp20_ = self->priv->app;
	_tmp21_ = usage_app_item_get_cpu_load (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = g_strdup_printf ("%.1f %%", _tmp22_ * 100);
	_tmp24_ = usage_app_dialog_property_new ();
	usage_app_dialog_property_set_name (_tmp24_, _tmp19_);
	_g_free0 (_tmp19_);
	usage_app_dialog_property_set_value (_tmp24_, _tmp23_);
	_g_free0 (_tmp23_);
	_data1_->cpu_property = _tmp24_;
	_tmp25_ = self->priv->app;
	g_signal_connect_data ((GObject*) _tmp25_, "notify::cpu-load", (GCallback) ___lambda4__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp26_ = g_strdup (_ ("Memory"));
	_tmp27_ = self->priv->app;
	_tmp28_ = usage_app_item_get_mem_usage (_tmp27_);
	_tmp29_ = _tmp28_;
	_tmp30_ = usage_utils_format_size_values (_tmp29_, NULL);
	_tmp31_ = usage_app_dialog_property_new ();
	usage_app_dialog_property_set_name (_tmp31_, _tmp26_);
	_g_free0 (_tmp26_);
	usage_app_dialog_property_set_value (_tmp31_, _tmp30_);
	_g_free0 (_tmp30_);
	_data1_->memory_property = _tmp31_;
	_tmp32_ = self->priv->app;
	g_signal_connect_data ((GObject*) _tmp32_, "notify::mem-usage", (GCallback) ___lambda5__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp33_ = self->priv->simple_properties;
	_tmp34_ = _g_object_ref0 (_data1_->cpu_property);
	_tmp35_ = _g_object_ref0 (_data1_->memory_property);
	_tmp36_ = g_new0 (UsageAppDialogProperty*, 2 + 1);
	_tmp36_[0] = _tmp34_;
	_tmp36_[1] = _tmp35_;
	_tmp37_ = _tmp36_;
	_tmp37__length1 = 2;
	_tmp38_ = usage_app_dialog_properties_new (_tmp37_, 2);
	_tmp39_ = gtk_no_selection_new ((GListModel*) _tmp38_);
	_tmp40_ = _tmp39_;
	gtk_list_view_set_model (_tmp33_, (GtkSelectionModel*) _tmp40_);
	_g_object_unref0 (_tmp40_);
	_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_object_unref), NULL);
	_g_free0 (_tmp8_);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}

UsageAppDialog*
usage_app_dialog_new (UsageAppItem* app)
{
	return usage_app_dialog_construct (USAGE_TYPE_APP_DIALOG, app);
}

static void
___lambda7_ (UsageAppDialog* self)
{
	UsageAppItem* _tmp0_;
	_tmp0_ = self->priv->app;
	if (!usage_app_item_is_running (_tmp0_)) {
		adw_dialog_close ((AdwDialog*) self);
	}
}

static void
____lambda7__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	___lambda7_ ((UsageAppDialog*) self);
}

static gboolean
___lambda8_ (UsageAppDialog* self)
{
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	gboolean result;
	_tmp0_ = self->priv->quit_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	_tmp1_ = self->priv->force_quit_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, TRUE);
	result = FALSE;
	return result;
}

static gboolean
____lambda8__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda8_ ((UsageAppDialog*) self);
	return result;
}

static void
___lambda6_ (UsageAppDialog* self,
             AdwAlertDialog* dialog,
             const gchar* response_type)
{
	g_return_if_fail (dialog != NULL);
	g_return_if_fail (response_type != NULL);
	if (g_strcmp0 (response_type, "quit") == 0) {
		GtkButton* _tmp0_;
		GtkButton* _tmp1_;
		AdwSpinner* _tmp2_;
		AdwSpinner* _tmp3_;
		UsageAppItem* _tmp4_;
		UsageSettings* _tmp5_;
		UsageSettings* _tmp6_;
		guint _tmp7_;
		guint _tmp8_;
		_tmp0_ = self->priv->quit_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, FALSE);
		_tmp1_ = self->priv->quit_button;
		_tmp2_ = (AdwSpinner*) adw_spinner_new ();
		g_object_ref_sink (_tmp2_);
		_tmp3_ = _tmp2_;
		gtk_button_set_child (_tmp1_, (GtkWidget*) _tmp3_);
		_g_object_unref0 (_tmp3_);
		_tmp4_ = self->priv->app;
		g_signal_connect_object ((GObject*) _tmp4_, "notify::running", (GCallback) ____lambda7__g_object_notify, self, 0);
		_tmp5_ = usage_settings_get_default ();
		_tmp6_ = _tmp5_;
		_tmp7_ = usage_settings_get_data_update_interval (_tmp6_);
		_tmp8_ = _tmp7_;
		g_timeout_add_full (G_PRIORITY_DEFAULT, 2 * _tmp8_, ____lambda8__gsource_func, g_object_ref (self), g_object_unref);
		_g_object_unref0 (_tmp6_);
	}
}

static void
____lambda6__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	___lambda6_ ((UsageAppDialog*) self, _sender, response);
}

void
usage_app_dialog_quit_clicked (UsageAppDialog* self,
                               GtkButton* quit_button)
{
	UsageAppItem* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (quit_button != NULL);
	_tmp0_ = self->priv->app;
	if (usage_app_item_is_killable (_tmp0_)) {
		UsageQuitProcessDialog* dialog = NULL;
		UsageAppItem* _tmp1_;
		UsageQuitProcessDialog* _tmp2_;
		UsageQuitProcessDialog* _tmp3_;
		GtkRoot* _tmp4_;
		UsageQuitProcessDialog* _tmp5_;
		_tmp1_ = self->priv->app;
		_tmp2_ = usage_quit_process_dialog_new (_tmp1_);
		g_object_ref_sink (_tmp2_);
		dialog = _tmp2_;
		_tmp3_ = dialog;
		_tmp4_ = gtk_widget_get_root ((GtkWidget*) self);
		adw_dialog_present ((AdwDialog*) _tmp3_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_window_get_type (), GtkWindow));
		_tmp5_ = dialog;
		g_signal_connect_object ((AdwAlertDialog*) _tmp5_, "response", (GCallback) ____lambda6__adw_alert_dialog_response, self, 0);
		_g_object_unref0 (dialog);
	}
}

static void
_usage_app_dialog_quit_clicked_gtk_button_clicked (GtkButton* _sender,
                                                   gpointer self)
{
	usage_app_dialog_quit_clicked ((UsageAppDialog*) self, _sender);
}

void
usage_app_dialog_force_quit_clicked (UsageAppDialog* self,
                                     GtkButton* quit_button)
{
	gboolean _tmp0_ = FALSE;
	UsageAppItem* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (quit_button != NULL);
	_tmp1_ = self->priv->app;
	if (usage_app_item_is_running (_tmp1_)) {
		UsageAppItem* _tmp2_;
		_tmp2_ = self->priv->app;
		_tmp0_ = usage_app_item_is_killable (_tmp2_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		UsageAppItem* _tmp3_;
		int _tmp4_;
		_tmp3_ = self->priv->app;
		_tmp4_ = SIGKILL;
		usage_app_item_kill (_tmp3_, &_tmp4_);
	}
	adw_dialog_close ((AdwDialog*) self);
}

static void
_usage_app_dialog_force_quit_clicked_gtk_button_clicked (GtkButton* _sender,
                                                         gpointer self)
{
	usage_app_dialog_force_quit_clicked ((UsageAppDialog*) self, _sender);
}

static void
usage_app_dialog_class_init (UsageAppDialogClass * klass,
                             gpointer klass_data)
{
	usage_app_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &UsageAppDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = usage_app_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Usage/ui/app-dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "icon", FALSE, UsageAppDialog_private_offset + G_STRUCT_OFFSET (UsageAppDialogPrivate, icon));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "app_title", FALSE, UsageAppDialog_private_offset + G_STRUCT_OFFSET (UsageAppDialogPrivate, app_title));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "app_user", FALSE, UsageAppDialog_private_offset + G_STRUCT_OFFSET (UsageAppDialogPrivate, app_user));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "in_background_info", FALSE, UsageAppDialog_private_offset + G_STRUCT_OFFSET (UsageAppDialogPrivate, in_background_info));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "simple_properties", FALSE, UsageAppDialog_private_offset + G_STRUCT_OFFSET (UsageAppDialogPrivate, simple_properties));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "quit_button", FALSE, UsageAppDialog_private_offset + G_STRUCT_OFFSET (UsageAppDialogPrivate, quit_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "force_quit_button", FALSE, UsageAppDialog_private_offset + G_STRUCT_OFFSET (UsageAppDialogPrivate, force_quit_button));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "quit_clicked", G_CALLBACK(_usage_app_dialog_quit_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "force_quit_clicked", G_CALLBACK(_usage_app_dialog_force_quit_clicked_gtk_button_clicked));
	gtk_widget_class_add_binding_action (GTK_WIDGET_CLASS (klass), GDK_KEY_Escape, 0, "window.close", NULL, NULL);
}

static void
usage_app_dialog_instance_init (UsageAppDialog * self,
                                gpointer klass)
{
	self->priv = usage_app_dialog_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
usage_app_dialog_finalize (GObject * obj)
{
	UsageAppDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, USAGE_TYPE_APP_DIALOG, UsageAppDialog);
	_g_object_unref0 (self->priv->app);
	G_OBJECT_CLASS (usage_app_dialog_parent_class)->finalize (obj);
}

static GType
usage_app_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UsageAppDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) usage_app_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UsageAppDialog), 0, (GInstanceInitFunc) usage_app_dialog_instance_init, NULL };
	GType usage_app_dialog_type_id;
	usage_app_dialog_type_id = g_type_register_static (adw_dialog_get_type (), "UsageAppDialog", &g_define_type_info, 0);
	UsageAppDialog_private_offset = g_type_add_instance_private (usage_app_dialog_type_id, sizeof (UsageAppDialogPrivate));
	return usage_app_dialog_type_id;
}

GType
usage_app_dialog_get_type (void)
{
	static volatile gsize usage_app_dialog_type_id__once = 0;
	if (g_once_init_enter (&usage_app_dialog_type_id__once)) {
		GType usage_app_dialog_type_id;
		usage_app_dialog_type_id = usage_app_dialog_get_type_once ();
		g_once_init_leave (&usage_app_dialog_type_id__once, usage_app_dialog_type_id);
	}
	return usage_app_dialog_type_id__once;
}

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);
}

